Sunday, September 12, 2010

What is Cloud Computing? (and, Why You Should Care)

Whether you like it or not, you have already succumbed to the evolution of the internet, cloud computing, you just don't realize it. I'll discuss two main points, what cloud computing looks like to the consumer, and why it is different on a technical level from other web hosting services.

Cloud computing to the consumer means that all your information is stored online, "in the cloud," then cached and processed locally. If you think you would never let this happen, because there's no way it could be secure, well, you're too late. A great example of early cloud computing are more advanced email clients such as Gmail or Yahoo! Mail. In Gmail, for instance, all your contacts, emails, and attachments are stored by google. Then, when you go to 'mail.google.com' the most important parts of that data are cached to your computer temporarily. So you see an email in you inbox, you click it, now the whole email is downloaded to your computer, but it was already stored on google's servers beforehand, same with attachments. So you're okay with email being a little "cloud," but now look back and think of all the other google services you use. Google Maps, you've probably allowed google to store your address, and you may have saved some maps images, all this is linked to your google account. But now you go to Youtube, search for a video, favorite it, and go on with your day. Well, all that info is linked to your google account as well (even your viewing history). There are countless other examples, all of which consist of you slowly moving your digital life off your computer's hard drive and into a nebulus "cloud," protected by nothing but a password (and a password recovery tool, and encryption). Here you may object, and say, what's new about an account, well, not much. What is new is how much is being put into that account, you may spend hours uploading your photos into facebook and tagging them, etc. without thinking that there is your life, stored on someone else's nebulus "cloud." And everyone is constantly ceding more ground to the likes of Google and Facebook, so much so that Google is releasing Chrome OS. Chrome OS is nothing but the Chrome browser running on top of a very lightweight and well-hidden linux build. Google can do this because they are so confident that you can live on only the internet, and they have launched many of the services to make this possible. (Gmail, Youtube, Google Docs, Google Maps, Google Chrome, Google Images and Picasa Web Albums, Google search even has a built in calculator, you can try it, just google something like 2+2) Don't worry, standard desktops will live on because of the drones who live on Photoshop, Word, Steam, etc., but google is trying to make web programming languages fast enough to soon do away with those programs as well.

All the things described above, can, from a consumer's standpoint, be called "cloud computing," however from a technical standpoint there is a hard line between a web server and cloud computing. For making the following technical stuff much much much much simpler (if you want the whole shabang!, ill post the link at the bottom) I will dumb down computing power to the unit x. Ok, so you want to host a web-site that will require heavy resources, something that will be constanly sending data to the user and receiving data from the user, like Facebook, or Gmail. At peak hours and holidays this will take a server (which is just a mega-desktop) with 100x power. Up until recently that meant you had to purchase a server with 100x power, and pay the power bill for something so powerful. But what about all the times in the middle of the night when only 5x power is being used, well, you still had to buy the 100x machine, and the powerbill is the same regardless of usage. As you can see, this isn't very cost efficient, so someone decided to buy a ton of servers to achieve 10,000,000x power. This person then started charging people a fee to host their web sites on his servers, but he will only charge based on usage, and as your web site grows you don't have to worry about new equipment, you just pay him a little more. This guy can make a living hosting 100 sites on his server, confident that he will always be using his servers, and keep getting payed by his clients. This, is cloud computing. It is a practical way for someone to host a website, because the host will buy more servers as necessary, and you just pay rent. So (pun warning!) this brings "cloud computing" down to earth. As it is nothing but warehouses filled with servers you'll never see or care about, in some remote location, holding all your precious data. That gives you a nice warm and fuzzy feeling doesn't it.

Further Reading:
Cloud Computing, The Invisible Revolution

Monday, September 6, 2010

Window(s) Management/Rendering

There is so much to learn about this subject, but this post is only aimed at how the basic desktop graphics are rendered. First, a minimalist approach to graphics, the monowidth font. If your lazy, or it's the 80's, this is how you do graphics. This style still lives on in command prompt, and looks like this: cd ~/Documents/Project/ 

All the letters are the same size, thus making the screen modular, but this really has nothing to do with rendering windows. And now, how do we get color, well, like everything else in a computer, with 1s and 0s. So to get 16 colors, which is the lowest standard, it takes 4-bit color, which is 4 1s and 0s, because 2 to the 4th power is 16. Then there is 8-bit color, which gives 256 options, for simplicity i'll skip to 24-bit, which gives 8 bits for each of the primary colors. So that means 256 red x 256 yellow x 256 blue = 16.8 million options. It doesnt stop there though, next up is 32 bit. 32 bit doesn't add more colors, it adds a secondary 8 bit channel for transparency data. This is what allows all the cool visual effects in Windows Vista and Windows 7.


Now for how the desktop is rendered, obviously all this stuff on color is incorporated here but what's is important is more conceptual than mechanical. All Windows desktops rendered pretty much the same from Windows 95 to Windows XP. Here is a sample:

You assume that behind the start menu and the my computer window is some blue. You would be wrong. This desktop is completely 2D, and so there is NOTHING behind them. This means that each time you drag a window around the computer has to figure out what should've been behind it. Most of the time it is quick enough, but sometimes it can't keep up and you get this:

I know that is vista, but the 'aero' transparency is turned off, so it acts like xp. 


Well that is unacceptable, which is why vista and 7 have transparency effects and improved rendering via a process called dwm.exe. This stands for Desktop Windows Manager, and it renders everything, even if it is hidden behind a window, this allows awesome transparency effects, like this:



If you have any questions, please ask them in the comments. Also, give suggestions for future posts.