Wednesday, May 13, 2009

an introduction to bluetooth API's using JAVA

Just started with some serious work on my FYP and this is a really interesting article on getting started with bluetooth communication in JAVA ME application.

http://developers.sun.com/mobility/apis/articles/bluetooth_gps/part1/

Now, the article talks generally about creating a JAVA ME program without the use of an IDE so it was a bit of a work around to get the thing to work using Netbeans. So here are some additional notes.

1. The mpowerplayer sdk comes with a tutorial folder. I would recommend reading this page /tutorial/index.html

2. You need to make a few changes to the manifest file in order to make the application work. In order to change the manifest file using Netbeans (manually changing it in the project files will not work as soon as you hit build again). Right click on the project and then add the Midlet name in the application descriptor (refer to image). This adds a midlet-1 tag to your manifest file. Just make sure that the name of the midlet corresponds to your specific midlet name.

Another error you might encounter is that a DiscoveryListener was not found. There is a slight mistake in the article, it asks you to put the avetanaBluetooth jar file in the bluetooth folder. Place it in the root folder where all the other jar files are and you should get around this pretty smoothly.

So thats about it. I am a newbie to this technology so hopefully this article helped.

Cheers
Sparsh

Wednesday, January 07, 2009

Phewwww !!!

Helloo !

Finally the phone screen is over. Yayy !

My interview was scheduled at 9am Singapore time and I log into my computer at 8 just to avoid some weird time zone calculation problem (yes others have had this before.) I log on to skype and I see that my interviewer is already online. Resisting the temptation to say hi.. I just go and have a coffee. Luckily the interview doesnt send me any message in this while.

Minutes are passing by and my overly inquisitive nature wants to say hi.. but then i avoid it... Its 9:05.. no response... 9:10... finally my interviewer tells me she is running a bit late and could I wait....Great :) that just increased a little thumping in there....


Finally the interviewer calls.. It was a skype call and I dint want the great NTU internet to screw it.. Thinking I had no choice (I had already told the interviewer I preferred a phone call but she kinda forgot so I dint remind)..


Well she (Ok I wont reveal her name) was quite cheerful on the phone.... Kinda got me a bit setlled. .asked me to tell her what I have been doing these days.. any projects.. favourite programming languages etc... so much for small talk... but it kinda got me flowing..


then came the technical questions.. they were very easy actually. She asked me whether java supported multiple inheritance, and stuff about interfaces.. then moving to operating systems (I dint expect this).. she asked me about deadlocks.. which was easy and then finally a question about recursion...


Moving on she said let me ask you something thats going to be fun. Having read somewhere that Microsoft has stopped asking puzzles for interviews I was a bit taken aback and was expecting something nasty. But then the interviewer was quite nice and threw me a problem involving baloons and a room. I think it was pretty manageable and she liked the fact that I asked her questions clarifying the question itself. That really helped.. Anything you would take as an assumption.. Clarify it. The more you ask the better it is.

The last question for me was to test a communication enabled coffee cup which can be heated using commands given from the computer. There were a lot of clarifying questions to ask on this and yes some suggested improvements which made the interviewer laugh.. Even better.

Finally she asked me whether I had some questions for her. I asked her about her job and the interview process in general and finally some feedback on my interview. Overall she was quite happy and ended on a positive note.


The interview I think went as good as it could have been. Now just hoping for the best. The email should arrive within a week or so.. Till then adieu....


Cheers

Sparsh


(PS : Just saved this as a draft post. Plan to publish this later....)

Tuesday, January 06, 2009

Hours before the Microsoft Phone Screen

Hi

Am like really nervous right now as my phone interview is just hours away . Just sharing some links here which I think are really a good guide to follow :

http://blogs.msdn.com/jobsblog/archive/2004/08/04/ace-that-phone-interview.aspx

http://blogs.msdn.com/descapa/archive/2007/03/24/program-manager-pm-interview-tips.aspx

