Suramya's Blog : Welcome to my crazy life…

June 20, 2012

I am now a proud owner of a RaspberryPi

Filed under: Computer Hardware,My Life,Tech Related — Suramya @ 11:54 PM

After waiting for almost 6 months from when it launched, and a month after I placed the order I am now a proud owner of a RaspberryPi πŸ™‚ For those of you who are wondering what on earth I am talking about, its a computer the size of a phone (see pic below comparing it with my old Nokia N95) costing $35 that is powerful enough to play Quake3. Its amazing how small this thing is and the features they have managed to cram on to the box. It was delivered yesterday and I was a bit upset at the customs duty I had to pay on the device (paid about 50% of the cost of the device + the cost of shipping as duty) but it still turns out to be a lot cheaper than any other contender.

I was really excited to work on it but when I got home and started to set it up I found that my SD card reader/writer was no longer functioning πŸ™ so after a few hours of trying and turning the house upside-down for the other card reader that I know I have and just couldn’t find, I finally gave up and messaged Krishna at 12:30am asking him to bring a SD Card reader with him to the office (which he did, thanks!) the next day. Had to wait a day to get back home and once I got home with the reader I then downloaded the Debian image to my computer and wrote it to the card, powered the system with my old blackberry charger, plugged in an Ethernet cable and a HDMI cable (actually HDMI to DVI cable if you want to be picky) connecting the Pi to my second monitor. That’s when I hit a snag. Turns out that I don’t have a single USB keyboard at home, all my keyboards are PS/2. πŸ™ So now I either need to borrow a USB keyboard or go buy a small one. In any case I powered the Pi up to see if it works ok and it powered up fine.

The first boot took about a min, but after that the system gets to the login prompt in about 15 secs, which is pretty cool. I can reduce the boot time further by disabling services that I know I won’t use (like NFS etc). Unfortunately SSH wasn’t enabled on the box, so without a keyboard and no remote connection I couldn’t really do anything more at this time, but I am full of idea’s for this device.

Below are some pics of the Pi in action:


Comparison shot of the RaspberryPi next to a Nokia N95


The RaspberryPi hooked up and ready for action


Initial Boot Sequence of RaspberryPi

I wanted to take a comparison shot of the Pi next to my Galaxy Nexus but I was using the Nexus to take the photos (didn’t feel like pulling out the camera, take a pic, take out the card and then upload the pics as compared to; take the photo, FTP to computer).

Well this is all for now, am a bit sad, but still excited. Keep an eye here for more on the Pi and my experiments with it.

– Suramya

June 13, 2012

Should you comment your code?

Filed under: My Thoughts,Tech Related — Suramya @ 11:12 PM

Had a really interesting discussion at work today about putting comments in source code. A while ago someone I know told people not to put comments in any code they create and we were arguing the pro’s and con’s of this. I personally think that good comments are quite useful and should always be added to code, but there is another school of thought that says that code should be written well enough that comments are not required. When I started coding, I was told to always put good comments in the code because it helps the person who is reviewing/debugging your code when you are not around to understand what your logic or thought process was when you created that wonderful collection of code. Assuming that your code is good enough to not require any comments is very egostical. What is perfectly clear and logical to you because you have been working on a system for a couple of years will not be clear to someone who is new to the system. Put another way, code tells you how something is done and comments tell you why.

I have had the joy of maintaining legacy code written in a mix of VB, VB.NET and Javascript with 0 comments in the code. Believe me it was not fun. The best part is when I talked to the guy who had written the code he could understand it perfectly without needing comments.

