Blog

During the course of the day I encounter lots of challenges, some of which take minutes to solve and others that take much longer. My goal for this section is to keep track of these challenges and their solutions. I will turn the longer ones into articles, while the shorter ones will stay as blog entries. You can expect topics to range from very specific programming challenges to broader topics like life.

Below is a list of the recent blog entries. You can also browse the blog by using the tags on the right side, or if you know what you are looking for then you can use the search box at the top right.

Adding Line Numbers to the Text in Vim

I got a track list for a CD that I ripped but this list didn’t have the track numbers. So I saved the list to a text file and opened it up in gVim. Vim is an awesome text editor; you can do almost any sort of text manipulation in there, including the easy task of adding line numbers. Anyways, here is the command that I used to add line numbers to the text. Enjoy Vim’ing!

%s/^/\=line('.') /g

Recompiling RMagick

So as I am working on the new site I got the following error about incompatible RMagick and ImageMagick versions.

Loading development environment.
>> cap = Captcha.new
RuntimeError: This version of RMagick was created to run with ImageMagick 6.2.6
but ImageMagick 6.2.8 is installed on this system. You should either
   1) refer to the RMagick README file to learn how to create
      a version of RMagick for ImageMagick 6.2.8, or
Read full post...

Europe Trip Update

Just a quick update, I am currently in London enjoying a small break during my month long vacation (two weeks in Europe, two weeks in Pakistan). My trip to Scotland was freakin’ awesome; I only got to visit Glasgow and Edinburgh but they were both very cool. Edinburgh is unreal, its as if you become part of a fairy tale. I will definitely be coming back to Scotland, but next time for a much longer period. Unfortunately my camera had an accident and is not functional any more, so probably won’t be taking many pictures 🙂

Below is a picture from Edinburgh, enjoy!

Edinburgh

Where am I?

It seems my home and work activities have consumed most of my time which is why I haven’t blogged much lately. I am actually working two very exciting projects. I believe one of the projects is of such magnitude that you will "automagically" find out about it when it goes live! 🙂 Wish me luck!!!

Oh and my linux machine has been doing it’s duty very persistently; the uptime is now 65 days! Last time I had it up to 132 days when at last I had to turn it off for the move to Madison 🙁

Disabling IRQ #11?

So lately I have been having trouble with my ArchLinux installation where sometimes my video card (nVidia GeForce 440 Go) wouldn’t work and sometimes the wireless card would not work. So I decided to take some time to track it down and after spending quite some time I noticed that this was related to IRQ #11 getting disabled. This message appears right after udev is started so I am guessing this has something to do with udev. With the research that I did it seems like this might also be related to ACPI which tries to poll that IRQ but never gets a response (maybe due to some bug?). I have tried disabling ACPI by passing several flags to the kernel command line but the results were random so I took all ACPI related flags out. Anyways my current solution is to just restart when I see that message, I’ll do another post if and when I find a definite solution.

CAPTCHA, a must have!

So I just checked the stats for my site and looks like I was attacked by the spam bots a few days ago. Guess what kept even a single comment from appearing?!? You guess it, Captcha! I had a comment spam problem a few months ago but since I have installed Captcha I haven’t had even a single incident where the were able to guess it correctly (but most don’t even try to guess). I think Captcha is a must have for any website that supports anonymous submission.

Shahablab.com Live!!

I just finished uploading the first version of Shahab Laboratory’s new website, shahablab.com. I did all of the graphics in Macromedia Fireworks and the whole site is running on the Ruby on Rails framework. The site sparingly uses AJAX where appropriate; for instance the rates page uses AJAX to dynamically get the procedure description; and the comments page also uses to provide a more friendly interface. Let me know what you think.

After this experience with Rails I am thinking of moving my website to a Rails based site. Drupal is awesome but I would like to have more control plus I want to actually base my website on something that I made myself. Considering the amount of things that I have on plate and the fact that I will be taking a month long vacation in February (i.e. all of February :)) this change will probably be coming around June or July of this year.

New Lean, Mean, Computing Machine Ready!

This is my first post on my new Dual Core Pentium 820, 1GB, 250GB, X700 PRO computer 🙂 I am really excited because this thing is freakin’ fast!! Before I stayed away from restarting my previous machines because it would take about two minutes for me to be back in a working condition but now it’s no fear! The startup time is a few seconds without any tweaks!! 🙂 Watch out because now you are going to start seeing some crazy stuff from me 🙂

I installed Call of Duty 2 to checkout the graphics and guess what? 1280×1024 without any hint that the computer is actually doing anything! 😀 Awesome stuff!

Firefox Memory Leak

Firefox has been my favorite brower for the past year or two but upgrading to the latest 1.5 is starting to change that. Looks like the latest release has a big problem with memory leaks. I have browsed on previous versions for hours and hours and not even a single crash but the latest 1.5 has been crashing way too often. There have been times when I have seen it using about 200MBs of RAM! This is insane considering that I only had four of five tabs open none of which had anything that would require any special memory considerations.

So I started looking around and found a page that demonstrated Firefox’s javascript leaks. Fire up task manager and then this page in firefox, then watch how the memory usages spikes up! Now, even if you close that tab the memory usuage will stay the same. Due to time constraints I haven’t looked into the reason but for now I am just going to downgrade to 1.0.7, the last version that seemed to be working fine.

Update: Ok, I think the reason Firefox has been crashing a lot on me is because lately I have been visiting newegg a lot and that seems to be another site which causes the leak. Ah, this is anonying. From reading online it seems like this has been happening since 1.05 or even earlier; I guess I just got lucky! Damn, as I am doing this post and a little browsing the memory usuage is again around 110MBs! I guess it’s time for me to seriously consider Opera, especially since now it’s actually free.

No Desktop DDR2 at Local Best Buy!?

So I stopped by the local Best Buy to check DDR2 prices for a new system but to my surprise they didn’t have any DDR2 for desktops, the only DDR2 modules that they had were SODIMM! When I say they didn’t have it I don’t mean they were out of it, I mean they just don’t carry them (yet?). I am wondering why that’s the case… DDR2 really isn’t that new.