http://www.tylerbutler.com/dailydose/Pages/MicrosoftProgramManagerInterviewTheBreakdown.aspx

http://blogs.msdn.com/jobsblog/archive/2005/03/01/382953.aspx

http://blogs.msdn.com/jobsblog/archive/2005/03/02/how-i-got-to-microsoft-part-2.aspx

Preparing for Microsoft Phone Screen

Hi

Thought of sharing some preparation material that Ive been using for my Microsoft Internship interview. Some of it is very generic to most technical interviews and hope this helps you out.

I mostly use JAVA for all my assignments but most of the stuff/links I post are generic.


1. Object Oriented Programming Concepts

For all those who have been out of touch with programming, this page is a quick refresher for OO concepts in Java : http://java.sun.com/docs/books/tutorial/java/concepts/index.html


2. Virtual Functions


- Quite an interesting page with a comprehensive coverage of virtual/purely virtual functions in C++, Java and C#.

Important Stuff


  • In Java, all methods are by default "virtual functions".

  • In C#, a base class must provide the virtual modifier for any virtual method, and derived classes must provide the override modifier for any overriden method inherited from a base class.

  • In Java, pure virtual methods are declared using the abstract keyword. Such a method cannot have a body. A class containing abstract methods (either directly, or inherited and not overridden) must itself be declared abstract.

  • Java also uses interfaces. All of the methods declared in an interface are implicitly abstract. Implementing an interface allows a class to become more formal about the behavior it promises to provide. Interfaces form a contract between the class and the outside world, and this contract is enforced at build time by the compiler. If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile.
    (http://java.sun.com/docs/books/tutorial/java/concepts/interface.html)
  • Difference between Abstract Class and Interfaces :
    http://social.msdn.microsoft.com/forums/en-US/csharplanguage/thread/8ad621b8-a915-4d7e-89c3-5dbbc47202fd/

3. Comparisons between JAVA and C++

Tuesday, December 09, 2008

Making an iTunes Store Account without a credit card

Hi

Queueing up outside the Singtel store for almost 4 hours before I could get my hands on an iPhone 3G had me all excited about its awesome features (seeing the hysteria in other people... the excitement just increased... )

Well being a student and without many lines of credit , I had been deprived of the most wonderful thing that the iPhone has to offer - Apps. If you have tried using the iTunes store, even the free applications cannot be downloaded without having an account and an account cannot be made without having a credit card.

But here is a catch for students. If you are members of the Facebook group - Apple Students, Apple periodically releases free iTunes giveaways - Tv shows, audio/video samplers etc. The best part is that these redemption codes allow one to make an iTunes account without a credit card - The payment option (None) comes in only when you are redeeming a gift code.

So here are the steps to get a free iTunes store account and getting all the exciting free apps it has to offer :

1) Make an account on facebook and join the Apple Students Group
http://www.facebook.com/pages/Apple-Students/11147074409?ref=share

2) Click on the promotion going on (Currently there is a free giveaway of a few TV Shows and songs (which can be converted to ringtones :) ) .. Its available only in December. So if you are late... youll have to wait till the next give away.
The direct link is http://apps.facebook.com/freeonitunes/

3) Get the redemption code. Open iTunes -> iTunes Store -> Change the store to the US store. (The redemption codes are generally from the US store. This is great because all the best applications are available on the US store.)

4) Click on redeem option available on the iTunes Store Homepage .

5) Enter the redemption code on the following screen :

5) Follow the instructions that follow to create an iTunes Store Account. Please note that you shall need a US address to complete the form . (It isnt difficult to get an address now is it ;)) Select the payment option to None (Note this None option is not available when you directly try to make an iTunes Store Account.)

You're done.. Start downloading all the cool free apps available. Some of them are really useful.. Another post on them shall follow..

Cheers
Sparsh

PS: This also helps if you have a credit card of say Singapore - but are frustrated that all the good apps dont appear in the Singapore store (or say India store etc.) . The US store is by far the best and has the most free apps.

