Google Treasure Hunt puzzles are too easy?

2008 May 23rd | By brutuscat | Comments (0) | Permalink

Under: Java - PHP - opinion - programming

Seems that the Google guys are getting softy. The last two questions of the Google Treasure Hunt 2008 were easily solved.

The Question #1 is about paths. We have a robot that can move down or right, in a n x m grid. So how many possible paths exists, from the top left to the top right?

It gets solved just searching in Google for “grid path right down” from there you will get the equation that you must run on any language that has Big Integer implementations, since involves the calculations factorial.

Example of our solution for the first puzzle in Java:

BigInteger dividend = factorial( (rows-1)+(columns-1) );
BigInteger divisor = factorial(rows-1).multiply(factorial(columns -1));
System.out.println(dividend.divide(divisor));

The Question #2 seems to be even easier. It involves to transverse a directory tree, filtering the files that verifies 2 conditions based on the path string and the extension string (like .txt or .xml). Then reading some specific line. All files are text files this simplifies then things even more. Nothing hard to any programmer.

Snippet of our solution for the second puzzle in PHP:

// Setting where's the Google Treasure Hunt Directory
$dirbase = 'GoogleTreasureHunt08_11336769377172459175';

// Creating and loading the directory Tree
$tree = new Mytree($dirbase);
$tree->load();

// Getting the leaf Files
$leafs = $tree->get_leafs();

// Filtering to files that satisfies the conditions
$cond1 = array_filter ($leafs, filter_bycond1);
$cond2 = array_filter ($leafs, filter_bycond2);

// Doing the sums at the right line number
$sum1 = array_reduce($cond1, create_function('$v, $node',
             '$v = ($v == null) ? 0 : $v;'.
             '$v += (int)read_line($node->data, 5);'.
            'return $v;'));
$sum2 = array_reduce($cond2, create_function('$v, $node',
            '$v = ($v == null) ? 0 : $v;'.
            '$v += (int)read_line($node->data, 5);'.
            'return $v;'));

echo $sum1, '<br>';
echo $sum2, '<br>';

// Obtaining result
echo $sum1 * $sum2;

So as you see, there’s no complication at all. I would expect some challenge when Google uses the “Puzzle” word. Maybe they aren’t what they were? I don’t know, but I will be expecting some real challenge to solve :).

Robot solution:  GTH Q1 Java solution

File transeversing solutino: GTH Q2 PHP solution

Data portability is good, but Late 2.0

2008 May 9th | By swain | Comments (0) | Permalink

Under: opinion

Back in 2001 we wrote an arcane simple perl script just for fun. The script gave you the freedom to export IMDB movies from your ranking to your web page. Now in 2008 and with business goals in mind, we need to export/interact with information from sites like LinkedIn and add it to our handcrafted mashup pipeline or our CRM, but it’s not possible without being blocked, see LinkedIn Scraper for more information.

Data portability is a must (sometimes an API is enough) but the "official" data portability innitiative came very late:

> whois dataportability.org

Domain ID:D149678191-LROR
Domain Name:DATAPORTABILITY.ORG
Created On:07-Nov-2007 04:21:39 UTC

Last Updated On:07-Jan-2008 03:49:01 UTC
Expiration Date:07-Nov-2008 04:21:39 UTC

On the other side, sites like LinkedIn increase their business risks if they share too much data and become easily replaceable. So the question is how to deal with this conflict of interest? An obvious business model  is what SalesForce does with AppExchange and Facebook does with Facebook applications: Run your applications within their [eco]system.

So now in 2008 LinkedIn has been lazy to balance between being open or not (even putting a public price to their data sharing policies), but the data portability "lobby" woke up too late, or Late 2.0.

 

Next moves: Spy Studio, Deviare, OEAPI for Vista, NKT WAB LGPL

2007 May 16th | By swain | Comments (0) | Permalink

Under: opinion - products

As you may already know, Nektra core skills & knowledge can be briefly summarized in system internals & problem solving, innovation and creativity. We were working hard to introduce new products in the market and it’s very stimulating when you receive “Wows!” from people who can appreciate the complex stuff we have made.

Our next play is Spy Studio, Deviare, OEAPI for Vista & NKTWAB license change to LGPL:

Spy Studio is a new tool for hooking microsoft windows applications, it has an intuitive interface and you don’t need to be an expert in assembler or reverse engineering to insert hooks into different API’s or DLL’s. It has many interesting applications like seeing what your software is doing internally, and from the business perspective it’s very useful for monitoring, isolating processes access to some API or DLL, debugging, litigation & software forensics, support, software engineering blackbox testing, etc. You can download it now from here. We would be very glad to receive you comments in our forums

Deviare is the component to do your own applications and the framework used to develop Spy Studio. You can do your own hooking application with it, and extends Spy Studio’s possibilities to your own requirements, for example your own api monitors, administration tools, themes/skins/gui (i.e: scrollbar issues), posture agents, intrusion detection at the application level, etc.

OEAPI has been growing and now supports Vista’s Windows Mail in addition to Outlook Express. We are currently at the version 3.1.2 and 3.2.0 will be released very soon. OEAPI has really improved in demos, documentation, performance and capabilities. There is an updated list at What’s new section.

NKT WAB is now LGPL and it shows how to implement features not available or documented in the microsoft windows api. This component is useful for accessing the WAB (Windows Address Book), creating groups & folders and now supports Vista’s contacts too.

There is new stuff coming, but the most important thing is that our customers continue expressing their Wows!

Keyword Exchange Market

2006 January 13th | By swain | Comments (1) | Permalink

Under: ideas - opinion

KEM (Keyword Exchange Market)Seeing impressive energy and room for improvement in the keyword advertising technology arena we ask ourselves when can we see something new.Our main idea is to have a Keyword Exchange Market like the ones in Stock exchange, Foreign exchange, Futures exchange.What are the real advantages of it?

  • You can contract with AdWords (from Google) and see your banners in the Overture network (i.e: Yahoo, MSN), whilst transactions between AdWords and Overture are being negotiated in the background.
  • If you like to implement your own mail service and want to receive ads revenue, you can do some analytics/text mining yourself and then sell keywords in the KEM to appear while the user reads his mail.
  • Build your own keyword server and integrate it on the KEM. Competing with the big players.

Main threat obviously is the Click Fraud and other kinds of attacks, but we hope to see research in the Economics Faculties about KEM soon.There are incredible possibilities with this kind of free market.