Returning a value in a function in Ruby


Interesting Ruby Tidbit –
In functions, the last value is always implicitly returned.
In the function below, “a” gets returned even though there is no explicit statement stating it should be returned:

def twoplustwo
a= 2+2
a # same as  return a

Diving into the wonderful world of Ruby


I recently started a bootcamp course at Tea Leaf academy, with the hope of soon becoming a ruby on rails rockstar(ish). I do alot of web client side/front end coding (html/css/jquery) but wanted to be able to write an app end to end in Ruby as opposed to PHP. Lets see how it goes.

The pace is challenging, brutal but you learn alot. For example, Ruby is not strongly typed. Its not weakly typed. Its apparently duck-typed. And everything is an object. I mean everything. Blows your mind how this things works as fast as it does, especially if you’re like me and you were brought up on Java!

Stay tuned for more useful writeups on coding in Ruby!

Back in time : Here come the Tablet Wars…


I wrote this about 3 years ago, on october 4,2009. its december 2012. besides being off by a year, it seems otherwise this wasnt too off the mark 🙂


Four years from now, there is a good chance that you’ll consider the laptop too bulky and slow for many of the things we use it for today; news, social networking and email. That “adaptation” of a desktop thing , i.e. the laptop is on its way out too, slowly but surely. Maybe us oldies might still use it but my kid would be using a flexible, touch screen based device and most of her work would be done in the cloud. Cheap Netbooks are a temporary solution to what is eventually going to be the norm in 2014 and beyond, a tablet based client machine that is connected to the cloud. And its got everyone from HP to Apple and even Nokia scrambling to come up with a solution and dominate the market. The software and user experience guys are scrambling to build next generation browsers and operating systems for these devices and even bloggers like Arrington are busy tinkering on their own versions of a tablet, presumably because they can’t wait for the big tech boys to get their act together. Rumours of an Apple tablet are abound while Microsoft’s solution has been “leaked” into the news today. HP already have a product out there and have said that they are working on a flexible display version of a tablet computer. When the user’s primary device changes, it usually leads to massive innovation and changes upstream from software, interfaces, networks all the way to data center designs…this is what happened when the smartphone became a commonly used platform, and is happening now when the “Web 2.0” paradigm is sending alot of the applications “into the network”. Remember the answering machine for the phone? We now have voicemail. Its in the network, not on our phones. Thats what’s happening with many applications, and has already happened to consumer email. While I still cant get over using a keyboard for typing and working (long live keyboard shortcuts), my little one is more interested in using my iTouch to play her games and watch videos, and whats more, she uses it like a pro. Touch is a paradigm shift, and moves us closer to a more natural way of working with computers. Star trek has been showing us the dream for years, everything on the Enterprise is essentially run by voice and touch based interfaces.  Both voice and touch technologies have come a long way in the last ten years but its really been reduction in manufacturing cost and processing power that has brought them into the consumer’s (yours and mine) realm.

Sleepless nights coding away is no longer cool….


When I was in college, staying up 2 days straight and coding away in the lab used to work well. Partly because there was a bunch of other undergrad geeks doing the same thing, at the same time. There was even a place to take naps if you wanted to. For the Automata theory final I stayed up 2.5 days and crashed right after I gave the exam. (I passed). At UT I learned -a lot-. There was so much to take in that there just were not enough hours in the day, but for the most part UT Austin was a marathon not a sprint. A good routine with solid concentration would do wonders for your GPA. Continue reading

Mac OSx Leopard VM running on my IBM T61 with Vista


have been giving alot of thought lately to moving to a Mac as a primary development platform, leaving behind my 12+ year associated with Windows and even my more recent Linux influx. I think the best ever Windows go to with XP..Vista has yet to impress, and maybe finding this as an excuse I decided to play around with the MAC OS, without standing for hours at an Apple store with someone store guy bugging me. After a few days of tinkering, here is the result: Using pcwiz’s VM release, I have a fully operational Leopard VM running on my Windows Vista laptop. (Yes, Leopard VM ON Vista, not XP/Vista ON a Macbook)

Mac OSx on Vista

This works well if you want to demo/play with the OS but is slow and you will not get any of the performance benefits of a real Mac. I did this to see if the usability is as credible as the hype says it is.

disclaimers : This is a test I did for educational purposes only. Buy a Mac OS Leopard license , or a Mac box if you plan to use a similar technique for daily work in a commercial environment.

Windows XP to stay on…


Despite what the high-ups at MS may want, MS users have made it clear : We still want XP.  Hence, Microsoft will keep an OEM option to customers so that they can get Windows XP when they buy a new machine, well beyond the original deadline to June 30th 2008. So if you want to stick to a legal copy of XP , then get it NOW….

Smart move by MS. Give customers what they want, Vista has nice bells and whistes, but not enough to make me move. I had to get it cause my IBM T61 came with it…so now…

I have Vista. You dont want Vista. You want XP..if you’re going to hang on to Windows..and I need to move to a Mac !

Good morning and…


Thank you for the post , Seth Godin. Here’s his post that made my morning:

Waiting until the last minute

In a nutshell: don’t.

Bad situations to wait until the last minute:

  • Catching a transcontinental flight
  • Asking your secret crush to the prom
  • Applying for a summer internship
  • Setting customer expectations
  • Studying for the SATs
  • Saving for retirement
  • Giving up smoking
  • Asking for a raise
  • Teaching ethical behavior to your kids
  • Winning a primary
  • Asking for directions
  • Sharing an idea

And, for balance, two times when it pays:

  • Bidding in an eBay auction
  • Giving up hope

Firefox 3 Beta fixes the memory hog problem.


I love Firefox. I really do. It has its issues, just like your iPhone or laptop. But you love your iPhone despite its issues. But then again, your iPhone doesnt eat up 600mb of memory to show you 6 websites. Which firefox does, or used to do shall I say. After I installed the beta release of FF3, the first thing I noticed was that the memory hog issues were -gone-. Continue reading

I’m done tinkering…


the first idea (called buzz.PK) is finally ready to jump into a public beta…took two weekends and a vacation but finally got done…go here to check it out :


The second cool idea is still in dev mode in my little lab, if I ever find time from work i’ll get that out too…

let me know what you think about buzz.PK ….