Thursday, September 25, 2008

Adventure Highlands

Ill try to keep this one short.. But so much adventure needs (and deserves ) a few lines.. So if you are the types who don't like long posts... Adieu my friend..

Well its been a complete roller coaster of a trip (surprisingly.. ive never been on one....) In their mid semester break my friends.. Mandeep, Raj, Rahul, Ishita, Shrey and Neeraj (some of them infamous from a previous ghost search adventure) decide to take a "relaxing" break to Cameroon Highlands in Malaysia. I, who is desperately in need of a break of a hectic Investment Bankers life (LOL), take a leave from office to join them in there search for an adventure packed "interesting" trip.. (not too much time later.. all of us are praying to God to make this trip boring.. )

so after a long journey of almost 8 hours we reach our destination, where a tactful sales woman for a local tour agency lures us into seemingly exciting - agro tour and night jungle trekking (which some of us dont want to.. in consideration of the female folk.. but after considerable deliberations and neeraj's intimidation - we are forced to.)

considering rahul's appetite for photos at almost any place (provided we give him time to pose) we spend a bright sunny morning (which is a welcome relief given the cool breeze) happily clicking photos in the tea plantations, terrace farms, flower nurseries etc...

The real adventure starts with our trip to a nearby waterfall... After spending some time navigating through rocks in the middle of the water..clicking photos and having good fun.. we return to the local village to have dinner when suddenly ishita realises that her wallet is not with her... All this while she thought it was all a prank but with the sudden realisation that it is indeed missing, we all panick and request our driver (who was really nice to have helped us out all the way) to take us back to the waterfall in search of the missing wallet. Whats more disturbing, is the fact that Ishita's student pass and embarkation cards are there in the wallet - meaning she would not be able to enter back to Singapore if it gets lost...

On reaching the waterfall, the driver and some other people from the tour company refuse to accompany us further . Their reason - "This place has spirits.. Even animals dont wander there at night.. You think we would go ?? ".. However, considering our desperate situation, we all decide that its definitely worth the risk. With our flashlights on, we go in as two groups, talking to each other continuously on the phone .. Most of us are really scared, we hold on to each other really tight and look around in the dense bushes - raj and neeraj even go down into the freezing cold water... after about an hour of searching to no avail we decide to go back lest we get into a bigger mess if someone gets hurt...

On reaching a nearby police station, we are greeted by not so friendly police officers who unfortunately do not understand a lot of english. Our driver then assumes the role of our translator and helps us communicate with them. In typical "Indian police" fashion, we are told that the area where the incident happened does not fall under their jurisdiction and that we would have to go to another police station to file a report (Later another officer told us that foreigners in trouble can file a complain anywhere... those officers were just running away from their responsibility.... not very new to an Indian ear... but the Singaporeans with us weren't very pleased :P)

Along all this, I assumed the role of calling up key "contacts" :P to get any help that we could. When people were not picking up.. they were sent SOS messages (an example ... "Dude... Sparsh here .... can you please pick up your phone or call me back.. Its VERY VERY urgent.. ")... Ultimately we decided to contact the Immigration and Checkpoints authority to issue a one time entry visa which would resolve our problems for the time being...

Next morning saw another frantic search at the waterfall .. (thanks again to our very kind driver.. having dropped us back to the hotel at 1130 pm he managed to pick us up again at 7 in the morning...).... So desperate to find the wallet, the likes of me and mandeep started looking at rocks in the water as if they were the wallet and poor raj had to wet his feet in the ice cold water........ But unfortunately we finally gave up and decided to visit the local police yet once again..

If this was not enough, as soon as we got to the main road, a bike lost control and skid into our vehicle exactly at the point where i was sitting.. Being involved in an accident for the first time in my life, I was terrified.. Raj again came to the rescue as he was the one who pulled my head away from the window, else I would not be writing this blog. .. Thank you soooo much.... Fortunately the driver dint get hurt.. By this time all of us were like really disturbed and some started attributing our misfortunes to the ghosts of the waterfall and some to "coming in other people's eyes " (kissi ki nazar lag gayi) .....  

I really dont know why,  but everyone was still in the mood for some more adventure by agreeing to go for a night jungle trek. Having done trekking a few times before, I was totally against the idea, but was vetoed down by the rest.. :(... Our prayers for a boring trip actually came true, as teh trek was really easy and it actually turned out to be pretty boring.. Or maybe it was just the fact that overexcitement in the last 24 hours made everything normal seem so boring..

The next morning, our bus supposed to get us back to Singapore actually left  WITHOUT us.... By now we were so used to all this, we calmly called up the tour operator and they sent a van to pick us up and take us to the bus which was waiting at a nearby town.  Everyone inside the bus was quite irritated as all of us had earned the reputation of being a noisy sing-along group....... The trip back was filled with constant nagging from the driver, who would shout "SIT DOWN" on the PA system as soon as anyone got up... and considering my restless antics... most of the time it was me .. hehe....

This trip has been a real adventure after a really really long time. However, if any of my manorite friend from grade 6 who accompanied me to the school stream back then, could probably relate to something similar.. :) But it was brilliant fun, and in the end as raj asked me.. I would rate the trip a 9/10...

So cheers to all those who survived (both in the trip and this incredibly long post)... :)

Sparsh

Friday, June 13, 2008

In Pictures

In a matter of hours I turn 20... just thought of putting up pictures of some high points of teen life :)
(1998-2004)St. George's College... well I cannot express my love and gratitude to my alma mater in words.. Definitely the most difficult (staying away from home aint easy) yet the most important decision of my life.

