Create A Polaroid Style Photo Gallery With CSS

Creating a simple Polaroid style gallery is much easier than you many think just using CSS and HTML. For the purpose of this example, I must say that the gallery works best with a small number of pictures. Basically you could add a high volume of pictures, but you will need to modify the CSS to account for the volume you want to work with. In my example I have six photos in order to best demonstrate the concept. If you’re just starting with CSS then be sure to check out the WC3 Cascading Style Sheets reference and you may want to consider purchasing Beginning CSS for Web Design.

The first step is to create a div wrapper that will contain the photos which is named photo-gallery and will hold the photos.

<h1><span>Microsoft PDC 2009</span></h1>
<a href="#" class="large polaroid img1"><img src="pdc-2009-01.jpg" alt="">PDC #1</a>
<a href="#" class="medium polaroid img2"><img src="pdc-2009-02.jpg" alt="">PDC #2</a>
<a href="#" class="large polaroid img3"><img src="pdc-2009-03.jpg" alt="">PDC #3</a>
<a href="#" class="medium polaroid img4"><img src="pdc-2009-04.jpg" alt="">PDC #4</a>
<a href="#" class="large polaroid img5"><img src="pdc-2009-05.jpg" alt="">PDC #5</a>
<a href="#" class="medium polaroid img6"><img src="pdc-2009-06.jpg" alt="">PDC #6</a>
</div>

Easily Capture Streaming Media

Are you looking to add your favorite television show or movie to your collection? If so, then I have a solution that you may be interested in. Now it is important to say that I do not advocate violating copyright laws, so be sure what content you are interested in capturing is legal to do so.

During my search for a product that would capture media content that I was interested in many came at a cost and did not allow a trial run. I for one typically do not pay up front for something that I am not entirely sure will work as expected. I ran across StreamTransport and best of all it is free, however the author does accept donations. this application is able to browse and download video clips from video hosting websites of HTTP, RTMP, RTMPT, RTMPE, RTMPTE protocol, and these cover overwhelming majority of websites such as Hulu, Veoh, Boxee, Joost, YouTube, Yahoo Video, CBS, etc. Setup is very simple and in no time at all I was capturing media.For example, the following video is that I captured of my daughter playing the piano as a Flash video.

http://www.youtube.com/watch?v=jfImDnjJpsQ?

The user interface is simple in nature and therefore extremely easy to use. All that is needed is to enter a URL and click start. This software will auto capture any video clip being played and you can then download the media with a single click. I love the fact that I can also save the media as MP4 and sych to my iPad for mobility.

As you can see it is very simple to capture that “legal” media that you are interested in. You can download StreamTransport here and if you are in need of a basic, no frills, and free FLV player, I recommend Wimpy. I hope that you find this article useful and if you have any tips and tricks that you would like to share with other readers please leave a comment.

AES Encryption Example In C#

In cryptography, the Advanced Encryption Standard (AES) is a symmetric-key encryption standard. This standard comprises three block ciphers, AES-128, AES-192 and AES-256, adopted from a larger collection originally published as Rijndael. Each of these ciphers has a 128-bit block size, with key sizes of 128, 192 and 256 bits.

What Is Encryption?

Encryption is the process of changing data into a form that can be read only by the intended receiver. To decipher the message, the receiver of the encrypted data must have the proper decryption key (password). In traditional encryption schemes, the sender and the receiver use the same key to encrypt and decrypt data. In this case the key is the password you supply.

Example Uses For Encryption

Many modern day systems process data which is considered sensitive. For example, doctors store patient information, stock brokers store client financial data and home computer users store personal information on their computers — their own personal information. All this information is vulnerable to exposure in the event of the theft of the computer itself.

Should you find yourself fortunate enough to be developing software in C# then you may find the following code snippets beneficial.

Helper:

public static string Encrypt(string PlainText, string Password, string Salt, string HashAlgorithm, int PasswordIterations, string InitialVector, int KeySize)
{
try
{
byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector);
byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt);
byte[] PlainTextBytes = Encoding.UTF8.GetBytes(PlainText);
PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8);
RijndaelManaged SymmetricKey = new RijndaelManaged();
SymmetricKey.Mode = CipherMode.CBC;
ICryptoTransform Encryptor = SymmetricKey.CreateEncryptor(KeyBytes, InitialVectorBytes);
MemoryStream MemStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(MemStream, Encryptor, CryptoStreamMode.Write);
cryptoStream.Write(PlainTextBytes, 0, PlainTextBytes.Length);
cryptoStream.FlushFinalBlock();
byte[] CipherTextBytes = MemStream.ToArray();
MemStream.Close();
cryptoStream.Close();
MemStream.Dispose();
cryptoStream.Dispose();
Encryptor.Dispose();
return Convert.ToBase64String(CipherTextBytes);
}
catch (Exception ex)
{
throw ex;
}
}

Implementation:

Encrypt("mykey", "mypassword", "mysalt", "MD5",5, "qwertyuiqwertyui", 256);

Helper:

