Nov
19
2008
0

Enjoying my moment while its there

This is a snapshot from my portfolio that I entered for CNBC Million Dollar Portfolio Challenge. Its the perfect way to get into the current dramatic stock market action without losing sleep at night.

Feels pretty awesome that I am in top 1.5% (kinda feels like I cracked IIT-JEE once again).

I know, I know, most of it is pure luck and I might be in bottom 1.5% tomorrow, in this volatile market. But still, out of 400K players, most of whom I guess trade with real money too, if I am in top 1.5% even for one day, I will take it.

Every dog has its day.

Written by Bhabishya Kumar in: General |
Oct
05
2008
1

Moved to WordPress

As you can notice, I have moved this blog from Mephisto to WordPress. One of the reasons was that Mephisto doesn’t have Trackback support. Also, WordPress has a much more active community, with lot of Themes & Plugins available, kind of like Firefox.

The move was quite smooth, thanks to a Ruby Script. Only part that I had to do manually was to categorize the posts. Also, WordPress was treating my ‘About’ Page as a post.

Written by Bhabishya Kumar in: General |
Jul
09
2008
0

Something for the brain

My layman solution to Dustin’s Programming Brain Teaser.

    var arr = ['a', 'b', 'c', 'c', 'd','e', 'e', 'e', 'e', 'e', 'f', 'e', 'f', 'e', 'f', 'a', 'a', 'a', 'f', 'f', 'f'];
 
    var result = '';
 
    arr.forEach(function(value, index){
        if(index > 1 && (arr[index] == arr[index - 1]) && (arr[index - 1] == arr[index - 2])){
            if(index == (arr.length - 1) || (arr[index + 1] != arr[index])){
                result += (index < 3 || (arr[index - 2] != arr[index - 3])) ? ' &lt;span&gt;' + value + '&lt;/span&gt;' : ' ' + value +  '&lt;/span&gt;' ;
            } else {
                result += (index < 3 || (arr[index - 2] != arr[index - 3])) ? ' &lt;span&gt;' + value : ' ' + value;                
            }
        } else {
            result += ' ' + value;   
        }
    })

Remi Sharp and other guys who used regular expressions came up with much ‘cooler’ solutions. Regular Expression is really powerful. Need to work on that.

Written by Bhabishya Kumar in: JavaScript |
Apr
07
2008
0

Happy Anniversary, Procrastination!

I can’t believe we have been together for one whole year! It was this very month last year that I started this blog. It was supposed to be a medium to share my experiences during my journey in Ruby on Rails & JavaScript hacking.

Of Course, I hadn’t met you yet!

All I wanted to do was create a super-simple website using Rails & JavaScript. But I couldn’t do that after meeting you. You were always there luring me with things which were much easier & fun then starting a project from scratch. You gave me the instant gratification which is so tempting. I was always looking for excuses to meet you even though it made me feel guilty afterwards. Whenever I faced some obstacle, you took me in your loving embrace and made me forget everything.

To be honest, I haven’t been totally loyal to you this whole time. I have been sneaking out to meet other people like Gadgets & GreaseMonkey scripts. They make me feel good about myself. I don’t feel miserable afterwards as I do after spending time with you. But those occasional dates never materialized into anything meaningful like a full website. Its about time that I change that. Its going to take a lot of commitment, effort from my side but I have to bite the bullet.

I am so sorry to say this but I think we should break-up.

Written by Bhabishya Kumar in: General |
Feb
21
2008
0

Happy or Successful or Both?

I was wondering what’s more important in life. I guess being happy would be everyone’s ultimate goal. I used to think that being happy & successful are linked together but it doesn’t seem so. I find a lot of people who I wouldn’t consider successful, quite content in their life. I guess it has do with how much expectations they have from themselves. And I think that depends on the company they keep. That’s a topic of another article altogether.

Now, how do you define - Successful? Is it being successful in profession or family life or something else? Its a weighted average of everything. And this is where it becomes interesting. Everyone decides whether they are successful or not based on whatever weightage they have given to each aspect of life. So, maybe there is in fact a link between being successful & happy. Its just that my formula for success doesn’t match theirs.

So, what do I give more weightage? I will have to say profession because that’s what we are. First we are a School Student, then a College Student, then a Doctor, Lawyer, Engineer, Businessman, whatever. I have yet to meet a person who introduced himself as

Hi, I am John. I am a Weekend-Poker-Player“, or

Hi, I am Charles. I am a After-Work-Bar-Goer“, or

Hi, I am Michael. I am Every-Weekend-Orlando-With-Kids-Visitor“!

Even if they are unemployed, that’s the first thing they will say about themselves and then all this. Also, we spend 5 days of our week in our job. If you don’t care what you do during the weekdays and are happy living the other 2/7th of your life, good for you.

Let me quote something from my article To Geek Or Not To Geek I wrote a few months back.

the amount of money that one can demand and, more importantly, get is inversely proportional to how many people can do his/her job.

The figure that you come up for yourself as compared to the market average for your job & experience should give you a pretty good idea of how you are doing in your profession.

So, what about me? I am happy to be unhappy! I am happy to be aware that unless I am successful in my life, I can’t he happy. There is an old adage - “To fix a problem, you have to first admit that there is one”. There are a lot of people who live in denial all their lives about their happiness or success or both. At least, I am not one of them.

Written by Bhabishya Kumar in: Programming |
Dec
20
2007
0

It seems Stevey can read my mind

I just read his latest rant Code’s Worst Enemy.
These two paragraphs from his latest rant are exactly my thoughts.

