Redesign!

After 6 years; Rusty.in has moved on to a brand new design. The design is minimalistic, and I have tried my best to make the site much more readable.

The site more or less conforms to the HTML5 spec and I have tested it across most browsers I have access to. It works best on any standard compliant browser – read Chrome (visitor share of 24.4%) , Firefox (23.5%), Safari (1.9%), Opera (4.3%), IE 9.0+ (1%). On the mobile, it works good in iOS (0.2%), on Android (0.2%) and also (almost perfect) on the Opera Mini (0.1%). IE versions less than 9.0 are a bit rough on the edges – IE6 (5.3%) is the worst but still readable enough. IE 7 (8%) & IE 8 (7%) are more or less ok. I don’t plan to spend too much time on that though as long as more than 3/4th of my visitors see what I intend them to see :)

The site is still powered by WordPress. All the extra HTML, CSS, JS and PHP were coded on gVim on Ubuntu and the logo on top was my first experiment with the excellent vector drawing tool Inkscape. So the new avatar is a 100% pure open source product! Yeah design is possible without spending a penny.

I have also moved the site on to a dedicated new account at A small orange. A big thanks to Anand Bhai for hosting me for free all these years. I finally moved out to my own home :D

I hope you do like the new version. Comments, criticisms and suggestions are most welcome!

2 Comments

Developing cross platform desktop applications

Right from the beginning of my interest in programming; I’ve always had a thing for developing apps. Apps in the classic sense; the ones with a lot of bells and whistles that used to dominate the Windows landscape of yesteryears; the same ones usability experts would now cringe on looking at. That was probably because of the way I was introduced into programming. Starting with the good old QBasic; then moving on to Visual Basic – the only language where even your grandma could build an app in minutes. I was a tiny bit succesful too. I had this simple application called e-Diary which was basically just what its name stated. At its peak it had around 50-60 downloads a day and around 15k users who had registered via email to me. I’m still proud of that minor achievement; even though e-Diary has now vanished without a trace mainly due to my lack of interest in maintaining it; and the fact that all VB6 apps crash on modern versions of Windows :)

After all these years; after working on embedded devices and the web; I finally got a chance to build a real app on the desktop. Despite my long standing interest in this field; I was totally lost. The whole landscape was now very different – and I to spend a few days researching what works and what doesn’t.

I ended up choosing Python, Qt and the PySide python bindings for Qt. Why?

  1. I prefer working on Linux; my target was however Windows. The gamble on Python and Qt to be truly cross-platform as they both claimed. Paid off!
  2. My C++ days are long gone; I don’t think I can write 5 lines of good code in C++ anymore. Next choice was Java; but I was just a bit scared of over-engineering if I started with Java. So the natural choice was Python; even though I was not yet proficient in it.
  3. Next question was which GUI framework to go for. I saw Qt and to be honest I fell for it at first sight. It had everything I had dreamed of during my VB6 days.
  4. PySide vs PyQt was the next question. The product had a commercial angle to it; PyQt seemed more mature but had the GPL restriction or pay a very hefty licensing fee for a commercial app – so again was left with the Nokia supported PySide. Worked for me.

So that was it. I developed it completely on Linux. Since I am an IDE person; I opted for Eclipse with the Aptana Python plugin. After making sure it worked well in Linux; the next step was packaging it for Windows.

Now this was a challenge. The app required a Python install (15 MB) and a PySide install, including the Qt Libs (around 25 MB). This meant a total weight of 40 MB; for my app code that ran into just a few hundred kBs. Plus the ugliness of using consoles and shortcuts to run the application using python. Well, the perfect solution for that was PyInstaller. It worked like a charm and I was left with an exe file and only the absolutely necessary python modules that were needed. Running it through UPX futher reduced sizes and my whole app along with the libraries were now a saner 7 MB.

Next I ran them through the excellent InnoSetup tool; to create a Windows installer wizard that everybody is familiar with and the product was ready to be shipped.

Sun’s Oracle’s VirtualBox avoided the clumsiness of rebooting into Windows to do all the above; I just ran Windows on my Ubuntu installation as a virtual machine.

All this was surprisingly easy; just needed some figuring out initially. But once you get the hang of it; developing cross platform applications (at zero cost) is surprisingly easy. All tools I’ve used for this (except for Windows off course) are free and open source software.

So what are you waiting for? Start with those application ideas that you all have! It’s still fun!

12 Comments

My Programming Progression and the Language Block

Tech content advisory : Non-techies exercise caution reading this, maybe a bit of geek overload in here. :)