October 2004- Winning the Masterson Debate... With Varun holding the team trophy for the third consecutive time..Am sure manorites would realise the sense of achievment...

May 2006 - My sisters wedding - a small gathering .. but it was a grand affair !!! a dream wedding

July 2006- Times Square !! My first trip abroad... Gosh i was so excited :)

August 2006-Trip to the United Nations ... Was an amazing experience..

july-august 2006 : GYLC..12 days.. amazing people.. great new perspectives... a conference I shall never forget...

aug 2006 - Singapore !!! getting(NOT) into IIT couldnt have been better... NTU has definitely been a blessing...

may 2007 - Trip to Leh... definitely a paradise on earth... (above) with mummy at Khardung-La : the highest motorable road in the world...(18,000+ feet)

may 2007- Pangong-Tso .. a 160 km wide lake at the Indo-China border... never seen anything more beautiful..

NTU BPC : Lucky to have been working with an amazing group of people.. thank you for everything... it was an amazing experience.. :)

November 2007- ThinkQuest : thanks to Dr. Amit Das, Pranav, Devayan and Gita.. without whom it would never have been possible.. my other teammates ... Arif , Dhruv and Vimal who despite not being in NTU put in their best efforts.. thanks to Oracle for the most extravagant ceremony ive ever been a part of..

April 2008- A380: wellll.. i was super excited before the trip.. dint turn out to be that great in the end..

april 2008 - haha.. this is my favourite pic.. at Madame Tusaaud's.. :)

To some amazing people I met at HPAIR 2008.. the conference was nothing great.. but amazing people :) cheers..
finally.. my friends at NTU.. who make life so much better :) cheers people ..

well i tried to restrict myself as much as possible.. too many pics to share... i am super excited ... there is no reason why.. but its good to be on a high i guess..

cheers
Sparsh

Wednesday, May 09, 2007

In search of ghosts !

Well the post exam rides have been quite a thriller for me and this incident is specially worth the mention.

