Saturday 31 December 2011

Bye bye 2011...it's (finally) time to say good bye to you...! Welcome 2012

If I recap my experiences in 2011, I am sure I have all the ingredients for a platinum-hit Bollywood movie. It has been a roller-coaster of a year (to say the least). Had a breakup (right at the 1st week of January 2011), somehow got over it, met another girl...was very happy with her...but then lied about things to her and our relationship got worse, then finally when I was sincerely making efforts to improve myself and when I thought that we both were making progress to get together, then I found that she was cheating on me... (sounds funny now, but it has been insanely frustrating and dramatic...!). Till 23rd November (my last post), I was very happy since I felt that 2011 would at least end on a good note...but then, I am not one deciding my fate (as Shakespeare would say: "I hold the world but as the world, Gratiano, A stage, where every man must play a part; And mine a sad one.")...and indeed mine was a sad one (at least in 2011). This year had a lot for me to learn...mostly the hard way...but then what we learn the hard way, possibly (and hopefully) stays longer with us. I am sure what I have learned this year, will stay with me for the rest of my life.


But being truly human, I believe that none of us is perfect and we all make mistakes. But, at the same time, being an eternal optimist, I believe in myself that I can get over my mistakes and make sure not to repeat those. Coming year, I have loads of plans, just to keep me busy and make sure that I feel better about myself. I want to travel to places, where I have never been or probably will never go either (once back in India), get going with my hobbies and interests and just keep myself busy. So I have to enjoy the coming year, be happy and keep learning (even if it is the hard way).

Yesterday, I was thinking of my motto for 2012 and I can put it up as below:

"Welcome 2012...it can only get better from here on...! Let go what was never mine and mend my present to make sure my future is happier. Live every moment this year as if there is no tomorrow...who knows maybe Nostradamus and Mayans might be right about 2012...!!!"

Stay happy and stay blessed...and welcome 2012 with both hands. Wishing a very happy New Year to all.............................

Wednesday 23 November 2011

Oslo - Trondheim - Oslo...Life takes another circle...

Yesterday I watched the movie: My Big Fat Greek Wedding (yeah once again, just about reaching a zillion views by now...) But even now, this one sentence in the movie struck me more than ever before:

"Don't let your past dictate who you are, but let it be part of who you will be..."

Well, our very famous Sherlock Holmes would have said: "That's elementary, my Dear Watson." but then it's normally those elementary things we end up neglecting/messing with. So Mr. Holmes, you should not be mocking Dear Watson... :)

Over the past some time, I have been trying to be someone....someone who I am (probably) not. In the hindsight, I feel that I have done things that I should not have done...! But then, a lot of what I did were based on my past...hence the opening line that somehow struck me.

My year started with a lot of turmoil...things happened in a jiffy. It seemed that everything that could go wrong (or even the ones which I would have never expected to go wrong), went wrong, all at the same time. Nothing seemed to be working then. All that I could think of was: "Why is all this happening to me?" OR "What have I done to deserve this?". It was just about the approach which seemed to be all negative then. It was as if I was standing in front of a mountain and I was just about cursing myself "How the heck did I reach here?" OR "What wrong path I took that I ended up here?" rather than trying to find ways to cross the mountain (somehow)...! I was living in a sea of problems rather than finding/building a boat to get through...!
In the later part of the year, I was at the cross roads...! I had to make some very important decisions....! It had reached a point of frustration (to some extent). Sounds funny now, but I was at a point where I was searching on the internet anything that could possibly motivate me...any inspirational quotes, any special stories...and it was then when I came across this:

"Fears over tomorrow and regrets over yesterday are twin thieves that rob us of the moment"

This was probably my Eureka moment...this was exactly what I was doing...I was worried what would happen when I would be in India (my most probable future at that time) - worried about people, especially so-called 'close relatives', worried about the time that I will have to spend to fetch a good job. To add on to it, I was regretting about what I had been through just a couple of months back (my near past...).

