Wednesday, March 14, 2012

Cows n Bulls

Have been a great fan of the Cows n Bulls game, ever since I was introduced to it some 12-13 years ago by a close friend of mine. It serves as a perfect time pass and good exercise to hone your analytical skills. But this has almost always needed atleast 2 person, one to guess the number and respond back to your attempts in terms of Cows (right digit at wrong place) and Bulls (right digit at right place).

So many a times while travelling alone, I couldnt really play it all by myself and then I decided to have it built within my mobile phone itself. And thats when I first picked up on J2ME to build a very vanilla version of Cows n Bulls game which I can download and run from my own mobile handset and play whenever needed. So I ended up with 'CnB' and posted the same on www.getjar.com as my first contribution to free mobile games. That was sometime in 2006.

Now with iPhone launched and so much of excitement / buzz / traction on the iOS app marketplace, I couldnt hold myself from developing an iOS port of the same vanilla Cows n Bulls game.

I hope it would soon be approved and made available on the app market place.

cheers.
NikhilDx

Monday, January 23, 2006

FireFox Extension - Tab Saver 1.0

I've been using Firefox for almost a year now. Earlier I have been using Opera mostly and like the tabbed interface and various other features.

Firefox also has most of the features and is pretty much neater. I liked the interface, various extensions and themes available. The hacks that can be done in the browser etc. The only missing part and the disconnect was, every time you install an extension/theme, you need to restart the browser and when you restart all the many tabs are simply lost. And you have to re-open them. Secondly, with earlier version of Firefox there was this memory issue and it never used to drop down, and I had to restart the browser.

So I was desparately looking for the Opera kinda functionality where in you can have the option to restore the old tabs with the respective URLs. And I did some lousy searches on the Firefox extension sites but couldn't find any. And perhaps that finally made me write this lousy half-finished extension for myself.

I did some quick searches on the mozilla development sites and found some handy scripts and tips and quickly assembled this simple extension. It save all the tabs with their URLs while you exit the Firefox and once you start your browser again, you can restore the old tabs-n-urls by using the Tools->Restore Tabs option or by Righ-click-menu-> Restore Tabs option.

I tried it for myself and then left it in the shape where I could achieve the basic functionality and was pretty satisfied. Then I thought of giving it a try to upload at the Firefox extension forum as well (after all if all the code pieces were used from the Firefox forum, then why not put the new piece back in :)). And it also got approved (to my suprise). And finally today I got a comment that I had put my extensions URL as this blog-site of mine but there is not a single word about Tab-Saver :). And so here I'm keying in a few lines about this plugin.

From functionality aspect, I prefer to add many more features like -
- Prompting the user to restore the tabs during startup itself.
- Saving even the history information for all tabs.
- Saving the tab information on every page load and not just browse exit.
- option for a toolbar button (as one user has commented)

But when I was done uploading this extension, I came across a fabulous extension by the name Session-saver and which does far more than all these. And all my enthu to work further on this extension vanished :)))...

Not sure if I would ever be working over it to refine and add more features :o).

Thanks to all those who have evaluated and are using this!!!

Thursday, April 07, 2005

InMemory DataCompression : Can this be an Aspect ?

I don't have much background on AOP and have never used the same in any of my projects. But I do have the basic understanding of the cross-cutting concerns and the power and applicability of AOP.

Having set the context of my exposure to AOP, I was wondering about not so strange requirement of compressing the data in memory and modelling it as an Aspect of the system.

One of my applications queries out thousands of record from the database and keeps it in memory, since a lot of viewing and summary generation takes place. To optimize the memory requirement of this application, various options were discussed and one of those was to keep the data compressed.

Now how much part of this data can be compressed so that performance is not severely hit by it are some questions which needs to be worked out. But generally thinking from a design view-point I thought of modeling it as an Aspect, so that it can be configured and applied at API level without doing much code changes and making the whole deal seamless.

So just wondering, how apt would it be from the AOP perspective and whether any such framework already exists which support InMemory DataCompression in applications ?

Thursday, November 04, 2004

Using EJB as Adapters : Multiple Class versions issue !

Recently came across a problem wherein, one application say (A) needs to communicate with another application say(B). But there are many versions of application B (say B1, B2 and B3). Each version has same package, class and API names for their respective implementations and are deployed in different regions. Where as A is a global application with one version and needs to communicate with respective version of B based on region of a request.

Both A and B are pure J2EE applications having their own set of EJBs in business and servlets/jsps in presentation.

There definitely is an issue that why there are various versions with same name of classes and differing in composition for application B. But that more or less happens in the projects either due to vague requirements or incomplete design or last minute changes.

The problem at hand is to allow application A to seamlessly communicate with B1, B2 and B3.

To enable this communication there is following conventional way used by many projects -

***1***
-Change the package names to include the version numbers of the application. But this seems like a very crude and not so maintainable way of achieving the objective. And is also tedious and error-prone at this stage.

***2***
Another approach is to build an Adapter class which will create class-loaders for different versions of the application B and will allow seamless communication. But creation of class-loader inside EJB Container is generally not recommended.

***3***
So I was wondering, can we not develop this Adapter as a simple SLSB and wrap it up in 3 different ejb jars with respective version's value-object classes from B1, B2 and B3. This way the different class-loaders will be provided by the container inherently and A can communicate seamlessly with all three versions of B with ambiguity of classes getting resolved by container class-loader heirarchy.

Only issue is that the application A will need to deploy these Adapter beans in its environment.

Sunday, October 31, 2004

This is my first Blog. Just created the blog through Googles Blogger site.

:)
Nikhil.