Wednesday, May 28

IMDbPY: The Python Interface for IMDb

I was looking at IMDb's Alternate Interfaces to find a way to quickly and easily retrieve information on a few hundred movies, to make a catalog for my collection. I was going to write a Python script to do all the hard work for me, but since Python is so widely used, I decided to do a little search on the topic before I start coding everything myself.

And guess what: there is already a Python package to do that: IMDbPY! It even has a web server package (imdbpyweb — a little buggy yet it works). The template is really ugly, and it can only display info on one movie, but it catches the data and only retrieves what is necessary, so it's quite fast. A little XHTML/CSS tweaking and it can look quite impressive.

So now I only have to write a snippet of code to do the search (using IMDbPY), pick the best result, download some basic info, like year, poster url, etc., and build a nice list to make an XHTML catalog for my movie files. It's not finished yet, but when I have something ready-to-use, I'll post it here (or maybe on the IMDbPY web site), maybe others might like it too.

Anyway, nice package. I like Python packages, they're easy to use, well documented, mostly cross-platform, and there's a whole bunch of them. That's why I decided to share my find with my readers (all eleven of them, he he). Maybe there are other Python addicts besides me out there :) So, have fun IMDbing!

Monday, May 26

Google Treasure Hunt Week 3 Announced

The Official Google Blog has announced week 3 of Google's Treasure Hunt to be on Tuesday, May 27 at 10 a.m. PDT. I just can't wait!

But I'm concerned about something: they say they'll be giving out a few prizes for the fastest contestants. Does this mean that someone can collect the best answers and only sign up when he has the fastest possible algorithm to calculate it? Like Larry's super-fast robot-maze calculation algorithm... Is it better then not to submit your answer until you have an efficient algorithm, so you could submit it in a matter of seconds? Phillip Grasso, Manager, Engineering/Operations posted:

We'll be giving out a few prizes for the fastest contestants to complete each question. There will also be a grand prize for the contestant who correctly answers all four questions in the shortest cumulative time (time is defined as the time between the question's release and the submission of the correct answer). The previous puzzles will still be accessible off of the main page.

Anyway, I can't wait for the next one. I definitely won't be the fastest to answer it, but I'll come up with something Pythonic :)

Second EC Contest: Primes in Pi

Here's another contest, this one for 2,048 EC. Since you all have practice with the number π, this shouldn't be hard at all. It took a few seconds to calculate. Well, let's see if you get those Entrecard Credits now :) As always, whoever posts the correct answer first is the winner.

Let's say, we start to color the first 1,000,000,000 digits of π, like this: find the first occurrence of 2 (since it is the first prime), and color it. Now look for the second prime, 3, after the occurrence of 2, and color it too. Then, look for 5 in the remaining digits after 3. And so on, we color each first occurrence of each prime in the digits right from the first occurrence of the previous prime. We'll get something like this:

π = 3.
14159265358979323846264338327950
28841971693993751058209749445923
07816406286208998628034825342117
06798214808651328230664709384460
...

So, in the first couple of decimals, we colored 8 digits. My question is, how many digits should we color in the first 1,000,000,000 digits of π? Try yourself, 1,000 EC is waiting for the winner!

UPDATE 1: I've raised the prize, since nobody seems give it a try for 750. So here's a chance to win 1,000 easy Entrecard credits. It's just a little math :)

UPDATE 2: I've raised the prize once again. I hope someone will come up with the correct answer soon, or I'll have to double the prize again!

Friday, May 23

EC Contest: Sum of 1,000,000,000 Digits of Pi (π)

I decided to host a contest here on my blog: The first person to calculate the sum of the first 1,000,000,000 digits of π (Pi, 3.141592...) and post it here will get 500 Entrecard Credits from me.

To be sure you don't misunderstand anything: You only need to sum the decimal digits of π: like, the sum of the first 10 digits = 41 (π ≈ 3.1415926535897932384, and 1+4+1+5+9+2+6+5+3+5 = 41). The result is a number < 1,000,000,000. When you find this number, post it here in a comment. The first one who posts the correct answer will be the winner.

If you have an Entrecard account, post your Entrecard user id so I cand send you your reward. If you don't have an account, I can write a review about your website or blog as a reward.