Friday, November 19, 2010

Pwnage on the cloud

Cloud computing is touted to be the next big thing. From Google Docs to Dropbox to Chrome OS, innovative applications are putting thousands of super powerful servers at the command of users like you and me. But non of these applications seemed that interesting. Granted, backing up to the cloud is one of the most failsafe ways to secure your data, but none of these things had that Ohmagawd effect. I was reading Gizmodo yesterday (sorry Jerry!) and I was hit with that effect thanks to this.

OnLive MicroConsole
(Image copyright Gawker media. Please don't sue me for unauthorised use!)
Think about it for a second. A game, rendered dynamically on the server, streamed to your home like a normal IPTV stream. Provided network latency is low (something that we really need to work towards in this country), your controller-strokes will be transmitted to some server in Palo Alto and the resultant scene in the video game rendered and retransmitted to your HDTV. It's like having a PS3 without having a PS3. And think about it, you don't have to worry about hardware upgrades, or buying expensive VGAs for the singular purpose of playing games anymore. The physics will be beyond awesome, the system requirements will always be met, and you don't have to deal with those pesky anti-piracy measures because there won't be any piracy anymore. If all the games run on servers, and no retail versions are ever released, there's obviously no way to pirate the games. It's a win-win situ whatever way you look at it. And imagine the amount of money spent on hardware that can be saved. You'll essentially be sharing a server with some dude in Bosnia, and while you sleep (due to the time difference) he'll be pwning away, and while he sleeps it'll be your turn. Playing multiplayer would be a breeze since inter-server connectivity is lightning fast (no need to worry about who's hosting and what his upload speed is anymore!)

And you know what the best part is? Servers hate Windows, because it is buggy, slow and expensive, where as Linux is stable, fast and free. The gaming servers will also need to run on Linux, which means... MORE GAMES FOR LINUX, YO! :D (side note: I discovered an open source clone of one of my favourite classic strategy games: Transport Tycoon Deluxe. It's called OpenTTD and it...is...AWEsome! A must have for any Linux user. There is a port for Windows too.)

All of that being said, I'm still not going to pay $99 a year to play games on my bullcrap internet connection. :P

Thursday, November 18, 2010

2nd Semester ST Project

The main intention I had when setting up this blog was to share coding related stuff and other content that would be deemed boring and too tech-y for my other blog. The following post is about an accomplishment of mine that I'm very happy about, and this seems like the perfect place to share it.

Software Technology was my favourite subject during my (recently concluded) second semester at SLIIT. We were blessed with a wonderful lecturer and assistant lecturer and this, combined with my love for code, resulted in one of the most enjoyable learning experiences I've ever had in my life, comparable to that time during A/Ls that we learned about sub-atomic particles and nuclear energy, or the time in 8th grade which I started my first website on Yahoo! Geocities. (RIP)

So, at the end of the semester, we had to do an assignment based on the stuff we learned. It was done in C++, in Visual Studio, this neat little Windows Forms Application. But all that Microsoft goodness came at a price, and our simple application was 1.8 megabytes large. Another drawback was that it wasn't portable, meaning poor old me couldn't compile it in my GNU/Linux machine.

So after we finished our semester, and began our two month long vacation, I reimplemented the program in C. I simplified the problem that we were given (it would otherwise need an insane amount of coding, which I - a lone programmer without the incentive of assignment marks - would find difficult to do), but also switched the data structure we used to store the records from a linked list to a binary tree. The advantages of using a binary tree would be  that searching and inserting would be pretty fast. I also did use a post order deletion method to ensure that every record on the tree was deleted before exiting the program, so as to ensure that there were no memory leaks.

My original idea for the C program was to implement it in GTK+ (a cross platform widget toolkit, itself written in C), but I settled for the command line in the end because I had no experience with GTK (and very little experience with C itself) and the learning curve could've been too steep to handle. But I did what I could do, and I finished up with this, a working system that does what does. :) And in the process, I learned how to use malloc and got a new found sense of respect for the 'new' feature in C++ which makes memory allocation so much easier.

So this concludes this long, boring and pointless ramble about a piece of code that doesn't really do much at all. But it is released under the GNU general public licence, not because the free software foundation needs crapware like mine, but because it feels so right to give back to the community that has given us so much, including (but not limited to) the OS that I'm using (GNU), the kernel (Linux), the distro (Ubuntu), the web browser (Firefox) as well as the compiler (GCC) and the text editor (gedit) that I used to create the program. Long live software freedom! :)

Thursday, November 11, 2010

The Southern coast in 8 pictures

Over the bridge...

past the temple in the sea...

a beach!

A wide deserted beach, with the softest, whitest sand...

But the sea is rough,

red flags are up,

what to do but walk away...

...at least the pool is tranquil.

Kinda ironic that I'm writing about beaches and sunshine when Colombo is undergoing the worst flooding in decades. What can one do but have hope in times like these.