Monday, June 21, 2010

Measuring the human stress level index

While I was calling up various dealers from Vibration Lab phone amidst the hectic schedule, I came across this magazine on the table called "World 2047". While I was wondering myself how complex and stressful our lives have become, it had an interesting article on measuring human stress in an indexed form and inferring the result. The death of your spouse is considered the most stressful with 100 points while minor traffic rule violation is mere 11.

The article starts with a saying by George Bernard Shaw, "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself" which I find is very true in present world scenario. There is no limit to tension and chaos around us. It is we who have to decide where to draw the line of being insensitive to situations around us. If we go on taking everything on our shoulder we are bound to crumple down. The article claims that homosapiens have never been subjected to as much stress as now. Petty quarrels over a pinch of space and public aggressions should be avoided as much as possible. For, there are indispensable stresses like the natural calamities, taking care of your loved ones, workplace stress, we should liberate our mind for these more critical activities of life.

I thought its a worth circulating article so took a picture of it and uploaded it here. So, why wait.. find your stress index and chances of getting affected.


Saturday, June 19, 2010

The cursed iphone[S] 3g[S]


Its summers again... yeah the beautiful summer which remind me of the summer of 2008, the most memorable period of my life when I was on internship in Sweden. I had just begun my journey with Apple with my white Macbook. It worked great. I don't know what was the impetus behind it, but something prompted me to try an iphone too. I started bidding on it on the US ebay and after 6 months of struggle I had it in my hand, the most amazing piece of creation in the world, the Iphone 2g. It has been my most wonderful companion for last one and a half years. While there has been some problem with its headphone jack recently, I had started using Shubham's iphone 3g whose touchscreen broke apart one day. Then one day Shubham's new iphone 3GS's screen also turned red and our group was bereft of any perfect iphone.


We ordered the components for repairing the headphone jack and Shubham's screen from ifixit.com. In the meantime I started looking for used 3GS on ebay and found some very nice deals in the range 300 to 400$. Though, I was unable to make payment due to paypal account not being verified. I asked Ankur Sharma to pay for one of them. After a lot of convincing, he did make the payment but the next day itself the seller rejected the payment saying that there was some breach of ebay policies. I was desperate to get the phone so I added Papa's credit card on the Paypal and got it verified and finally ordered a white Iphone 3GS. It reached Surbhi Goel's place in New Jersey in 4 days and she confirmed that it was almost like a new phone. We were happy. After arriving in Delhi, she was supposed to take a train from Delhi to Calcutta on the 13th evening. The train was supposed to pass Kanpur at 1 in the night. While we were preparing to go there, with the stuffed parathas as demanded by her, I called her for confirmation and it turned out that her flight was late and so she had missed the train. Now she was taking a flight for Calcutta in the morning at 10 am. Who would pick the phone from her in such a short time was the question. Shubham called his Dad and found out that he was arriving at Delhi airport at 9 am. He asked his driver who was coming to pick him to reach at 8 am and get the phone from her. It was definitely a big LUCK. Now how would it travel from Lucknow to Kanpur ??? Should we catch his Dad at the Lucknow airport itself or wait for some other opportunity? Next day I found out from Yadav travels about a taxi which would be coming from Lucknow and asked the driver, Anil to do this favor. When he was about to head towards Shubham's house, I asked Shubham to confirm from his parents about the same. And apparently there was no one at home. It was pretty disappointing. The driver came back without the phone.

Two days later, Vyas Sir was going to Delhi to give a presentation on broken rail detection. He was to leave for Lucknow at 7 am. Shubham and myself went to his place in the morning and talked to the driver once again. Limits of jugaadbaji no doubt!! We asked the driver to deliver an important paper at his house, the deed papers indeed ! He was not carrying any cellphone with him though, so that he could be contacted. He asked us to write our contact nos. on a paper. We wrote down our contact number and Shubham's address in Lucknow. We came back to the lab and slept dreaming about the phone. Around 9.30, I suddenly realized that we had not talked about the phone to anyone, neither to the driver nor at his home. I tried waking up Shubham to inform his parents. He said "He would call us once he is there and then we would tell him" and slept. Around 11 am, Papa called me asking to pick up the iphone from Shubham's house. I called his landline no. and came to know that the driver had left the papers but the phone was not handed to him. Papa finally sent someone to pick it up from his house. When Papa got the phone, he was excited and called me up telling that it was in an excellent condition. I could resist no more. The phone was coming nearer day by day. I finally decided to go and pick it up myself. We booked a taxi for 1 pm. When we are about to leave, the courier containing our parts arrived. It took us less than 2 hours to repair both the existing phones which is too fast considering the fact that involved lot of complicated soldering and wire management, and yaaay.. now I can again listen to music on it in the loudspeaker mode after 5-6 months.