Like most people (ok, geeks!) of my generation, my first tryst with programming was with BASIC. Sometime during the mid-90s my dad gave me a book on BASIC programming, which he found in some book expo he attended. During that time, I had just about barely used a computer, and I didn’t really have an inclination towards technology at all. I do not know what made my dad buy that book for me, but that single thing changed a lot of things – a defining point in my life, if you may. That was my first spark. I just loved how programs were written, the system and the method in them fascinated me – to the point that I persuaded my dad to buy me a PC (It was a big deal then – to put that into perspective, I guess the computer density in my suburb at that point of time, would have been probably < 10 in a 5km radius).

So I got my first chance to try out some real programs. I got QBasic 4.5 installed from a floppy disk and merrily enjoyed my time making text scroll around, drawing human faces, creating monotone music, yada yada. I just fell in love with BASIC – for the simple reason that I didn’t even know alternatives existed and I could program as though writing in English. Even now, I feel so sad when people say BASIC is evil. Maybe it is, but it did end up as a stepping stone to where I am now. Eternally grateful for that.

A few years later, I got my hands on Visual Basic. Boy did that change the game altogether. I could make Windows apps now – with all those shiny text boxes, 3d effects, command buttons! And for the first time I found that I could monetize my hobby. Those days were just wonderful, that awesome feeling of having dispensable income while you are still in school! I saved up all the bits of money I got then doing mini-freelance projects and ended up buying my first camera – one that I still own. Technically here though, I have to agree with the critics. I had learned so many bad practices doing VB that I had a tough time unlearning it all. But whatever it may be, it was definitely worth it. I cannot remember another time, when I had so much fun doing programming. Nothing absolutely matched VB for me in that!

My first encounter with a ‘serious’ language was, again like most people, C and C++. This was a different beast altogether. I had a strong aversion to the language when I first learnt it in school, but slowly but steadily I have grown to respect it. I am still nervous doing C, but no other language actually gives me that feeling of solidness. Can be slippery, but still solid if you do it right. And that’s definitely the language that has lasted the longest for me. I still enjoy doing stuff in C.

College taught me some very interesting languages like Pascal, COBOL and Assembly. Pascal I loved, because of its cleanliness, but I never had any real use with that (except for the exams off course). COBOL was already of archaeological interest only, but served as a measure that gave me an idea of how much languages had progressed since the ’50s. Assembly was my new friend. But refusal to invest time on it (and basic laziness) has never let me really delve into that deeper.

Sometime sandwiched between all those I came across PHP. And that was only because I wanted to do web (this site basically). And web was just about getting trendy at that time. I have always had a love-hate relationship with this one. I used to hate a lot of it, when I was using it for only personal stuff. But ironically after having to professionally code in PHP, I kind of appreciate the language a bit more. That might raise a few eyebrows – but it’s true. It’s not as perfect as Haskell, but in my opinion it does its job well.

My first real ‘career’ language was Java. And the one in which I can say I am the strongest in. It’s bloated, it’s over-engineered – over-engineered, well I guess that was the buzz word for me. I think I like a bit of over engineering. It was more fun designing for the Java than actually doing stuff in Java. That’s obviously also its biggest pitfall. I cannot say I love Java, but I do like it a lot. And it did improve my design skills a lot and taught me how to think big – really big (and off course it paid my bills for 4 years!)

Then I joined MobME. Things were different here – very different. People coded in Python, Ruby, Clojure, Haskell, PHP.. what not. I was a bit overwhelmed at first, but yeah I got used to it. Python – I liked, maybe because it looked BASIC like and invoked a bit of nostalgia, PHP I had already met. Then there was Ruby.. and here’s were I get the mental block. I just can’t get myself to code in Ruby. I’m in a room filled with Ruby enthusiasts, but I just don’t get it. I even went to a RubyCon for inspiration, but no spark. I read everywhere that Ruby brings back the fun to programming. But I still don’t get that feeling. Have been wondering about that for long, why does the whole world get it, but not me! This post is a result of thinking about that loud. Maybe it’s because of all the unkown magic that happens behind what I type? Or is it that my mind far too entrenched in the bracey C-esque languages? I would never know…

Ah well, let’s leave it there then, for I have to go write a billing engine for a service in Ruby… Wish me luck, or a lot of people are gonna loose a bit of money ;)

7 Comments

Media's Tech Illiteracy?

Allow me to be that guy who for once ignores his emotions and patriotism and just says WTF.

A few weeks back, there was big fanfare orchestrated by a lot of Indian media outlets regarding a homegrown web browser called as Epic. I was a bit skeptical already, but after downloading and using Epic, I outrightly recommend reading those reports as a case study in technology sensationalism. I’m not putting down the Epic packaging, as a one click browser suite it has quite done its job. But what puts me off are the claims that this is India’s answer to Mozilla! But hey, the browser IS Mozilla’s, just that they have packaged a few utilities, plug-ins and wallpapers into one single pack. It is not a new browser, and it definitely is not the hallmark moment marking the maturity of Indian software.

