<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8063665696479699369</atom:id><lastBuildDate>Tue, 14 Feb 2012 00:21:26 +0000</lastBuildDate><category>Google code jam solutions</category><category>news</category><category>google auto filler</category><category>akgorithm solutions</category><category>google code jam 2009</category><category>gwt</category><category>Google Zurich</category><category>algorithm competitions</category><category>algorithms</category><category>programming puzzles</category><category>Calculating 'e' to 10000 Digits In Groovy</category><category>inurl</category><category>mapreduce</category><category>store credit problem</category><category>opensocial</category><category>babji prashanth chetty</category><category>Disclaimer</category><category>Schweiz</category><category>bayern</category><category>David A.Vise</category><category>bot trust problem</category><category>google math</category><category>Alien Numbers</category><category>Eulers Number e</category><category>google algorithms</category><category>Google code jam 2008</category><category>google hacks</category><category>big table</category><category>page rank</category><category>intitle</category><category>technical</category><category>first 10 digit prime in consecutive digits of e</category><category>security</category><category>chetty</category><category>Google pig latin</category><category>nuremberg</category><category>dynamically typed language</category><category>india</category><category>goole file system</category><category>minimum scalar product</category><category>Babji</category><category>Eulers Number</category><category>africa</category><category>Bangalore</category><category>gcj 2010</category><category>android</category><category>babji chetty</category><category>software</category><category>Munchen</category><category>europe</category><category>Google development centre</category><category>Job at Google</category><category>Google Developer Day Munich 2008</category><category>interesting google suggestions</category><category>play with googol</category><category>number system and bases</category><category>google code jam puzzles</category><category>google search suggestions</category><category>bigdecimal</category><category>google calculator</category><category>Google system architecture</category><category>Liechenstein</category><category>google app engine</category><category>technology</category><category>Alien Language</category><category>GCJ 2008</category><category>google job tips</category><category>java algorithms</category><category>English To Pig Latin Translator</category><category>google operating system</category><category>google joins oCERT</category><category>chetty babji prashanth</category><category>oktoberfest</category><category>scripting language</category><category>Google Munich Job</category><category>Pig Latin</category><category>magicka problem solution</category><category>Interesting Or Creative Google Search Queries</category><category>code jam africa</category><category>greatest common divisor</category><category>google code jam 2010</category><category>babji p chetty</category><category>gcj 2011</category><category>Google Billboard Math Puzzle</category><category>T9Spelling</category><category>goolag scanner</category><category>Open Source Jam</category><category>programming competitions</category><category>Google Story</category><category>Getting a job at google</category><category>google web kit</category><category>google-tale</category><category>All your base</category><category>fair warning problem</category><category>Eulers number e to 10000 digits</category><category>google tale</category><category>Munich</category><category>Brandschenke strasse</category><category>math</category><category>deutschland</category><category>coding competitions</category><category>google coding competitions</category><category>top coder</category><category>reverse words problem</category><category>google gears</category><category>Java</category><category>e</category><category>Google</category><category>Switzerland</category><category>Google code jam problems solution</category><category>google code jam 2011</category><category>Germany</category><category>cult dead cow</category><category>distributed computing model or frameworks</category><category>weird Google search queries</category><category>bavaria</category><category>Google events</category><category>snapper chain problem</category><category>babji prashanth</category><category>prashanth chetty</category><category>Prashanth</category><category>google path to success</category><category>Zurich Google office</category><title>Googol</title><description>-----------------------------------------Math.pow(10,100)------------------</description><link>http://google-tale.blogspot.com/</link><managingEditor>noreply@blogger.com (Babji Prashanth, Chetty)</managingEditor><generator>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/Zxyb" /><feedburner:info uri="blogspot/zxyb" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-4560523911177635177</guid><pubDate>Sun, 08 May 2011 22:17:00 +0000</pubDate><atom:updated>2011-05-09T00:17:33.768+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">gcj 2011</category><category domain="http://www.blogger.com/atom/ns#">magicka problem solution</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2011</category><title>GCJ 2011 - Magicka</title><description>Below is the description of a problem called 'Magicka', from 'Google Code Jam - 2011':&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;font color="green"&gt;&lt;br /&gt;
Problem&lt;br /&gt;
-------&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
Magicka™ is an action-adventure game developed by Arrowhead Game Studios. In Magicka you play a wizard, invoking and combining elements to create Magicks. This problem has a similar idea, but it does not assume that you have played Magicka.&lt;br /&gt;
&lt;br /&gt;
Note: "invoke" means "call on." For this problem, it is a technical term and you don't need to know its normal English meaning.&lt;br /&gt;
&lt;br /&gt;
Problem&lt;br /&gt;
&lt;br /&gt;
As a wizard, you can invoke eight elements, which are the "base" elements. Each base element is a single character from {Q, W, E, R, A, S, D, F}. When you invoke an element, it gets appended to your element list. For example: if you invoke W and then invoke A, (we'll call that "invoking WA" for short) then your element list will be [W, A].&lt;br /&gt;
&lt;br /&gt;
We will specify pairs of base elements that combine to form non-base elements (the other 18 capital letters). For example, Q and F might combine to form T. If the two elements from a pair appear at the end of the element list, then both elements of the pair will be immediately removed, and they will be replaced by the element they form. In the example above, if the element list looks like [A, Q, F] or [A, F, Q] at any point, it will become [A, T].&lt;br /&gt;
&lt;br /&gt;
We will specify pairs of base elements that are opposed to each other. After you invoke an element, if it isn't immediately combined to form another element, and it is opposed to something in your element list, then your whole element list will be cleared.&lt;br /&gt;
&lt;br /&gt;
For example, suppose Q and F combine to make T. R and F are opposed to each other. Then invoking the following things (in order, from left to right) will have the following results:&lt;br /&gt;
&lt;br /&gt;
QF → [T] (Q and F combine to form T)&lt;br /&gt;
QEF → [Q, E, F] (Q and F can't combine because they were never at the end of the element list together)&lt;br /&gt;
RFE → [E] (F and R are opposed, so the list is cleared; then E is invoked)&lt;br /&gt;
REF → [] (F and R are opposed, so the list is cleared)&lt;br /&gt;
RQF → [R, T] (QF combine to make T, so the list is not cleared)&lt;br /&gt;
RFQ → [Q] (F and R are opposed, so the list is cleared)&lt;br /&gt;
Given a list of elements to invoke, what will be in the element list when you're done?&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of the input gives the number of test cases, T. T test cases follow. Each test case consists of a single line, containing the following space-separated elements in order:&lt;br /&gt;
&lt;br /&gt;
First an integer C, followed by C strings, each containing three characters: two base elements followed by a non-base element. This indicates that the two base elements combine to form the non-base element. Next will come an integer D, followed by D strings, each containing two characters: two base elements that are opposed to each other. Finally there will be an integer N, followed by a single string containing N characters: the series of base elements you are to invoke. You will invoke them in the order they appear in the string (leftmost character first, and so on), one at a time.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is a list in the format "[e0, e1, ...]" where ei is the ith element of the final element list. Please see the sample output for examples.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
1 ≤ T ≤ 100.&lt;br /&gt;
Each pair of base elements may only appear together in one combination, though they may appear in a combination and also be opposed to each other.&lt;br /&gt;
No base element may be opposed to itself.&lt;br /&gt;
Unlike in the computer game Magicka, there is no limit to the length of the element list.&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
-------------&lt;br /&gt;
0 ≤ C ≤ 1.&lt;br /&gt;
0 ≤ D ≤ 1.&lt;br /&gt;
1 ≤ N ≤ 10.&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
-------------&lt;br /&gt;
0 ≤ C ≤ 36.&lt;br /&gt;
0 ≤ D ≤ 28.&lt;br /&gt;
1 ≤ N ≤ 100.&lt;br /&gt;
&lt;br /&gt;
Sample Input &lt;br /&gt;
------------&lt;br /&gt;
5&lt;br /&gt;
0 0 2 EA&lt;br /&gt;
1 QRI 0 4 RRQR&lt;br /&gt;
1 QFT 1 QF 7 FAQFDFQ&lt;br /&gt;
1 EEZ 1 QE 7 QEEEERA&lt;br /&gt;
0 1 QW 2 QW&lt;br /&gt;
  &lt;br /&gt;
Output &lt;br /&gt;
------&lt;br /&gt;
Case #1: [E, A]&lt;br /&gt;
Case #2: [R, I, R]&lt;br /&gt;
Case #3: [F, D, T]&lt;br /&gt;
Case #4: [Z, E, R, A]&lt;br /&gt;
Case #5: []&lt;br /&gt;
&lt;/blockquote&gt;&lt;/font color&gt;&lt;br /&gt;
&lt;br /&gt;
This problem can be easily coded, if you can use some efficient data structures to look up, which elements when invoked merge and which elements oppose each other. The problem requirements should also be carefully read and implemented, for example: "After you invoke an element, if it isn't IMMEDIATELY combined to form another element, and it is opposed to something in your element list, then your whole element list will be cleared."&lt;br /&gt;
&lt;br /&gt;
First off, when parsing the input, I'm using Java's HashMap data structures to build a convenient data structure to look up, which elements oppose and which elements combine to form an other element. The code to build these data structures, is as below:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;String[] splitString = line.split(&amp;quot; &amp;quot;);
int index = 0;
int num1 = Integer.parseInt(splitString[index]);
HashMap&amp;lt;String, String&amp;gt; mergeMap = new HashMap&amp;lt;String, String&amp;gt;();
          
for(int i=0;i&amp;lt;num1;i++) {
  index++;
  String str = splitString[index];
  String sub1 = str.substring(0,2);
  String sub2 = str.substring(2);

  mergeMap.put(sub1, sub2);
  mergeMap.put(sub1.charAt(1) + &amp;quot;&amp;quot; + sub1.charAt(0), sub2);
}
          
index++;
int num2 = Integer.parseInt(splitString[index]);
HashMap&amp;lt;String, ArrayList&amp;lt;String&amp;gt;&amp;gt; opposingMap = new HashMap&amp;lt;String, ArrayList&amp;lt;String&amp;gt;&amp;gt;();
          
for(int i=0;i&amp;lt;num2;i++) {
  index++;
  String str = splitString[index];
  String sub1 = &amp;quot;&amp;quot; + str.charAt(0);
  String sub2 = &amp;quot;&amp;quot; + str.charAt(1);
            
  if(opposingMap.containsKey(sub1)) {
     opposingMap.get(sub1).add(sub2);
  } else {
     ArrayList&amp;lt;String&amp;gt; keyList = new ArrayList&amp;lt;String&amp;gt;();
     keyList.add(sub2);

     opposingMap.put(sub1, keyList);
  }

  if(opposingMap.containsKey(sub2)) {
     opposingMap.get(sub2).add(sub1);
  } else {
     ArrayList&amp;lt;String&amp;gt; keyList = new ArrayList&amp;lt;String&amp;gt;();
     keyList.add(sub1);

     opposingMap.put(sub2, keyList);
  }
}

index++;
int invokeStringLength = Integer.parseInt(splitString[index]); 
          
index++;
String invokeString = splitString[index];
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
And...with the above input, I'm using the below code, for solving the problem:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*;
import java.io.*;

public class Magicka {
 public String castAspell(HashMap&amp;ltString, String&amp;gt mergeMap, HashMap&amp;ltString, ArrayList&amp;ltString&amp;gt&amp;gt opposingMap, String invokeString,         int invokeStringLength) {
  StringBuilder sbOutput = new StringBuilder("" + invokeString.charAt(0));

  for(int i=1;i&amp;ltinvokeStringLength;i++) {
   int len = sbOutput.length();
   if(len &gt; 0) {
    int pos = sbOutput.length() - 1;
    String str1 = "" + sbOutput.charAt(pos);
    String str2 = "" + invokeString.charAt(i);

    if(mergeMap.containsKey(str1+str2) || mergeMap.containsKey(str2+str1)) {     
     sbOutput.deleteCharAt(pos);
     sbOutput.append(mergeMap.get(str1+str2));
     continue;
    } else {
     String tempStr = sbOutput.toString();
     Iterator iter = opposingMap.entrySet().iterator();
     boolean flag = false;

     while (iter.hasNext()) {
      Map.Entry pair = (Map.Entry) iter.next();
      String key = (String) pair.getKey();
      ArrayList&amp;ltString&amp;gt keyList = (ArrayList&amp;ltString&amp;gt) pair.getValue();
      
      if(tempStr.indexOf(key) &gt;= 0) {
       for(String value: keyList) {
        if(str2.indexOf(value) &gt;= 0) {
         sbOutput.delete(0, len);
         flag = true;
        }
       }
      }

      if(flag) {
       break;
      }
     }
     
     if(!flag) {
      sbOutput.append(", " + invokeString.charAt(i));
     }
    }
   } else {
    sbOutput.append(invokeString.charAt(i));
   }
  }

  return "[" + sbOutput.toString() + "]";
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-4560523911177635177?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/tdckg2IsPEQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/tdckg2IsPEQ/gcj-2011-magicka.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2011/05/gcj-2011-magicka.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-6192940678338054673</guid><pubDate>Sun, 08 May 2011 21:46:00 +0000</pubDate><atom:updated>2011-05-08T23:47:29.964+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">bot trust problem</category><category domain="http://www.blogger.com/atom/ns#">programming puzzles</category><category domain="http://www.blogger.com/atom/ns#">gcj 2011</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2011</category><title>GCJ 2011 - Bot Trust</title><description>Below is the description of a problem called 'Bot Trust', from 'Google Code Jam - 2011':&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;font color="green"&gt;&lt;br /&gt;
Problem&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
Blue and Orange are friendly robots. An evil computer mastermind has locked them up in separate hallways to test them, and then possibly give them cake.&lt;br /&gt;
&lt;br /&gt;
Each hallway contains 100 buttons labeled with the positive integers {1, 2, ..., 100}. Button k is always k meters from the start of the hallway, and the robots both begin at button 1. Over the period of one second, a robot can walk one meter in either direction, or it can press the button at its position once, or it can stay at its position and not press the button. To complete the test, the robots need to push a certain sequence of buttons in a certain order. Both robots know the full sequence in advance. How fast can they complete it?&lt;br /&gt;
&lt;br /&gt;
For example, let's consider the following button sequence:&lt;br /&gt;
&lt;br /&gt;
O 2, B 1, B 2, O 4&lt;br /&gt;
&lt;br /&gt;
Here, O 2 means button 2 in Orange's hallway, B 1 means button 1 in Blue's hallway, and so on. The robots can push this sequence of buttons in 6 seconds using the strategy shown below:&lt;br /&gt;
&lt;br /&gt;
Time | Orange           | Blue&lt;br /&gt;
-----+------------------+-----------------&lt;br /&gt;
1  | Move to button 2 | Stay at button 1&lt;br /&gt;
2  | Push button 2    | Stay at button 1&lt;br /&gt;
3  | Move to button 3 | Push button 1&lt;br /&gt;
4  | Move to button 4 | Move to button 2&lt;br /&gt;
5  | Stay at button 4 | Push button 2&lt;br /&gt;
6  | Push button 4    | Stay at button 2&lt;br /&gt;
Note that Blue has to wait until Orange has completely finished pushing O 2 before it can start pushing B 1.&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of the input gives the number of test cases, T. T test cases follow.&lt;br /&gt;
&lt;br /&gt;
Each test case consists of a single line beginning with a positive integer N, representing the number of buttons that need to be pressed. This is followed by N terms of the form "Ri Pi" where Ri is a robot color (always 'O' or 'B'), and Pi is a button position.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the minimum number of seconds required for the robots to push the given buttons, in order.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
1 ≤ Pi ≤ 100 for all i.&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ T ≤ 20.&lt;br /&gt;
1 ≤ N ≤ 10.&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ T ≤ 100.&lt;br /&gt;
1 ≤ N ≤ 100.&lt;br /&gt;
&lt;br /&gt;
Sample Input &lt;br /&gt;
------------&lt;br /&gt;
3&lt;br /&gt;
4 O 2 B 1 B 2 O 4&lt;br /&gt;
3 O 5 O 8 B 100&lt;br /&gt;
2 B 2 B 1&lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------&lt;br /&gt;
Case #1: 6&lt;br /&gt;
Case #2: 100&lt;br /&gt;
Case #3: 4&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
The solution to the problem can be easily coded, after understanding the fact that the robot (which was not scheduled to press the switch) can freely move to it's destination (next switch), so as to make the time required to solve the problem, as minimal as possible. Both the robots start at 1. So, for example, if one robot has to press the switch at 10 (first move), it takes 9 seconds (10 - 1) to move and 1 to press the switch...So, it takes a total of 10 seconds...In these 10 seconds, the other robot can move as long as possible and stay-put there, waiting for its turn. I used Java datastructures 'Queue' and 'Deque' to solve the problem. Below is my solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*;
import java.io.*;

public class BotTrust {
 private int findMin(String inputLine) {
  int index = 0;
  String[] splitString = inputLine.split(" ");
  int n = Integer.parseInt(splitString[index++]);
  Queue&amp;ltString&amp;gt orderQueue = new LinkedList&amp;ltString&amp;gt();
  Deque&amp;ltInteger&amp;gt orangeQueue =  new ArrayDeque&amp;ltInteger&amp;gt();
  Deque&amp;ltInteger&amp;gt blueQueue = new ArrayDeque&amp;ltInteger&amp;gt();

  for(int i=0;i&amp;ltn;i++) {
   String robot = splitString[index++];
   orderQueue.add(robot);

   if(robot.equals("O")) {
    orangeQueue.add(Integer.parseInt(splitString[index++]));
   } else {
    blueQueue.add(Integer.parseInt(splitString[index++]));
   }      
  }

  int res = 0;
  int orangePos = 1;
  int bluePos = 1;
  
  while(true) {
   if(orderQueue.isEmpty()) {
    break;
   }
   String robot = (String) orderQueue.remove();   
   
   if(robot.equals("O")) {
    int orangeSwitch = (Integer) orangeQueue.removeFirst();
    int orangeTimeRequired = Math.abs(orangeSwitch - orangePos) + 1;
    res += orangeTimeRequired;
    orangePos = orangeSwitch;    
    
    if(!blueQueue.isEmpty()) {
     int blueSwitch = blueQueue.removeFirst();
     blueQueue.addFirst(blueSwitch);
     int blueTimeRequired = Math.abs(blueSwitch - bluePos);
     if(blueTimeRequired &gt;= orangeTimeRequired) {
      bluePos = (blueSwitch &gt; bluePos) ? (bluePos + orangeTimeRequired) : (bluePos - orangeTimeRequired);
     } else {
      bluePos = blueSwitch;
     }
    }    
   } else {
    int blueSwitch = (Integer) blueQueue.removeFirst();
    int blueTimeRequired = Math.abs(blueSwitch - bluePos) + 1;
    res += blueTimeRequired;
    bluePos = blueSwitch;
    
    if(!orangeQueue.isEmpty()) {
     int orangeSwitch = orangeQueue.removeFirst();
     orangeQueue.addFirst(orangeSwitch);
     int orangeTimeRequired = Math.abs(orangeSwitch - orangePos);
     if(orangeTimeRequired &gt;= blueTimeRequired) {
      orangePos = (orangeSwitch &gt; orangePos) ? (orangePos + blueTimeRequired) : (orangePos - blueTimeRequired);
     } else {
      orangePos = orangeSwitch;
     }
    }    
   }
  }

  return res;
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-6192940678338054673?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/mLvECDECf3A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/mLvECDECf3A/gcj-2011-bot-trust.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>2</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2011/05/gcj-2011-bot-trust.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-5526473627482371371</guid><pubDate>Mon, 10 May 2010 23:52:00 +0000</pubDate><atom:updated>2011-03-18T23:28:35.741+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google code jam 2010</category><category domain="http://www.blogger.com/atom/ns#">greatest common divisor</category><category domain="http://www.blogger.com/atom/ns#">gcj 2010</category><category domain="http://www.blogger.com/atom/ns#">fair warning problem</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth</category><category domain="http://www.blogger.com/atom/ns#">prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><title>GCJ 2010 - Fair Warning</title><description>Below is the description of a problem called 'Fair Warning', from 'Google Code Jam - 2010':&lt;br /&gt;
&lt;blockquote&gt;&lt;font color="green"&gt;&lt;br /&gt;
Problem&lt;br /&gt;
-------&lt;br /&gt;
On our planet, Jamcode IX, three Great Events occurred. They happened 26000, 11000 and 6000 slarboseconds ago. In 4000 slarboseconds, the amount of time since all of those events will be multiples of 5000 slarboseconds, the largest possible amount... and the apocalypse will come.&lt;br /&gt;
&lt;br /&gt;
Luckily for you, you live on Jamcode X! The apocalypse came on Jamcode IX less than a year ago. But Jamcode X has a worrying prophecy: "After the moment of reckoning, on the first optimum anniversary of the N Great Events, the apocalypse will come. 64 bits will not save you. You have been warned."&lt;br /&gt;
&lt;br /&gt;
The people of Jamcode X are very concerned by this prophecy. All of the Great Events have already happened, and their times have been measured to the nearest slarbosecond; but nobody knows when their optimum anniversary will occur. After studying the diary of a scientist from Jamcode IX, scientists working on the problem have come up with a theory:&lt;br /&gt;
&lt;br /&gt;
The moment of reckoning is now, the moment you solve this problem. At some time y ≥ 0 slarboseconds from now, the number of slarboseconds since each of the Great Events will be divisible by some maximum number T. If you can find the smallest value of y that gives this largest possible T, that will give you the optimum anniversary when the apocalypse will come.&lt;br /&gt;
&lt;br /&gt;
On Jamcode IX, for example, there were 3 Great Events and they happened 26000, 11000 and 6000 slarboseconds before the moment of reckoning. 4000 slarboseconds later, the amount of time since each event was a multiple of T=5000 slarboseconds, and the apocalypse came.&lt;br /&gt;
&lt;br /&gt;
Your job is to compute the amount of time until the apocalypse comes. But remember the prophecy: even though the people of Jamcode X have been solving problems for two years, and 64-bit integers have always been enough, they might not always be enough now or in the future.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
-----&lt;br /&gt;
The first line of the input gives the number of test cases, C. C lines follow. Each starts with a single integer N, which is followed by a space and then N space-separated integers ti, the number of slarboseconds since Great Event i occurred.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
------&lt;br /&gt;
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the minimum number of slarboseconds until ti + y is a multiple of the largest possible integer factor T for all i.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
------&lt;br /&gt;
1 ≤ C ≤ 100.&lt;br /&gt;
ti ≠ tj for some i, j.&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
-------------&lt;br /&gt;
2 ≤ N ≤ 3.&lt;br /&gt;
1 ≤ ti ≤ 108.&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
-------------&lt;br /&gt;
2 ≤ N ≤ 1000.&lt;br /&gt;
1 ≤ ti ≤ 1050.&lt;br /&gt;
&lt;br /&gt;
Sample Input &lt;br /&gt;
------------ &lt;br /&gt;
3&lt;br /&gt;
3 26000000 11000000 6000000&lt;br /&gt;
3 1 10 11&lt;br /&gt;
2 800000000000000000001 900000000000000000001&lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------ &lt;br /&gt;
Case #1: 4000000&lt;br /&gt;
Case #2: 0&lt;br /&gt;
Case #3: 99999999999999999999&lt;br /&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;
Below is my java solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*;
import java.math.BigInteger;

public class FairWarning {
public BigInteger nextApocalypseParty(int n, ArrayList&amp;ltbiginteger&amp;gt numberList) {
Collections.sort(numberList);
BigInteger smallest = numberList.get(0);
BigInteger gcdBigInt = new BigInteger("0");  

for(int i=1;i&amp;lt;n;i++) { 
   gcdBigInt = gcdBigInt.gcd(numberList.get(i).subtract(numberList.get(i-1)));
   if(gcdBigInt.equals(BigInteger.ONE)) return BigInteger.ZERO;
  }

  return ((((smallest.add(gcdBigInt)).subtract(BigInteger.ONE)).divide(gcdBigInt)).multiply(gcdBigInt)).subtract(smallest);
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-5526473627482371371?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/fhmXfaYdDkU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/fhmXfaYdDkU/gcj-2010-fair-warning.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/05/gcj-2010-fair-warning.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-5514193050350423615</guid><pubDate>Sun, 09 May 2010 16:28:00 +0000</pubDate><atom:updated>2011-03-18T23:29:57.352+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">snapper chain problem</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2010</category><category domain="http://www.blogger.com/atom/ns#">gcj 2010</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth</category><category domain="http://www.blogger.com/atom/ns#">prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><title>GCJ 2010 - Snapper Chain</title><description>Below is the description of a problem called 'Snapper Chain', from the 'Google Code Jam - 2010':&lt;br /&gt;
&lt;font color="green"&gt;&lt;br /&gt;
&lt;blockquote&gt;Problem&lt;br /&gt;
&lt;br /&gt;
The Snapper is a clever little device that, on one side, plugs its input plug into an output socket, and, on the other side, exposes an output socket for plugging in a light or other device.&lt;br /&gt;
&lt;br /&gt;
When a Snapper is in the ON state and is receiving power from its input plug, then the device connected to its output socket is receiving power as well. When you snap your fingers -- making a clicking sound -- any Snapper receiving power at the time of the snap toggles between the ON and OFF states.&lt;br /&gt;
&lt;br /&gt;
In hopes of destroying the universe by means of a singularity, I have purchased N Snapper devices and chained them together by plugging the first one into a power socket, the second one into the first one, and so on. The light is plugged into the Nth Snapper.&lt;br /&gt;
&lt;br /&gt;
Initially, all the Snappers are in the OFF state, so only the first one is receiving power from the socket, and the light is off. I snap my fingers once, which toggles the first Snapper into the ON state and gives power to the second one. I snap my fingers again, which toggles both Snappers and then promptly cuts power off from the second one, leaving it in the ON state, but with no power. I snap my fingers the third time, which toggles the first Snapper again and gives power to the second one. Now both Snappers are in the ON state, and if my light is plugged into the second Snapper it will be on.&lt;br /&gt;
&lt;br /&gt;
I keep doing this for hours. Will the light be on or off after I have snapped my fingers K times? The light is on if and only if it's receiving power from the Snapper it's plugged into.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of the input gives the number of test cases, T. T lines follow. Each one contains two integers, N and K.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "ON" or "OFF", indicating the state of the light bulb.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
1 ≤ T ≤ 10,000.&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ N ≤ 10;&lt;br /&gt;
0 ≤ K ≤ 100;&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ N ≤ 30;&lt;br /&gt;
0 ≤ K ≤ 108;&lt;br /&gt;
&lt;br /&gt;
Sample Input &lt;br /&gt;
------------ &lt;br /&gt;
4&lt;br /&gt;
1 0&lt;br /&gt;
1 1&lt;br /&gt;
4 0&lt;br /&gt;
4 47&lt;br /&gt;
&lt;br /&gt;
Sample Output &lt;br /&gt;
-------------&lt;br /&gt;
Case #1: OFF&lt;br /&gt;
Case #2: ON&lt;br /&gt;
Case #3: OFF&lt;br /&gt;
Case #4: ON&lt;br /&gt;
&lt;/blockquote&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
The description of the problem might be a bit confusing, but if you spend some time and clearly understand about what it really wants, then its really easy to code the solution for that. In my case, I wrote it down on paper and looked at the pattern of the snappers, for different values of n (number of snapper devices)....After looking at the different patterns, it was easy for me to figure out that the number of minimum snaps required to power the end device is equal to "(2 power n) - 1". Ok, this is just the minimum number of snaps! After the minimum number of snaps, it takes 1 snap to totally power off all the snappers...and it again takes "minimum number of snaps', to power the end device. So, after the 'minimum number of snaps', it takes (2 power n) to power the end device. Below is the solution, that I coded in Java:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;public class Snapper {
 private String findDeviceStatus(double numOfSnappers, double numOfSnaps) {
  if(numOfSnaps == 0) return "OFF";
  double minRequiredSnaps = Math.pow(2, numOfSnappers) - 1;
  if(numOfSnaps &lt; minRequiredSnaps) return "OFF";

  return (minRequiredSnaps == numOfSnaps || ((numOfSnaps % (minRequiredSnaps + 1)) == minRequiredSnaps)) ? "ON" : "OFF";
 }
}
&lt;/pre&gt;
&lt;br /&gt;
The solution for this problem can be coded in different ways...In the 'Content Analysis' section of Code Jam site, there is another interesting solution of using XOR operation of bits.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-5514193050350423615?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/Mc0zpey0KvM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/Mc0zpey0KvM/gcj-2010-snapper-chain.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/05/gcj-2010-snapper-chain.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-733513818675458295</guid><pubDate>Sat, 10 Apr 2010 21:21:00 +0000</pubDate><atom:updated>2011-03-18T23:32:26.413+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google algorithms</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2010</category><category domain="http://www.blogger.com/atom/ns#">Prashanth</category><category domain="http://www.blogger.com/atom/ns#">java algorithms</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><title>Odd Man Out - GCJ 2010 (Africa)</title><description>Below is the problem statement of 'Odd Man Out' problem, from 'Google Code Jam 2010 (Africa)':&lt;br /&gt;
&lt;blockquote&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;
Problem&lt;br /&gt;
-------&lt;br /&gt;
You are hosting a party with G guests and notice that there is an odd number of guests! When planning the party you deliberately invited only couples and gave each couple a unique number C on their invitation. You would like to single out whoever came alone by asking all of the guests for their invitation numbers.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
-----&lt;br /&gt;
The first line of input gives the number of cases, N.&lt;br /&gt;
N test cases follow. For each test case there will be:&lt;br /&gt;
&lt;br /&gt;
One line containing the value G the number of guests.&lt;br /&gt;
One line containing a space-separated list of G integers. Each integer C indicates the invitation code of a guest.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
------&lt;br /&gt;
For each test case, output one line containing "Case #x: " followed by the number C of the guest who is alone.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
------&lt;br /&gt;
1 ≤ N ≤ 50&lt;br /&gt;
0 &lt; C ≤ 2147483647

Small dataset
-------------
3 ≤ G &lt; 100

Large dataset
-------------
3 ≤ G &lt; 1000

Sample Input 
------------
3
3
1 2147483647 2147483647
5
3 4 7 4 3
5
2 10 2 10 5

Output
------
Case #1: 1
Case #2: 7
Case #3: 5
&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Below is the solution coded by me in Java:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*;
import java.io.*;

public class OddManOut {
public String getTheOddOneOut(String lineWithNumbers, int numberCount) {
String[] numberArr = lineWithNumbers.split("[ ]");
Arrays.sort(numberArr);
ArrayList&amp;ltstring&amp;gt list1 = new ArrayList&amp;ltstring&amp;gt();

for(int index=0;index&amp;ltnumberCount;index++) {
   String strNumber = numberArr[index];
      
   if((index%2) == 0 &amp;&amp; index != (numberCount - 1)) {    
    list1.add(strNumber);
   } else if(!list1.contains(strNumber)) {    
    if(index == (numberCount - 1) || !strNumber.equals(numberArr[index + 1])) {
     return strNumber;
    } else {
     return list1.get(list1.size() - 1);
    }    
   }
  }

  return null;
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-733513818675458295?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/s0Bbij9bBWU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/s0Bbij9bBWU/odd-man-out-gcj-2010-africa.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/04/odd-man-out-gcj-2010-africa.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-4630994377603384802</guid><pubDate>Thu, 25 Mar 2010 20:37:00 +0000</pubDate><atom:updated>2011-03-18T23:33:35.674+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming puzzles</category><category domain="http://www.blogger.com/atom/ns#">store credit problem</category><category domain="http://www.blogger.com/atom/ns#">africa</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2010</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth</category><title>Store Credit - GCJ 2010 (Africa)</title><description>Below is the 'Store Credit' problem statement from the qualification round of Google Code Jam 2010 - Africa: &lt;br /&gt;
&lt;font color="green"&gt; &lt;br /&gt;
&lt;blockquote&gt;Problem &lt;br /&gt;
------- &lt;br /&gt;
You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to buy two items that add up to the entire value of the credit. The solution you provide will consist of the two integers indicating the positions of the items in your list (smaller number first). &lt;br /&gt;
&lt;br /&gt;
Input &lt;br /&gt;
----- &lt;br /&gt;
The first line of input gives the number of cases, N. N test cases follow. For each test case there will be: &lt;br /&gt;
&lt;br /&gt;
One line containing the value C, the amount of credit you have at the store. &lt;br /&gt;
One line containing the value I, the number of items in the store. &lt;br /&gt;
One line containing a space separated list of I integers. Each integer P indicates the price of an item in the store. &lt;br /&gt;
Each test case will have exactly one solution. &lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------ &lt;br /&gt;
For each test case, output one line containing "Case #x: " followed by the indices of the two items whose price adds up to the store credit. The lower index should be output first. &lt;br /&gt;
&lt;br /&gt;
Limits &lt;br /&gt;
------ &lt;br /&gt;
5 ≤ C ≤ 1000 &lt;br /&gt;
1 ≤ P ≤ 1000 &lt;br /&gt;
&lt;br /&gt;
Small dataset &lt;br /&gt;
------------- &lt;br /&gt;
N = 10 &lt;br /&gt;
3 ≤ I ≤ 100 &lt;br /&gt;
&lt;br /&gt;
Large dataset &lt;br /&gt;
------------- &lt;br /&gt;
N = 50 &lt;br /&gt;
3 ≤ I ≤ 2000 &lt;br /&gt;
&lt;br /&gt;
Sample Input  &lt;br /&gt;
------------ &lt;br /&gt;
3 &lt;br /&gt;
100 &lt;br /&gt;
3 &lt;br /&gt;
5 75 25 &lt;br /&gt;
200 &lt;br /&gt;
7 &lt;br /&gt;
150 24 79 50 88 345 3 &lt;br /&gt;
8 &lt;br /&gt;
8 &lt;br /&gt;
2 1 9 4 4 56 90 3 &lt;br /&gt;
&lt;br /&gt;
Output  &lt;br /&gt;
------ &lt;br /&gt;
Case #1: 2 3 &lt;br /&gt;
Case #2: 1 4 &lt;br /&gt;
Case #3: 4 5 &lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;/font&gt; &lt;br /&gt;
&lt;br /&gt;
This is one of the easiest problems, I've ever seen in a programming competition. Below is the solution in Java: &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;public class StoreCredit { 
public String buyTwo(int price, int numOfItems, int[] itemPrices) { 
for(int i=0;i&amp;ltnumOfItems;i++) {
for(int j=0;j&amp;ltnumOfItems;j++) {
if(i != j) { 
if(itemPrices[i] + itemPrices[j] == price) { 
return ((i + 1) + " " + (j + 1)); 
} 
} 
} 
} 

return ""; 
} 
} 
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-4630994377603384802?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/FtojWXmL8PQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/FtojWXmL8PQ/store-credit-gcj-2010-africa.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>3</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/03/store-credit-gcj-2010-africa.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-7265755165126612834</guid><pubDate>Tue, 23 Mar 2010 19:48:00 +0000</pubDate><atom:updated>2011-03-18T23:35:12.609+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">T9Spelling</category><category domain="http://www.blogger.com/atom/ns#">google coding competitions</category><category domain="http://www.blogger.com/atom/ns#">babji p chetty</category><category domain="http://www.blogger.com/atom/ns#">google algorithms</category><category domain="http://www.blogger.com/atom/ns#">africa</category><category domain="http://www.blogger.com/atom/ns#">java algorithms</category><category domain="http://www.blogger.com/atom/ns#">gcj 2010</category><title>T9Spelling - GCJ 2010 (Africa)</title><description>Below is a problem from the qualification round of 'Google Code Jam 2010 - Africa': &lt;br /&gt;
&lt;blockquote&gt;&lt;font color="green"&gt; &lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;T9Spelling&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
Problem &lt;br /&gt;
------- &lt;br /&gt;
The Latin alphabet contains 26 characters and telephones only have ten digits on the keypad. We would like to make it easier to write a message to your friend using a sequence of keypresses to indicate the desired characters. The letters are mapped onto the digits as shown below. To insert the character B for instance, the program would press 22. In order to insert two characters in sequence from the same key, the user must pause before pressing the key a second time. The space character ' ' should be printed to indicate a pause. For example, 2 2 indicates AA whereas 22 indicates B. &lt;br /&gt;
&lt;br /&gt;
Input &lt;br /&gt;
----- &lt;br /&gt;
The first line of input gives the number of cases, N. N test cases follow. Each case is a line of text formatted as: &lt;br /&gt;
&lt;br /&gt;
desired_message &lt;br /&gt;
&lt;br /&gt;
Each message will consist of only lowercase characters a-z and space characters ' '. Pressing zero emits a space. &lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------ &lt;br /&gt;
For each test case, output one line containing "Case #x: " followed by the message translated into the sequence of keypresses. &lt;br /&gt;
&lt;br /&gt;
Limits &lt;br /&gt;
------ &lt;br /&gt;
1 ≤ N ≤ 100. &lt;br /&gt;
&lt;br /&gt;
Small dataset &lt;br /&gt;
------------- &lt;br /&gt;
1 ≤ length of message in characters ≤ 15. &lt;br /&gt;
&lt;br /&gt;
Large dataset &lt;br /&gt;
------------- &lt;br /&gt;
1 ≤ length of message in characters ≤ 1000. &lt;br /&gt;
&lt;br /&gt;
Sample Input  &lt;br /&gt;
------------ &lt;br /&gt;
4 &lt;br /&gt;
hi &lt;br /&gt;
yes &lt;br /&gt;
foo  bar &lt;br /&gt;
hello world &lt;br /&gt;
&lt;br /&gt;
Output  &lt;br /&gt;
------ &lt;br /&gt;
Case #1: 44 444 &lt;br /&gt;
Case #2: 999337777 &lt;br /&gt;
Case #3: 333666 6660 022 2777 &lt;br /&gt;
Case #4: 4433555 555666096667775553 &lt;br /&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
There's also a pictorial representation of the problem statement, which I didn't attach to this post. If you want, you can check the link: &lt;a href="http://code.google.com/codejam/contest/dashboard?c=351101#s=p2"&gt;GCJ 2010 - T9Spelling&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
The solution for the above problem is pretty easy. Below is my Java solution: &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*; 
import java.io.*; 

public class T9Spelling {  
public String translate(String phrase) { 
HashMap&lt;String, String&gt; alphaMap = getKeypadDictionary(); 

StringBuilder sbTranslatedMessage = new StringBuilder(); 
for(int i=0;i&amp;ltphrase.length();i++) {
if(i != 0) { 
String str1 = alphaMap.get("" + phrase.charAt(i-1)); 
String str2 = alphaMap.get("" + phrase.charAt(i)); 

sbTranslatedMessage.append((str1.charAt(0) == str2.charAt(0)) ? " " + alphaMap.get("" + phrase.charAt(i)) : 
alphaMap.get("" + phrase.charAt(i))); 
} else { 
sbTranslatedMessage.append(alphaMap.get("" + phrase.charAt(i))); 
} 
} 

return sbTranslatedMessage.toString(); 
} 

private HashMap&lt;String, String&gt; getKeypadDictionary() { 
HashMap&amp;ltString, String&amp;gt alphaMap = new HashMap&amp;ltString, String&amp;gt(); 

alphaMap.put(" ", "0"); 

alphaMap.put("a", "2"); 
alphaMap.put("b", "22"); 
alphaMap.put("c", "222"); 
alphaMap.put("d", "3"); 
alphaMap.put("e", "33"); 
alphaMap.put("f", "333"); 
alphaMap.put("g", "4"); 
alphaMap.put("h", "44"); 
alphaMap.put("i", "444"); 
alphaMap.put("j", "5"); 
alphaMap.put("k", "55"); 
alphaMap.put("l", "555"); 
alphaMap.put("m", "6"); 
alphaMap.put("n", "66"); 
alphaMap.put("o", "666"); 
alphaMap.put("p", "7"); 
alphaMap.put("q", "77"); 
alphaMap.put("r", "777"); 
alphaMap.put("s", "7777"); 
alphaMap.put("t", "8"); 
alphaMap.put("u", "88"); 
alphaMap.put("v", "888"); 
alphaMap.put("w", "9"); 
alphaMap.put("x", "99"); 
alphaMap.put("y", "999"); 
alphaMap.put("z", "9999"); 

return alphaMap; 
} 
} 
&lt;/pre&gt;&lt;br /&gt;
The solution for the above problem can be coded in a couple of other creative ways, but the above solution is fast and works good enough, although it has a trade-off in memory complexity (in the form of HashMap).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-7265755165126612834?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/cLNqQXpmcCY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/cLNqQXpmcCY/t9spelling-gcj-2010-africa.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/03/t9spelling-gcj-2010-africa.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-5161431732618473897</guid><pubDate>Tue, 23 Mar 2010 19:23:00 +0000</pubDate><atom:updated>2011-03-18T23:36:07.701+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">code jam africa</category><category domain="http://www.blogger.com/atom/ns#">programming puzzles</category><category domain="http://www.blogger.com/atom/ns#">google code jam 2010</category><category domain="http://www.blogger.com/atom/ns#">algorithm competitions</category><category domain="http://www.blogger.com/atom/ns#">gcj 2010</category><category domain="http://www.blogger.com/atom/ns#">reverse words problem</category><category domain="http://www.blogger.com/atom/ns#">coding competitions</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><title>Reverse Words - GCJ 2010 (Africa)</title><description>Below is a problem statement from the 'Google African Code Jam' (which is happening, at the moment):&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;&lt;font color="green"&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;Reverse Words&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Problem&lt;br /&gt;
-------&lt;br /&gt;
Given a list of space separated words, reverse the order of the words. Each line of text contains L letters and W words. A line will only consist of letters and space characters. There will be exactly one space character between each pair of consecutive words.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
-----&lt;br /&gt;
The first line of input gives the number of cases, N.&lt;br /&gt;
N test cases follow. For each test case there will a line of letters and space characters indicating a list of space separated words. Spaces will not appear at the start or end of a line.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
------&lt;br /&gt;
For each test case, output one line containing "Case #x: " followed by the list of words in reverse order.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
------&lt;br /&gt;
Small dataset&lt;br /&gt;
-------------&lt;br /&gt;
N = 5&lt;br /&gt;
1 ≤ L ≤ 25&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
-------------&lt;br /&gt;
N = 100&lt;br /&gt;
1 ≤ L ≤ 1000&lt;br /&gt;
&lt;br /&gt;
Sample Input &lt;br /&gt;
------------&lt;br /&gt;
3&lt;br /&gt;
this is a test&lt;br /&gt;
foobar&lt;br /&gt;
all your base&lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------&lt;br /&gt;
Case #1: test a is this&lt;br /&gt;
Case #2: foobar&lt;br /&gt;
Case #3: base your all&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The solution for the above problem is pretty easy. Below is my solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.*;
import java.io.*;

public class ReverseWords {
public String reverseWords(String phrase) {
List&amp;ltstring&amp;gt wordList = Arrays.asList(phrase.split("[ ]"));
Collections.reverse(wordList);

StringBuilder sbReverseString = new StringBuilder();
for(String word: wordList) {
sbReverseString.append(word + " ");
}

return sbReverseString.substring(0, sbReverseString.length() - 1);
}
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-5161431732618473897?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/sfMfmbyJMUo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/sfMfmbyJMUo/reverse-words-gcj-2010-africa.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>3</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2010/03/reverse-words-gcj-2010-africa.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-2899087058493825594</guid><pubDate>Sun, 13 Sep 2009 14:36:00 +0000</pubDate><atom:updated>2011-03-18T23:37:15.773+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google algorithms</category><category domain="http://www.blogger.com/atom/ns#">akgorithm solutions</category><category domain="http://www.blogger.com/atom/ns#">All your base</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">Google code jam solutions</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><category domain="http://www.blogger.com/atom/ns#">number system and bases</category><title>All Your Base - GCJ 2009</title><description>First off, Welcome...and AYBABTU...I mean "&lt;a href="http://en.wikipedia.org/wiki/All_your_base_are_belong_to_us"&gt;All Your Base Are Belong To Us&lt;/a&gt;" :)&lt;br /&gt;
&lt;br /&gt;
And now...lets get serious:&lt;br /&gt;
&lt;br /&gt;
The problem listed below, is from the 'Round 1C' of Google Code Jam - 2009:&lt;br /&gt;
&lt;font color="green"&gt;&lt;br /&gt;
&lt;blockquote&gt;Problem&lt;br /&gt;
&lt;br /&gt;
In A.D. 2100, aliens came to Earth. They wrote a message in a cryptic language, and next to it they wrote a series of symbols. We've come to the conclusion that the symbols indicate a number: the number of seconds before war begins!&lt;br /&gt;
&lt;br /&gt;
Unfortunately we have no idea what each symbol means. We've decided that each symbol indicates one digit, but we aren't sure what each digit means or what base the aliens are using. For example, if they wrote "ab2ac999", they could have meant "31536000" in base 10 -- exactly one year -- or they could have meant "12314555" in base 6 -- 398951 seconds, or about four and a half days. We are sure of three things: the number is positive; like us, the aliens will never start a number with a zero; and they aren't using unary (base 1).&lt;br /&gt;
&lt;br /&gt;
Your job is to determine the minimum possible number of seconds before war begins.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of input contains a single integer, T. T test cases follow. Each test case is a string on a line by itself. The line will contain only characters in the 'a' to 'z' and '0' to '9' ranges (with no spaces and no punctuation), representing the message the aliens left us. The test cases are independent, and can be in different bases with the symbols meaning different things.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output a line in the following format:&lt;br /&gt;
&lt;br /&gt;
Case #X: V&lt;br /&gt;
Where X is the case number (starting from 1) and V is the minimum number of seconds before war begins.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
1 ≤ T ≤ 100&lt;br /&gt;
The answer will never exceed 1018&lt;br /&gt;
Small dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ the length of each line &lt; 10

Large dataset

1 ≤ the length of each line &lt; 61

Sample Input 
------------ 
3
11001001
cats
zig

Output 
-------
Case #1: 201
Case #2: 75
Case #3: 11
&lt;/blockquote&gt;&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
Coding the solution for the above problem, might sound easy, but its more trickier than what you first think. That is probably because you might understand it differently, than what the problem really wants. &lt;br /&gt;
&lt;br /&gt;
The above problem statement, requires the output to be the minimum possible number. The first step is to understand that the number would be smaller if you take the smallest possible 'Base System' for the number. To find the base system that you want, you would have to find the number of unique symbols in the input string. If there are 2 'Unique' symbols in the string, take it as 'Base 2' system. If there are 10 unique symbols, take it as 'Base 10 (Decimal)' system.....and so on. Since the 'Unary System' is not used, ignore that.&lt;br /&gt;
&lt;br /&gt;
After that, we need to find how we can make the sum, as minimal as possible. Since we don't know which digit stands for what, we have to make a decision for each symbol, so as to make the number, as small as possible. Since the left most digit carries more weight, this digit should be multiplied by the smallest digit. But since the left-most digit can't be zero (0), make it '1'. Use the Zero (0) for the second left-most digit (if there is 2nd digit in the number). Then use '2' for the third left most digit (if it is unique), '3' for the 4th left most digit (if it is unique)..and so on, unitl the end of the string with symbols. Here's the solution, that I coded in Java:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.math.BigInteger;
import java.io.*;

public class AllYourBase {  
public BigInteger convert(String str) {
BigInteger res = new BigInteger(&amp;quot;0&amp;quot;);

int base = 0;
int len = str.length();

HashMap&amp;lt;String, Integer&amp;gt; hm = new HashMap&amp;lt;String, Integer&amp;gt;();

int index = 1;

for(int i=0;i&amp;lt;len;i++) {
if(!hm.containsKey(&amp;quot;&amp;quot; + str.charAt(i))) {
if(i != 0) {
if(index == 1) {
index--;
} else if (index == 0) {
index = 2;
} else {
index++;
}
}        

hm.put(&amp;quot;&amp;quot; + str.charAt(i), new Integer(index));
base++;
}
}

if(hm.size() == 1) base = 2;

System.out.println(&amp;quot;base : &amp;quot; + base + &amp;quot; Len : &amp;quot; + len);

for(int i=0;i&amp;lt;len;i++) {
String s = str.charAt(i) + &amp;quot;&amp;quot;;

res = res.add(new BigInteger(&amp;quot;&amp;quot; + hm.get(s)).multiply(
new BigInteger(&amp;quot;&amp;quot; + base).pow(len-i-1)));
}

return res;
}  
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-2899087058493825594?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/zJMO9gpoJFM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/zJMO9gpoJFM/all-your-base-gcj-2009.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2009/09/all-your-base-gcj-2009.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-7060933853854167212</guid><pubDate>Sun, 13 Sep 2009 14:00:00 +0000</pubDate><atom:updated>2009-09-13T18:46:11.402+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google search suggestions</category><category domain="http://www.blogger.com/atom/ns#">interesting google suggestions</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">google auto filler</category><title>Interesting 'Google Suggestions'</title><description>Here are some interesting 'Google Suggestions' that you find, when you type some specific phrases : (It also shows the best of stereotypes that people have, in reality) :P&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/hD_ZVn44fKyBwH5kKrO5Qw?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh5.ggpht.com/_KT5j9JZRXjo/Sq0dYAw3J3I/AAAAAAAAZb4/pdu7_D0MmFA/s400/FireShot%20capture%20%23001%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/SM4JRhLSKxgVswAhIUpV1A?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_KT5j9JZRXjo/Sq0dY6WBOXI/AAAAAAAAZcA/dYkEN0UCVSY/s400/FireShot%20capture%20%23002%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/_44fqaOV4GeyT_2NA9IXig?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh3.ggpht.com/_KT5j9JZRXjo/Sq0dZvUveuI/AAAAAAAAZcI/SpdWOkUcNOc/s400/FireShot%20capture%20%23003%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/M9pMyA74UiKmvCHM_iuY4Q?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_KT5j9JZRXjo/Sq0db0LtdGI/AAAAAAAAZcQ/rJZT8L4B1TI/s400/FireShot%20capture%20%23004%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/ifsYjjp-kjoyAYX0L6EynA?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh3.ggpht.com/_KT5j9JZRXjo/Sq0ddPixA_I/AAAAAAAAZcY/vT0QkB9yoMg/s400/FireShot%20capture%20%23005%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/2vOVSbEsX3VmzPJ9bc_NCQ?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0decqhOoI/AAAAAAAAZcg/_RrR-TBctEc/s400/FireShot%20capture%20%23006%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/KMm34LjxmjznjbWTArgaHQ?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0dfolIx6I/AAAAAAAAZco/IHpct1Zcung/s400/FireShot%20capture%20%23007%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/LDAEWIMqLuTRxUgEpG5tsA?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0df-svpHI/AAAAAAAAZcw/F9j3rW1m17E/s400/FireShot%20capture%20%23008%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/7DdTeTUIWTPPVsJHMzF7fw?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0dgzOnCII/AAAAAAAAZc4/s9H6qNZmHSw/s400/FireShot%20capture%20%23009%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/CdQy8iV16e1tPrtnk_bRAw?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0dhS1B9dI/AAAAAAAAZdA/2IIEbHU2hiM/s400/FireShot%20capture%20%23010%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/KQn9_WSJnoLsR3Yp871D9Q?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0diB2W1tI/AAAAAAAAZdI/-3CrPFyBMQY/s400/FireShot%20capture%20%23011%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/bjl-WXIidnncub8ggTVpkQ?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_KT5j9JZRXjo/Sq0dipiq_zI/AAAAAAAAZdQ/etgvRasC3jU/s400/FireShot%20capture%20%23012%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/wa9pd50JEJ8aNHsTgb5Flg?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh5.ggpht.com/_KT5j9JZRXjo/Sq0di6qo3AI/AAAAAAAAZdY/6JHAOsdpN40/s400/FireShot%20capture%20%23013%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/Dvawr2E7sxPHKpA7byIEDA?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh3.ggpht.com/_KT5j9JZRXjo/Sq0djWG0qSI/AAAAAAAAZdg/GrrGnqYCsaI/s400/FireShot%20capture%20%23014%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/7fCLuB4mJ86n94BUUlKMcw?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_KT5j9JZRXjo/Sq0dkKAAMGI/AAAAAAAAZdo/BEF03PT6R5o/s400/FireShot%20capture%20%23015%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/GioHevwWvkaSZebn_oT-Pg?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_KT5j9JZRXjo/Sq0dkh9AMgI/AAAAAAAAZdw/IMi2i_JWWvE/s400/FireShot%20capture%20%23016%20-%20%27Google%27%20-%20www_google_com.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleSuggestions?authkey=Gv1sRgCKS5kOb776XfZQ&amp;feat=embedwebsite"&gt;Google Suggestions&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;It's somehow funny, as well as serious at the same time, to see what people have on their minds. :P You can probably find many more interesting things like this, when you type some special phrases, on Google search box.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-7060933853854167212?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/f8UJifIYgAs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/f8UJifIYgAs/interesting-google-suggestions.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_KT5j9JZRXjo/Sq0dYAw3J3I/AAAAAAAAZb4/pdu7_D0MmFA/s72-c/FireShot%20capture%20%23001%20-%20%27Google%27%20-%20www_google_com.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2009/09/interesting-google-suggestions.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-8809362751268939720</guid><pubDate>Fri, 04 Sep 2009 01:26:00 +0000</pubDate><atom:updated>2011-03-18T23:37:56.503+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google code jam 2009</category><category domain="http://www.blogger.com/atom/ns#">Alien Language</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><title>Alien Language - GCJ 2009</title><description>...Just finished the qualification round of 'Google Code Jam - 2009', passed through and just thought of posting this simple solution to the first problem, called 'Alien Language'. Here's the problem description:&lt;br /&gt;
&lt;br /&gt;
&lt;font color="green"&gt;&lt;blockquote&gt;Problem&lt;br /&gt;
&lt;br /&gt;
After years of study, scientists at Google Labs have discovered an alien language transmitted from a faraway planet. The alien language is very unique in that every word consists of exactly L lowercase letters. Also, there are exactly D words in this language.&lt;br /&gt;
&lt;br /&gt;
Once the dictionary of all the words in the alien language was built, the next breakthrough was to discover that the aliens have been transmitting messages to Earth for the past decade. Unfortunately, these signals are weakened due to the distance between our two planets and some of the words may be misinterpreted. In order to help them decipher these messages, the scientists have asked you to devise an algorithm that will determine the number of possible interpretations for a given pattern.&lt;br /&gt;
&lt;br /&gt;
A pattern consists of exactly L tokens. Each token is either a single lowercase letter (the scientists are very sure that this is the letter) or a group of unique lowercase letters surrounded by parenthesis ( and ). For example: (ab)d(dc) means the first letter is either a or b, the second letter is definitely d and the last letter is either d or c. Therefore, the pattern (ab)d(dc) can stand for either one of these 4 possibilities: add, adc, bdd, bdc.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of input contains 3 integers, L, D and N separated by a space. D lines follow, each containing one word of length L. These are the words that are known to exist in the alien language. N test cases then follow, each on its own line and each consisting of a pattern as described above. You may assume that all known words provided are unique.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output&lt;br /&gt;
&lt;br /&gt;
Case #X: K&lt;br /&gt;
where X is the test case number, starting from 1, and K indicates how many words in the alien language match the pattern.&lt;br /&gt;
&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ L ≤ 10&lt;br /&gt;
1 ≤ D ≤ 25&lt;br /&gt;
1 ≤ N ≤ 10&lt;br /&gt;
Large dataset&lt;br /&gt;
&lt;br /&gt;
1 ≤ L ≤ 15&lt;br /&gt;
1 ≤ D ≤ 5000&lt;br /&gt;
1 ≤ N ≤ 500&lt;br /&gt;
Sample Input &lt;br /&gt;
------------&lt;br /&gt;
3 5 4&lt;br /&gt;
abc&lt;br /&gt;
bca&lt;br /&gt;
dac&lt;br /&gt;
dbc&lt;br /&gt;
cba&lt;br /&gt;
(ab)(bc)(ca)&lt;br /&gt;
abc&lt;br /&gt;
(abc)(abc)(abc)&lt;br /&gt;
(zyx)bc&lt;br /&gt;
&lt;br /&gt;
Output &lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
Case #1: 2&lt;br /&gt;
Case #2: 1&lt;br /&gt;
Case #3: 3&lt;br /&gt;
Case #4: 0&lt;/blockquote&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
The solution to this problem is pretty simple, if you could figure it out, that its tailor-made for regular expressions. I used Java. So, I could create a solution, with just a couple of code statements. Here's the solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.ArrayList;
import java.io.*;

public class AlienLanguage {
public int checkPattern(ArrayList wordsAL, String pattern) {
int res = 0;

for(int i=0;i&amp;lt;wordsAL.size();i++) {
if(((String) wordsAL.get(i)).matches(
pattern.replaceAll(&amp;quot;[(]&amp;quot;,&amp;quot;[&amp;quot;).replaceAll(&amp;quot;[)]&amp;quot;,&amp;quot;]&amp;quot;))) res++;
}

return res;
}
}

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-8809362751268939720?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/JgR9VhcLGJ4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/JgR9VhcLGJ4/alien-language-gcj-2009.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>3</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2009/09/alien-language-gcj-2009.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-5424035131705508039</guid><pubDate>Sat, 15 Aug 2009 00:36:00 +0000</pubDate><atom:updated>2011-03-18T23:39:17.740+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google algorithms</category><category domain="http://www.blogger.com/atom/ns#">Google code jam 2008</category><category domain="http://www.blogger.com/atom/ns#">google code jam puzzles</category><category domain="http://www.blogger.com/atom/ns#">GCJ 2008</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">minimum scalar product</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">programming competitions</category><title>Google Code Jam 2008 - Minimum Scalar Product</title><description>Recently, I was just trying to solve some problems from GCJ - 2008 and started off with a problem, which looked pretty easy. This problem is from the 'Round 1 A' and is called 'Minimum Scalar Product'. The problem statement is as below:&lt;br /&gt;
&lt;font color="green"&gt;&lt;br /&gt;
Problem&lt;br /&gt;
&lt;br /&gt;
You are given two vectors v1=(x1,x2,...,xn) and v2=(y1,y2,...,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+...+xnyn.&lt;br /&gt;
&lt;br /&gt;
Suppose you are allowed to permute the coordinates of each vector as you wish. Choose two permutations such that the scalar product of your two new vectors is the smallest possible, and output that minimum scalar product.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&lt;br /&gt;
The first line of the input file contains integer number T - the number of test cases. For each test case, the first line contains integer number n. The next two lines contain n integers each, giving the coordinates of v1 and v2 respectively.&lt;br /&gt;
Output&lt;br /&gt;
&lt;br /&gt;
For each test case, output a line&lt;br /&gt;
&lt;br /&gt;
Case #X: Y&lt;br /&gt;
where X is the test case number, starting from 1, and Y is the minimum scalar product of all permutations of the two given vectors.&lt;br /&gt;
Limits&lt;br /&gt;
&lt;br /&gt;
Small dataset&lt;br /&gt;
&lt;br /&gt;
T = 1000&lt;br /&gt;
1 ≤ n ≤ 8&lt;br /&gt;
-1000 ≤ xi, yi ≤ 1000&lt;br /&gt;
&lt;br /&gt;
Large dataset&lt;br /&gt;
&lt;br /&gt;
T = 10&lt;br /&gt;
100 ≤ n ≤ 800&lt;br /&gt;
-100000 ≤ xi, yi ≤ 100000&lt;br /&gt;
&lt;br /&gt;
Sample Input  &lt;br /&gt;
------------&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
1 3 -5&lt;br /&gt;
-2 4 1&lt;br /&gt;
5&lt;br /&gt;
1 2 3 4 5&lt;br /&gt;
1 0 1 0 1&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
------&lt;br /&gt;
Case #1: -25&lt;br /&gt;
Case #2: 6&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
The solution for the above problem is pretty easy, as all that you gotta do, is to multiply the largest/smallest element from X-Array to smallest/largest element in Y-Array. If you are using Java, it is probable that your solution might pass through, for small input file, but not for the large one. This is because the data in the larger input file, might cause an overflow of the 'int' value. So, care should be taken to use 'BigInteger' or 'BigDecimal', instead of primitive 'int'. Here's the bare bones Java code, for that problem:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;public BigInteger findMin(String strXArr, String strYArr) {
String[] xArr = strXArr.split(&amp;quot; &amp;quot;);
String[] yArr = strYArr.split(&amp;quot; &amp;quot;);

BigInteger res = new BigInteger(&amp;quot;0&amp;quot;);

int len = xArr.length;    

int[] iXArr = new int[len];
int[] iYArr = new int[len];

for(int i=0;i&amp;lt;len;i++) {
iXArr[i] = Integer.parseInt(xArr[i]);
iYArr[i] = Integer.parseInt(yArr[i]);
}

Arrays.sort(iXArr);
Arrays.sort(iYArr);

for(int i=0;i&amp;lt;len;i++) {                  
res = res.add((new BigInteger(&amp;quot;&amp;quot; + iXArr[i])).multiply(new BigInteger(&amp;quot;&amp;quot; + iYArr[len-1-i])));      
}

return res;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
After reading the input from the file, I pass the X-Array (v1) and Y-Array (v2), to the above method, get the result and write back to the output file. Thats it! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-5424035131705508039?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/mZTVI1-SoKA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/mZTVI1-SoKA/google-cod-jam-2008-minimum-scalar.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2009/08/google-cod-jam-2008-minimum-scalar.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-3022254406479036371</guid><pubDate>Sun, 12 Oct 2008 00:12:00 +0000</pubDate><atom:updated>2009-05-16T13:20:11.795+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Schweiz</category><category domain="http://www.blogger.com/atom/ns#">Google Zurich</category><category domain="http://www.blogger.com/atom/ns#">Google events</category><category domain="http://www.blogger.com/atom/ns#">Brandschenke strasse</category><category domain="http://www.blogger.com/atom/ns#">Liechenstein</category><category domain="http://www.blogger.com/atom/ns#">Open Source Jam</category><category domain="http://www.blogger.com/atom/ns#">Germany</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">nuremberg</category><category domain="http://www.blogger.com/atom/ns#">Google development centre</category><category domain="http://www.blogger.com/atom/ns#">Zurich Google office</category><category domain="http://www.blogger.com/atom/ns#">Switzerland</category><title>Open Source Jam - Google Zurich</title><description>Last Thursday (Oct 2), I happened to be there at Google office in Zurich, Switzerland for the 'Zurich Open Source Jam' event, for just a couple of hours and also got to see the office, which is said to be one of the best places to work (with all the work done and the facilities/benefits provided). Its also said to be the Google's biggest R&amp;D centre, outside US of A.&lt;br /&gt;&lt;br /&gt;I spent a couple of hours there, listening to the presentations given by a couple of other developers from Zurich and its surroundings. I haven't been to many events like that before and so, I planned on this event and also thought of spending the weekend, looking around Zurich and some other places in Switzerland and Liechenstein (although it was my third entry into Switzerland).&lt;br /&gt;&lt;br /&gt;I started working early in the morning, on Thursday (Oct 2) and took off from work in the afternoon (Friday was a holiday, as it was German Re-Unification Day) and set off to Zurich, by the German ICE train. After reachin' Zurich, I went directly to the Google office, with my huge backpack. After checkin' in and signin' an NDA, I was there for a couple or hours, listening to the presentations given by a couple of developers. It was ok, nothing interesting. I just thought that it would be a nice experience and will get to know what other guys are tryin' to do and get to know the perspective and come up with my own ideas (if any) and try to do something. I'm more interested in the math, algorithms, Java, AJAX, js, scripting languages or any other creative stuff. &lt;br /&gt;&lt;br /&gt;Most of the guys who attended were pretty young. Some are studying at ETH Univ, Zurich and some are working. After the event, I got to see the Google Zurich Office and the extra things offered there. Michael Haselmann (Zoogler - who works there) guided us through all this stuff. He's a pleasant guy, with a smile always. Good to see relaxed people like that (specially, in the German world) ;-). Apart from this, I also saw the display screen, at the reception, which shows all the 'Google Search Queries' that are fired by different people across the world. If you happen to be there, you can probably see some funny/weird/naive queries on the screen. &lt;br /&gt;&lt;br /&gt;Taking pics inside the office is prohibited, but there are numerous sources on the internet, from where you can check how the 'Zurich Google Office' looks like. Here's one of those links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://picasaweb.google.com/CamenzindEvolution/NewGoogleOfficeZurich#"&gt;Google Office - Zurich&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you wanna check the rest of my trip, follow the link below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://journal-of-a-nomad.blogspot.com"&gt;Journal Of A Nomad&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-3022254406479036371?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/-rTFASti3r0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/-rTFASti3r0/open-source-jam-google-zurich.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/10/open-source-jam-google-zurich.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-6714702218906140253</guid><pubDate>Fri, 26 Sep 2008 20:04:00 +0000</pubDate><atom:updated>2008-09-27T00:07:52.787+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Munchen</category><category domain="http://www.blogger.com/atom/ns#">gwt</category><category domain="http://www.blogger.com/atom/ns#">oktoberfest</category><category domain="http://www.blogger.com/atom/ns#">google web kit</category><category domain="http://www.blogger.com/atom/ns#">Germany</category><category domain="http://www.blogger.com/atom/ns#">google app engine</category><category domain="http://www.blogger.com/atom/ns#">babji chetty</category><category domain="http://www.blogger.com/atom/ns#">android</category><category domain="http://www.blogger.com/atom/ns#">opensocial</category><category domain="http://www.blogger.com/atom/ns#">google gears</category><category domain="http://www.blogger.com/atom/ns#">Google Developer Day Munich 2008</category><category domain="http://www.blogger.com/atom/ns#">deutschland</category><title>Google Developer Day 2008 - Munich (Germany)</title><description>Last month, I was searching for something on the internet and stumbled upon this news that Google is organising its 'Developer Day' event at Munich (Germany)/Munchen (Deutschland). Since I haven't attended many events like that and was interested in Google's tech stuff, I filled up the form on Google's site and got an e-invite from Google folks at Munich. Also, I thought I could meet up with a couple of famous or well-known Googler's and discuss things, personally (although I aint bigtime and just a face in the IT-Crowd) on varied topics like Java frameworks, MapReduce/Apache Hadoop, Cloud Computing and the hype around it, AJAX stuff and new Java frameworks like Richfaces, JBoss Seam, Dependency Injection (which is implemented by many, but not understood by all), et al.&lt;br /&gt;&lt;br /&gt;The event was scheduled on Tuesday, Sep 23 2008 and the agenda/sessions for that day was known well-ahead and so, I flicked through the Google pages and went through a couple of technologies like 'Google App Engine', 'OpenSocial', 'Geo', 'Visualization API', 'GData', 'Google Web Toolkit (GWT)', 'Guice', et al. I ran a couple of examples and got an idea about how these technologies are useful and what is the strategy behind this, for Google to release those API's. &lt;br /&gt;&lt;br /&gt;I planned my trip so that I could also spend some time in Munich and visit 'Oktoberfest', which is well-known all over the world, for being the biggest folk festival, in the world. Indeed, many people consider this 'Oktoberfest', as a binge-drinkin' event, rather than a normal folk festival, with people dressed up in colourful Lederhosen and Dirndl's (typical Bavarian dress'). Also, it offers a couple of other amusement-park stuff like the 'Free-Fall', et al. So, I went on Monday afternoon by the German ICE train (which sped to a max of 301 km/h and took me to Munich in just 1 hour, from Nuremberg/Nurnberg) and spent sometime lookin' around 'Oktoberfest' (not for binge-drinking. I'd no company, anyways. ;-)) and also checked the location of Google's event, the next day. Here's a post from my other blog, about 'Oktoberfest':&lt;br /&gt;&lt;br /&gt;&lt;a href="http://journal-of-a-nomad.blogspot.com/2008/09/oktoberfest-2008-munich-germany_26.html"&gt;Oktoberfest 2008 - Munich, Germany&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The next day, I was there in time for the Google's 'Developer Day' event and attended the keynote by Markus Muhlbauer (Google Munich's Engineering Director) and Chris DiBona (Open Source Manager for Google, who previously worked as a editor for 'Slashdot', hosted 'FLOSS weekly' event and also co-founded 'Damage Studios'). Chris DiBona has good presentation skills, which is mixed up with a bit of humour and other facts. Here are some pics:&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/0OQm_YYzERm5rbgQ_IlVVA"&gt;&lt;img src="http://lh4.ggpht.com/prashanth.chetty/SN0xvrIIo4I/AAAAAAAAMc0/KvLl2Uzt8KM/s400/DSC02038.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/q9CbtnWHJlXirGODVYublw"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xHky7vbI/AAAAAAAAMZw/AHj_kbawkeg/s400/DSC02030.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/ueFlqjDkp2QNWKtd21cWig"&gt;&lt;img src="http://lh5.ggpht.com/prashanth.chetty/SN0xJkvRyNI/AAAAAAAAMZ8/o6NSVr-6X9c/s400/DSC02031.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/Hr6tDnkLGUEYQtxYg3jE2A"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xMFJ9zAI/AAAAAAAAMaI/m52wHPl23fA/s400/DSC02032.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/VWO54atKOkdhQ7O1HiQpNw"&gt;&lt;img src="http://lh4.ggpht.com/prashanth.chetty/SN0xNXjdTyI/AAAAAAAAMaU/iSJiXWWBS3M/s400/DSC02033.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/wA1V3WOppeeq5VP1ES8xLQ"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xP-ymrOI/AAAAAAAAMag/KvhJa6cXowk/s400/DSC02034.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/n5ewrsXtUDuJm4UDQNAsbg"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xhliDNpI/AAAAAAAAMbo/92Lr76KnfJI/s400/DSC02049.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/2147dxeGnCQuPITeOKm3uA"&gt;&lt;img src="http://lh4.ggpht.com/prashanth.chetty/SN0xj2TPoTI/AAAAAAAAMb0/s6MTpn7PmM8/s400/DSC02050.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After the keynote, I spoke a bit to Chris DiBona and immediately rushed up to the next session (App Engine Code Labs). Since I ran those examples already, I didn't spend much time there. So, I went to the other code lab for 'Google Geo' and spent sometime there, just to get an idea . I also spoke to 2 French employees of Google. One Googler said that he's from South France and I'd a good conversation with him, talking about my 'Monte Carlo and French Riviera trip'. Indeed, I was excited to talk about that, as I like that part of France (which has good weather, sophisticated to laid-back and relaxing places, many things to do, et al).&lt;br /&gt;&lt;br /&gt;Later, I met 'Markus Muhlbauer' at Google Lounge and talked to him, a bit about Google Munich's R&amp;D centre, its location and what they exactly do over there. I gotta know that Google Munich's office is located at Marienplatz, Munich (which is the centre and one of the best parts of Munich) and at the moment, there are just a couple of employees working there and that the office aint so big and that they are planning to expand. Here are some pics:&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/poRXtMnWlZ4NdTW26sid4g"&gt;&lt;img src="http://lh5.ggpht.com/prashanth.chetty/SN0xocEyBgI/AAAAAAAAMcM/yBUfHx1waUM/s400/DSC02043.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/CaMO8R-cUiZmhprxEVEtMQ"&gt;&lt;img src="http://lh4.ggpht.com/prashanth.chetty/SN0xrn8YlDI/AAAAAAAAMco/9dFTkrkScW4/s400/DSC02037.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/GTayi06n9hl5sYo3sadKgA"&gt;&lt;img src="http://lh5.ggpht.com/prashanth.chetty/SN0x5ZXKVTI/AAAAAAAAMdY/Ka4Rg8-q9SQ/s400/DSC02041.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/uCiaG1zMnZQZDSgjdRygAA"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xdhbfGzI/AAAAAAAAMbQ/4sX6W4IP3YI/s400/DSC02047.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/rNxojkPSlv-Hs5u-DnNodg"&gt;&lt;img src="http://lh5.ggpht.com/prashanth.chetty/SN0w8ntldrI/AAAAAAAAMZk/KjiiDSwQsso/s400/DSC02036.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;After the lunch break, I also attended 'Google Web Kit' (presented by 'Sumit Chandel') and 'Google Gears' (by 'Dion Almaer'). I was particularly interested in 'GWT' as it relates to Java stuff and also explored a bit of it, already. All the presentations were pretty basic (or 'Just Right') as they have to target all the audience. If you have gone through the Google documentation regarding these technologies, attending this event is not a big deal, but the whole experience and meeting bigtime folks, gives you a perspective (if you are a budding and ambitious developer/user). Anyways, its a freebie and if you attend that, you get more presents as freebies. So, its definitely worth it. ;-) Here's a pic from the 'Google Web Kit' session:&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/8WHdn6TRfFSVnEIxSuZOOw"&gt;&lt;img src="http://lh3.ggpht.com/prashanth.chetty/SN0xTTOkNXI/AAAAAAAAMas/oBf2vk0KbEc/s400/DSC02035.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;I also spent some time listening to 'Ian Fette',who was presenting 'Google Chrome' stuff. There was a nice Q&amp;A session, at the end of this presentation and got to know a couple of things.&lt;br /&gt;&lt;br /&gt;At the end of the day, there was a 'Wrap-up' session, in which 'Chris DiBona' presented some cool things on the mobile and talked a bit about 'Android'. After that, I wanted to talk to 'Peter Chanezon' about 'Cloud Computing' and other technologies, but didn't happen, as he was busy. Apart from that, I was particularly interested in talking to 'Dion Almaer', as I know him pretty well through his 'Ajaxian.com' site/blog. I couldn't speak to him at length, but had a small talk and called it a day and headed back home. Here are some more pics:&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/QY_gikk6mx32CY6FhDRP7A"&gt;&lt;img src="http://lh6.ggpht.com/prashanth.chetty/SN0x7xBBOjI/AAAAAAAAMdk/toAHAzwrRc4/s400/DSC02042.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="width:auto;"&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/ccQYYTO3PxsGRiJO0B85ZQ"&gt;&lt;img src="http://lh5.ggpht.com/prashanth.chetty/SN0x3BnLoRI/AAAAAAAAMdM/kLWdOG9fhE8/s400/DSC02040.JPG" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family:arial,sans-serif; font-size:11px; text-align:right"&gt;From &lt;a href="http://picasaweb.google.com/prashanth.chetty/GoogleDeveloperDay2008Munich"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;If you need more info regarding the sessions, check the below link (which has youtube videos from those sessions on that day):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://de.youtube.com/googledeutschland"&gt;Google Developer Day 2008 - Munich&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-6714702218906140253?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/--idGciGf6A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/--idGciGf6A/google-developer-day-2008-munich.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/prashanth.chetty/SN0xvrIIo4I/AAAAAAAAMc0/KvLl2Uzt8KM/s72-c/DSC02038.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/09/google-developer-day-2008-munich.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-3598131532214880960</guid><pubDate>Tue, 26 Aug 2008 20:18:00 +0000</pubDate><atom:updated>2008-09-27T00:27:46.222+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">weird Google search queries</category><category domain="http://www.blogger.com/atom/ns#">inurl</category><category domain="http://www.blogger.com/atom/ns#">Interesting Or Creative Google Search Queries</category><category domain="http://www.blogger.com/atom/ns#">google math</category><category domain="http://www.blogger.com/atom/ns#">Prashanth</category><category domain="http://www.blogger.com/atom/ns#">chetty</category><category domain="http://www.blogger.com/atom/ns#">Babji</category><category domain="http://www.blogger.com/atom/ns#">intitle</category><category domain="http://www.blogger.com/atom/ns#">goolag scanner</category><category domain="http://www.blogger.com/atom/ns#">google hacks</category><category domain="http://www.blogger.com/atom/ns#">google calculator</category><category domain="http://www.blogger.com/atom/ns#">cult dead cow</category><title>Google Hacking And Other Interesting Search Stuff</title><description>Apart from 'plain search' stuff, Google is versatile, does good math and offers other good services like weather info, stock market quotes, et al. If you had tried the new experimental version (beta) of the 'Google Search', you would probably know that they are trying to come up with more creative/useful search stuff. Here are some of the interesting Google queries:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=what+time+is+it+in+vanuatu%3F&amp;btnG=Search"&gt;What Time Is It In Vanuatu?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?q=28+C+in+F&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-GB%3a%6ffficial&amp;client=firefox-a"&gt;28 C in F&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?q=1+Euro+%3D+%3F+%24&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:de:official&amp;client=firefox-a"&gt;1 Euro = ? $&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?num=30&amp;hl=en&amp;safe=off&amp;q=2.728+euros+per+liter+in+dollars+per+gallon&amp;btnG=Search"&gt;2.728 euros per liter in dollars per gallon&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;safe=off&amp;q=987654321+to+binary&amp;btnG=Search"&gt;987654321 to binary&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=1+nautical+mile&amp;btnG=Search"&gt;1 Nautical Mile&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?q=1Z9999W99999999988"&gt;UPS, Fedex or USPS Package Tracking&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=speed+of+light+in+kilometres+per+hour&amp;btnG=Search"&gt;Speed Of Light In Kilometres Per Hour&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=weather+munich&amp;btnG=Search"&gt;Munich Weather&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=how+many+leagues+are+in+a+furlong&amp;btnG=Search"&gt;How Many Leagues In A Furlong?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are many queries like this. Apart from this, some guys use Google for the sole purpose of hacking into systems or assessing security of their sites. Not many people really saw Google from this perspective (hacking), until some of the hackers did. If my memory serves right, I heard from someone (or read somewhere) that 'Google' was the kind of thing that some security/spying organisations were looking for, 10/20 years back. &lt;br /&gt;&lt;br /&gt;There are several search queries, which any end-user can use to find a security hole on some site, which aint secured in the right way (And ofcourse, that site is already indexed by Google). Its surprising to see some of the search results and it shows that there are still many vulnerable sites in our virtual world. &lt;a href="http://johnny.ihackstuff.com"&gt;Mr. Johnny Long &lt;/a&gt; maintains a 'Google Hacking Database', which has hundreds of queries to assess the security of a system. And there are couple of 'Google Hacking' books published based on this stuff. After all this stuff, I dont mean to say that Google is helping crackers to break into systems. It just shows the 'Power Of A Good Search Technology'. Also, Google directly doesn't help you to break into systems. If you have some knowledge about hacking concepts, then you could couple that with effective Google-search and if you are probably lucky, you can find some defect (Ex: You can probably figure out how to access a restricted htpasswd/htaccess file or a file with passwords and from that, you figure out how to access the server or things like that). Here are some queries:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=filetype%3Apdf+inurl%3Asecret&amp;btnG=Search"&gt;filetype:pdf inurl:secret&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=en&amp;q=filetype%3Apdf+inurl%3Aconfidential&amp;btnG=Search"&gt;filetype:pdf inurl:confidential&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you go through Mr. Johnny's 'Google Hacking Database', you can find many search queries like this. Also, one of the well-known hacking cult groups, called 'cultdeadcow' released a security scanner for websites based on this 'Google Hacking Database', called 'Goolag Scanner'. This is a pretty simple GUI application, which just stores the 'Google Hacking Queries' in a XML file (dorks.xml) and performs test by firing a search query (from its XML database) for a particular site. For more info on 'Goolag Scanner' and other 'Google Hacking' stuff, check my other (security) blog: &lt;a href="http://white-hat-stuff.blogspot.com"&gt;&lt;span style="font-weight:bold;"&gt;White Hat Stuff&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-3598131532214880960?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/LH1WRGcA5-Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/LH1WRGcA5-Q/google-hacking-and-other-interesting.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/08/google-hacking-and-other-interesting.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-1890688394644837802</guid><pubDate>Wed, 16 Jul 2008 18:22:00 +0000</pubDate><atom:updated>2011-03-18T23:43:01.803+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">algorithms</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Alien Numbers</category><category domain="http://www.blogger.com/atom/ns#">Google code jam 2008</category><category domain="http://www.blogger.com/atom/ns#">google tale</category><category domain="http://www.blogger.com/atom/ns#">Prashanth</category><category domain="http://www.blogger.com/atom/ns#">chetty</category><category domain="http://www.blogger.com/atom/ns#">Babji</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">Google code jam problems solution</category><title>GCJ 2008 - Alien Numbers</title><description>'Alien Numbers' problem statement:&lt;br /&gt;
&lt;br /&gt;
&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Problem&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;The decimal numeral system is composed of ten digits, which we represent as "0123456789" (the digits in a system are written from lowest to highest). Imagine you have discovered an alien numeral system composed of some number of digits, which may or may not be the same as those used in decimal. For example, if the alien numeral system were represented as "oF8", then the numbers one through ten would be (F, 8, Fo, FF, F8, 8o, 8F, 88, Foo, FoF). We would like to be able to work with numbers in arbitrary alien systems.  More generally, we want to be able to convert an arbitrary number that's written in one alien system into a second alien system.&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Input&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;The first line of input gives the number of cases, &lt;b&gt;N&lt;/b&gt;. &lt;b&gt;N&lt;/b&gt; test cases follow. Each case is a line formatted as&lt;/p&gt;&lt;pre style="color: rgb(0, 102, 0);"&gt;alien_number source_language target_language&lt;/pre&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;Each language will be represented by a list of its digits, ordered from lowest to highest value. No digit will be repeated in any representation, all digits in the alien number will be present in the source language, and the first digit of the alien number will not be the lowest valued digit of the source language  (in other words, the alien numbers have no leading zeroes). Each digit will either be a number 0-9, an uppercase or lowercase letter, or one of the following symbols &lt;code&gt;!"#$%&amp;amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~&lt;/code&gt; &lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Output&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;For each test case, output one line containing "Case #&lt;b&gt;x&lt;/b&gt;: " followed by the alien number translated from the source language to the target language.&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Limits&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;1 ≤ &lt;b&gt;N&lt;/b&gt; ≤ 100.   &lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Small dataset&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;1 ≤ num digits in &lt;b&gt;alien_number&lt;/b&gt; ≤ 4,&lt;br /&gt;
2 ≤ num digits in &lt;b&gt;source_language&lt;/b&gt; ≤ 16,&lt;br /&gt;
2 ≤ num digits in &lt;b&gt;target_language&lt;/b&gt; ≤ 16.     &lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Large dataset&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);"&gt;1 ≤ &lt;b&gt;alien_number&lt;/b&gt; (in decimal) ≤ 1000000000,&lt;br /&gt;
2 ≤ num digits in &lt;b&gt;source_language&lt;/b&gt; ≤ 94,&lt;br /&gt;
2 ≤ num digits in &lt;b&gt;target_language&lt;/b&gt; ≤ 94.&lt;br /&gt;
&lt;/p&gt;&lt;p style="color: rgb(0, 102, 0);" class="problem-item"&gt;Sample:&lt;/p&gt;&lt;table style="color: rgb(0, 102, 0);"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;br /&gt;
&lt;span class="problem-item-gray"&gt;Input&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;span class="problem-item-gray"&gt;Output&lt;/span&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt; &lt;code&gt; 4&lt;br /&gt;
9 0123456789 oF8&lt;br /&gt;
Foo oF8 0123456789&lt;br /&gt;
13 0123456789abcdef 01&lt;br /&gt;
CODE O!CDE? A?JM!.&lt;br /&gt;
&lt;br /&gt;
&lt;/code&gt; &lt;/td&gt;&lt;td&gt; &lt;code&gt; Case #1: Foo&lt;br /&gt;
Case #2: 9&lt;br /&gt;
Case #3: 10011&lt;br /&gt;
Case #4: JAM!&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
There are a couple of ways you can code a solution for this, but if you know (or did some research on) number systems, you can figure out the easiest solution.&lt;br /&gt;
&lt;br /&gt;
My Solution:&lt;br /&gt;
Since the 'decimal system' is the easiest that we humans and the programming languages (Higher-Level Languages) can comprehend, I converted the 'Alien Number' (using 'Source Language' input) into a decimal number and then divided that number with the 'base of the 'Target Language' number system) . The remainder is found and if its not zero, the division has to be done repeatedly on the quotient of the previous division until the remainder is '0' and collect all the 'remainders'. Form a number from the remainders, in the reverse order....and....VOILA!&lt;br /&gt;
&lt;br /&gt;
Example: (Converting '19' (decimal) to 'base 5')&lt;br /&gt;
&lt;br /&gt;
19/5 = 3       ------&gt;   4 (remainder)&lt;br /&gt;
3/5  = 0        - -----&gt; 3 (remainder)&lt;br /&gt;
&lt;br /&gt;
So, the decimal number 19 is equal to 34 in 'base 5'. Simple! :-)&lt;br /&gt;
&lt;br /&gt;
Then I uploaded the output files and found the solution to be 'Correct'.&lt;br /&gt;
&lt;br /&gt;
Here's the code for my solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;public class AlienNumbers
{
public String convertFromOneNumberSystemToOther(String alienNum, 
String srcLang, String targetLang) {

int iSrcLangBaseNum = srcLang.trim().length();
int iTgtLangBaseNum = targetLang.trim().length();

int iAlienNumInDecSystem = 0;
int iAlienNumLen = alienNum.length();

for(int i=0;i&amp;lt;iAlienNumLen;i++) {
iAlienNumInDecSystem += srcLang.indexOf(alienNum.charAt(i)) *
Math.pow(iSrcLangBaseNum,(iAlienNumLen-1-i));
}

StringBuffer sbTgtLangNum = new StringBuffer();

int tempNum = iAlienNumInDecSystem;

while(true) {
sbTgtLangNum.append(strTgtLang.charAt(tempNum % iTgtLangBaseNum));
if((tempNum/iTgtLangBaseNum) == 0) {
break;
} else {
tempNum /= iTgtLangBaseNum;
}
}

return sbTgtLangNum.reverse().toString();
}
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-1890688394644837802?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/vQkjc1NM2cE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/vQkjc1NM2cE/google-code-jam-2008-1.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>4</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/google-code-jam-2008-1.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-248578891974391400</guid><pubDate>Mon, 14 Jul 2008 23:50:00 +0000</pubDate><atom:updated>2009-10-19T21:23:34.750+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">algorithms</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">scripting language</category><category domain="http://www.blogger.com/atom/ns#">Babji</category><category domain="http://www.blogger.com/atom/ns#">Eulers Number</category><category domain="http://www.blogger.com/atom/ns#">prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">Calculating 'e' to 10000 Digits In Groovy</category><category domain="http://www.blogger.com/atom/ns#">bigdecimal</category><category domain="http://www.blogger.com/atom/ns#">dynamically typed language</category><title>Calculating 'e' to 10000 Digits In Groovy</title><description>Yesterday, I was reading a bit about scripting languages and started playing with 'Groovy', which is an alternative to 'Java'. You can say that it's a bit higher-level language than Java, as it is built on Java libraries (or classes) and provides one more abstraction layer.  Groovy, which is a 'Dynamic Language' (dynamically typed) was built to provide a scripting language for the Java platform, along the lines of Python, Ruby and Perl. Below are some imp points:&lt;br /&gt;&lt;br /&gt;1) The Groovy compiler can be used to generate 'Java Bytecode', which can be integrated with any other java module/project.&lt;br /&gt;&lt;br /&gt;2) Most of the Java code is also a valid syntax for Groovy.&lt;br /&gt;&lt;br /&gt;3) Groovy is dynamically typed, whereas Java is static and strongly typed. Dynamically typed languages have lesser code, but more execution time.&lt;br /&gt;&lt;br /&gt;4) Groovy also provides special XML processing through the classes XmlParser, XmlSlurper, DOMCategory.&lt;br /&gt;&lt;br /&gt;Apart from these, Groovy has features like 'Dynamic Typing', 'Closures' and 'builders'. Also, it's pretty useful for testing as it supports unit-testing and mocking out-of-the-box.&lt;br /&gt;&lt;br /&gt;After doing a bit of reading and coding some basic scripts, I tried to code a Groovy solution for the Java code that I wrote for solving the "Google's Billboard Puzzle" (from other post in this blog). It's for calculating "Euler's Number (e)" , which is pretty basic and simple code. Here's the code:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;BigDecimal e = new BigDecimal(1.0G)&lt;br /&gt;BigDecimal temp = new BigDecimal(1.0G)&lt;br /&gt;&lt;br /&gt;for(i in 1..100) {&lt;br /&gt;   temp *= i&lt;br /&gt;   e += new BigDecimal(&amp;quot;1&amp;quot;).divide(temp, new java.math.MathContext(10000))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;println(&amp;quot;e : &amp;quot; + e)&lt;br /&gt;println(&amp;quot;length of e calculated : &amp;quot; + (e+&amp;quot;&amp;quot;).length())&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-248578891974391400?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/jsPWskHpgeI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/jsPWskHpgeI/calculating-e-to-10000-digits-in-groovy.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/calculating-e-to-10000-digits-in-groovy.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-1408009672266668197</guid><pubDate>Sat, 12 Jul 2008 17:27:00 +0000</pubDate><atom:updated>2011-03-18T23:53:27.596+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Google pig latin</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">europe</category><category domain="http://www.blogger.com/atom/ns#">English To Pig Latin Translator</category><category domain="http://www.blogger.com/atom/ns#">Google</category><category domain="http://www.blogger.com/atom/ns#">chetty babji prashanth</category><category domain="http://www.blogger.com/atom/ns#">Pig Latin</category><title>English To 'Pig Latin'</title><description>Yesterday, I was doing some research about 'Latin' and 'Roman Civilization' and as I was scouring the internet, I stumbled upon this slang (or 'Backslang') called 'Pig Latin', which is also a 'English Language Game'.  Following are the rules to translate a 'English' word into 'Pig Latin':&lt;br /&gt;
&lt;br /&gt;
1) For words that begin with&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt; 'consonant' sounds, move the initial consonant or consonant cluster to the end of the word and add "ay."&lt;br /&gt;
&lt;br /&gt;
Ex:  English: &lt;span style="font-weight: bold;"&gt;Zeitgeist   &lt;/span&gt;------ Pig Latin: &lt;span style="font-weight: bold;"&gt;eitgeistzay&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2) For words that begin with vowel sounds (including silent consonants), simply add the syllable "ay" to the end of the word.&lt;br /&gt;
&lt;br /&gt;
Ex: Englsih: &lt;span style="font-weight: bold;"&gt;Algorithm  &lt;/span&gt;------ Pig Latin: &lt;span style="font-weight: bold;"&gt;Algorithmway&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This is the basic stuff for 'Pig Latin'. If you wanna know more about this, you can fire a Google query and do some research. Also, I'm not covering much of 'silent consonants' stuff in this post.&lt;br /&gt;
&lt;br /&gt;
Ok..I thought its pretty simple and wrote a basic 'Java' program to translate an 'English phrase' into 'Pig Latin'. This is a pretty basic 'Java' program tested with just a couple of test cases. And ofcourse, there are a lot of other things to be added, in order to make it a perfect translator. I'm just posting the 'Java' code that I wrote in a couple of minutes, outta my own interest. Here's the code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.util.Scanner;

public class EnglishToPigLatinTranslator {
public static void main(String[] args) {
System.out.println(&amp;quot;Enter The English Phrase To Be &amp;quot; 
+ &amp;quot;Translated Into 'Pig Latin' : &amp;quot;);
Scanner scanner = new Scanner(System.in);

String strEngPhrase = scanner.nextLine();

if(strEngPhrase != null &amp;amp;&amp;amp; !strEngPhrase.equals(&amp;quot;&amp;quot;)) {
System.out.println(&amp;quot;\nPig Latin Text : \n&amp;quot; + 
convertEnglishToPigLatin(strEnglishPhrase));
} else {
System.out.println(&amp;quot;No Input Specified!&amp;quot;);
}
}

public static String convertEnglishToPigLatin(String strEnglishPhrase) {
String strVowels = &amp;quot;aeiou&amp;quot;;
String[] strTokens = strEnglishPhrase.split(&amp;quot;[ ]&amp;quot;);
StringBuffer sbPigLatinStuff = new StringBuffer();

for(int i=0;i&amp;lt;strTokens.length;i++) {
if(strVowels.indexOf(strTokens[i].charAt(0)) &amp;gt;= 0) {
sbPigLatinStuff.append(strTokens[i] + &amp;quot;way &amp;quot;);
} else if((strTokens[i].indexOf(&amp;quot;a&amp;quot;) &amp;lt; 0) &amp;amp;&amp;amp; 
(strTokens[i].indexOf(&amp;quot;e&amp;quot;) &amp;lt; 0) &amp;amp;&amp;amp; 
(strTokens[i].indexOf(&amp;quot;i&amp;quot;) &amp;lt; 0) &amp;amp;&amp;amp; 
(strTokens[i].indexOf(&amp;quot;o&amp;quot;) &amp;lt; 0) &amp;amp;&amp;amp; 
(strTokens[i].indexOf(&amp;quot;u&amp;quot;) &amp;lt; 0)) {
sbPigLatinStuff.append(strTokens[i] + &amp;quot;ay &amp;quot;);          
} else {
for(int j=1;j&amp;lt;strTokens[i].length();j++) {
if(strVowels.indexOf(strTokens[i].charAt(j)) &amp;gt;= 0) {
sbPigLatinStuff.append(strTokens[i].substring(j) + 
strTokens[i].substring(0,j) + &amp;quot;ay &amp;quot;);
break;
}
}
}
}

return sbPigLatinStuff.toString();
}
}

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The above code reads/takes 'English' phrase as input from the console and outputs a 'Pig Latin' phrase as output.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Example Input: &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;She sells sea shells by the sea shore&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Output: &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;eShay ellssay easay ellsshay byay ethay easay oreshay&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Also, the above code doesn't take care of special characters. If you want, you can customize that, accordingly. Here's an input phrase, which shows that:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Input:  &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;A skunk sat on a stump and thunk the stump stunk, but the stump thunk the skunk stunk.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Output: &lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;Aay unkskay atsay onway away umpstay andway unkthay ethay umpstay unk,stay utbay ethay umpstay unkthay ethay unkskay unk.stay&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;One more interesting thing is that, Google also offers its search in 'Pig Latin'. I used the link and searched using a set of keywords and found that this 'Pig Latin' search gives priority to 'Pig Latin' stuff only if you search in 'Pig Latin'. Otherwise, it is just the usual way of 'Googling'. I dont know if they cover all the cases, but here's the link:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.google.com/intl/xx-piglatin/"&gt;Google Igpay Atinlay (Pig Latin)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-1408009672266668197?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/O-CcBEArZL8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/O-CcBEArZL8/english-to-pig-latin.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>3</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/english-to-pig-latin.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-9115064129023197004</guid><pubDate>Sat, 12 Jul 2008 12:36:00 +0000</pubDate><atom:updated>2011-03-18T23:54:36.015+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">europe</category><category domain="http://www.blogger.com/atom/ns#">play with googol</category><category domain="http://www.blogger.com/atom/ns#">Prashanth</category><category domain="http://www.blogger.com/atom/ns#">chetty</category><category domain="http://www.blogger.com/atom/ns#">Babji</category><category domain="http://www.blogger.com/atom/ns#">Google</category><category domain="http://www.blogger.com/atom/ns#">bigdecimal</category><title>Playing With Googol</title><description>The only way, you can play around with 'Googol' in Java, is to use 'BigDecimal' or 'BigInteger', since the other primitives can't bear the weight of 'Googol'. Here's some code, which I used to test:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.math.*;

public class Googol {
public static void main(String[] args) {
long googol1 = (long) Math.pow(10,100);
System.out.println(&amp;quot;Googol1 : &amp;quot; + googol1);
System.out.println(&amp;quot;Max Value of Long : &amp;quot; + Long.MAX_VALUE);

BigDecimal googol2 = new BigDecimal(Math.pow(10,100) + &amp;quot;&amp;quot;);
System.out.println(&amp;quot;Googol2 : &amp;quot; + googol2);

BigDecimal bigDecimal = googol2.multiply(new BigDecimal(Math.PI + &amp;quot;&amp;quot;));
System.out.println(&amp;quot;Googol Multiplied By PI : &amp;quot; + bigDecimal);
}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Here's the output of this program:&lt;br /&gt;
&lt;br /&gt;
Googol1 : 9223372036854775807&lt;br /&gt;
Max Value of Long : 9223372036854775807&lt;br /&gt;
Googol2 : 1.0E+100&lt;br /&gt;
Googol Multiplied By PI : 3.1415926535897930E+100&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-9115064129023197004?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/r440qok7ERM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/r440qok7ERM/playing-with-googol.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/playing-with-googol.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-9019634069068664164</guid><pubDate>Sat, 12 Jul 2008 01:07:00 +0000</pubDate><atom:updated>2011-03-18T23:51:37.196+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">first 10 digit prime in consecutive digits of e</category><category domain="http://www.blogger.com/atom/ns#">algorithms</category><category domain="http://www.blogger.com/atom/ns#">Google Billboard Math Puzzle</category><category domain="http://www.blogger.com/atom/ns#">Eulers Number</category><category domain="http://www.blogger.com/atom/ns#">e</category><category domain="http://www.blogger.com/atom/ns#">chetty babji prashanth</category><category domain="http://www.blogger.com/atom/ns#">Google Story</category><title>Google Billboard Puzzle</title><description>In July 2004, Google posed a complex mathematical question on a billboard on 'Highway 101' in the heart of silicon valley, to lure some of the mathematically talented guys (probably with special software skills too).&lt;br /&gt;
&lt;br /&gt;
The billboard read:&lt;br /&gt;
&lt;b&gt;{first 10-digit prime found in consecutive digits e}.com." &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The answer, 7427466391.com, would lead to a Web page with yet another equation to solve, with still no sign of the firm that wanted to recruit some of the best math guys, out there. It wasn't known that it was Google, until the puzzle was cracked.&lt;br /&gt;
&lt;br /&gt;
Here's a pic of that billbaord:&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT5j9JZRXjo/SHgKKiTWtBI/AAAAAAAAMEA/glO3revI2kM/s1600-h/google_billboard.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_KT5j9JZRXjo/SHgKKiTWtBI/AAAAAAAAMEA/glO3revI2kM/s320/google_billboard.jpg" alt="" id="BLOGGER_PHOTO_ID_5221934944059044882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I happened to know about this puzzle much later and thought of giving it a try. My first approach was to calculate the 'Eulers Number (e)'. I didn't knew what precision (the number of digits in the decimal part) would be required for this, as no one knows where the 'first prime number' would occur. I decided to calculate 'e' to 10000 digits (decimal part) and loop through the 10 digit numbers from the beginning of the decimal part, incrementing by 1 digit in each and every loop. This is a very basic solution that I thought of, without any special/fast mechanism (or algorithms). "Euler's Number" can be calculated in a couple of ways, but I used the following formula:&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_KT5j9JZRXjo/SHgRNVCOKeI/AAAAAAAAMEw/R_-zLDKl_UE/s1600-h/e.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_KT5j9JZRXjo/SHgRNVCOKeI/AAAAAAAAMEw/R_-zLDKl_UE/s320/e.png" alt="" id="BLOGGER_PHOTO_ID_5221942688618523106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
With the above formula, we can calculate 'e' by looping through, finding factorial and adding up 1/Facorial(n), in each and every loop. I decided to give a try, although it was a bit naive, brute-force approach. Java was my programming language of choice, but calculating e to 10000 digits precision is a problem because you cant use the normal primitives like "double", "float" or whatever to contain the huge number of digits in the decimal part of a number. So, it was pretty obvious that I had to use 'BigDecimal'.&lt;br /&gt;
&lt;br /&gt;
One more tricky part was to determine 'how many times should the program loop through , for the precision to be around 10000 digits'? I tried a couple of combinations and found that "100" would be good enough. Also it doesn't consume much time. If you try it for 10000 or more, it would probably take a couple of minutes or hours.&lt;br /&gt;
&lt;br /&gt;
Ok....I looped through "100" times in the code, calculated 'e' to a bit more than 10000 digits, in the first step. The next step, I looped through the decimal part of 'e', taking 10 char substrings (starting from the decimal point) in each and every loop (and incrementing by 1 char in each and every loop) and figuring out whether its a prime or not. If its a prime, thats it..Voila..Puzzle solved! ;-)&lt;br /&gt;
&lt;br /&gt;
Here's the Java code for finding the 'First 10 digit prime number in the consecutive digits of e':&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import java.math.BigDecimal;
import java.math.MathContext;

public class EulersNumber {
public static void main(String[] args) {
BigDecimal e = BigDecimal.ONE;
BigDecimal bigDecimal = BigDecimal.ONE;

for(int i=1;i&amp;lt;100;i++) {
bigDecimal = bigDecimal.multiply(new BigDecimal(i*1.0 + &amp;quot;&amp;quot;));
e = e.add(new BigDecimal(1.0 + &amp;quot;&amp;quot;).divide(bigDecimal,
new MathContext(10000)));
}

String strDecimalPart = (e + &amp;quot;&amp;quot;).substring(2);

for(int i=0;i&amp;lt;strDecimalPart.length()-10;i++) {
long num = Long.parseLong(strDecimalPart.substring(i,i+10));
if(isPrime(num)) {
System.out.println(&amp;quot;First 10 digit prime number in the &amp;quot; + 
&amp;quot;decimal part of e : &amp;quot; + num);
break;
}
}
}

public static boolean isPrime (long n) {
if (n&amp;lt;=1) return false;
if (n==2) return true;
if (n%2==0) return false;
long m = (long) Math.sqrt(n);

for (long i=3; i&amp;lt;=m; i+=2)
if (n%i==0)
return false;

return true;
} 
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I ran this program and got the following output: b&gt;First 10 digit prime number in the decimal part of e : 7427466391&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So, thats the answer and the domain address would be &lt;b&gt;7427466391.com&lt;/b&gt;" (which is defunct now).&lt;br /&gt;
&lt;br /&gt;
....and here's the "Euler's Number (e)" that I calculated using the above approach: &lt;a href="http://google-tale.blogspot.com/2008/07/e-to-10000-digits.html"&gt;'e to 10000 digits'&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;PS: The above solution is a very basic, brute-force/trial-and-error approach that I used, but it very much solves the puzzle. &lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-9019634069068664164?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/L0U-BJ1bzkA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/L0U-BJ1bzkA/google-billboard-puzzle.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_KT5j9JZRXjo/SHgKKiTWtBI/AAAAAAAAMEA/glO3revI2kM/s72-c/google_billboard.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/google-billboard-puzzle.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-502918092868676117</guid><pubDate>Fri, 11 Jul 2008 23:42:00 +0000</pubDate><atom:updated>2008-07-12T05:00:03.686+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Eulers number e to 10000 digits</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Google Billboard Math Puzzle</category><category domain="http://www.blogger.com/atom/ns#">Eulers Number e</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><title>Euler's Number (e) to 10000 digits</title><description>2.71828182845904523536028747135266249775724709369995957496696762772407663035354&lt;br /&gt;759457138217852516642742746639193200305992181741359662904357290033429526059563&lt;br /&gt;072731008532378052751063686487016953141865527484590824495504533928649764277413&lt;br /&gt;664165964636632508736091584134397099983170353823380092116814655415374930542022&lt;br /&gt;2461709321230949167763499311130703029256989342067643919136650384873578846610775&lt;br /&gt;725576307921898867353790419412043377406494907073863079049248976437069836297366&lt;br /&gt;862198429250767700214157406500293826954406871877954270969766247465243666295138&lt;br /&gt;572019208303177269234097701656745392257779147341603684935723103304485761429026&lt;br /&gt;633263529379734450400061311941647086898259755208734782937085387009434178080656&lt;br /&gt;799728070459503917013351431243873005220184059659629058572148124084211850064775&lt;br /&gt;039817941961218573369359733233622726060251817838892702513619492060782438693702&lt;br /&gt;3374814484201715707221499854656151809995508987059685112005970217969141325866928&lt;br /&gt;6602317310229797290687832208352244139159906185931458214703478815445166479832&lt;br /&gt;5046262522680294449747348465327518061648320621808534750359139800448221992875&lt;br /&gt;4115421760307308298093805920594877077289150276094679343039089600258059624590&lt;br /&gt;1090903863567364545438437944570459218550946553360104699219626269410126910458&lt;br /&gt;90340647723383513632617624742197059501772297495397551854979415896674068860108&lt;br /&gt;7398443700914012801686726593427163552302821660247771908837094815869645205666&lt;br /&gt;8815969321410949439503674072209706019571063864125657863462531390320535926139&lt;br /&gt;8065461279426613181836499453900527608815525900579545890516959001648050702509&lt;br /&gt;6403143330697134846164437723068270522333891693693343907700497785650966434405&lt;br /&gt;2325996256928278405152469924949198823766952739854288105544527565986294752452&lt;br /&gt;05693358119115333543019700716769864683030634526402994568932551341887981026382&lt;br /&gt;2843693783432310455460084376713678585540041637300910512388440410273740721407&lt;br /&gt;6089146349592070628050009074145432574228970773743592716838514050834569168569&lt;br /&gt;4020069628069142977701272380383001974272807014909792386389979599361210460546&lt;br /&gt;6132878158380106008513525733886057866008226873313592611944487920707602483719&lt;br /&gt;175378078444093479419423995579464945674756628701559497832841333591914786214637&lt;br /&gt;35603157123715972525235081340992882850434547504729694274009993485285212359739&lt;br /&gt;17674488103383877169147599028815092782273697356447476531171632071581081270552&lt;br /&gt;5598851856502807470004430053271066985202412593972634396001301781754281722806&lt;br /&gt;99015701997418112250357373092905792348289915876331111795795255780918373793205&lt;br /&gt;1269240357824595461131785114968639639991476102270714665227802289055681089509&lt;br /&gt;0146736930196174130025404517196793385306069511899147940409256879369338070338&lt;br /&gt;44117960210757341657750887635675554190855634632412343556830822523527371221710&lt;br /&gt;5503387342646635300259679114329308264293528681728967169757966418436808935072&lt;br /&gt;1853584011065482617985869437542874723693228725609077359083959083910914601426&lt;br /&gt;14117072184462117369425231608550325954157093031897697899281462993247498822840&lt;br /&gt;92401485466120845575841709241943040201506918613662787810741263281974371666516&lt;br /&gt;330008170760884695890852048059030709279849861998603838516800211544530926982&lt;br /&gt;11263222953723523749313973888100541833082146561100109711466796181542127994450&lt;br /&gt;76235099916977658728501385580985438616207865146047255866541716806751679188638&lt;br /&gt;59113108312166753578697511605452236122500023689152933590078679967211452212392&lt;br /&gt;2290098658574120910961465211460661599806140981235585382519904891440442062925&lt;br /&gt;925495112139384134252979654512252377847573748760543708287671195154844747383508&lt;br /&gt;1601573510092133293063560544492520388015467416485377322694920822119530493637&lt;br /&gt;1369428240434858154048599765296403148619908392124953147575475332405124625889&lt;br /&gt;57121686955156360920651701645327408228490984014959122126619201970425151542106&lt;br /&gt;73013640542646030186192840107095300278713215958912957724597357283841662968309&lt;br /&gt;12210516806720757220478234957553878098197623884867165276206434004671154492769&lt;br /&gt;7250480660380146624193025161061045950219756822986117002086519032370669831556&lt;br /&gt;2314828872353526031083929446762905715191928824538549193915211069960080432370&lt;br /&gt;33684427165463758461688160355511644363832742245956811161693438212701845186156&lt;br /&gt;55761416101372838979107942215779375878684115441845526446284300286082840561456&lt;br /&gt;5145085097678489064642723633070628029478321647090193520218183692763368807386&lt;br /&gt;1858596938408033154128062810735163112651849784428507068524266997588412327010&lt;br /&gt;9692644594407018059178367047739180941656620079419717122687690165757425276849&lt;br /&gt;092593900829181546327673012278265309721072694711649587180103237308336037094&lt;br /&gt;124718002747971763353021975270212394223029724655135470200873265326088010696&lt;br /&gt;51682316957653741866561230702746577570979189592110672163958193180910193572622&lt;br /&gt;40138979571594510928768813979234045832681877376433987660178768467826282141951&lt;br /&gt;3568794428050748765941809093175009332292937037772747009321804115353182640653&lt;br /&gt;1171780622593070127430035280400923998246278841349928607003107461709846780856&lt;br /&gt;60256146171925487380730445091187515582011517793133710289833229203277586780250&lt;br /&gt;9139516998337048606875794415220704398884922919940020129431383431469287267708&lt;br /&gt;3681404480986230206993613730660473248727695273521560257818607833251900314636&lt;br /&gt;1037460329769173708864378340410730989044302850521251156907880247563440669279&lt;br /&gt;9182321051095812359725793718986048188974020453536240320581284657153065142529&lt;br /&gt;12492042439476614866877083286718121151289143738010495191991475375329312502675&lt;br /&gt;42902206790327004738901758137411520731783829875119152758426735040751711054714&lt;br /&gt;1941923246974848693131873714706453440439743879138400949332358403482499509194&lt;br /&gt;9842096735171845236053213985888923697150231999224724594151335488800213847246&lt;br /&gt;91538470943183864703011070217387104702703139593543751554326649899326338571842&lt;br /&gt;2582613915316926076702248679586655222978767959539102851890398902126342161697&lt;br /&gt;9159330165276969103518713133047990903094329029249914628420541512490428251645&lt;br /&gt;6746932746214616902647057490059256740212429170561779045681950630945431315218&lt;br /&gt;4766472404736695193704209539728909985576721636243705276264090590830454379672&lt;br /&gt;502679091492454257912086044133852067859002754311689904906392195537002710581&lt;br /&gt;8216612975571073213954866373070339848665183771444369369480523976858199390808&lt;br /&gt;6125130002701638160264500919161836188968056406647070513470493616674082416217&lt;br /&gt;06481772590630197958443972272171843656472316231680270512046751129103103526136&lt;br /&gt;5544408015102410339248492737018338624019133546654930438348313815488287286553&lt;br /&gt;43791539697505176626178810067645315090761240203654377248976565316875366959861&lt;br /&gt;3931146415608407893795807492175484372273231557705894548508328231662541302564&lt;br /&gt;27171611575544774997441224243993883274759254403869584854298041515014362996853&lt;br /&gt;2593601476977133327825679930040071754343452156177043925100909751088480877331&lt;br /&gt;7082193696476465084182224449241071211734426403970652458158152697327028141431&lt;br /&gt;5186959263778428980663510467346428841265110885224631075683457878504930178218&lt;br /&gt;225174460500041466882994355935522278641033817469626394254500139506953702358&lt;br /&gt;63111068710336036419928254963754755661181239993344592703865918454163813726481&lt;br /&gt;523004938480329009196512667559683877825792199002609332773006030203819120544&lt;br /&gt;7473075865273513891589520992388057333363975767184807782646421490529836209478&lt;br /&gt;1696991729150079770978589433510054782303689081363960711565433419871905351687&lt;br /&gt;34752631783851814430979644887878785718990707589067054658544435461194598811093&lt;br /&gt;41473535982500945675748301178172162084714614189329196146949347030676397298772&lt;br /&gt;332232445341105199525228932493624308607658460785332802038864362569780270279&lt;br /&gt;2148665178441664055725072156401901023676418513333803139797562192289727683806&lt;br /&gt;81261858779967914175349201748151716744913513256578568502951083358429780913639&lt;br /&gt;5053727848617771983290354188250603562852158316159055091186345022334351945324&lt;br /&gt;14452531774950581454159454767896926235849069644331189538317451035275870827121&lt;br /&gt;298185800924354383038105151741805807889998458063104249533759109476263763294&lt;br /&gt;9017938803529523129067651391537272995328629369956730072056740076487607846839&lt;br /&gt;31338214106648455757216268590483893617111078110461552879534435611222664995665&lt;br /&gt;9784035933910764838551152739021256100763830358119151783051993496819479915082&lt;br /&gt;392479782967650501768646964257960281471100407585359604523309962347485350677&lt;br /&gt;289284632970184431527197085081286106985690573223295367005888075920350341430&lt;br /&gt;34360015717447329278150239175788794731286592663631604212679563569122828211951&lt;br /&gt;0586536161249244064369095864500845511321589618532587572544297576556384231892&lt;br /&gt;6441607600001517773056094180774786690888004129069593271289638606751911883864&lt;br /&gt;4306238369851982856459515425563968332542495703882827336959908735218801381827&lt;br /&gt;7514390458919247613316334001807369271619250148169382222374126875014028010303&lt;br /&gt;3142186226903645789262051876342085012091447322173282103203638118464396858702&lt;br /&gt;930558330391858010947310234962853502303569995878716757612530603333848540209&lt;br /&gt;4782747364951007075237736181632922607373937890256246832186567543964696045242&lt;br /&gt;7148754101498994468898956060485426243616680157799303275578481736989107749824&lt;br /&gt;70738334470245233484311989072122254971558825789527474764575763565558605790976&lt;br /&gt;9165036383994176295514220082474314305216853172774430602210206147858651829252&lt;br /&gt;4335664928405241205101395006669723427516698744021233815406010137407923958491&lt;br /&gt;342930373595709530010609740899961898712955216954476343410258194640698989420&lt;br /&gt;3050328794275681342976086330639372160824427910284180259614219885424355337261&lt;br /&gt;9756728839042776695026783656807516269448233053600297161311517954960480081510&lt;br /&gt;103759243696856094894001139222873705396028826060269848058131712469307843008&lt;br /&gt;61945457601943691625162492400802152241873307859151281377890962735078347713297&lt;br /&gt;94749868587559773372475556238112674596550231901852686726565447277424962024757&lt;br /&gt;9753164331835977166382242200301837076942301952858848502901552674537404631697&lt;br /&gt;7964904657195931255912764404368321965951006839312721523813963827559536872525&lt;br /&gt;9255663498774450204128408552760135665311196585057294907726531374828285017666&lt;br /&gt;9079493575681332107268805108427749201049594207542083964439885861615931834645&lt;br /&gt;965491121494647577006591807761793166616453673095582354711565411724127405791276&lt;br /&gt;4935942066671832251736836733963627188213305106330064328648272252338925308465&lt;br /&gt;30211236426964803883363073178869980611993731052155742778573936345107647011533&lt;br /&gt;450683469883317339446680597758269980660569964529693684365470406533604545189&lt;br /&gt;6856420175232112318731261169525302795582438878696844145909635734913232&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;The above value of 'e' is indeed more than 10000 digits. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-502918092868676117?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/5elPYrxVC2c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/5elPYrxVC2c/e-to-10000-digits.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>3</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/07/e-to-10000-digits.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-2623197372465368319</guid><pubDate>Tue, 06 May 2008 18:15:00 +0000</pubDate><atom:updated>2008-05-06T21:27:16.583+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">news</category><category domain="http://www.blogger.com/atom/ns#">india</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">google joins oCERT</category><category domain="http://www.blogger.com/atom/ns#">Germany</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">nuremberg</category><category domain="http://www.blogger.com/atom/ns#">Bangalore</category><category domain="http://www.blogger.com/atom/ns#">Google Story</category><title>Google Sponsors oCERT</title><description>Google has joined a volunteer workforce called oCERT (Open Source Computer Emergency Response Team) to play an active role in reviewing/fixing security issues in open source applications. I think its a very good move for the software community. Its just not only useful for the open source community, but anyone who uses open source software and I dont think there's any developer in this world who's not using atleast a snippet of code which is a freebie from open source community.&lt;br /&gt;&lt;br /&gt;No software version is perfect and comes with its own security risks and it specially applies for open source software as multiple developers work on a single module/API and the developers working on that might not be that adept in managing the security part or in testing each and every test-case related to security risks associated with that module/API. Also, some software products are developed without much priority/importance on the security issues. These security holes (if any) might bring down the total system/business and cause a huge loss. So, I think its a great move by Google to consider that. For more info, check the links below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://googleonlinesecurity.blogspot.com/2008/05/contributing-to-open-source-software.html"&gt;&lt;span style="text-decoration: underline;"&gt;Google Security Blog&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.zdnet.com/security/?p=1076"&gt;&lt;span style="text-decoration: underline;"&gt;ZDNET NEWS&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here's a good article which discusses the security issues related to open source software:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/open-source-security.html"&gt;Is Open Source Good For Security?&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-2623197372465368319?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/Skg-3wIVnZ8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/Skg-3wIVnZ8/google-sponsors-ocert.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/05/google-sponsors-ocert.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-4203894074071232820</guid><pubDate>Thu, 10 Apr 2008 21:48:00 +0000</pubDate><atom:updated>2008-07-22T23:33:50.248+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">google job tips</category><category domain="http://www.blogger.com/atom/ns#">Getting a job at google</category><category domain="http://www.blogger.com/atom/ns#">europe</category><category domain="http://www.blogger.com/atom/ns#">Google Munich Job</category><category domain="http://www.blogger.com/atom/ns#">bayern</category><category domain="http://www.blogger.com/atom/ns#">Job at Google</category><category domain="http://www.blogger.com/atom/ns#">Germany</category><category domain="http://www.blogger.com/atom/ns#">bavaria</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><category domain="http://www.blogger.com/atom/ns#">nuremberg</category><category domain="http://www.blogger.com/atom/ns#">deutschland</category><title>Wanna Work At Google?</title><description>Sometime back, on a German chat forum, there was this speculation about Munich's new Google R&amp;amp;D centre and how to get into that. I'm just posting what I wrote there, so that it may be useful for folks who are preparing/looking forward to get into Google..Here I go:&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.......yes, Google has recently opened its R&amp;amp;D centre in Munich, knowing the importance of that place and also because of its location (although there is one more R&amp;amp;D centre very close by - in Zurich).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    QUOTE(plex24 @ Sep 13 2007, 3:11 am) *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    i am interested too, where did you see the job advert?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;There are scores of young people who are ready to work for Google, even for a small payscale. But ofcourse, they pay good and you get a lot of benefits too.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Also, lots of people who wanna work at Google, start preparing for the interviews well ahead of the interview (a couple of months before) in diverse topics like distributed systems, algorithms, networking problems, linux, information retrieval algorithms, and sundry other things. If you are into that already, it would be a bit easy. Do you think, its that easy to comprehend those intricate algorithm problems? ...It takes a while. And you know there are good number of young guys in Poland, Russia, China, India, etc countries who can solve these intricate algo problems in just a couple of minutes (which you can notice in a couple of coding competitions), which would otherwise take a while for some other guys (probably days, months or years).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;And one more thing is that, it depends on what kind of position you are expecting at Google. Google Hamburg and Düsseldorf is mostly into sales and marketing. Google has many offices, but its main R&amp;amp;D centres in Europe are in Dublin(Ireland), Zurich (Switzerland), Munich(Germany) and Krakow (Poland).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    QUOTE(rhein @ Sep 14 2007, 1:05 am) *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    For others - any other tips !!! I am preparing my resume at the moment to apply.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Ofcourse, you can apply. But dont be surprised if you dont get any reply. They receive hundreds of resumes everyday. They had some kind of puzzle, reasoning test too. But I dont really know if they still have that procedure coz its grown big enough now and indeed some Google folks have quit working and joined Facebook, just because its grown big enough and they are missing the challenges of working as an entrepreneur. But still, its a great company to work at, because you learn much.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I have some more interesting facts for you folks:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1) Do you know that Google folks prepare their own super computers by stacking up low cost linux box's and connecting them?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;2) Do you know that Google hired a Brain Surgeon (who was good in computers too) as the network admin and supervisor (in the beginning)?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    QUOTE(berny @ Sep 13 2007, 11:56 pm) *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;    Google do have tech offices in munich. but the location is kept VERY secret because google dont want every weirdo extremist freak to know where their hardware is located.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;QUATSCH! Why would they hide the location details of their office? If they would hide Munich's location, they would hide the mountain view HQ location too? and also Zurich location?...But did they?..NO.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;But its obvious that they wouldnt reveal the information of their server farms, but not their office. They have huge server farms and they already had some problems (a couple of years back) when one server farm went down due to fire. There are different security risks associated with that. So, no one would reveal the location of that (Atleast, the exact location). Even if one server farm fails, there's an other one which acts as a substitute and makes it fail-safe. But still, its a huge loss. So, those details are kept confidential. Simple! smile.gif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;PS: Working at Google also depends of one's priorities. I know of some people who are content with what they are working on and can do other things in life and maintain that poise in life. And there are some more, who are ambitious and want to do things. So, it all depends! Choose for yourself and then Google decides whether they can choose you or not! :-)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;That was it..Good Luck! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-4203894074071232820?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/MZkF5qy3sRs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/MZkF5qy3sRs/wanna-work-at-google.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2008/04/wanna-work-at-google.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-8225984717168116922</guid><pubDate>Wed, 19 Dec 2007 18:56:00 +0000</pubDate><atom:updated>2008-07-05T23:51:37.020+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">top coder</category><category domain="http://www.blogger.com/atom/ns#">Munich</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">David A.Vise</category><category domain="http://www.blogger.com/atom/ns#">math</category><category domain="http://www.blogger.com/atom/ns#">google-tale</category><category domain="http://www.blogger.com/atom/ns#">algorithms</category><category domain="http://www.blogger.com/atom/ns#">technology</category><category domain="http://www.blogger.com/atom/ns#">google tale</category><category domain="http://www.blogger.com/atom/ns#">Prashanth</category><category domain="http://www.blogger.com/atom/ns#">google path to success</category><category domain="http://www.blogger.com/atom/ns#">Babji</category><category domain="http://www.blogger.com/atom/ns#">chetty</category><category domain="http://www.blogger.com/atom/ns#">Germany</category><category domain="http://www.blogger.com/atom/ns#">Bangalore</category><category domain="http://www.blogger.com/atom/ns#">nuremberg</category><category domain="http://www.blogger.com/atom/ns#">Google Story</category><title>Introduction (To my google story)</title><description>I'm one of those who's interested in creative and innovative things and would like to stuff a wealth of information into my mind. What prompted me to set up this blog (Google Tale) is the interest that I've taken in Google since its inception (specially because of the math and the algorithm work that they do).&lt;br /&gt;&lt;br /&gt;I have been following the Google-path (we use 'Google' almost everyday, anyways) and thinking about how they are leading and where they are heading, from different perspectives (logical, technical, philiosophical and ..whatever). My initial interest started when I registered for Top-coder programming competitions just outta my pure passion to compete in those challenging and exciting competitions. I registered for that although I had a good, demanding job and was satisfied in my job, salary and had a cosy enough life. This is because it was interesting, challenging,exciting and the problem-set of those competitions involved a lot of algorithms(Not to forget that programmers from all over the world were part of that).Top coder was also given the privilege of managing and co-ordinating Google's 'Code Jam', once in an year.So, it was a big learning curve too. Also, I think that every one who is working in software field should keep  abreast of the cutting-edge stuff and learn as much as possible, to be a better programmer.&lt;br /&gt;&lt;br /&gt;And since then, I was hungry for more info and knowledge.. and started loafing around on the information superhighway, jumping from one link to other link for more info and kept myself updated with cutting-edge technologies. The way google is heading with its clear vision, hard work, clever and healthy strategy, mind-boggling math and algorithms impressed me. I dont deny that Microsoft lacks this. I admire microsoft too for being so stubborn, for having to fight with numerous firms and people, lawsuits, and sundry other stuff...It might be bad in some people's terms, but on the flip side when you think about the challenge of facing almost all or many of the other software giants, bear the brickbats and still keep progressing, aint that easy. But my policies strike with google, because of its open-minded strategy, policies, technology, creativity and innovation.&lt;br /&gt;&lt;br /&gt;Finally, this is one reason why I thought that I would dedicate a blog to Google (inspite of the fact that Google is providing the free space for me on blogger..lol). I recently bought a book called 'Google Story' and was immersed in reading that after work, when I'd free time. Being a technology enthusiast, I was impressed with some of the facts and behind-the-scenes stuff that was written in that book. Thats when I decided that I should dedicate a blog and share my views to the world. Ofcourse, there are scores of blogs writing about Google and their stuff, but I just dont wanna 'copy and paste' or be stereotypical, but write something about the Google technologies with some examples.&lt;br /&gt;&lt;br /&gt;I know that there are lot of people, who are more knowledgeable and know much more stuff than I do. So, please correct me if I go wrong rather than directing flames at me. If you still wanna do that, please direct them to dev&gt;&gt;null. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-8225984717168116922?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/ChX5ATQI1O8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/ChX5ATQI1O8/introduction-to-my-google-story.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2007/12/introduction-to-my-google-story.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8063665696479699369.post-8741958054057857691</guid><pubDate>Mon, 17 Sep 2007 01:18:00 +0000</pubDate><atom:updated>2008-11-13T07:38:12.630+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">page rank</category><category domain="http://www.blogger.com/atom/ns#">google operating system</category><category domain="http://www.blogger.com/atom/ns#">goole file system</category><category domain="http://www.blogger.com/atom/ns#">big table</category><category domain="http://www.blogger.com/atom/ns#">distributed computing model or frameworks</category><category domain="http://www.blogger.com/atom/ns#">mapreduce</category><category domain="http://www.blogger.com/atom/ns#">google tale</category><category domain="http://www.blogger.com/atom/ns#">Google system architecture</category><category domain="http://www.blogger.com/atom/ns#">babji prashanth chetty</category><title>The Google System</title><description>&lt;span style="font-weight:bold;"&gt;NOTE: Please read the 'Disclaimer' before reading this post. Also, this is just a naive attempt to explain the Google Architechture, in brief.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My first thought about the Google system is to compare the entire Google system to an operating system. This is because, there are many similarities in between the two. Below are some points, by which I compare Google system and an operating system:&lt;br /&gt;&lt;br /&gt;1) Google has an 'File System' (GFS) like any other operating system.&lt;br /&gt;&lt;br /&gt;2) Google uses 'caching' concept similar to an operating system. (Not exactly similar, but something that you can compare).&lt;br /&gt;&lt;br /&gt;3) All the data is contained in the file system of operating system. Similarly, Google contains much of the internet (it aint everything, but Google is the top engine at the moment, which has crawled the maximum number of pages/sites) and is containing almost all the data on the internet (in its cache/Distributed File System - GFS).&lt;br /&gt;&lt;br /&gt;4) An operating system maintains a 'page/paging' table to store the mapping between virtual addresses and physical addresses. In a similar way, Google system has a table (Big Table) which maps the domains to their respective pageRank's (and ofcourse, many other things are involved. This would probably be enchanced/modified gradually, as building software is an evolutionary process - as new ideas/requirements keep poppin' up).&lt;br /&gt;&lt;br /&gt;Below is the schematic of the bare bones of a Google System (Note: I'm just trying to put forward my thoughts and not assuring the system architecture, as I dont work for Google.com Engineering (and I dont know any of the Google employees, in person)):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KT5j9JZRXjo/SC4zVf9l4wI/AAAAAAAAFik/xXv0Gs-7xGA/s1600-h/Google_System1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_KT5j9JZRXjo/SC4zVf9l4wI/AAAAAAAAFik/xXv0Gs-7xGA/s320/Google_System1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5201151064109605634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see in the above pic, if a end-user sends a request (using Google.com search) to the Google server, the server receives the request, interacts with its 'File System' and looks up the 'Big Table' for pageRank  of domains related to that keywords (or search terms) and responds by providing a ordered list (descending order of PageRank's) of results with domains related to that search term.&lt;br /&gt;&lt;br /&gt;Note: This is just a simplified system architecture. Ofcourse, there's much more complexity associated with that - with things like Clusters, Distributed Computing models/frameworks like mapreduce, Distributed File System, calculating pageRank, Complex Algorithms That Run Behind The Scenes, Network Algos,...and much more.&lt;br /&gt;&lt;br /&gt;Its obvious from the above pic and the associated text, that Google can be compared to an operating system (similar to the way, you fetch a file from the operating system). It also means something....that Google contains much data or metadata of many sources on the internet and is adding much data day-by-day (or hour-by-hour /sec-by-sec or whatever). The way it searches for new (freshly created) or middle-of-nowhere domains, by sending crawlers, indexing/caching that info in its 'Big Table'/'File System', is one more topic. And ofcourse, because of privacy policies or any other reasons, some domains might not be included. Also, any domain can exclude itself, by creating/copying robots.txt file in one of its directories, so that the Google crawlers would stop including that in search results or updating its info).&lt;br /&gt;&lt;br /&gt;Apart from all this info, one more point that I would like to add is the strategy by which Google is attracting users to use their other technolgies like Google Maps, blogger, photo albums, Google pages, Notebook, Spreadsheets, Orkut, et al (which indirectly help Google in containing all the data on the internet).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8063665696479699369-8741958054057857691?l=google-tale.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/Zxyb/~4/-_q45gdz5uI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/Zxyb/~3/-_q45gdz5uI/google-system.html</link><author>noreply@blogger.com (Babji Prashanth, Chetty)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_KT5j9JZRXjo/SC4zVf9l4wI/AAAAAAAAFik/xXv0Gs-7xGA/s72-c/Google_System1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://google-tale.blogspot.com/2007/09/google-system.html</feedburner:origLink></item></channel></rss>

