Google

Google Treasure Hunt: Last problem

The last and fourth problem from Google Treasure Hunt deals with consecutive prime numbers. Its basic form is:

Find the smallest number that can be expressed as
the sum of m consecutive prime numbers,
the sum of n consecutive prime numbers,
the sum of o consecutive prime numbers,
the sum of p consecutive prime numbers,
and is itself a prime number.

For example, 41 is the smallest prime number that can be expressed as
the sum of 3 consecutive primes (11 + 13 + 17 = 41) and
the sum of 6 consecutive primes (2 + 3 + 5 + 7 + 11 + 13 = 41).

In the case of m, n, o, and p, there are four conditions, although there can be more. The example of 41 has only two conditions, for instance.

Again, my solution was written in Python and is designed to scale to a variable amount of conditions, as seen in the primes.py I wrote:

Google Treasure Hunt 2008

Google Treasure Hunt seems to be fairly interesting. There are three puzzles released so far; a fourth one will ensue at 1212448500 (that's new Date(1212448500 * 1000) for you JavaScripters). The first two are dubbed "robot" and "zip" by Google, the former sponsored by the Sydney office, the latter sponsored by the Mountain View headquarters. The latest one, which I call "route" (there is no official name for it yet officially named "network"), is sponsored by the San Francisco office.

Flayout: Flexible Degrading Layout

Some time ago, I read an article that described a smart dynamic layout mechanism for web pages that would gradually hide and collapse certain elements of the page as the browser window is resized. Unfortunately I can no longer find the article (I'd appreciate it if someone points out where it is), but I thought the idea was great. In this era of awesome JavaScript libraries, it's trivially easy to implement this mechanism. So I took the liberty to do just that on this site.

On a resize event, it would check the viewport width and height, and, depending on what range it falls in, it would hide or collapse elements accordingly, gracefully degrading the layout. A technique that I dubbed "intelligent switching" was used to determine which range the width and height falls in, elegantly. To me, that means not resorting to a chain of if statements. I'll talk about intelligent switching in another article, but for now, below is the list of ranges and what happens when the viewport dimensions fall in that range.

When Width Is Below (px) This Happens
875 Right sidebar disappears.
700 Service links disappear.
550 Pine trunk on the right collapses. The navigation and breadcrumb bars disappear.
When Height Is Below (px) This Happens
500 Breadcrumb bar disappears. Navigation bar shortens and floats to top right. Header region collapses.

When the viewport dimensions move out of range the changes reverse. Flayout is working right now, live on this site, so try it out and see for yourself how it works. This has been tested and known to work under Firefox, Opera and Safari, and it isn't working under Internet Explorer, yet. I have yet to debug this under Internet Explorer. Someday, I'll do it.

New Version of Gmail Is Slower?

There has been several reports mentioning how slow the new Gmail is. In all cases, the problem seems to be cross browser, and of course, cross platform.

Strangely, in my own case, the new Gmail was not slow at all. In fact, it was so fast that I was surprised. It was then when I noticed subtle changes like the custom drop-down list, narrower message rows, the new position of the "Loading..." message, and the "Older Version" link. It even kindly reminded me that Firebug slows Gmail down, and, to fix it, I should disable Firebug for mail.google.com.

According to Google, Santa Claus is...

Recently I've been trying out the US International keyboard layout, so naturally Google's search box was the obvious target. I typed père noël (Santa Claus in French), and out came...

"père noël est une ordure" (Santa Claus is rubbish)

Congrats to the Writely Team

Writely has been acquired by Google.

Congrats to the whole Writely team, including Sam, Claudia, Steve, and Jen.
This is a great opportunity for great improvements!

Devmo Ads on Google

I just searched for "ajax columns" in Google, and gosh, there's this ad on the side:

Wow. I love that ad ;)
It's clear (tells you what it is), has a clean URL, and a good title.
Devmo's getting much better at advertising.

Search Engine Thanksgiving Roundup

First, the Google logo and Gmail logo has some changes.

This is last year's Thanksgiving Gmail logo.

This is the '05 one.

7 things the Gmail Team is thankful for this year

Countering Google Analytics Boycott

Some guy on the net thought of a clever way to make Google Analytics unable to collect data under Firefox browsers. First of all, he spelled Firefox wrong. It's "Firefox", not "FireFox". He achieved this by using the adblock extension (not "plug-in", as he said) to block *.google-analytics.com.

After using this "counter-anti-block" method, the only way to avoid is to turn off JavaScript.

Happy Birthday Google


Happy Birthday Google!
Google is now 7 years old.

Syndicate content