…I think that his “something bad” may well have been the act of creating the book Refactoring, which showed Java programmers how to make their closets bigger and more organized, while showing Martin that he really wanted more stuff in a nice, comfortable, closet-sized closet…….

…..Tragically, the only GoF pattern that can help code get smaller (Interpreter) is utterly ignored by programmers who otherwise have the names of Design Patterns tattooed on their various body parts……

I too believe that each and every line of code that we add to our project brings with it some kind of entropy (disorder). It adds to the clutter making it difficult for us to see what exactly is going on. And that’s why I like attr_accessor
in Ruby over “Alt+Insert” shortcut for Java in IntelliJ IDea, even though both will require the same effort.

It gives me an itch looking at the ROI (Return on Investment) in Java Projects. The ratio of the amount of code that we write to the functionality that we get out of it is really embarrassing.

I think the authors of the mentioned books should have put a Statutory Warning on the back of their books.


Using these patterns/refactorings just for the heck of it may be injurious to your project. Use at your own discretion.

Written by Bhabishya Kumar in: Programming, Ruby on Rails |
Oct
20
2007
0

What a Movie!

I just finished watching Boiler Room. Amazing movie! No wonder, the Brokerage firms make all the new recruits watch this movie along with Wall Street and Glengarry Glen Ross. In fact, there is a scene of “Wall Street” played in the movie and all the Brokers watching it repeat the dialogues word by word!

The best scenes are when Ben Affleck gives speeches to new recruits. I loved this Group Interview scene.

There is something exciting about the Stock Market. Especially the Trading part. Its like Gambling. Very Addictive. I guess if I was not a Software Engineer, I might have have tried my hands at Trading full-time. Or, may be I can mix the two and build some software for Stock Market.

Anyway, can’t wait to see “Glengarry Glen Ross” now. Its next in my Netflix queue.

Written by Bhabishya Kumar in: General |
Sep
13
2007
2

Google Gadget for fellow Immigrants

I have created a Google Gadget for all the Immigrants of India/China who were finally able to proceed with the last stage of their Green Card process after I-485 Fiasco of 2007.

This displays the Date as well as the Countdown to 180 days from I-485 Receipt Date of Green Card. I call that day “H1B Independence Day”. They have to add their own I-485 Receipt Date under Settings. The default is last date of filing - August 17, 2007. This Gadget can be added to iGoogle, Blog or Website. They can look at this Gadget every morning and feel good.

Its hosted in Google Directory. I have posted about this at ImmigrationPortal Forum.

Written by Bhabishya Kumar in: JavaScript |
Aug
25
2007
0

More Monkey Business

Gasoline requested me if I could develop a Greasemonkey script similar to my first script for Picsearch.com. Initially I thought it should be fairly simple. So, I looked into Picsearch. I was wrong. The good thing with Google Image Search is that all the search results have the url of actual image and actual page as part of their href. So, you just have to parse the href and replace it with image url.

Picsearch on the other hand just points to some ID and when you click on the search results to go to next page, then only you see those urls. So, it became a 2-step process compared to one for Google. First, I had to load the actual href in an invisible Iframe and then read the document in that Iframe to look for the desired urls.

And so, something which was supposed to be a mundane task turned out to be exciting. I had tried this Iframe busines earlier too but had to give up because of cross-domain security restriction (silly me!).

Also, I guess I have to learn more about Greasemonkey quirks. Some things which work fine in real world stop working in Greasemonkey script. Like my onload event handler for Iframe started giving some strange errors in Firebug though it worked perfectly fine in my standalone testing. So, I had to do it the eventListener way. I guess it doesn’t like level 4 JavaScript:).

Another weird thing was that the popup-positioning JavaScript which was working perfectly fine for my Google script stopped working. I have no idea why. Maybe, it was conflicting with something in the main body of Picsearch. Anyway, this forced me to try something else and I came across something new. You can manipulate the loaded stylesheets through JavaScript using document.stylesheets. That was fun.

So, finally the script is ready. I even added [Origin Image | Origin Page] to it like CustomizeGoogle. And its also an indicator that the script has done its business and popups should appear now (helpful, since its slower compared to google version because of above mentioned reason). And I assume everybody is going to open images in new tabs(if at all) because if you open in the same tab and come back it will obviously reload all the Iframes and images again.

You can download it from its UserScripts page or directly from here.

Update - 08/28/2007 - I came across an irritating problem with some of the search results. Some of the origin pages don’t want them to be shown in frames in some other site. So, they use the following hack at the top of their pages to break out of frames.

if (window!= top) top.location.href=location.href

This was loading their pages in Picsearch results page when I was trying to load them in a IFrame, spoiling the whole thing. So, instead I am using Ajax now. I had thought of Ajax earlier too but gave it up thinking invisible IFrame should work the same way. But, I was wrong(again?). The new script is MUCH FASTER!!!

Written by Bhabishya Kumar in: JavaScript |
Aug
11
2007
0

JavaScript Knowledge Test

I came across a very interesting test of JavaScript Knowledge. I agree with most of the comments for that article, the gap between level 5 & 6 is much more than any of the other levels.

I have yet to come across a Java project with JavaScript code of level 6. Even level 4 and 5 are rare. And the reason being that in traditional Java projects, JavaScript is used only for basic UI validations, for which anything over level 3 is an overkill.

I would love to try out level 6 JavaScript code in my projects but I guess that would scare all the other Java Developers away:)

Written by Bhabishya Kumar in: JavaScript |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes