Sunday, November 9, 2008

The heights of geekiness

Geek noun \ˈgēk\: Geek  Used in a nice way it is someone who seems to know everything there is to know about computers.

If I were to define myself as a geek, I would say:

   1:    -----BEGIN GEEK CODE BLOCK-----
   2:    Version: 3.12
   3:    GED/J d-- s:++>: a-- C+++(++++) 
   4:    ULU++ P+ L++ E---- W+(-) N+++ 
   5:    o+ K+++ w---  O- M+ V-- PS++>
   6:    $ PE++>$ Y++ PGP++ t- 5+++ 
   7:    X++ R+++>$ tv+ b+ DI+++ D+++
   8:    G+++++ e++ h r-- y++**
   9:    ------END GEEK CODE BLOCK------



(don't understand the above? refer to The Geek Code v3.12, Yup, we have one) smile_nerd


Even as a geek, there comes a point, where you need to draw the line. One such point came today. I found myself facing a dilemma, unable to decide, "How to get bored today". After much deliberation I found that I simply could not decide between five things to do. Under these circumstances I decided a coin toss would be ideal. This of course brought up another question how best to decide between 5 choices using a coin. At that time a brilliant geeky idea came to me, and I decided to whip together a "Random Choice Maker"


Screenshot


Took me 20 minutes to whip together this simple utility, I wrote a simple RNG function it went like:



   1: class myRandomizerClass
   2: {
   3:     public int generateRandomValue(int uValue)
   4:     {
   5:         int millisecondsNow = DateTime.Now.Millisecond, breakIndex = 1000/uValue;
   6:         return millisecondsNow/breakIndex;
   7:     }
   8: }



It uses a simple uValue for checking quantile density.


So, that's it. Once again I ended up prooving that "Once a geek, always a Geek"


Cheerio. smile_tongue

3 comments:

Anonymous said...

Well Done! And geeky as hell!!

;)

-vikas

Anonymous said...

good job mr.debu. btw. are you using gtk#? the code looks like c#, but the ui is linux.
ritesh

Devesh Rai said...

@vikas: Thanks.

@ritesh: Thanks, No, I am not using gtk#. I'm using Java here. JDK1.6, with swing.

Regards,

Debu :)