Saturday, October 31, 2009

Luck at DSPic

void main()
{
unsigned int i=0;

for (i=10;i>=0; i--)
{
display (i);
...
..
}

display("task completed");

}

Do you think the last line of code (red one) will ever be executed ?
If yes... think again..

The problem occurred when Soumya and myself were programming DSPic for IMU. The program wouldn't come out of the loop. We flagged and traced each and every line. Ultimately we tried writing the following just before the brace close of the for loop and it worked.

if (i==0) break;

We tried figuring out what was stopping the for loop from exiting by itself when all the i iterations were done. We realized that when the i=0 iteration has completed, i-- is executed. i should have become -1 but since i is unsigned int, it becomes 255. Now i>=0 is checked which is obviously true so the loop is executed 256 times more. This cycle goes on indefinitely. To overcome the issue, we decided to run the loop from i=11 to i=1 not letting i attaining sub 0 value anymore and it worked.

Great discovery at 2 in the night once again in TMRS lab.

Monday, October 5, 2009

Mac Enhancements

While I am loving my Mac more and more, thought why not make you jealous with various enhancements I have been using.

Multiclutch
A trackpad gesture customization app which you configure so that when you swipe or rotate or pinch your fingers, a new Safari tab opens or you switch to new tab or or go backward or forward while browsing. Details and download link available at
http://wcrawford.org/2008/02/28/everytime-i-think-about-you-i-touch-my-cell/

TabExposé
If you have upgraded to Snow Leopard you would have definitely liked the improved expose features with quick-look like scrolling and switching features. Now imagine all your tabs exposing like various application windows and you are able to switch between them using cursor and arrow keys. Added to it is the fact that expose has quicklook features so you switch between tabs using cursor keys and press space bar to maximize a window.




Details available at:
http://www.cocoamug.com/tabexpose/manual.html

Smart scroll
Let me add to all this another cherry which I have been enjoying . I came across this app called smart scroll which can further enhance your multi touch experience.


http://marcmoini.com/sx_en.html
Now you don't even need to drag your fingers to scroll. If you have enjoyed the iphone touch screen you would love the same effects on your mac. Just scroll and lift your fingers and watch your window smoothly scrolling and coasting through.

Quicktime codecs from Perian
Installing the Perian codecs makes your quicktime million times more capable than it is normally. Now you can natively play AVI, DIVX, FLV, MKV,MS-MPEG4 v1 & v2, DivX, 3ivx, H.264, MPEG videos in quicktime. To add to it, remember quicktime has video editing facility now, so now natively trim and convert any video in .mov, 3gp or .m4v format suitable for iphone.
http://www.perian.org/

Add Glims to Safari
An awesome plugin for Safari which adds numerous elegant features to it. If you loved Firefox for plugins, here is the ultimate boss of all plugins.




http://www.iskysoft.com/article/perian-for-quicktime.html

Current features list:

* Adds thumbnails to Google.com or yahoo search results
* Adds search engines to the default Google search tab
* Adds full-screen browsing capability (^+cmd+F)
* Adds Favicons to tab labels
* Adds keyword search from address bar
* Undo "Close Tab" (cmd-z)
* Re-opens last session when Safari starts
* Auto-Closes download window
* Adds new tab position option (right/left/leftmost/rightmost)
* Adds tab closing using middle mouse button
* Focus last selected tab
* Always open links in a new tab
* Type-ahead support (auto cmd-f)
* Sets the focus on the search field when opening a new window
* Adds Amazon's information banner on Google.com search results
* Adds Amazon's information banner on Yahoo.com search results
* Adds a "Max Window Size" menu item to resize the Safari window
* Forms autocomplete always on
* Autocomplete search phrase
* Adds bookmark separator
* Adds bookmark actions
* Dated download folders

Quicklook plugins
Came across some nice quicklook plugins.
The first one is called the sneak-peak which can display detailed image information including all metadata.


The other one is color code generator which colors up code syntaxes appropriately without having to open the file.

Saturday, October 3, 2009

On Snow with the PRO