Somehow, this one sentence changed my line of thinking...made me more focused about what I had right at this moment rather than thinking too much about my past and my future. Of course, this is not something I was able to achieve (or rather am still striving to achieve) in a moment of truth, or a day, or a month...but certainly it gave me a much clearer thought process. I was stuck in the deadly loop of past and present (both of which are not in my control) and hence was neglecting my present. It is not as if it changed the situation I was going through then, it just changed my perception towards it.

After a hard year, I can certainly say that my last month has been somewhat more stable...probably GOD planned to end my year on a good note OR probably he just wanted me to realize that we need to work hard to achieve if we want something from our life. Perhaps, it was HIS way of reminding me...just waking me up of the dream run I have been through the year before (2010). I am sure this is not the last time I am going though a rough phase in my life, certainly not (and I hope not)...as true character of a person is tested, not in good times, but in difficult ones.

Seems like it was just now that I came to Trondheim...a place where I knew no one from before...just carried with me a hope and a will (and my couple of bags :) ). Now after two eventful years in Trondheim, after meeting loads of people, and making some friends (a few of whom will stay with me for a long time to come), I am again back to the place from where I started my Norwegian voyage...back to those whose first years in Norway coincided with mine. So my life has taken another circle...back to where it all started...hopefully for the good...but just remember to live in the present...!!!


An optimist...

Sunday 9 October 2011

Facebook...or...Fakebook...or...a land of Virtual Reality...???

On the name of 'development', the list of necessary evils goes on increasing...! A major inclusion in this list has been Facebook.

As per Wiki, Facebook is: 
        "a social networking service and Web site launched in February 2004, operated and privately owned by Facebook, Inc. As of July 2011, Facebook has more than 800 million active users. Users may create a personal profile, add other users as friends, and exchange messages, including automatic notifications when they update their profile."

True, that it has been a revolution in itself. Emerging from possibly one of the most important/basic concepts of human existence - the concept of society and that humans are social beings, it provides one of the strongest and widest base to connect to those whom you know/don't know, friends/enemies (well you can..or at least stalk them), inland/out-land, home/away, acquaintances/complete strangers. It makes distances disappear. You can get in touch with those whom you have not met for a decade. Find friends, check updates, arrange events, 'poke' people (though I am yet to decipher the real use of it...!), create fan pages (useless for me...!), create posts, comment on posts, like posts and what not! True, Facebook has been a meteoric success!
So, when it comes to Facebook 'To be or not to be' is indeed not the question anymore...it's just about how long when you are in finally in there..............

But then what's the catch here? Is it all so goody? Personally, I don't think so...perhaps I am still to find an ideal world...or maybe I am just overly pessimistic. Have we lost something during the process of being represented only by our Facebook profile? Have we lost the emotional aspects of a human interaction to a 'poke' or a 'pinch' - I don't care!

When I started my engineering studies in 2001 (yeah has been 10years now...phew !), we used to remember the birthdays of our friends (remember no Facebook then to give an alarm that its my friends birthday today!)...used to make greetings cards for them, either by hand or just fetch one from Archies Gallery or Hallmark...! Every card I used to receive made me feel good, made me feel that I know one more person who took enough trouble to remember this date and made some effort to make this day more special to me...in his/her own way. Then the closest of those friends probably arranged a birthday cake for me...and I had to pretend to be surprised... :) but it was fun and joy - all in one ! Last month, I celebrated by 28th birthday. I got loads and loads of wishes (way way way more than I used to get 10 years ago), though, yeah you guessed it right, on Facebook...coupled with a few phone calls from family and close relatives. A few of my 'Facebook friends', in order to make their wish 'stand-out' threw a 'Virtual Cake' on me...! Infact, the height of everything was the conditional wish from my girlfriend who actually wished me birthday only after I surrendered to her condition to upload a picture of ours on Facebook, a picture which was already on my profile, but then she wanted me to upload the same picture once again and so it had to be so...!!!

Among all of the wishes that I received, one of them stands out to me...the one I received from a college friend of mine. She actually sent me an e-card...! Sounds old fashioned...but that possibly was one of the best wishes I received this year! It made me feel that there is still some hope left, some people still care, some people still think that there exists a life outside that woven by Facebook...some people still remember your birthday not just because there was a birthday alarm on Facebook...but because they genuinely remember!

