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
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
Dilbert in new flavor
New design and features @ www.dilbert.com
Read more about it: Dilbert.com relaunches with Web 2.0 flavor.
They have added comic strips as flash content. But I liked the old format..more simple. And now all comics are colored too.
An IITian’s super power strikes again in new comic strip. ![]()

Super powers of Asok (Used till now):
- Guided reincarnation
- Advance shape shifting
- Telekinetic powers (used to cause remote explosions, just by thinking)
Please add ..if i misssed some. (for reference of above mentioned powers see my collection)
Read My collection of strips featuring IITs and Linux
Double century of posts : A comic break
I found this Best of Blaugh through webyantra. So enjoy…
Here are the other webcomics that i love:
- Dilbert
- xkcd.com
- .pOINT_bLANK: Cartoons, India
- Explosm.net
- gapingvoid: “cartoons drawn on the back of business cards”
- bLaugh - The (un)Official Comic of the Blogosphere
- We Blog Cartoons
My collection of dilbert comics: Dilbert, IIT and Linux
Related Posts:
Great Amul Ads !
Damned funny Unix humor
.Net apps on linux
Actually i had to do some assignment in C#, so first i thought of going to windows and do it with VisualStudio (IDE)..but voila… i found its alternative for linux : mono
It allows you develop and run .net framework applications.
I was able to install it easily in ubuntu:
sudo apt-get install mono
sudo apt-get install mono-gmcs
Now you can compile .cs files {extension for c#} using
gmcs file.cs
and run using
mono file.exe
More details about Csharp compiler :gmcs
See these links for more details and examples:
http://www.mono-project.com/Main_Page
Mono brings .NET apps to Linux
Introduction to Mono - Your first Mono app
Open source is key to reaching 500 million Indian children
An interesting article by Mark Rais on role of open source in making education available to the large youth population of india. And a greta initiative by CII-Shiksha.
To support more than 650,000 villages and one half billion youths who need education, the Confederation of Indian Industry (CII) created a nonprofit organization called Shiksha India in 2001. One of Shiksha’s primary initiatives was the creation of a collaborative online Web portal, which the president of India launched in a formal ceremony last month. The new e-learning and collaboration portal uses open source technology such as Moodle, Drupal, and MediaWiki.
In my opinion the reason behind its success can be attributed to mainly: its free of cost availabilty which is big issue in regard to country like India, where population(half billion) which need attention is much higher and money involved if proprietary softwares are being used. And other important aspect which article mentions is in the ability to customize and provide products in local languages (including Hindi and Tamil) along with chosing most suited among vast available resources.
Another important issue which can be solved with open source is large scale piracy, currently software piracy laws are not so strict in india but still piracy is a getting a major issue.
“The bad side is that with so much available, a newcomer to OSS is bound to get confused about what to use.” He says this is often exacerbated due to some projects being fixated on proving that their product is best.
Other than that at present, their are linux distributons like Ubuntu, which is quite user friendly and its available in many flavours. Also earlier there has also been efforts in shifting towards linux and other open source mediums like :
LIC opts for Linux
Taking Free Software to the Farmers and Fields of India
Kerala logs Microsoft out
Linux.com : Open source is key to reaching 500 million Indian children
Program Details for Shiksha India
The Dilbert Principle
Did you know about Dilbert Principle..
The Dilbert Principle refers to a 1990s satirical observation stating that companies tend to systematically promote their least-competent employees to management, in order to limit the amount of damage that they’re capable of doing.
Now i understand it all
..
The Dilbert Principle is a takeoff on the Peter Principle. The Peter Principle addresses the practice of hierarchical organizations (such as corporations and government agencies) to use promotions as a way to reward employees who demonstrate competence in their current position.
what do you think ??
Related links :
Dilbert, IITs & Linux
Some useful command line tricks
SEOmoz.org has listing of linux commnad that may be useful in web development but they are uerful otherwise too.
Some of them are here:
- ln -s /some/destination name_of_link
- ctrl+z and bg
- scp : scp user@example.com:~/dir /destination
Read More : Web Developers: 13 Command Line Tricks
Some other Miscellaneous Tricks:
ls -lSr List files (sorted by size) df -h Show available disk space in human-readable format du -sh /some/dir Show how much space /some/dir is taking up
Related Posts:
Ten Cool Coreutils Commands
Searching with find
Best Linux One Liners
Cleaning up a Ubuntu GNU/Linux system
I’m using ubuntu dapper, and i came across this nice ubuntu blog : Ubuntu Tutorials, having post on how to clean your ubuntu system to remove residual config packages, partial packages to free up your disk space. it also provides screen shot to help you follow the process. it also explains how to use localpurge, deborhan and other tools.
Read more >> Cleaning up a ubuntu system
Related post : How to install ANYTHING in Ubuntu!

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