Friday, August 5, 2011

Coding Vs Alcoholism

There isn't much of a difference in my opinion... here's why:
1. It takes a while to develop a taste for both
2. Sooner or later, it becomes an addiction
3. Too much of both makes you dizzy
4. There's no going back from either...

\m/

Tuesday, July 26, 2011

How to generate a random string in ruby

Just ran into this while googling for random string generation in ruby. This is pretty awesome:

Also, thanks to divisionoftigers for posting it on stackoverflow here

Let me put it directly here instead:
require 'active_support/secure_random'
random_string
= ActiveSupport::SecureRandom.hex(16)

Friday, July 22, 2011

Productivity is inversely proportional to process -- In my arrogant opinion!

Experience says it and even the observations. Companies creating wonders are fairly disorganized within the teams! I've been talking to my friends whose companies are doing great and are running with minimal documentation and processes and so called systems. On the contrary, I work at a place where how you do it is more important than whether it works or not, which adds to a great extent in Quality (non)Assuarance!
I have always been very opinionated about things and with due respect to the genuine intentions behind the workflows and procedures, I think nothing would do more harm to the quality of the product than the mindless implementation of a good workflow (this is assuming that the developers are pretty darn good at what they do). It is this very blindness, mindlessness, the culture that prefers standard procedures over genuine ideas, preference to stability over adaptability that's making me go crazy! It is frustrating to test a product that in your own opinion -- sucks, it is frustrating to see raised eyebrows when something fails, it is frustrating to not being able to fix it yourself and rely on someone else who apparently wouldn't fix it anyways because apparently that person wasn't able to "reproduce" it.
I am hating being a part of the system and my threshold is almost reached.
I shall move on... hiring anyone?

Thursday, June 30, 2011

"Hassle-free" life of a software engineer

Out of nowhere, I have this urge to learn development on rails now... since everyone thinks that it's so awesome and most importantly it's free and has shitload of free reference material online. I thought this would be a good idea to "start" (literally) with web development, when I should really be packing my bag for a flight to Chicago tomorrow.
Okay, so I have "THE" Mac OS X 10.6.7 and obviously since Apple think it's so damn awesome, it shipped the laptop with ruby pre-installed... Awesome right? WRONG!!
To go by the tutorials, I want to install rails 3.0.1... which by the way, works with ruby 1.9.x. So, all I need to do now is uninstall the ruby 1.8.6 that my macbook shipped with and install ruby1.9.x. Easy right?? WRONG again. Here's why:
1. To uninstall ruby, I will have to force remove the installation folder manually -- the idea with which I've never been and probably never will be comfortable, since I have messed up such a big time in the past.
2. I know a good way, which will get me started with a clean slate. Yes, I am talking about the rvm (the ruby version manager). The problem is, rvm needs cUrl (a command line utility that lets you download stuff from command line) and cUrl website is DOWN!!
.
.
.
You might as well tie my neck to the tail of the flight tomorrow and take me to Chicago. I bet that'll be way less irritating.
This is certainly one of the situations when I feel that windows is way better!!

Update: My bad! Apparently, MacBook also comes with the curl installed... now that's awesome. Just installed rvm, but rvm notes for snow leopard do insist on updating the xcode, which is what I have to do now :(

Saturday, June 25, 2011

Ubuntu on VirtualBox

In case you're wondering why your Ubuntu installation gets stuck while you're trying to actually install it from the disk that you mounted, it's probably because you have checked the download updates installation in the beginning. Try starting over with that option unchecked to get the downloads out of your way, you can have ubuntu do that separately later when you're sleeping with your headphones on or something (like I do). If that doesn't work, use the try ubuntu option to run it from the cd-rom without installing it and then install it by double clicking the install icon on the desktop. This worked for me on both - mac and windows!
On a personal note, VmWare in my experience, is much more feature rich as compared to Oracle's VirtualBox (and I swear there's nothing more painful than calling it Oracle's VirtualBox instead of Sun's VirtualBox... but I'll get over it someday), but seriously...who buys a software these days? Also, there's a developer kit for VirtualBox... so someday you happen to crave for some opensource development, you can dive into that and I guess it's worth getting used to it now rather than later.

Monday, June 20, 2011

Murphy's Law

Found this line in Linux Kernel Module Programming Guide this morning and aptly so:

"You'll need to compile your code using various header files from the Linux kernel. Murphy's Law states that the headers that are missing are exactly the ones that you'll need for your module work."

lol

Sunday, June 19, 2011

A Note to myself - JTable.setRowSorter(null)

Never, ever use a line of code from a random forum without completely knowing what it can do to your code. I happened to use JTable.setRowSorter(null)
because I wanted to prevent users from clicking the column header and accidentally sorting the row. While I did that, I didn't know that it would actually end up disabling all the filters I might add later. Murphy's law - it did exactly the same and I wasted hours trying to figure out why aren't my filters working when the sorters are returning correct values. Google doesn't really help a lot when it comes to debugging your code. Unfortunately, I did not mention disabling the rowsorter in the changelist when I committed the changes. Thanks to my memory though, it reminded me of that as a possibility and after removing that line of code, everything is golden!