From 2001 till 2011, there have been lots of changes...our lives have become faster, we are running against time...always playing a catch-up game...we don't have time to stop and say 'Hi! How are you today? How is the weather in your city? How is your family? Have a very nice day ahead and send my regards to your family'. We don't find time to stop by our neighbour's house to have a cup of tea and discuss about 'other stuff'. We are now more like machines, working hard to make our ends meet or just working hard as we have nothing better to do...but...that one e-card made me realize how much difference personal touch can make...and sometimes, doing a lot does not count, but just making someone smile does...!

Well, I started from Facebook, but wavered somewhere in between onto our lives and how those small things can make your life appear more than worth just 'ahh...Friday is still way far off'...! So just do something, not necessarily of magnanimous proportions, but something that makes someone smile: crack a joke, give a rose to a friend, give a dime to a needy, help someone cross the road, listen to your friend...or just send a card to someone you care about.........................

Saturday 20 August 2011

It all comes back...in this life...!!!

"The worst lies are the lies we tell ourselves. We live in denial of what we do, even what we think. We do this because we're afraid. We fear we will not find love, and when we find it we fear we will lose it. We fear that if we do not have love we will be unhappy" - Richard Bach


I have just been through the worst time of my life. I found love and lost it...! All I said to the girl who loved me all the time, was a bunch of lies...all the way long. But in the process, I became so engrossed in all this, that I forgot that it all comes back...in this very life...!!! So it was just a matter of time when this house of cards was to fall...and so it happened today...!!! I am sad...yes...but happy, at the same time because I feel that what should have happened much earlier, finally happened...!


I know that in all those lies, there was ONE truth which was and will always be a TRUTH...! I really loved her (and still do) and always wanted (and still do) to be with her...!!! But then, when she asked me, "Is this what you do to people whom you love?" then I had no answer...I was as dumb as a rock...! I am guilty of committing this sin, not once, not twice, not thrice, but again and again and again...and I am already being punished as the girl, who unselfishly loved me, wanted to be with me, was ready to change herself just for me...and wanted just one thing from me - she wanted to be happy with me and I could not give her even that much...all I gave her was pain and sadness. I have learnt my lesson...unluckily too late though...!


Through this post, I just want to tell everyone just one thing - If you love someone, then take care of them and they can make your life heaven with love and happiness...! And never lie to someone you love, as love and lie don't really live together...! I learned it the hard way...I hope you all can learn it just in time and make your special ones believe that they hold a special place in your heart...!

Saturday 7 May 2011

Day 1: Travel Trondheim - Oslo (Rygge) - Krakow and Polish Pierogi

Flight from Trondheim - Oslo (Rygge) on 20.04.2011 by Norwegian Airlines (15:30 - 16:35)
Flight from Oslo (Rygge) - Krakow on 20.04.2011 by Ryanair (17:45 - 20:50)

One thing on the wrong side for me was that I did not make flight reservations well in advance...! On the other hand, I wanted to keep my expenditure to a bare minimum...hence I had to settle with the 'poor man's option' - Ryanair...! They do not provide the most comfortable journey you can experience, but then there had to be a compromise...and I went in to compromise some comfort...anyways it was only a 2hr long journey :))

I booked a hostel in Krakow barely two days in advance...it is advisable though to book well in advance, but then there are numerous accomodation options in Krakow...so I could probably afford to be a bit lazy... ;) though it was Easter time. Reason for booking a hostel was 2-fold. Firstly, hostel was very cheap...it cost me just about 55EUR for a 4-night long stay in Europe. But I have checked, if someone wants little more comfort, it is pretty cheap to book a room in hotel as well. Krakow, in general, is extremely cheap place to travel, especially since I am presently living in Scandinavia, all other places appear very cheap to travel across :) I stayed in a hostel AES Mosquito Hostel...my recommendation for this hostel is very positive. The staff is very supportive. They have some or the other special event, every evening...a very nice way to interact with more people, which brings me to the second reason for staying in a hostel...meet more people, from different countries, cultures and understand them (or at least try to do so...!). I met people from USA, UK, France, Spain, Turkey, South Africa, Italy, Polish, Sweden, Norway to name a few...! So my stay was very interesting overall...! In addition, this hostel is just 5minutes walk from the old city center and some other major attractions in Krakow.

