Finally updated the internals of this blog

well, its been a long silence. But better late than never. I have finally updated the base wordpress engine and the plugins to its current available state. I am not saying I will post this update message every time I will update, but this one needs a mention as I have taken log time ignoring this. Partly for ignoring and partly too enthusiastic. But then, i think I am better now to get up and keep going.
I least I am hoping so and wish me luck for the same.

Thank you all for stopping by.

Good to take a break.

Well, its a long time since I have done anything, I used to do for a long long time. I am getting back to the normal flow of life again. This was a break I needed and I am very satisfied with my move.
There was a time, not so long back when I got surrounded by such negative people for a long time, that I had to cut it at any cost. The worst part is, when you are going in a negative stream, you always feel good and think you are with right kind people. But actually its all decisive and the truth is as it is said, “if you are not facing any difficulty in a day, you are not moving forward”. I had to do some drastic changes in order to get back to track.
I am happy that my actions not only get me back on track but revealed some really unknown facts of life which I could not have experienced otherwise, as its said, even the darkest cloud has a silver lining. My suggestion would be try and avoid negativity in any form and be true to yourself. The world and life will unfold some beautiful new things everyday making the journey an exciting one.
On my way back to the track, I was not all confident all the time, but hope was there to get in place. It was not smooth but that is interesting in itself. I got some real nice invitations from different companies and associations to get into a job. I had options in hand and different options gave me different dimensions to the vision. Exciting :) yeah, it is. Finally I have joined a mid sized company with a standard salary, when I had offer in hand, which were almost double in the salary structure and much above on corporate ladder. I never felt so confident to deny big corporate names and bigger positions in them. I am happy and confident and I know what I am doing. So satisfying.
In the mean time, i started visiting places and finally changed my location too. Exciting again . Meeting new people, seeing new culture and most importantly enjoying them all again.
I am so glad to be back again. Love you all, those, who stand by me and encourage me during my these past days.
So finally landed on foot after jumping from the cliff. The free fall was exciting.
Happy living :)

Inspiration from friends

Everytime I visit Bhubaneswar, I get inspiried by my fellow friends here. These guys are really changed the face of architecture in the city and in the state of Orissa. The conventional way, the conventional thinking and the conventional excution are just history now. As of my past visit to the place, and my thoughts regarding that is already in here. I am not repeating them, rather putting something else here.
There are so many new architectural firms and they all are doing good.They are doing so good that, some of these successful enterpreneurs are starting their second venture. Wow! thats so awesome to know. Well, these guys are changing everything. Where convention told us that one should not be a friend to the collegue, these new breed enterpreneurs are growing as a community and thats a very big news.Previously community was a fake thing to showoff each other, now its for the purpose of betterment of each and everyone.
The life style, is simple and on the move always.That does not mean busy for nothing, rather these people are really active in community events and take resposibility on orgsanising community events too. This is very unlike as conventaional thoughts here are very deep rooted and always tells not to waste time in these kind of things rather spend time in your own office. But these people are taking things to the upper level, they know how much commmunity is a necessity for growing our own self. Last time I had a talk with one of my friends, who is in a very high post and is serving to one of the bigger software companies in India and is abroad for a long long time. He asked me, “whether these guys have projects?!” For him, like a lot of other software people (managers, delivery heads, account mangers etc) being busy in office doing nothing is called good work. Now I must say, these people here have got such a lot of work that its even beyound the visible area of most you high ranked fellows in a software company. That does not mean, you leave your life and be in the office 7 days and 24 hours. And thats exactly what guys here are doing. Enjoying their life and doing their job to earn money. This is not same as earn money to live the life rather living life and earning money.
These guys took the chance and made it big, and now on their second venture, they are joining forces to go even bigger. Congratulations guys and best wishes for your new venture.
In the evening, I enjoy their company at the badminton court, despite from different offices, different profiles, these are just friends outside. They help, share and grow. Thats life. They have just rejected to just exist and make the life a beautiful living.
The tough part and most ignored one is the hard work, patience and the risk they had taken ten years back. Yes, as it is said, your success is kind of misunderstood as a overnight success which had taken 10 years of hard work. Exactly the samething is in play here. All the risk, hardwork and new thoughts are now seen as success and only success.
All the best to you all for your work and aspirations. Thank you all for giving me such a motivation to keep on working and keep on growing. And the most important thing is believing in yourself. That one thing has changed everyone including people here. Despite of the conventional forces, the believe, that there is a better way to do things, is a nice thing to learn from these new breed enterpreneures.

