Zune Bug explained
On new year eve, All Microsoft Zune players freezed, becoming totally unresponsive and practically useless.
“In what appears to be the biggest worldwide device failure in consumer electronics history, tens of thousands of owners of Microsoft’s Zune turned on the music player Wednesday morning only to discover it was the day the music died. By early afternoon, Microsoft released a statement saying the problem, which affected the original 30-gigabyte model of the Zune that first went on sale in September 2006, was solved. The issue: a bug in the way the gadget’s internal clock handles a leap year.”
The problem was in a small part of code in Zune’s clock driver which resulted in Zune looping forever.
Zune Failing :
http://gizmodo.com/5121311/reports-30gb-zunes-failing-everywhere-all-at-once
http://www.mercurynews.com/ci_11345379
Cause : (Zune bug explained here )
Bug in code ( Not taking leap year into account properly, seems simple ?)
Part of a function :
————————————————————–
while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}
————————————————————–
Bugs:
1) It should be days==366 or days>=366
2) No else condition mentioned for nested if. (Should have been there specially when if is inside a while loop )
Now Zune will keep looping forever. Zune bug explained here
Microsoft response : http://www.zune.net/en-us/support/zune30.htm
This is big reputational risk for Microsoft’s Zune, when it trying hard to stand against Apple’s Ipod.
Happy Diwali !!
Wishing each one of you a very happy and prosperous deepawali. May this year brings you lots and lots of happiness in life and fulfill all your dreams.
Above is Rangoli, we made at office.
Enjoy !!
New Rubiks Cube
Yesterday I went for the movie Hancock and I was only able to get the tickets for the evening show, We were there in afternoon itself. So we went to nearby Crosswords nearby

Then I saw, they were selling rubik’s cube. It has been a long time since I touched it. So I bought myself a Rubik’s Cube (Original from Rubiks.com, my first one) and It cost me around Rs 225.
Also few must be knowing that around 2 weeks back Rubik’s Cube was celebrating its 25th anniversary.
Check out some cool ads for Rubik cube.
25 years and still going

Today, I also found some creative ads related to Rubik’s cube via Toxel.com

So I have the new cube now, which is much better (smoother) compared to ones i previously had. I hope to improve upon my timing now.
And about the movie, Hancock, it wasn’t worth the hype created. though Will Smith rocked as always.
happy cubing !!
Related Posts:
Solving Rubiks Cube
Adobe AIR: Rubik Timer
Also check: Rubik Cube Timer, My Rubik Page
Purity of Mathematics
My friend, Abhishek has put up a series of posts which describes various branches of Mathematics (Applied Mathematics, Pure Mathematics). Some of you may not be able to read them as they are in hindi.
Reading these I remembered a similar post on xkcd comparing purity of various field (branches)

I’ll agree with it but comic misses the Applied Mathematics, which i think will have application in the whole spectrum of various branches mentioned by comics. On the other side Pure mathematics is purely based on reason, ignoring its usability.
Mathematicians have always had differing opinions regarding the distinction between pure and applied mathematics. One of the most famous (but perhaps misunderstood) modern examples of this debate can be found in G.H. Hardy’s A Mathematician’s Apology.
Applied mathematics sought to express physical truth in a mathematical framework, whereas pure mathematics expressed truths that were independent of the physical world.
Yahoo search is improving
Earlier I wrote about Sometimes yahoo is better is better than google in providing search results when I was searching for Installing latex on hostmonster. And now with its open search platform SearchMonkey its trying to close in to Google. SearchMonkey allows you to create data services to built search apps that can enhance your search results.

Yahoo search gallery provides you many existing search enhancements that you can add after logging to yahoo. [Via labnol.org].Try various enhancement like LinkedIn Profile, IMDB results, StumbleUpon Reviews and other popular ones.
And you can also create your own search enhancement using step by step method using Presentation application (SearchMonkey Guide).
SearchMonkey API unables you to modify how particular links appears in search results. You can add images, related links and other html formatting but it does not unable you change position of a page in search result. I was unable to find feature which will enable us to filter sites which requires you to login or sites like ebay and amazon which may not be relevant to us by making their appearance farther in search results.
But still these enhancements provides you little summary of search results which is very useful like in case of movie reviews, people profile via linkedIn, stock information etc thus sometimes making opening the actual webpage unnecessary.
Puzzle puzzle every where
Past few weeks have been puzzle/problem solving weeks, which includes 4 google treasure hunt problems. (Robot in a Maze, Puzzle 2 (getting lines from specific files in zip archive), Network routing table and last one:Prime numbers ). Solving these was fun.
puzzle
Two days back my friend shared this (Galton’s Paradox) on Google reader (My Google reader shared Items). Try explaining it
not that difficult though.
But what drew my attention again? Yesterday I was watching 21 movie, Its based on real story of six MIT students cashed in millions in Vegas Casinos by counting cards. Here comes the puzzle, In a classroom scene Prof Micky asks one of the student (Jim, our hero)
Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?
I’m sure you will be left puzzled for a moment, when you hear the solution by Jim, at least I was. Its a tricky one, But you can get through it
. So what choice would you have made, I’ll update the post with answer after few days.
Update:
This is famous puzzle known as Monty Hall Problem. Wikipedia has very good explanation for this.
Because there is no way for the player to know which of the two unopened doors is the winning door, most people assume that each door has an equal probability and conclude that switching does not matter. In fact, in the usual interpretation of the problem the player should switch—doing so doubles the probability of winning the car, from 1/3 to 2/3.
Also Read: Classic Computer Science Puzzles
Related Post:
Orio’s Riddle Completed
Twisty Puzzles
Google treasure hunt: last puzzle
Few days back google announced about last leg of google treasure hunt journey. This time they provided unix epoch time 1212448500, time when puzzle was supposed to get released.
You can use http://www.epochconverter.com/ to convert it to human readable format. This side also provides list of available methods to get epoch time, convert it to human readable format and vice-versa.
PHP date(output format, epoch); Output format example: ‘r’ = RFC 2822 date
Python import time first, then time.gmtime(epoch)
MySQL from_unixtime(epoch, optional output format)
So the puzzle was supposed to release at
Mon, 02 Jun 2008 23:15:00 GMT, for India: Tuesday, June 03, 2008 4:45:00 AM (middle of the night).
Forth Puzzle is available here. Its a bit tricky, but i wrote a c program to calculate the number using brute force method…and it worked.(Share how you did it or is there some shortcut which works without any programming). Problem is to find a prime number which in turn can be expressed as sum of of n consecutive prime numbers. Your answer should satisfy 4 such list of prime numbers of given length.
So its over for now and soon they are going to contest winners and rewards. Hope i could have been one
. But I have submitted this puzzle after long delay.(Was sleeping when it was released)
- Puzzle 1 (Robot in a maze) : Find it here
- Puzzle 2 (getting lines from specific files in zip archive) : Find it here
- Puzzle 3 (Network routing table) : Find it here
Google Treasure Hunt puzzle 3
Two days back google posted that they will be posting 3 puzzle for google treasure hunt soon.
This week’s puzzle is set to be released on Tuesday, May 27 at 10 a.m. PDT.
PDT is 7 hours behind UTC, so its around 10 PM, 27th May in India.
So the 3rd puzzle is live now. I have given it a try and submitted my answer, I think (!) it should be correct.
This time question is related to networking. You have to find the path followed by a packet given its destination and routing table for the network.