Now done with the bookings, I will now start with the actual travel. My first flight was with Norwegian Airline. The tricky thing here was that my flight was from Oslo (Rygge) and not from the main international airport at Oslo. But I was kind of lucky here to find this flight with Norwegian Airlines direct to Oslo, Rygge and also that the arrival timing was well suited to the timing of my next flight. So it somehow, worked out...! The flight was pretty comfortable, no hiccups as such...!

Then it was turn of Ryanair. Well, my intention initially was to book flights via Norwegian Airlines, even for Oslo - Krakow journey, but, when I compared the prices with Ryanair, it did not take much effort to change my decision :) Anyways, also that flight timings for the Ryanair flight was apt for me...! So I went ahead with it.

Somtimes, it is just quite interesting to travel with Ryanair. Since they do not allot seats as such, so announcements like "The flight is fully booked. Please occupy the first seat you come across to avoid any commotion...!" are common. Another good one: "We do not allow smoking on our flights. But for our esteemed passengers, we bring about non-smoking cigarettes...! Each pack costs 6EUR only and contains 10 no-smoke cigarettes!"...very "passenger friendly" :)

Anyways, the flight departed about half hour late. So I was initially thinking that I might end up reaching half hour late to Krakow...but I was only about 10 mins which was a good feeling. I had already arranged for airport pickup which was fairly cheap - only 70PLN, though if someone does not want to pay that much, then there are frequent public buses available till old city center and they cost only 2-3PLN. So a very good alternative. It takes about 20mins to reach the city center...so not that
far off as well. I reached my hostel by about 21:30. The check-in was very smooth and the support staff was very friendly. They provided me with some very essential information, along with the city maps when I checked in. After that I just went out to have a quick look to the city center...and ofcourse, have some dinner...I was crazy hungry !

So I started walking and decided to try some Polish traditional food - Polish Pierogi (dumplings). The place where I tried it was U Vincenta Pierogi Restaurant at the Jewish District, Kazimierz. Since, I was very tired with all the travel, so I kept the sneak-peak of the city to a bare minimum that day and just passed by the Old City Center, Wavers Castle and the Jewish District, Kazimierz.

The next day and onwards, there was a lot planned to be done there.

Thursday 21 April 2011

Travel Diary to Krakow, Poland

Keeping up with my new year resolution to take up travels across Europe, I have kind of held on with it by starting my trip to Krakow (which follows my trip to Stockholm last weekend :) ). This trip will last for 5 days: From today i.e. Wednesday (20.04.2011) till Sunday (24.04.2011). I will keep on writing a day-to-day diary, each day as a new post, for all I experienced that day. I am really looking forward to this trip as Krakow hold so much history in itself.
Hoping to learn a lot and meet loads of new people.
And now another new journey begins.....

UPDATE: Sorry for the delay in updating my Krakow travel experiences as I have been very busy in the past few days. I will try to update it in the coming couple of days....happy traveling.....

Thursday 17 March 2011

All my Internet Friends - Amanda French

Really nice song I came across recently:
The lyrics are as follows:
(Let the geeks and nerds inside you have a bright smile...)


********************

Monday afternoon I gave a presentation to the staff
Kicked off with a knock-knock joke to liven up the charts and graphs
That crowd
Never laughs out loud
But all my internet friends were tickled pink
They put animated smileys when they passed around the link
They said, Hey, girl, here’s another awesome thing we found
Sarah Palin getting smacked down
With a Prince song in the background
Better watch it quick before they take it down
Wednesday night I figured I’d go out and buy a DVD
Walked into a store and walked right out again immediately
This sucks
They want thirty bucks
But all my internet friends give things away
They just really like to make stuff even when it doesn’t pay
They say, Hey, girl, here’s a picture, here’s a poem too
Here’s a blog post, here’s a podcast
Here’s a song and here’s a lolcat
And an iPhone application all for you
Saturday I had a date with Dave the software engineer
Told him bout the time I got my headphones wrapped around my ear
I swear
He just didn’t care
But all my internet friends they listen well
They make sympathetic comments when I say that I’m in hell
They say, Hey, girl, what’s your status? I say, Omigod,
I’m not sleeping, I’m not eating
I can’t take another meeting
With the clean, well-meaning morons at my job
There are those who say I spend a little too much time online
Sometimes I agree, but on the whole I think I’m doing fine
Click, buzz
I feel strong because
All my internet friends are here with me
Saying Love and information want only to be free
And we’ll take no crap from anyone who says that they know better
We won’t stand for that because we all came here together
We’re remaining interwoven
We’re a net, and we have chosen
To be knotted tightly to each other
You be client, I’ll be server
We won’t ever have to be alone