I am not talking about putting comments like “Here we are checking if the value of Var is more than 5” for code that reads: if($Var > 5). I am talking about taking a few lines to explain code like (This is an example from one of my scripts to create collages):

	# Repeating the cropping process to get the other half of the image. This reduces the possibility of half empty collages

	for ($i=5; $i>0;$i--) 
	{
		opendir(DIR, ".");
		while ($file=readdir(DIR)) 
		{

I could figure out what this 30 line blob of code was doing after walking through the code in 5-10 mins or I can read the comment and understand the logic in 30 sec’s. If needed I can then look at the code more closely but if I just want to understand how the code works on a high level comments help a lot.

Now lets look at it from the other perspective. Comments take up space in the file and if not well written they just take space and at times if they are not updated when the code changes can provide the user with incorrect information. The idea is that if required any documentation on the code can be auto generated by auto documentation tools. However if my developers are not trustworthy/reliable enough to update comments in code then I am pretty sure they can’t be trusted to follow the format required for the documentation creator software either.

The one point that made sense to me was that at times people put information in code comments that should not be public. For example a developer can comment out a section of JSP code that has the DB connection info for the dev servers but now this information is visible to anyone who views the html code generated. Or other notes/comments that probably should not be openly accessible to everyone that searches.

Last point before I end the post. Code should be clean and readable, you shouldn’t rely on comments to cover for bad coding practices. But I don’t want you to put a comment on every line of code, you should only put useful comments. Comments that help a future coder understand why you did something in a certain way are great.

What do you think? Code comments are good? Bad? You don’t really care?

Additional articles/posts that discuss this:

* Coding horror
* Successful Strategies For Commenting Code
* Don’t comment your code

This is all for now. Will post more later.

– Suramya

May 17, 2012

Random thoughts & Ramblings.

Filed under: My Life — Suramya @ 11:29 PM

Just posting some random thoughts bouncing around my head. I think people who use the phrase “He/she works Banker hours have obviously never worked in a bank. Also the people who keep telling others that they slept like a baby have never spent time with a baby for an extended period of time.

I have finally placed my order for the Raspberry Pi πŸ™‚ No I don’t mean the actual pie, (I don’t think I would like it that much. Too sweet for me) I mean the mini computer the size of a deck of cards costing about $35. Can’t wait for it to arrive, have loads of projects in mind.

Tried eating honey roasted cashew nuts today dipped in spicy sauce and it tasted awesome, I think I need to go buy more honey roasted cashew nuts. I had tried the same earlier with just salted nuts but that didn’t taste quite as good and I ended up burning my tongue.

Did you know Taco Bell in Bangalore gets a weekly shipment of Taco Buns (?) Bread (?) Round thingies (?) from Delhi and if the shipment doesn’t arrive then they don’t have the ability to make it in Bangalore?

Well this is all for now. I will stop now before I sound like a complete lunatic.

– Suramya

April 27, 2012

Tor E-book Titles are DRM-Free (from July)

Filed under: Books Related / Reviews,My Thoughts — Suramya @ 11:59 PM

Another publisher (Tor) sees the light and from July 2012 will start selling DRM free books. Yay! I have long advocated DRM free books for no other reason than the fact that I would like to read my books on all my platforms (Linux PC, Tablet + Android Phone) without restrictions or compatibility issues.

Tor is mainly a SciFi and Fantasy publisher with some great authors in its line up so I am glad that they are removing DRM from their books. Plus its not like the DRM was stopping anyone from making a copy of a book in any case.

Check out the Smash Words blog for a really good writeup on why DRM doesn’t work.

Five Reasons to Say No to DRM:
Readers (who know about DRM) don’t like DRM
DRM adds expense to books
DRM makes books complex
DRM limits accessibility to books, especially for those with vision disabilities who require Text-to-Speech (TTS)
DRM doesn’t prevent piracy

In all this is a great step forward in the fight against DRM. Now we just have to convince the publishers to price the ebooks reasonably and I will be all set. πŸ™‚ Ah well, one step at a time.

Source: Tor/Forge E-book Titles to Go DRM-Free | Tor.com.

April 22, 2012

Arree main Mama baan Gaya!

Filed under: My Life — Suramya @ 3:41 AM

Just about a week ago, my sister gave birth to a lovely boy named Vir. It feels great to have such a lovely nephew. πŸ™‚ This is the first kid for whose birth I was there at the hospital. Mom said “Sarb ka phal Meetha hota hai (Fruits of Paitience are sweet), Vir made us wait a lot for his arrival but is so sweet that the wait was worth it. I was asked not to post photos on the Blog/Facebook so have waited till now to let Vinit and Surabhi post the pics. but Now its my turn. I was also asked to make sure no fugly photos are posted but that’s not possible since Vir is too cute to have Fugly photos. Vinit and Surabhi on the other hand are a completely different story.

Without further ado, I present Vir:



Vir just about an hour old


Me and Vir at the hospital about an hour after he was born.


Vir and Me at home about a week later

Have more pics but need to get them past the censor board (Vinit & Surabhi) πŸ˜‰ before I can share them.

Well this is all for now. Will post more later.

– Suramya

April 14, 2012

How does painting trees blue raise awareness about their importance to our survival? Plus rants on ‘art’

Filed under: My Thoughts — Suramya @ 4:56 AM

Seriously, can someone please explain this to me? This guy went and painted a bunch of tree’s blue and that is supposed to raise awareness about the importance of tree’s. I would be more concerned about the harm this paint might cause the trees. (Paint blocks the pores so could effect the ability of the tree’s to convert co2). I would understand if he went out and planted a lot of trees or did something that educated people about them. I really doubt that I will ever understand these so called ‘artists’, A lot of the ‘modern’ art looks to me like a mad monkey was dropped in paint and crawled across the canvas in its death throes. Or maybe its because someone supposed to be a big art critic said that the above is art and everyone else is just jumping on the bandwagon so that they don’t seem as if they don’t know art (kind of sounds like the emperor’s new clothes if you ask me).

Drawing a box bisected by a line with different colors on both sides or putting a rock on a fence does not make it art or you an artist. Making something that takes actual effort and skill (like this or this) is art.

Now a lot of folks say that it requires a lot of thought to create a painting and I agree with it, I just don’t classify my examples above as paintings. A while ago I visited a art exhibition with a friend and one of the paintings over there was a canvas painted yellow with a black line cutting across it diagonally about a third of the way from the corner. Another painting was a blank canvas with a red (or was it blue) dot in the middle of it (that’s it). Now please tell me what makes it so impressive that someone painted a dot on the canvas?

Source of the image prompted this rant (Although I have been meaning to post about this): Urber Humor: Daily Morning Awesomeness 32.

Any thoughts/Comments?

– Suramya

April 11, 2012

Doctor Who RPG Video

Filed under: Humor,Tech Related — Suramya @ 11:52 PM

Normally I don’t post links to video’s on the blog but after watching this video I just had to share. Its a must watch for all Doctor Who fans but it has a lot of spoilers so don’t watch it if you haven’t seen the last season of Dr Who. The video shows the last season of Dr Who as an 8bit RPG and is awesome. Plus it has Fish and Custard πŸ™‚ I wish that this was a real RPG.

Click on the image below to watch the video:

BTW, Shipra: is 11:50pm better for this stuff than 6am? πŸ™‚

Thanks to Nerdapproved.com for the link.

– Suramya

April 8, 2012

Day spent Geeking out

Filed under: My Life — Suramya @ 5:42 AM

Today was fun. After a long time I spent an evening completely geeking out at Krishna’s place swapping mother-boards to get a server back up and running. Initially we were going to hot swap the Bios chip to re-flash it as the chip seemed to have gotten corrupted. But then we realized that the board we were swapping to (my old motherboard) had a different Bios chip so the pin layout was completely different so obviously the swap wouldn’t work. πŸ™ Then we decided to take the motherboard from another computer (Preeti’s desktop), put that in the server (who’s MB had died) and put my MB in the desktop as a temp solution. Spent over 5 hours trying to get this to work. Gah. Most of it was because of the trouble Windows gave when switching motherboards.

The desktop was originally running windows 7, and there is a new program called sysprep that you can use to prep a Windows 7 system to move it to another motherboard. At first I was impressed that Windows finally supports something that Linux has had for a while. Even though it was a bit clunky and required an extra step but this is an improvement from what it used to be. But then we found out that sysprep really messed up the system. It destroyed the Windows 7 partition and we had to recover it using the windows recovery CD (That Krishna had thankfully created the day before). We recovered the partition but nothing really worked even after that. Basically after answering all the setup questions we kept getting put in a temp profile that would be deleted when you log out. So even though the data was all there, the system was unusable.

Looking at the system log didn’t get us any answer and finally we decided to restore the original partition (that we had created before the sysprep using dd) to the drive and put it in the new system without running sysprep. Hopefully this will work (I Left while the dd restore was running), will find out tomorrow. Otherwise lets see what other options we have.

When I upgraded to this new motherboard, all I did was plug in my old drive and Linux detected all the new hardware and booted up without any major issues.

The funniest part was when we booted up the disk after cloning it but before running sysprep (we had swapped the USB keyboard and mouse around) I got a message that new device was detected and drivers were being installed for the keyboard (the same one that was being used earlier) and once the installed finished we were asked to reboot the system for the changes to take effect. I always thought that this was a joke (“Windows detected that you moved your mouse cursor, please reboot for the changes to take effect.) but this happened today.

Once I came back home I watched a couple of episodes of “The Guild” which is an web series about a group of online gamers, and how they interact online and offline. I had found the series after listening to their music video: I’m the One That’s Cool and searching for more stuff by them. Check it out if you have some time, each episode is only about 3-5 mins long so doesn’t take long to watch.

Well this is all for now. I was planning on doing some coding but its hot and almost 6am so I should probably get some sleep. Will write more later.

– Suramya

March 30, 2012

No way I am trying this Delicacy from China: Urine-Boiled Eggs

Filed under: My Thoughts — Suramya @ 7:52 PM

I am all for trying out the local cuisine when visiting various places as long as its vegetarian or has eggs but there is no way I am every going to try this Delicacy from Dongyang, China: Urine-Boiled Eggs. At first I thought that this was a joke but its on the food section of Gizmodo and a search on Google gave articles going back a few years so it looks like this is real. These are regular eggs that have been boiled in urine collected from boys under 10 years old. Yes, you read it correctly. The eggs are boiled in actual urine and then eaten.

The recipe for Virgin Boy Eggs is quite simple really. One first collects a bucket of piddle from the local primary school. Only the water of boys under the age of ten is suitable. Virgin Boy Eggs are first soaked in in a pot of urine, then brought to a boil. Once firm, the eggs’ shells are cracked to allow fuller penetration, and bathed regularly through out the day with fresh piss to prevent them from overheating.

This is all for now. I am going to go throw up now.

Source: ChinaÒ€ℒs Urine-Boiled Eggs Are a Cultural Delicacy I Will Not Try

– Suramya

March 24, 2012

Einstein Archives website starts project to get 80,000 documents online

Filed under: Interesting Sites,My Thoughts — Suramya @ 1:55 AM

Seems like slowly everyone is finally figuring out that sharing information is good (except for RIAA/MPAA etc). First Royal Society journal archive was made permanently free to access then Sir Isaac NewtonÒ€ℒs scanned notes got published online by Cambridge. Now the Hebrew University of Jerusalem has published some 2,000 digitized documents from their Albert Einstein’s archives ranging from personal correspondence to scientific papers online (on alberteinstein.info). These documents are fully searchable and can be examined right down to the finest detail. They will continue adding additional documents over the course of 2012, with the ultimate goal being to get all of the 80,000+ items in the university’s archives online.

This is an amazing collection that can maybe help more people understand how one of the most brilliant men in history thought. I would love to go through the archive, but unfortunately they are mostly gibberish to me. I am sure other folks would find them most interesting and who knows, this might spark some idea in someones mind that could end up changing the world.

Source: CBC News
Thanks to Engaget for the initial story.

– Suramya

« Newer PostsOlder Posts »

Powered by WordPress