This is not the only example. After this came the $35 palmtop. This time it wasn’t just the Indian media that jumped into the bandwagon, I saw such reports even on foreign news outlets like BBC News and The Guardian. I don’t really know how this $35 laptop is going to work out, especially since we import most of the hardware from China. Haven’t these journalist had the sense to look up the status of some of the other low cost appliances the Indian government announced a few years ago? I’m talking about the Simputer (to be fair, it was atleast insignificantly successful), the under $100 computer and the numerous other projects. They are all paper tigers that didn’t seem to have seen the light of day. I sincerely do hope that I am wrong and our Government actually builds this. But I’ll believe it when I see it.

And does anyone remember Bhuvan? Touted as the Google Earth killer. I haven’t even been able to get it working so far. After all the media hype surrounding this, I don’t even find a mention of that now in any of the newspapers or by the government.

What we need to do is to encourage the REAL projects that came out from India and Indians. Like Zoho or Varamozhi or Quillpad or MashiThantu or Posterous (atleast in part). Why don’t these awesome products never get a mention anywhere in the media? Sad!

3 Comments

Adventures with Ubuntu Karmic Koala

No I am not talking about a spiritual trip to Australia or about the animal; Karmic Koala is the latest version of the Linux distro Ubuntu :)

So I decided to switch to Linux on my laptop; since I found it much better suited for programming than Windows 7. First thing I tried was to run Linux on a VirtualBox environment; though it did work quite beautifully; it still wasn’t ‘perfect’. Therefore I decided to do an actual install; and I chose Ubuntu as it is now more or less the de-facto Linux distro for a desktop (and also since I had a Ubuntu CD lying around). It was an adventure of sorts, so I decided to document all that I did; as a note for myself and also for any of you who wants to do this. But then if you don’t want to read the technical bla-bla; you can go right to the point here.

Pre-installation woes

The first problem was that somehow my hard disk was partitioned as a ‘Dynamic’ volume; which is Microsoft proprietary and I had trouble getting the Ubuntu installation to understand this. So my first task was to revert the ‘Dynamic’ disk to ‘Simple’. It wasn’t as simple as I thought. But thanks to the Google, I managed to find a way. It involved using a low level hex editor to directly edit the values in the partition table. Detailed instructions are here. Now came another problem; as soon as I rebooted to Windows 7, only my first partition was visible. I was a bit scared that all my data was lost, but then I found this wonderful tool called as TestDisk. It scanned my disks and fixed my partition table for me. What a relief! I did a reboot and my happiness was short-lived – Windows 7 won’t boot anymore! Now I have lost my OS too. But this wasn’t as tricky as I thought. To fix that all I had to do was to boot with a Windows 7 setup disk and do a repair (the option comes right after you select the language). So now I finally had a working system with ‘Basic’ disks. Ubuntu now installed as a breeze and all was well.. that’s what I thought.

Post-installation woes

Now once Ubuntu was up and running, my display wasn’t working optimally. But to fix that all I had to do was to install the non-open-source drivers from ATI (which is easy to do from Ubuntu, look under System->Admin->Hardware Drivers). A happy few hours went by and it was time to watch IPL on YouTube when I realized that my sound card was not working. This was a major pain, I spent another few hours trying to figure this one out. The Ubuntu forum said that the solution was to install the backport drivers for ALSA.

sudo apt-get install linux-backports-modules-alsa-karmic-generic

Reboot and lo I had sound! But wait… my display driver is gone now. And now it was not possible to activate it anymore. The problem (my best guess, I am no linux guru) was that the ALSA install also updated my linux kernel version, which wasn’t supported by the display drivers. After another reboot into the older linux kernel version, I finally nailed it. The trick was to install the proper backport version instead of the karmic-generic one. The command is now:

sudo apt-get install linux-backports-modules-alsa-2.6.31-14-generic

You’ll have to replace the ’2.6.31-14′ part to your linux kernel release number; which you can find by typing ‘uname -r’ on the terminal. Now I had sound and light! Awesome; finally a full fledged linux installation.


Ubuntu

Coming to the point…
If you want a real free (as in speech or as in beer) alternative to your Windows or Mac, then Ubuntu is your answer. It is an awesome OS and not just for programmers. The performance is really really impressive and it looks and works clean and secure. But then again is it really ready for the common user? Unfortunately I think not. I am a tech guy, and computers are my bread-and-butter, but even for me the installation was such a headache. For a normal user, this would be a roadblock preventing them from going any further. That’s just a pity. Ubuntu is a real alternative with a solid foundation, but if only it polished some of those rough edges…

My laptop is an HP Pavilion dv6 2020ax and the Ubuntu version I tried to install was Ubuntu 9.10 Karmic Koala.

7 Comments