I will be collecting some photos of the work and fun here and keep it for a later post. Would love to see your reactions and comments here.

My second iphone game

CatchThemAllV0.1.0

Just finished my second iphone game. While I have not tested it on device yet!!

My first iphone game was taking the accelerometer into game play and this game is all about multi-touch. While it is quite straight forward to play, but it holds the ability of being engaging and addictive.

The game play is to choose the color which is displayed maximum times on screen. There are only 5 colours, but then one has to count the number of times. There is a simple counter runs to show how much time one is spending in a particular question. If the counter reaches 1000, the question changes to the next question and the player looses one point. The interesting part of the same is, each of the colours is assigned a different touch input. That means, if the player has to choose a particular colour, he/she may have to touch with 3 fingers, similarly there are 2 finger touch, 4 finger touch etc are available.
The game play is going to be interesting if you are trying out in device, on the simulator, its a waste and boring thing.
Hope, I will test it soon with a real device and come up with my first experience with it.

Code is hosted at Github and the direct location is here.

Happy Gaming :)

Making random numbers in ObjectiveC, the quick and dirty way.

This is another part of my iphone development experience, where I really feel the pain over and again. So putting up my quick way to do get a random number. There are a lot of methods regarding the random number generation in objectiveC and there are even third party attempts to get the best random number possible.
The three most obvious functions are rand(),random() and arc4random(). While a lot can be heard around of not getting a random number by the first two functions, the last options is better. At least I get decent random numbers with it.
Now to get a random number between 2 points, the code would be

//random number between 0 and 5 not 5, till 4
int i=arc4random()%5;
//random number between 10 and 15 not 15, till 14
int j=10 + arc4random()%5;

Hope that makes my next random number creation search leads me to look at this post.
Happy coding :)

Dealing with Touch Events, the Sparrow way.

This is specifically caught me, when I am coming from other object oriented technology. May be because of those environments are all single touch based. And I never have worked in multi-touch based application.
While working in Sparrow-framework, there is a nice event called “SP_EVENT_TYPE_TOUCH” . This is basically used if we want to use the touch based interaction in our game. Once we add an handler to it, the general expectation is it will just fire up once per touch/tap. But actually it will fire up 2 times as we have 2 different events, “touchesBegan” and “touchesEnded” for each touch interaction in the main cocoa/objectiveC framework. And the good news is Sparrow-framework does a nice job of encapsulating the internals of all those two events and gives us one event to deal with, that is “SP_EVENT_TYPE_TOUCH”.
Well, but the catch is getting confused with the event handler code. Lets dive in here.

[self addEventListener:@selector(onUserTouch:) 
	atObject:self forType:SP_EVENT_TYPE_TOUCH];

Now the handler code will look as below

- (void)onUserTouch:(SPTouchEvent*)event
{
        NSLog(@"onUserTouch");
}

When run, this code will generate log messages two times for a single touch! Thats for the reason we discussed earlier. Well, the fix is on the handler. We have to deal the events inside if-else where we will check, whether its single or multi touch as below.

- (void)onUserTouch:(SPTouchEvent*)event
{
        NSLog(@"onUserTouch");
        NSArray *touches = [[event touchesWithTarget:self 
                       andPhase:SPTouchPhaseBegan] allObjects];
	if (touches.count==1) {
		NSLog(@"1 fingure touch ");
               //Do the custom code here for single touch events
	}else if (touches.count==2) {
		NSLog(@"2 fingure touch ");
	}
}

For only single touch the syntax is even smaller

- (void)onUserTouch:(SPTouchEvent*)event
 {
     SPTouch *touch = [[event touchesWithTarget:self 
                 andPhase:SPTouchPhaseBegan] anyObject];
     if (touch)
     {
         SPPoint *touchPosition = [touch locationInSpace:self];
         NSLog(@"Touched position (%f, %f)", 
              touchPosition.x, touchPosition.y);
     }
 }

The only difference being, while handling single touches we can directly use “anyObject” as the last parameter and that will give us a single event and for multi-touch environments we have to use “allObjects” as the last parameter. But all this will happen inside the event handler, which will by default fire up twice.
One has to get the “touch” or “touches” inside the event handler and then process the code according to it. Directly the handler will fire up twice and that must not confuse as to, whats happening around!

Happy coding :)