Suramya's Blog : Welcome to my crazy life…

July 9, 2012

Watched the Amazing Spider-man

Filed under: My Life — Suramya @ 12:37 AM

Watched the Amazing Spider-man this weekend after a week of trying. Verdict after watching the movie: ‘meh…’, The movie was decent, not great. Although this review could have been affected by the fact that the 3D in the theater we watched it in (Fame Lido) was screwed up completely. Not sure what the problem was but most of the 3d scenes were really off, not sure how to explain it but at times the foreground was overlapping with the background kind of like the two were merging together. Made me queasy after a while, the effect lasted about 2 hours after I had finished the movie.

I think I liked the first 2 spider-man movies better (the less said about the 3rd one the better). This one was a bit more gritty and they did try to show the conflicting emotions that spider-man always deals with in the comics, but once he puts on his mask he is a wisecracking fast talking character which was kind of missing in this movie. There were a couple of scenes where he wisecracks but not a lot. The character is a bit more true to the comic books but over all the experience wasn’t that great. It didn’t put me to sleep but neither was it a ‘wow!!’ movie.

Now the next movie I am waiting to watch is Batman. It should be a lot of fun, and I don’t think its in 3d which is good. Although I only have problems with 3D movies in Bangalore, I didn’t have any similar issues when I watched 3D movies in Delhi.

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

– Suramya

July 4, 2012

Interesting Troubleshooting step

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

This is a question that has been bugging me for a while and I see most tech support people do this; both here in India and in the US and I can’t figure out how it helps, maybe one of you guys can help me figure this out. Basically if you someone from tech support is working on your computer, lets say installing a driver, or troubleshooting why your net connection is not working, they will minimize all the windows, right click on the desktop and then click refresh. They usually do it a couple of times before continuing with the troubleshooting. Supposedly this helps resolve issues, I did ask them why they do it but didn’t really get a clear answer and it bugs the hell out of me… Any idea what that is supposed to accomplish, other than refresh my desktop icons? I have only one icon on my desktop right now: Trash, which really confuses people and its fun to watch them.

Some of the troubleshooting questions I have heard and the statements people make when I call to complaint about issues are just hilarious. For example I was once told that you can only connect to the internet using a DSL connection if you have windows installed. No other OS’s are supported. I asked the guy to just give me the settings I needed to have and the password to the modem but he kept telling me that since I didn’t have windows it would never work (the conversation started when he asked me to install a software to configure the modem).

It would be interesting to know if others have seen similar behavior when they talk to helpdesk?

– Suramya

July 1, 2012

Had a fun weekend

Filed under: My Life,Tech Related — Suramya @ 11:08 PM

This weekend was fun, parents are in town so they came over. I originally wanted to go watch the new Spiderman movie but couldn’t do so because something came up, but other than that the weekend was great. Mom and dad spent most of the weekend here before Surabhi called them back. Having parents over is both a positive and negative thing. Positive in the sense that your house gets cleaned and stuff gets arranged/organized, the downside is that stuff gets arranged/organized. Simple example, for the past year the switches in my kitchen were wired in a certain way, 1st switch was for the exhaust fan and the second was for the lights. Now dad rewired them so that the 1st switch is for the light, now it makes perfect logical sense but for the past few days every single time I go to the kitchen I switch on the fan when I want to turn on the lights… and its annoying…

As some of you know I use a hard-drive platter as a coaster and over the past year the platter I was using got a lot of scratches and it seemed to be ready to be replaced. I had a 200GB drive that had died a while ago sitting in my drawer so after I made sure it didn’t have any important data (stuck in it the freezer and then was able to read the drive. Yes you read that correctly, sticking drives in the freezer actually helps recover data) I dismantled the drive. Surprisingly it was a pain to dismantle the drive, there were 6 screws in the spindle that took me almost 1/2 hour to unscrew because everytime I tried to unscrew the entire platter would rotate. Finally had to stick another screwdriver in there and got the platters out. Now I have a brand new coaster. 🙂

The drive had three platters so if anyone wants a coaster, let me know. BTW its also reflective enough to be used as a mirror.

Other than that I finished some work and upgraded the OS on the RaspberyPi. Initially I had installed the Debian Squeeze (Ver 6) standard install but today I upgraded to Debian wheezy public beta build. It installed without issues and I like the new build, it seems a bit snappier than the old install, also they have included a new configuration tool that comes up the first time the system boots up that allows you to configure various options using a menu based system (sort of like the Debian installer used to work). Haven’t really played with it yet, but looking forward to it. Maybe the stupid wifi card will work on the new build. If not I am going to go steal a powered USB hub from someone.

Going to connect the Pi to my TV and try playing a movie on it to see how it works… lets see… Hopefully it will play without issues. If not, then its an excuse to fiddle with it till it does work.

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

– Suramya

June 27, 2012

Installing Citrix on the RaspberryPi + Other Pi related stuff

One of the use cases I had for the Pi was to use it as a portable thin client that could connect to a Windows server using Citrix. After a little experimentation I managed to get Citrix installed on the Pi and was able to connect to a Windows server successfully and work. I documented the steps I followed to get this to work on the RaspberryPi forum, check out the Tutorial (How to get Citrix working on a RaspberryPi) if you are interested.