We finally left for Lucknow where Shubham tried to unlock it but with no success. We were finally back at 1.30 in the night. It was one Iphone rescue day. Now I proudly claim to be the owner of the fastest and smartest phone ever. It also came with a beautiful white case and an anti-glare screen guard and of course in the original box with data coed and headphones. The condition is excellent and it looks great with the shining white back cover.




I tried jailbreaking it but as expected there appears to be no free solution available till 24th.

Thursday, June 10, 2010

An evening with a photographer and my best 20



Shubham and myself were returning from the Prince of Persia late night show when Shubham invited three of his junior friends in the same cab. Amongst the various discussions that followed, one of the guys told us about a photography workshop to be held the next day. "Who is taking the workshop?" was the obvious question. "Subi Chaturvedi from LSR, Delhi. She has even been the Miss Antaragni." Suddenly it sparked a new delight on our faces and made the news of the workshop more interesting.

"So what time is the workshop ..... who is picking her up... where is she staying and bla bla...."
The next day we woke up as usual at 2 pm in the lab. The first spot we rushed towards today, unlike other days was not our about to close mess but Visitor's Hostel. The receptionist told us that she was staying in A-1, Visitor's Faculty Hostel and we dropped there on Shubham's scooty in flash of a second.

Three guys, apparently the photography club coordinators, were waiting outside the door while a tall smart lady was locking her doors. As she moved past us, SHUBHAM was quick to pounce on her introducing both of us - "we are into photography" and we got invited to the lecture with our best 20 pictures. She gave some really nice tips on taking better pictures. She showed some of her pictures taken in Europe and east India. They were amazingly impressive. She told us how the getup, colors and light conditions change the look and feel of the picture. She shared her experience when she had to decide Sushma Swaraj's dress after she had won the election. She also impressed on us that we should wait for the right moment of action before clicking and look for the right expressions - as she had clicked Laloo Yadav sleeping many a times in Lok Sabha. Some of the landscape pictures taken by her looked very serene and appeared like a painting which she said is accomplished by introducing a shake by clicking and immediately releasing the shutter button.




Next day, the lecture began at 4 pm. And what more she started off with the discussions of my photos. One by one the pictures rolled and her expert comments coupled with the photography rules - "rule of the thirds", "importance of head space", "perfect symmetry is unpleasant", "leading lines in the photograph", "going deep into the picture into the 3rd dimension by taking pictures at angles with wide angle lens", "using the available light to your advantage"..... made the session unforgettable and extremely interesting for me. Although she kept kicking my ass for being "an excellent photographer but a bad editor" but I really cherish those moments. It was the ultimate surprise for an amateur photographer like me to have my pictures discussed on stage that too by such a great talent. For reference, she asked us to follow Tarun Khiwal, Rafique Sayad, Raghubir Singh, Raghurai and Prashant Panjair. Later, once again we went out to take pictures outside the CSE building. I even tried clicking her picture in the dim light with tips from her but apparently light had a reddish tint which did not allow me to take a good picture.




Back from the two day workshop, I suddenly realize that my composition and photography skills have drastically improved. Such a remarkable difference in a short span of time is simply unbelievable. I went through all the pictures I took in Europe and to my surprise I was very easily able to identify the issues with them and improve most of them as much as possible. Thanks Subi for the wonderful time and being such a great teacher. It has also helped me update my best photos gallery .

Monday, June 7, 2010

AVR development on Mac OS X with XCODE


Are you an AVR fan who has recently migrated to Mac and disappointed by the lack of AVR support for Mac users? Specially if you have been working on CVAVR and AVRStudio for development, and now you realise that there is no such GUI available for Mac.
A closer look at the situation reveals that there is ample support and resources available for here which I will list one by one.