********************






Enjoy all out there... :)

Thought for the day...

"Every experience has one thing in common - an attached lesson...! It's upto us to be smart enough to learn in the  first take or be stupid enough to wait for a retake...."

Saturday 12 March 2011

Another firsts in my list...my first Salsa experience :)

........today I thought to try something new. And believe me, it was not the easiest thing to do...well partly because of what I chose (I think) to try. I tried to go for SALSA...!
        Before I go any further, I should probably tell more about my dancing experiences till date...let me think, maybe a little harder, OK a little more, maybe, possibly I will remember something...! Nah...I don't think I will remember anything apart from those dance/jumps at some party/get-togethers/weddings - 'Baraat' processions...! So now you know, that I am not even at the level to be termed as a novice when it comes to dancing.
         Well, my colleague asked me if I would like to try salsa once and give it a shot...? I don't know if it was the sushi I was having then or what, that I ended up saying 'Yeah sure, why not...! Trying once won't hurt!" And that was it...I kind of realized it as soon as I finished my sentence...I felt that it ain't gonna be as smooth as it was sayin' it !
          So my colleague sent me the mail like 4-5days back, where I had to register for the session today. But since I had kind of realized my mistake right after I agreed to it, I preferred to delay the registration process :) My plan was pretty good though - Postpone the registration process till the last minute and then send a SMS
with an excuse that there were no more places left...!
          So then came today, the D-Day. I was all ready and everything was going 'as planned'. So 11:00 was the starting time for the SALSA session. So, as per plan, I sent a SMS saying that I could not register because of XYZ reason. I was pretty relaxed after that (rather with a sense of achievement that my plan worked out as expected). But then, something, that I had not thought of happened. Well my colleague messaged me "Just come, it will be fine. You can have the registration here...!" Hmm, was really not expecting that but then I was stupid that I did not have a backup plan...! Well well well...now I did not have any more excuses with me...so I thought whatever be it, I will now just give it a go...what worse can happen !
        I went there and saw over 20 people there, mostly couples (well it was supposed to be SALSA :) ). I don't think it did much to calm my nerves. But then having my colleague as the instructor helped a little for sure. Also it was somewhat soothing to find there I was not the only one out there with 'two left feet'... ;)
        So I started with the basic steps and after a few initial hiccups, I started getting some (if not all) of the steps...which made me feel nice actually :) And soon I kind of started enjoying (don't know if my partners felt the same or not though :) ). More than anything else, it was really relaxing and trying something new, actually after a pretty long time, was definitely a good feeling. Overall, I had a very nice time and another new experience added to my list of experiences in Norway - one which is surely worth remembering :)
       Apart from everything else, I think this experience certainly taught/reminded me one thing - Do not hesitate from trying something new (I think I had forgotten this for quite sometime) just for the fear of failure. The experience might be great, good or not-so-good, but then, at least you gave it a shot ! So that's how it will be from now...and my old list of 'To-Do's' that somewhere got lost in the heap of 'Doing now' ... but I have just brushed it off and cleared the dust from it today. I will make sure that it does not just stay there anymore...I will keep my pen in my hand - ready to check item in the list, in due time...............


PS: I will check out if my colleague did click any picture when we were in the session, I will upload it here :)

Cheers,
Keep trying and discovering...

Saturday 5 March 2011

Trip to Oppdal...through pictures