The day Apple introduced its unibody Macbooks, I have been eyeing it like an eagle looking for the right opportunity to grab it. Their demo video has since then always been hanging around in my iphone. But changing computers every year that too the costliest ones would be too much for a UG student like me. One day Vyas Sir realizes that I have been having trouble with my old machine and like any fortunate incident in my life this lovely surprise came to me without any hope. And now I am on a Macbook Pro 13" unibody.

Its an innovative piece of creation by the maestros. The glistening silver colored body with sleekness personified is a stunning sight to behold. Weighing less than 2 kgs its the ultimate companion for journeys and portable use. The speakers, cameras, LEDs are amazingly well embedded into the aluminum body pushing the unibody idea further high.
The battery backup has further improved and now its 7 + hours.
The trackpad as demonstrated in the videos is very smooth and sensitive and the multitouch gestures are really really cool. The headphone and line in jack have now been integrated into one socket. So now you can use your iphone headphones with built in mics with this machine.
The LED lit LCD display has incredible contrast and brightness with auto adjustment depending on the ambient light. Coupled with the Nvidia graphics card, every piece of crap looks glittering and lovely on it.
By the way all the pros now have a backlit keyboard. The only issue with this machine appears to be the heating issue as compared to the white ones. Being metallic they heat up little faster.

And the 2nd big surprise was the fact that it comes with OSX 10.6 Snow Leopard upgrade DVD. After lot of speculations snow leopard is finally out with almost no new features but still claiming to be the most advanced and stable operating system ever. The startup and shutdown speed has almost doubled. If you are upgrading to Leopard, you get to save an additional 6 to 10GB hard disk space on installation.
The graphics has become smoother and richer. Expose is more magnificent now with quicklook features integrated into it meaning that when all the open windows are exposed, you can hover over a particular window and press space bar to magnify and focus on that window. Now as you hover over other windows they keep magnifying in turn. With the new version, APPLE probably wanted to do away with the Mac-NTFS boundary by incorporating native NTFS read/write support but due to technical issues hasn't made it official yet. However you can do a small hack to enable the write capability. Fortunately I came across this unique app called the NTFS mounter which does this job for me without opening terminal or any other thing like that.
iTunes has definitely become more advanced with more iphone oriented features. But what I really liked as a big leap is Quicktime 7.It comes with many more plugins and codecs. And.... now you can record video movies and audio using the in built camera and mic. What really add flavors is the fact that now one can directly video record screen without any heck.... wow. That means making tutorials or explaining a software is so very easy now. If you also have a windows comp for which you want to record screen.... just remote Desktop onto it from MAC and record .

Second amazing feature is video trimming. Now you can cut out a scene or a song from a movie in 3 clicks. There's nothing breathtaking yet but I am really loving it.

Disappointment:
I loved the quicklook folder view plugin which is no more compatible with 10.6.

Friday, October 2, 2009

Farm House fun @ Meerut

"Sir we plan to go to Meerut", said Shantanu to Sir. "You people don't concentrate on work then why have you spread so much work bla bla ". This was the second time when Sir was scrapping a well planned picnic. But this time everyone was determined to go. Sir himself had promised us a picnic after Shantanu's thesis. Ruchira ma'am also had to leave for home for her marriage on October 6th so we barely had time to have fun.We left on th night of 1st from Kanpur. The journey was real fun with people revealing their secrets one after the other. The details of the game as per the deal can not be disclosed here. Next morning we were at his picturesque and well furnished farmhouse.

It was lush green environment amidst absolute peace with shades, fountain, bridges, DJ floor and a wonderful swimming pool.

At the first sight it was planned that the evening would be spent in water. In a corner were two rooms with beautiful lights and ceilings, cosy bed and yes swords hanging on the walls. So the breakfast was served and what tasty pakoras, jalebis and sandwiches. We chilled out for a while and then most of us slept.

Lunch was served at 4 p.m.followed by the FUN time in the pool. Everyone jumped into the water in their capries and tshirts. Water polo, trains, waves , find the coin and what not. No one was willing to leave the pool before 9. Some delicious dinner still awaits us before we start our return journey.