Getting Citrix working was a positive thing, other than that I spent some time trying to install my Wireless network dongle (3Com OfficeConnect Wireless. Model # 3CRUSB10075) on the Pi and hit some hurdles in the process. If you remember the last time when I tried this I thought the problem was caused because the card was pulling more power than the Pi could provide. So I went and got a Belkin powered USB hub (I needed it anyways as I need to connect more than 2 USB devices to the Pi).

When I initially plugged in the hub everything seemed to work without issues and the keyboard + mouse I had connected to the hub worked without issues. So I plugged in the wireless dongle, as soon as I plugged it in my mouse and keyboard both stopped working. I then unplugged the dongle and both the mouse & keyboard started working again. I then plugged the keyboard directly on the Pi and the dongle on the hub, now the keyboard worked but the mouse had issues. Looking at the /var/messages log I saw a ton of error messages like the following:

Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK
Jun 21 18:10:46 raspberrypi kernel:
Jun 21 18:10:46 raspberrypi kernel: DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

Tried a few things but nothing worked and since it was 3:30 in the morning I gave up and crashed for the day. Will try again when I have had some sleep and get some dedicated time to play with the Pi.

– Suramya

June 23, 2012

Experience so far with the RaspberryPi

Filed under: My Life,My Thoughts,Tech Related — Suramya @ 10:46 PM

In one word, the experience so far has been awesome! I recently got my hands on the RaspberryPi and as I mentioned earlier I will be blogging about my experience with it. I had to go buy a USB keyboard as I didn’t have any USB keyboard at home (yeah yeah, lot of people ask me about that… My old PS2 keyboards worked fine so didn’t even realize I didn’t have USB). I bought the mouse as well since I didn’t want to disconnect the mouse from my main system every time I booted into X on the Pi. I got the wired version of both because I wasn’t sure if the Pi could support wireless. It does support wireless stuff but it depends on how much power each device pulls and since I didn’t want to take a chance I went with wired.

Set it up, hooked it to my 2nd monitor and booted and it came up perfectly. Initially there was a problem with the display switching of for about 1/2 a sec at random intervals but that was easily fixed with a line added to the config file. Basically the problem was that the HDMI output wanted more power than the board was giving and since that is software controlled I was able to change it by adding the following line to /boot/config.txt

config_hdmi_boost=4

The other, I won’t call it an issue but distraction I had to fix was that when the system started up in full screen, there was an inch of black space around the display on all four sides. This also was easily fixed by adding the following line to the config file (more details on troubleshooting and available config options are available Here):

disable_overscan=1

I added the line, restarted and both the issues listed above disappeared. After that I played around a bit with the system and found that the average boot time is about 10-15 seconds to the login prompt. If I start the GUI interface it takes between 20-30 seconds for it to come up and be usable. Was able to browse the web and install software without any issues at all.

One interesting fact that I noticed was that the system didn’t appear to honor the rcX.d convention. I was trying to get ssh to start be default on the Pi when it booted up so I put an entry in the /etc/rc2.d directory called S25ssh which was a symbolic link to /etc/init.d/ssh and this should have started up SSH everytime the system booted up but for some reason that wasn’t the case. I tried fiddling with the number, made sure the file was executable etc but nothing seemed to work so I finally ended up adding the line in /etc/init.d/rc.local and then it worked fine. Haven’t really debugged it but it felt like it wasn’t supported or something else was overriding the instructions.

Finally once everything else was working the way I wanted it to, I decided to try get my Wireless dongle working on the Pi. Unfortunately I could only get it to work partially. The system detected the dongle without issues but gave the following error as the firmware for the dongle wasn’t installed:

zd1211rw 1-1.2:1.0: couldn't load firmware. Error number -2
usb 1-1.2: Could not load firmware file zd1211/zd1211_ub. Error number -2

The fix for this was easy, all I had to do was run the following command to install the firmware:

apt-get install zd1211-firmware

Once the command finished, the card was activated and I was able to see the networks around me including my home wireless network. However for some reason it was unable to get a DHCP lease from the router no matter what I tried, I even tried setting a static IP but it still wouldn’t go out to the net. I think the problem might have been because the dongle was trying to pull more power from the USB than the board supported, but since I didn’t have a working powered USB hub I couldn’t test the theory. Wondering if I should go buy a powered USB hub… Haven’t decided yet but it might be required as the Pi only has two USB ports and already I have three devices that I want to connect (the number will go up as I find more and more uses for the board).

Well this is all for now. Will post more once I play with the board a bit more.

– Suramya

June 22, 2012

Bug in FB Publication script fixed + Other Blog woes

Filed under: Knowledgebase,Website Updates — Suramya @ 11:56 PM

Fixed a small bug in the Facebook publication script that I had written, basically if the first para was over 1000 characters the post would fail. At first I thought I would just do a substr and limit the character to 900, but that didn’t work for some reason and I got some really weird posts on FB. But it looks like its working fine now and the last post came up on on Facebook. 🙂

There was another issue which I had faced a couple of days ago on the blog and wanted to document. Basically whenever I tried posting any comment or new post on the blog I would get a really weird error message that made absolutely no sense:

Are you sure you want to do this? Please try again.

After spending a couple of hours on the web over a period of few days trying to get things working, I found a post explaining how to turn DEBUGGING ON in WordPress (See below for instructions) and once I enabled that I found out that the DB I was using was over the max size my hosting company allowed so all inserts were failing, removed junk from the DB (Stats etc) and I was good to go.

To enable debugging follow these steps:

  • Open wp-config.php located in the wordpress blog’s root directory
  • Add the following line to the file:
    define('WP_DEBUG', true);
  • Save the file and Exit

Once you finish debugging you should either comment out the above line or delete it from the file, otherwise a lot of debug information will be shown to your visitors and that is something you don’t really want.

Hope this helps others.

– Suramya

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.

« Newer Posts — Older Posts »

Powered by WordPress