This are some memories from my recent trip to Oppdal with my colleagues. It was an amazing trip, filled with many 'firsts' (and probably that was the most fun part of it).


Thursday 3 March 2011

Wii - Moving from making a 'Family Console' to 'Making a Family' Console

In a recent turn of events, Wii, from out of nowhere has come up with their very first seducive Wii Game - Wii Dare!!! Though, I must say, more interest in this game has been developed by promo of this game rather than the game itself. Well, well, well I don't know what Wii wants from this game, but certainly they have stuck to being a 'Family Console' - though just by a thread now :))


Sunday 20 February 2011

Nokia - It's not just about 'connecting people' anymore...

I still remember my Nokia 2100, that was my primary means of 'connecting' with my friends and family during my engineering studies. It was perfectly suitable for crystal clear calling, messaging, was very sturdy (I don't even remember how many times it has fallen, taped as well, but still it worked just fine...with days worth of battery life...!) and above all, very cheap ! At that time, Nokia was a synonym for mobile.
But from then to now, what changed (or probably did not change) this company to an extent that from a point where they had almost monopoly on this so very booming market, fell to a level that they had to take such drastic measures so as to abandon their 'in-house creation' - the Symbian ! The case of Nokia reminds me of another giants in their industry who have been through the same stage - Ford (a popular quote "Any customer can have a car painted any colour that he wants so long as it is black.").
But why did this happen, was it inability to look beyond the obvious, was it the company structure which was hierarchical to the extent that decision making was next to impossible, or was it the thinking - "Why to change a successful recipe?". Possibly, it was a combination of all of them. As per some sources, Nokia had a prototype of possibly the 'first ever' smartphones designed as early as 2005...but then they rejected any further development on the same then restating their theory that there is not much market for such mobiles...! But then came iPhone and people were drawn to it their new 'touch-technology' which drew considerable interests and even more profits. Even then, Nokia did not realize the shift, or even if they did, they did not perceive it to be 'Big enough to hurt their eco-system'...! But with the introduction of iPhone 3G and 3GS, and other companies also introducing their first prototypes of smartphones in the market, Nokia found that they have postponed the decision way too long not to be in a spot of bother.
At this time, they still were very sure that Symbian is the way to go for Nokia...few reasons I can think of behind this...Firstly, of the past success and the fear of abandoning what has been great (to say the least) and Secondly, the pro-Symbian voices in the company were pretty strong...enough to make sure that they were being heard and Thirdly, the company structure that was not meant to be flexible and agile. But anyway, though late, they did climb on the smartphone market (with the Symbian, ofcourse).
The dynamics of mobile industry had now changed drastically...Nokia were like dinosaurs in an age where beind as nimble and swift as birds was the order of the day ! They had reached a point where though they were still leading the volumes, but the profits were consistently falling. Now they did feel that they needed to take some immediate measures to compensate for this situational disadvantage. And then came Maemo and Meego (in partnership with Intel).
That was certainly a step in the right direction, just the strategy behind promoting this was not well laid out. Nokia wanted Meego to be as a side project (Symbian still being their flagship OS). If we look into the first Maemo device, Nokia N900, it certainly was very impressive...! A positive user experience, refreshingly positive and way more CPU boost than most of the other existing smartphones in the market then. But then, did we hear any followup devices with an improved version of Maemo? Nope, that did not happen...instead what we heard were new smartphones (especially N8) with Symbian - once again! By this time, iPhone had set the standards and moulded the definition of a smartphone such as to suit its needs. To add on to it, the Google Android had improved impressively and pretty quickly with more and more handset manufacturers now joining hands with Android as a preferred software to align with their hardware - but not Nokia.
Now Nokia are in a state where they know that they had to make some revolutionary changes, but what??? They have not been used to being in this situation, neither are they used to change. So they decide to 'finally' part ways with Symbian and partner with Microsoft. Nokia, no doubt, still produce some of the best hardware, but, it is still to be seen how this partnership can succeed. We can now discuss (for and against) about the decision they took as to why they did not go for Android, which has recently outnumbered iPhone on the basis of sales (by volume). But personally, I think they made the best possible decision, given the circumstances to partner with a company with which they share some synergy, be it on the level of organizational composition and corporate decision making or maybe on the company objectives. But considering how dynamic the smartphone market is now, where Moore's Law of technological advancement is basically modified to the core... (not long ago the 1Ghz Hummingbird snapdragon processor and Nvidia Tegra 1Ghz processor were introduced, and now we have new smartphones introduced @MWC 2011 which are running on a dual-core 1Ghz Nvidia Tegra processor. And if this was not enough, Nvidia have announced that they will soon introduced a quad-core mobile processor - codenamed, 'Kal-El', very soon - and all these advancements are just about the processors!), it is still to be seen how will this partnership prosper, but this certainly marks a sad end to a very enterprising life of the very reliable - Symbian !
On a positive note, I still foresee a future for their partnership with Intel on their fledgeling OS, the Meego. At the recently concluded MWC 2011 (at Barcelona), they have unveiled a new tablet running Meego and another netbook which runs an impressively interfaced version of Meego. But if it has what it takes to reach the heights once Symbian conquered, is still to be seen...but I am hopeful...

Sunday 13 February 2011

New language features with JDK7 (Project Coin)

With JDK 7 already passed its Feature Complete stage (M11) and currently in its Developer's Review stage (M12), it will be interesting to list the feature modifications that have been made in this release.

In this blog, I will primarily focus on the language enhancements that have been a part of this JDK release (Project Coin - covered in M11). Some of these I was really looking forward to... :)