public static string Decrypt(string CipherText, string Password, string Salt, string HashAlgorithm, int PasswordIterations, string InitialVector, int KeySize)
{
try
{
byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector);
byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt);
byte[] CipherTextBytes = Convert.FromBase64String(CipherText);
PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8);
RijndaelManaged SymmetricKey = new RijndaelManaged();
SymmetricKey.Mode = CipherMode.CBC;
ICryptoTransform Decryptor = SymmetricKey.CreateDecryptor(KeyBytes, InitialVectorBytes);
MemoryStream MemStream = new MemoryStream(CipherTextBytes);
CryptoStream cryptoStream = new CryptoStream(MemStream, Decryptor, CryptoStreamMode.Read);
byte[] PlainTextBytes = new byte[CipherTextBytes.Length];
int ByteCount = cryptoStream.Read(PlainTextBytes, 0, PlainTextBytes.Length);
MemStream.Close();
cryptoStream.Close();
MemStream.Dispose();
cryptoStream.Dispose();
Decryptor.Dispose();
return Encoding.UTF8.GetString(PlainTextBytes, 0, ByteCount);
}
catch (Exception ex)
{
throw ex;
}
}

Implementation:

Decrypt("ND5lYPo4czOk5ZT7KNmU2Q==", "mypassword", "mysalt", "MD5",5, "qwertyuiqwertyui", 256);

There you have it. Now there is no reason to secure your sensitive data.

Creating A System Image With Windows 7

Consider the following, you have just purchased that new computer and spent hours installing all of your software and now you have everything to your taste. I am not sure about you, but I hate setting up a new computer and once I have everything I want in place the first step I take is to create a system image. This is an important step should you ever find yourself wanting to perform a fresh installation of Windows in the future. A system image is essentially a snapshot of your computer at a given point in time. Be sure that you have plenty of blank disc on hand and time to finish this process. The time required depends upon how much software you install before starting the image process. Here is Microsoft’s definition of a system image:

A system image is an exact copy of a drive. By default, a system image includes the drives required for Windows to run. It also includes Windows and your system settings, programs, and files. You can use a system image to restore the contents of your computer if your hard disk or computer ever stops working. When you restore your computer from a system image, it’s a complete restoration—you can’t choose individual items to restore, and all of your current programs, system settings, and files are replaced with the contents of the system image.

You should know that an image will contain any data you may have but do not confuse an image with a backup. The do differ greatly, for this reason you must implement a backup plan.

Why Have A Data Backup Plan

There are instances when a computer becomes your life and you would feel completely lifeless without it. I know some people may say people should get a life, but if you work in the field of Information Technology you have no recourse but to regularly backup your data. There are various reasons for the failure and I will not begin to list them. Just know this, what can go wrong will go wrong! For this reason consider a backup plan that works best for you.

Create A System Image

Open the Control Panel and select “Back up your computer“:

control panel

Click “Create system image“:

create a system image

Decide where you want to save the image:

save backup dialog

Confirm your backup:

confirm backup

As you can from the screen shot above, a high number of blank DVD disc will be required. Once the process completes be sure to store these disc in a safe location for future needs. When you are ready to restore the system image utilize the “System Recover Options” to refresh your computer.

system recovery options

Once you complete this process your computer is as it was the day you first opened it with the difference being you also have all your software in place. Not bad! I can tell you from first hand experience that the process is painless both in the area of creating and restoring an image and it does in fact save a great deal of time in the event you want to format your computer and start from scratch.

Trust me, a little time spent up front can both save time in the future. A system image is a must for anyone who is picky about housekeeping when it comes to a safe a reliable computer.

How To Decompile A Java Class Inside A JAR File

Today I am stepping outside what I consider my comfort zone when in comes to programming languages and I will be talking about Java. To tell the truth it has been a number of years since I have even looked at code, but recently I am working with a vendor that does not directly support Microsoft .NET and they were nice enough to provide a JAR that contained the classes for clients that do work with Java.

Now the hurdle I faced was to be able to peek at the class files in a manner that they were readable by the human eye. Before I proceed any further take a moment to understand what a JAR file is in the event you are not sure.

In computing software, a JAR file (or Java Archive) aggregates many files into one. Software developers generally use .jar files to distribute Java applications or libraries, in the form of classes and associated metadata and resources (text, images, etc.) JAR files build on the ZIP file format. Computer users can create or extract JAR files using the jar command that comes with a JDK. (via WikiPedia)

There probably are a number of ways to extract a JAR file, but I do not recall the syntax for doing this, therefore I turned to a piece of software to help me do this job. For the purpose of this discuss, I will discuss two products that I am aware of which are JD-GUI are DJ Java Decompiler. Each of these software products will do the job, but there are differences from my point of view and I will cover these later.

JD-GUI

jd gui screen

This product is the clear winner from my point of view. It is free (donate if you use it, developers have to eat also) and it requires no installation, extremely small in size, and comes in Windows, Linux, and Apple flavors.

DJ Java Decompiler

dj decompiler screen

This product is much more robust and may be overkill, in the context of my need I saw no need to open up my wallet.

I hope these two products can help you in the event you find yourself in a similar situation as myself. Do you now of any other products or a command line interface to extract classes? If so, please leave a comment and share with the other readers.

Pages:«123456»