One night after the exams, the likes of Mandeep, Raj, Neha, Rahul and Mannan (names changed to protect their identities ;) )decide to go to the deserted Changi Hospital - supposedly a 'haunted house' on an adventure trip to get the thrill and excitement of being near ghosts. As I am the only one left to go home in Hall 10, they were kind enough to ask me to come along and since my new found best friend Mannan was also there, I decided it was worth the time...
Its 2 am and somehow Raj manages to stuff 6 people into his Subaru.... Till now I had only heard tales of his capabilities as a race driver but that night I was lucky to experience the thrill of travelling in a stuffed car at 170-180 kmph on a smooth singaporean road , praying that I would reach home safely ... ;)

After a long drive from the other end of the island we finally reach this spooky place which is also famous for the so called 'he-she's' (quoting Raj) . Weve already been warned not to stare at them cause apparently they are on the lookout for fights and we definitely were not in the position to handle one - Neha and Rahul had to leave for home the following morning....

So we enter this deserted place .... Instructions are thrown around that we arent supposed to touch anything , not the staircase railing, the glass lying around, broken wires...... and all 0ther stuff that one could imagine in a deserted hospital. There are blood stains on the floor , Graffiti is visible across the building with people trying to make the mark that they were amongst the fearless who have happened to visit the place which till now was pretty scary...
Not until long......

Holding each other's hands and expecting a ghost to pop up from anywhere we manage to reach the 5th floor of the building. Manan has been providing us with entertainment all along.. He is drunk (well its not so usual these days ;) and Raj has caught him by the neck to stop him from touching all sorts of things and pulling them down. He had shown us a place where the ceiling had given way and we definitely did not want to start our holiday in such a wreck.......

Call it coincidence or a simple intution , Raj somehow remembers that this place is out of bounds for the public and we were actually trespassing into someone else's property - which actually is a serious offence under Singaporean law (and we all have heard how strict the law can be in Singapore)... So he advises us to look out for police and look for cover if someone sees them coming.... and bingo.. no points for guessing ... moments later Manan points out to a police car .... sirens turned off ...

GOD ....... we are shit scared....... we run trying to make the least noise and go and hide in a room nearby........ There is broken glass all over the floor and imagine sitting down there with our flashlights turned off... the room barely visible in the moonlight...... We are sitting down there for about half an hour or so just to realise that the two other groups that were exploring the place like us have been caught.. Now this smells trouble cause Rahul and Neha have to leave for the airport in like 3 hrs time and here we are kneeling down in a small room in one deserted hospital with no idea what would happen if we also happened to get caught. Weve totally forgotten about all the ghosts and just want to get out of the place. After all who would want to be blacklisted by the police for some harmless fun....

Raj's NS finally comes to our rescue and we who had originally come on the lookout for ghosts are ghost walking down the building in the hope that we would finally make it..... At last we did manage to come out ..... with due thanks to Raj without whom we would never have managed to do it... especially since Neha and Rahul had decided to go to the police and tell them everything so that would have pity on us and let them go catch their flight... In hindsight... that would have been a disaster....

We roamed around the streets of Changi village for some more time ....... remembering our experiences.. running not from ghosts ... but from the police... loll :D Now I know how it feels like to be a fugitive .. atleast in part....

Thanks to Mandeep(for holding my hand so tight that I almost felt it would break.... just kidding ;).... Manan (for all the drunkard entertainment...) Neha and Rahul (for the good time...) and especially Raj without whom this trip would not have been possible.....

It was one wonderful night and I would probably remember it as one of my most memorable experiences in singapore which happens to be quite a dull place as far as adventure is concerned....

Had a pleasant flight back home... was sufferring from an entire lack of sleep for the last three days..... but the sight of the Airbus A380 at the IGI airport really did something to get me all excited... Now am back home... sleeping away to glory.. trying to forget low moments from college ... trying to get over certain issues I cannot blog about.... loving the presence of mum and dad... waiting for my sister to arrive... oh I could give thousands of reasons but I think you might just never return to read another post... ;)

Cheers people

Sparsh

PS : Do you actually believe all that I just made up ??? ;)