1) Strings in Switch: With this release, the Switch statement can be based on String expressions as well. e.g. let us consider the following code:

String s = ...... ;
switch(s) {
case "abc":
processABC():
break;
case "def":
case "ghi"
processDEForGHI();
break;
case "xyz":
processXYZ();
break;
default:
processDEFAULT();
break;

2) Automatic Resource Management: This is a form of 'try-catch' that declares one or more resources (a resource is an object that must be closed manually e.g. OutputStream, InputStream). The scope of these resources is limited to the statement. When the statement completes, normally or abruptly, all of its resources are closed automatically.

Presently, this is how a resource is handled:

static String readLineFromFile(String path) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path));

try {
return br.readLine();
} finally {
br.close();
}
}

In the case, when both readLine and close invocations throw exception, the latter exception takes priority over the former. As of now, the only way around is to ignore any exception thrown by the close invocation. This can prove to be an issue, more so in case of a writer or OutputStream operation.
With automatic resource management in place, the above sample code will look something like:

static String readLineFromFile(String path) throws IOException {
try (BufferedReader br = new BufferedReader(new FileReader(path))){
return br.readLine();
}
}

3) Improved Type Inference for Generic Instance Creation (diamond): This feature tries to simplify the parametrized assignment. Consider the following example:

Map<String, List<String>> fooMap = new HashMap<String, List<String>>();

This is rather lengthy and can now rather be replaced with:
Map<String, List<String>> fooMap = new HashMap();

Advantage is the simplicity it provides to assignments, hence cleaner code. Conversely, it can be argued that though a code like Map = new HashMap(); looks cleaner, but then for backward compatibility, new HashMap(); denotes a raw type. Hence a sense of conformity is missing as of now. But this is just a minor drawback, I would say. For this reason, a provision has been made to add empty <>, like: Map<String, List<String>> fooMap = new HashMap<>();

4) Simplified Varagrs Method Invocation: As of now, when a user tries to invoke a 'varargs', the compiler generates an "unsafe operation" warning. Now, this warning has been moved from the call site to the method declaration. This significantly reduces the number of warnings reported and suppressed by the programmer.

e.g. Before, a varargs declaration would have been something like:

static <T> List<T> asList(T... elements) { ... }

static List<Callable<String>> stringFactories() {
Callable<String> a, b, c;
...
*// Warning: **"uses unchecked or unsafe operations"*
return asList(a, b, c);
}

Now it will be like:

*// Warning: **"enables unsafe generic array creation"*
static <T> List<T> asList(T... elements) { ... }

static List<Callable<String>> stringFactories() {
Callable<String> a, b, c;
...
return asList(a, b, c);
}