The nodes are hosts on the network, and the lines between them are links. A packet is sent out from host O with a destination of 46.44.187.63. Which nodes does the packet pass through on its way to the destination?
To refresh your concepts read (Routing tables, On wikipedia). If you got the idea, then it shouldn’t be difficult. Intuitively also you should be able to find your way through routing table. Give It a try..and but you will only get to know your answer status after 23hrs from now.
Previous Puzzles:
- Puzzle 1 (Robot in a maze) : Find it here
- Puzzle 2 (getting lines from specific files in zip archive) : Find it here
Latex on wordpress blog
Some time back I came to know that wordpress blogs hosted at wordpress.com supports latex. But no such default functionality for self hosted wordpress blogs. But there are plugins (latexrender, wp-latex) which can facilitate similar things.
But for these to work you will need to install latex on your hosting account. (I have intalled latex on my hostmonster account some time back.).
For installing latexrender wordpress plugin you can find guidelines here
One more thing to remember while setting $latexrender_path_http in latex.php give full http path to latexrender folder like $latexrender_path_http = "http://your blog addr/latexrender";
Now you are set to go. To include
in your posting, use the following:
[tex] your latex code here [/tex] For example:
[tex] (a+b)^3 = (a+b)^2(a+b) [/tex]
produces :
But after setting up latexrender plugin, the png image was still not generated. Error that I got was:
I can’t find the format file ‘latex.fmt’!
But when I tried similar command (latex sample.tex) from shell prompt, It was working fine.
So I thought that problem is in calling latex from php file using exec. So when I copied the latex.fmt file to directory containing .tex file it started working fine. May be some problem in setting environment variable.
You can look for latex.fmt file using :
find -name latex.fmt
For latexrender you can copy latex.fmt file to latexrender/tmp/ folder inside your wordpress installation.
I’m still working on how to set environment variable in php so that I don’t have to copy latex.fmt again and again.
But for now I gave got working latex on my blog
. Now I can write math equations in my blog posts.
You can try latex formulas in comment too.
And if you want to publish LaTeX equation in WordPress blog without installing any software, try jsTeXrender: http://yourequations.com/. Thanks Doug for the tip.
Related Posts:
Latex Beamer
Installing latex on hostmonster
Tagged: hostmonster, http, latex, php, wordpress
Wordpress plugins you should install
Few months back I have shifted my blog to self hosted wordpress blog at this location. I have passed few months trying new things on this blog like themes, plugins and its been fun playing with it. During this time I have tried several plugins, so wanted to share some of the plugins that I liked the most:
- Aksimet: filters spam comments and tracksbacks. You don’t want your post to be filled with useless comments.
- Wordpress.com Stats: Its a light weight plugin but still provides detailed representation of important statistics
- Google Sitemap Generator: Generates sitemap for your wordpress blog which is by Ask.com, Google, YAHOO and MSN Search.
- Get Recent Comments: Display the most recent comments or trackbacks with your own formatting in the sidebar.
- FeedBurner FeedSmith: It redirects your wordpress feeds to feedburner so that you can easily track your subscribers.
- Plugin Central: Automatically installs and updates WordPress plugins.
- Wordpress Data backup: Its a necessary plugin to backup your blog. I still haven’t restoring posts from backup though.
For some specific users plugins like wp-latex, are also useful. It generates PNG images from inline $\LaTeX$ code in your posts and comments. I have installed latex on my hosting service( hostmonster) and still working on making simliar plugins(LatexRender) to work.
You can find many more such list on web if you do a google search. But Lorelle has a nice compilation of list of favorite wordpress plugins.



Add to del.icio.us Network
Google Reader Shared Items
Twitter Feed
Flickr Photos