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
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.
Evolution of a blogger
It has been almost 3 year, When I started blogging. Looking back to see how my blogging style has changed, change in content of blog post or change in my motivation for blogging to sum up how I am evolved as a blogger. First I’ll tell you how my reasoning behind blogging has changed:
Why do I Blog ?
- Because I wanted to blog, seeing so many on internet.
- Then as catalog of stuff I’m doing, for me and may be for others to know.
- And with time it changed to showcasing what I like, what I’m doing, sharing tips and then taking readers opinion, discussing with them. (at leasts thats the aim)
In all above cases common things can be to pass time and share experience plus along with we are (I am) also always looking for recognition and admiration.
And about change in my blog content:
- May 2005, Posted some pictures, wanted to avoid much writing.
- June 2005, Just write about your projects, so that you don’t have to dwell for blog content.
- November 2005, You try to write some good posts(Solving Rubik’s Cube, Speed up firefox) but you end with posts like Unnatural laws whose content is generally a email forward or similar.
- February 2006, You try your best looking for good content to post but most of post were result of “submit to blog” button on digg.
- July 2006, Most of blog post consists of linking to stories of others blogs or quoting parts of posts from other blogs.
- September 2006, Now blog posts are mixture of posts from above categories.
- January 2007, Now You are improving with some good posts (sharing knowledge firefox: about pages). Also tried covering some events in IITB (Techfest 2007: Feeding the Fish, Creative Commons, India launched on 26th Jan at IIT Bombay)
- Then there is also a time when you stop blogging for some time (for me this hibernation period was from May 2007 to Nov 2007)
- Decemeber 2008, January 2008: You are trying to get back in form and you want to write good posts now)
- February 2008, Some good posts which includes what new you tried Adobe AIR: Web to Desktop, Trying hands on Google gadgets) or tips you want to share(Google movie search tricks).
- Now I feel, I have a good enough blog which people (atleast some) want to read. And I’m always ready to try, explore new things and share with my viewers and always waiting for there feedback. (Check my posts for this month)
In all these time periods you will always have some good posts and some just blog posts.
Share with your motivation behind blogging and how you pick up content for your blog. I’m not a good writer (I try to share mostly technical, geeky stuff through my blog) so any suggestion/feedback to writing style are always welcome.
Google treasure hunt (Second puzzle)
Its about time (936266827 seconds before Y2K38) i.e 19may2008 17:07:58 (UTC) and the second puzzle is live (Check it out). You can still try the first question here. Second puzzle from google treasure hunt is to calculate
Sum of line n for all files with path or name containing pattern and ending in particular extension. Similarly Sum of line m for all files with some pattern.
Hint: If the requested line does not exist, do not increment the sum.
Multiply all the above sums together and enter the product below.
for a given set of files contained in a zip archive. I have already submitted my answer
, but this time I will have to wait for 24hrs to check the status of my answer
. I thinks its a good puzzle to test your quick shell script abilities. (Can also be done easily in perl/python).
For the solution part, I wont give the actual solution (As dont want it to spoil for others who are actually trying) but you can use shell commands [grep, find ,sed and pipe (|)] to get to solution. You can get all the required numbers in 2 lines on shell.
Related Post:
Google Treasure Hunt
Orio’s Riddle Completed
Twisty Puzzles
Google treaure hunt
The Google Engineering team is launching its first ever Treasure Hunt, a contest designed to challenge your problem-solving skills.
Find more details at Google Australia blog here
They will be releasing first four puzzles in the next consecutive four weeks, one is alread released.
To get the URL of the contest you have to decode:
aHR0cDovL3RyZWFzdXJlaHVudC5hcHBzcG90LmNvbS8=
And yeah,
I was able to that do that. I’ll tell you the answer its http://treasurehunt.appspot.com/, as its already on Google Blog
Actually its the base64 decode of the given code.
You can find the first puzzle here.
A robot is located at the top-left corner of a 34 x 49 grid.
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there?
I have solved this one. Give it a try, its not that difficult. Any way I’m there to help ![]()
Here is the solution to the problem :
The number of paths for n x m grid (n-1 down blocks and m-1 right blocks) is equal to number of ways of arranging n-1 D’s (Down move) and m-1 R’s (Right move). So it’s
(n-1+m-1)! / ((n-1)! * (m-1)!)
You can calculate it using calculator in Windows/Linux.
I’m waiting for the next to come.
The second puzzle will be appearing soon — to be exact, 936266827 seconds before Y2K38,
Update:
Unix internal time is commonly stored in a data structure using a long int containing the number of seconds since 1970. This time is used in all time-related processes such as scheduling, file timestamps, etc. In a 32-bit machine, this value is sufficient to store time up to 18-jan-2038. After this date, 32-bit clocks will overflow and return erroneous values such as 32-dec-1969 or 13-dec-1901. Read More about Y2K38.
According to wikipedia The latest time that can be represented in this format, following the POSIX standard, is 03:14:07 UTC on Tuesday, January 19, 2038. So when you calculate specified 936266827 seconds before that next puzzle should come around 19may2008 17:07:58 (The puzzle is alread there)(UTC) .
I have removed exact timing for you to get it on your own.(or is it still there ..haha ). And still if you need it, you can request in comments.
I calculated it using stata. You can easily calculate this in two lines in python:
>>> import time
>>> print time.ctime(2**31 - 1 - 936266827)
Related Post:
Orio’s Riddle Completed
Twisty Puzzles
How to share notes across multiple machines
Throughout the day, I am working on multiple machines. And sometimes I need to a way to note down some ideas, links, articles in whome I’ll be looking later on, and at that time I could be on different machine. Its also important that its an OS independent solution.
Earlier I used backpackit to write down notes, links etc. But It was cumbersome, I had to go to my backpackit page and than add the required thing still It allowed you to add notes, check lists, links etc.
Now a days I’m using Google Notebook. It allows you to add text clippings, images and links to your notebook. And you can access it on any machines. It becomes more useful and productive with the help of firefox extension for google notebook where you just select the text (or link, image) and right click and Note this! (Or Clip it) And you are done. Now you can access the notes on any other machines.
It also allows you to comment, tag your ideas along with providing the functionality of sharing the notebook and many new improvements.
Tell me how do you share notes when working across multiple machines.
Turn off beep sound in firefox
I recently installed new firefox version on my ubuntu and was trying to find some text on a webpage. Suddenly, as I pressed next to search it, the searchbox turns red showing Phrase not found and started making beep noise. I was annoyed, So was thinking of way to disable / turn it off. To look for some preference to set, I typed about:config (special firefox about: pages) in location bar and searched for sound. I was lucky i found two related preferences.
So you can set accessibility.typeaheadfind.enablesound Value to false by double clicking it. And you are done. No more beep beep to annoy you.
Related Post:
Firefox about: pages
Speed Up firefox
View contents of Zip/Jar files using firefox
With Firefox 3, you can use firefox browser to view contents of zip/jar files.
For viewing contents of filename.zip type following at location bar:
jar:file://< full path to filename.zip >!/
Example: jar:file:///home/user/Desktop/filename.zip!/
Also: jar:file:///home/user/Desktop/filename.zip!/dir/file1.js
This is specially very useful when you want to see contents (.js, .css, .html files) included in firefox extension’s jar file. After it list the contents, you can easily browse through the directory, sorting files etc.
Update: Security problems that come with jar: protocol
While serching for pages related to jar protocol in firefox, I found an interesting article at www.gnucitizen.org
In simple terms, it means that any application which allows upload of JAR/ZIP files is potentially vulnerable to a persistent Cross-site Scripting. Potential targets for this attack include applications such as web mail clients, collaboration systems, document sharing systems, almost everything that smells like Web2.0, etc, etc, etc.
Similar security concerns also arise in data: protocol in firefox. So one need to be careful to filter files you want to allow for upload. Actually, once I had similar situation with a website which allowed you to host image files, but the problem was they were not checking for file types. Thats means you are allowed to upload a php file too. So now you can do anything you want with that server (don’t ask me what I did
). So beware of such issues.
Related Post:
Perfect password according to firefox
View Page Source trick in firefox/flock
Firefox about pages
Cross Site Scripting
Installing latex on hostmonster
In continuation with my previous post (Some times yahoo is better), I followed the steps on how to install latex/tetex on my web host from here (You can also get the Installation steps from QuickInstall file in source code or access the same file from tug.org).
But the problem is that on web hosts like hostmonster you won’t have root access so you will need to modify some of the things and do a local install in your home directory.
For that you can specify –prefix accordingly while doing ./configure. So you need to do:
./configure --prefix=/home/username/local/teTeX
replace username with your account name
This step ended without any errors But while I was doing make world, the process exited with following error:
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.a when searching for -lXt /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.so when searching for -lX11
I found this thread, where they were discussing similar error and from what I got it was due to machine platform. So I checked my host system information with
uname -afrom there I got x86_64 x86_64 x86_64 GNU/Linux which meant its a 64 bit architecture.
So after some tweaking to what I found here(CBLFS: TeTeX) to make it work for local install, you can do following to compile the package:
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" USE_ARCH=64 \ ./configure --prefix=/home/username/local/teTeX/ \ –enable-shared \ –without-texinfo \ –with-x=no \ –with-system-ncurses \ –with-system-zlib && [ -f texk/libtool ] && sed -i “/sys_lib_search_path_spec=/s:/lib:&64:g” texk/libtool;
And then you can do
make world make all install
You can then add generated executable to your system path by:
PATH=/home/username/local/teTeX/bin/x86_64-unknown-linux-gnu:$PATH; export PATH
You can also configure your installation using:
texconfig
And its DONE
Find all steps followed by me here
So if you want to install on 32 bit config the method at Microcontroller programming Blog should work fine.
Also read: The Tetex HowTo
You can download required packages using wget on shell account at hostmonster from ctan.org
Related Post: Latex Beamer




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