5) JVM level source-code syntax (JSR 292): These primarily include the following:

a) Dynamic Invocation: The interface java.dyn.Dynamic may be used with the static call syntax to form an invoke dynamic call site. The arguments may be of any number and any type. Hence, theoretically java.dyn.Dynamic appears to have infinite number of methods, of every possible name and signature.
e.g.
Object obj = Dynamic.getDynamicLink();

An invoke dynamic call is linked to a target method under control of an application-defined bootstrap method and the linkage state is defined by a method handle (explained below) with the same type descriptor as the call itself.


b) Method Handle Invocation: Method handles (java.dyn.MethodHandle) provides the linkage state behind any invoke dynamic instruction. Like Dynamic calls, a method handle also accepts any number of type and signature, which means that it can also have infinite number of calls to method "invoke".
e.g.
MethodHandle mh = ...
mh.invoke();

c) Exotic Identifiers: The identifiers can now be any sequence of characters (with minor restrictions). Certainly this will enable in more user-friendly naming and hence cleaner and more maintainable code.
e.g.
int #"valid variable name" = 100;
System.out.println(#"valid variable name"); //this will print 100

d) Conversion rule for Interface Dynamic: Type Dynamic also serves a purpose of a wildcard type. As a mere reference, it can be freely converted to any other type and to object and as a cast, it can be converted to any type. Along with invoke dynamic syntax, it allows dynamic method calls chaining.
e.g.
Dynamic dynObj = (any type of expression);
Object obj = x.foo("ABC").bar(100).baz();

The JSR292 changes basically allow Java to interoperate with new JVM languages. It also enables Java to serve well as a language implementation or systems programming language.

These are the language changes that I have come across with JDK 7. More information can be found at http://blogs.sun.com/darcy/entry/project_coin_final_five
I am certainly now looking forward for JDK7 to be officially released (should be sometime in the second half of 2011). Enjoy coding... :)

Saturday 29 January 2011

To hibernate or not...???

Do humans hibernate? Well, technically 'NO' (though my absence from the blog world - incidentally, right after my very first blog, comes a close second :) ) - My dormancy from the Blog world was so long that even Google AdSense lost any sense and hope of posting ads on my blog :D

As per Wiki, the definition of Hibernation is: "Hibernation is a state of inactivity and metabolic depression in animals, characterized by lower body temperature, slower breathing, and lower metabolic rate. Hibernating animals conserve food, especially during winter when food supplies are limited, tapping energy reserves, body fat, at a slow rate. It is the animal's slowed metabolic rate which leads to a reduction in body temperature and not the other way around.It usually does that in the season of winter during which the climate is harsh."

Well...today sitting in my living room and watching snowfall from the window, I was wondering that why not have we been designed to do so? The world could have been so different then. For example, here in Norway, people would have gone into hibernation from December to March. All offices, all multiplexes, shopping malls, parks, convenience stores and everything else, throughout the country, would have been closed. Life would have just come to a complete stand still - out of office reply would have read something like "I will be out of office from December 1 to March 31 (hibernating). For any immediate issues, please contact the Australia office" - hopefully the salaries would not have stopped flowing - monthly ;)

There would have been lots of fun things pre-hibernation as well...like getting into a 'hibernation shape'. Before going on hibernation, people would have started eating like crazy...lots of burgers, mayonnaise and all the fats one can just dream of...to make sure that your long sleep is not disturbed because you are feeling hungry ;) And to top it off, not exercise !!! Wow...up for this one definitely...!!!
Considering you will be in sleep for like 4months, it would be advisable to prepare a comfortable bed for yourself. A big double bed with a very comfortable mattress and a cozy blanket would have been just perfect !
A Tip: I would have made sure to put on earplugs and switch off my mobile phone...I would not want to be disturbed by some noises made my neighbour's dog or any other non-hibernating living being !

And...not to mention the positive effect this would have been on the environment - "imagining to make a greener world" ;). In addition, it would saved a bunch not to be spending for almost 4months, every year !!!


Well well well, the snowfall has stopped now...and so its time for me to be out of 'my hibernation' and prepare for my 'brunch' :)