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

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:

My collection of dilbert comics: Dilbert, IIT and Linux
Related Posts:
Great Amul Ads !
Damned funny Unix humor

Damned funny Unix humor


Source : Boing Boing
Originally at http://xkcd.com/c149.html

Secure Programming for Linux and Unix HOWTO

This book provides a set of design and implementation guidelines for writing secure programs for Linux and Unix systems. Such programs include application programs used as viewers of remote data, web applications (including CGI scripts), network servers, and setuid/setgid programs.

read more | digg story

graph plotting with gnuplot

Gnuplot is a free, command-driven, interactive, function and data plotting program.
Here i’ m providing a quick reference guide for plotting graphs (as many of us don’t bother to go in detailed documentation).
On Unix/Linux systems start Gnuplot by simply typing:
gnuplot

first the formal syntax :

plot {[ranges]}
{[function] | {”[datafile]” {datafile-modifiers}}}
{axes [axes] } { [title-spec] } {with [style] }
{, {definitions,} [function] …}

To plot functions simply type: plot [function] at the gnuplot> prompt
gnuplot> plot sin(x)
gnuplot> splot sin(x*y/20)
gnuplot> plot sin(x) title ‘Sine Function’, tan(x) title ‘Tangent’

Now for plotting data points firstly data points should be written in text file with axis ranges as columns.Data files should have the data arranged in columns of numbers. Columns should be separated by white space (tabs or spaces) only, (no commas). Lines beginning with a # character are treated as comments and are ignored by Gnuplot. A blank line in the data file results in a break in the line connecting data points. ‘
Plotting a graph from data file “plot.data” , do
gnuplot>plot “plot.data”

Now customizing the plot :


set xlabel “x-axis data” # will set a label “x-axis data” in graph
set ylabel “y-axis data”
set title “x vs y” # will set title for graph
set xrange [0.001:0.005] # Change the x-axis range:
set yrange [20:500] # Change the y-axis range:
set logscale # plot using log scale
set autoscale #let gnuplot determine ranges
plot “file.data” with lines #will join data points with lines
plot “file.data” smooth csplines with lines #will join plot graph using smooth curves

Gnuplot can mathematically modify your data column by column:
to plot sin( col.3 + col.1 ) vs. 3 * col.2 type:

plot ‘force.dat’ using (3*$2):(sin($3+$1))

To print graph (this will store graph in post script(.ps) file do this before plotting graph:

set output “graphs.ps”
set terminal postscript
plot “file.data” using lines

This will save the graph in graph.ps
For more help type ‘help’ in gnuplot mode :
gnuplot>help

somelinks
www.duke.edu/~hpgavin/gnuplot.html
A simple guide to GNU plot
Introduction to GNU plot

Some Latex tips & Links

Here are some quick tips and links which you can find useful when writing some report, article in latex.

Firstly here is an nice article explaining why latex is good .
Here are some editors available for latex:
For Linux :

For windows :

Getting to grips with Latex
Getting Started with LaTeX
LaTeX Tutorial : some templates here
LaTeX Tips and Tricks