Alternative 1 :
Install VMware on Mac and run all your old windows programs without a glitch. The disadvantage is that running another OS like XP, more so if its Windows 7, consumes a lot of resources and your system performance goes down. Nevertheless, you can give it a try if you have a free/ trial copy of VMware, and of course XP.

Alternative 2 :
As we all know avr-gcc compilers are available for linux and Mac as well. So you can download and install them and start writing programs and burning them from Terminal command line. This might turn out to be a tedious task if you are new to command line. You are bound to falter once while changing fuse bits through command line and this results in killing your poor Atmel chip.

To burn fuses without burning the chip, there is a nice application available for Mac called the AVR Fuses . This application provides the same interface as your AVRStudio for changing fuses and programming your chip.





This GUI uses avrdude to program the fuses as well as the program memory. (I will explain installing that later). Just go to the preferences and set the right path to avrdude and the programmer port and it begins to work.

Note : If you plan to use a USB to serial converter like the one from prolific you need to install a PL2303 prolific mac driver which is readily available on the web.

Alternative 3 :
A similar but more useful app called the AVR Tools also has a built in serial terminal. So this eliminates the need for XTerm etc. The environment is slowly building up to give you a good experience. This app has a whole list of programmer support ranging form USBasp to the simple sercon mini programmers. Select the port form the dropdown list which is automatically populated depending on the available serial ports (USB to serial adapters, bluetooth serial ports etc.). This as well requires installing avr-gcc and avrdude. I would recommend AVR-Crosspack for installing the avr-gcc toolchains etc. To configure it rightly, please follow Lady Ada's tutorial . Please follow it step by step.



Alternative 4 :
Till now we haven't come across a native IDE for AVR development on Mac. We haven't yet explored the beauty of development on Mac. If you are not familiar with Xcode, its the native development environment for Mac. It has an amazing GUI. Yes, you are thinking in the right direction. We are about to use Xcode for AVR development. Please install and test AVR-CrossPack and configure it correctly before you proceed.
Xcode provides you option for creating project templates. A great person has created a nice AVR template for us. Download the template folder from the following link:

and copy the folder into the directory:

/Developer/Library/Xcode/Project Templates/Others/
or,

/Library/Application Support/Developer/Shared/Xcode/Project Templates/

Now run the Xcode and click open a new project. A template chooser like one of the following will appear depending on where you had copied the folder in the previous step.



Select the AVR project or the Atmega project. On the left pane you see firmware folder. Expand it and you will see 2-3 files including main.c and makefile. main.c is the file you need to edit and write your project in. After writing the code click on build and a hex file will be created in the project folder. From the Release dropdown list on top left, you can choose to flash the microcontroller if the write programmer and options are set in the makefile.

You can also edit this template to include some default things by opening the project file from the directory you copied in the first step. For example, I edited the template so as
1. to use particular serial port by default by editing the make file
AVRDUDE_PORT = /dev/cu.STK500-1-GenericSerial
2. to use a particular programmer type by editing the make file

AVRDUDE_PROGRAMMERID = stk500v2

3. I often use delay functions. So I made a delay.h header file and included it in main.


I made some more changes in the make file to write all the build files in a subdirectory of the project file to prevent it from unnecessary cluttering.

Later, I connected a bluetooth serial module to the programming port of my STK500 board and began flashing it wirelessly from my Mac. So now when I press the build button, it automatically compiles the code and burns it on the microcontroller wirelessly :P . Details about it in the next blog.


Hope you have a good AVR+Mac experience.

Sunday, June 6, 2010

Activating Matlab on Mac OSX Snow Leopard

This post is meat for people who are having problem activating MATLAB on OSX Snow Leopard. You should be aware of the fact that MATLAB runs on Mac through Java and not as a native Cocoa application. After the recent kernel upgrade to 64-bit, MATLAB is facing problem writing the license file to the installation folder specially if you are activating in the offline mode with a license file. It gives an error message asking to view the log the file in /var/..../-temp-/ews.log.

To fix this problem is very easy. Actually the Java comes configured to run applications in the 64-bit mode which is causing the problem. Follow two simple steps to resolve it.
Step 1 : Open the java preferences from Spotlight as shown in picture below.

Step 2 : Drag 32-bit option above 64-bit.


Try activating now. It should work.