Search

Monday, December 31, 2007

Open a beer bottle with paper

 

If I knew this during my college years my teeth would've been in better shape now :)

For more life hacks head here.

Wednesday, December 19, 2007

Giving up on Ubuntu

Whidbey_2005_0409_131710

I have an old hp laptop (1.3 GHz, 512 mb RAM) lying around on which I'm trying to install Ubuntu. There's no reason for it, but I had just backed up all stuff on it to another machine and I thought I'll give Ubuntu a spin.

I downloaded Ubuntu 7.10 burned it onto a CD and booted it up. After that the experience so far has been real bad. I ran into all sorts of issue. Listed some of them below

  1. Initially I tried various languages in the installation screen, complex script was completely broken. I understand if an installer doesn't support Bengali or Hindi, but in that case the option shouldn't be in the screen, specially when it's not even readable. On top of it language switch wasn't painting the screen correctly
  2. Installer went on broadcasting some sort of weird garbled sound (I guess garbled due to CPU stress)
  3. It booted up into a brown screen without any option to do anything. I waited couple of hours and figured out something is wrong and rebooted again into some safe mode
  4. After a long time it did come up but the UI was sluggish to the point of not working
  5. I clicked on the install icon and nothing happened for a long time.
  6. Now I'm stairing at a fancy screen where the cursor is frozen and the CD is making sounds as if it wants to join F1 racing.

I know the Linux fanatics will sham me as a fool and point me to all sorts of hacks and stuff I can do. The problem is that I'm really not interested in tinkering with installation, I'm used to them just work. I'm not an admin and couldn't care less about these things. For me getting it up and running so that I can do the stuff I wanted to do is more important.

Right now I'm at the point of giving up and moving to some other Linux distro. I'm out of touch with Linux for a long time (~6 years) and I guess I need to look around. Hopefully Red-Hat and Mandrake will work for me.

Thursday, December 13, 2007

Bar Charts on the console

Golconda fort arches

I work on the UI action recorder and it has a strict performance requirement. The tool dumps the time it takes to record each action in it's log and that is compared against the maximum allowed value (otherwise the system will seem sluggish). To do this obviously we need fancy charts, as everyone likes them, other than of course the alpha-geeks :).

However, I like the console chart. Way back my mom used to work on Main-frames that ran COBOL on them and dumped out business data on paper at the end of the day. These reports had these printed bar charts.

I wrote a small ruby script to dump these charts on the console. The output looks like

D:\MyStuff\Code\Ruby>perf c:\logs\Recorder_20071118_144855.843.log
c:/logs/Recorder_20071118_144855.843.log ===============================>
640 ********************************************************************************
0 *
109 *************
0 *
46 *****
0 *


Serves the same purpose as their fancier counterpart but manages to look uber geeky.

Support for range in programming languages

DSCF2530

The .NET platform and the languages on top of it have limited or no support for range of values. Data ranges are one of the most common data-types and somehow it's not there. Funnily most programmers do not even seem to miss it (unless of course if you have used Ruby).

How would you specify a valid range of age and validate user data against it? If you know the maximum and minimum values, at max you'd define a MaxAge and MinAge consts and strew the code with if(age < MinAge|| age >MaxAge). Or maybe you'll define a class to encapsulate this and add a IsValid method.

However, in Ruby, Range is a standard DataType like say string. To do the above processing you'd do

age = 1..120

print age.include?(50)
print age.include?(130)


print age === (50) # more easier way to do include? test using the === operator


So intuitively you create a range using start..stop.


Creating a range of data is also very simple. Say you want to generate the column numbers for an excel sheet, you'd do the following

column = 'A'..'ZZ'

column.to_a # creates an array of all the values

column.each {|v| puts "#{v}\n"}

Similarly ranges can be easily created for any class by implementing some special methods. On ruby the support of Range is in the compiler and makes the code very easy to develop and intuitive.


>>Cross posted here

Wednesday, December 05, 2007

Fun Windows Home Server site

2006_1101_200024

Windows Home Server team has a nice light-hearted site up at http://www.stayathomeserver.com/. All of it was funny, until I reached the page http://www.stayathomeserver.com/book.aspx. It says "daddy wants to give mommy a special gift.... So he buys a stay-at-home server".  That's not funny, "Wife Acceptance Factor" would be reflecting nitrogen freezing point for a home server.

You can sneak one in, understate the price and show all the image streaming to kinda buy acceptance, but a gift, no way :)

Saturday, December 01, 2007

Choose your company name well

 

Picture 057

Sometime back Hutch phone in India got bought over by the international phone giant vodafone. They re-branded Hutch in India to Vodafone.

Now when I call up home and the phone is busy I get a recorded message in Bengali which means "The Vodafone number you're trying to call is busy". All that is good but the problem is that vodafone in Bengali exactly means foolish phone. So I just hang up and wait for the foolish-phone to get free.