Skip to main content


Showing posts from May, 2011

Conversion of miles to kilometers (and back) using addition only

Some time ago I came across the trick that allows easy conversion of miles and kilometers (and also mph and km/h) using addition only. The trick uses the fact that the ratio of the Fibonacci numbers is very close to the conversion factor between miles and kilometers. This is an example of turning multiplication to addition in a similar manner to the use of logarithms in a slide rule . Firstly, the Fibonacci sequence is pretty easy to remember or regenerate from scratch because it is generated by the rule "the next number is the sum of the preceding two numbers". The sequence starts from 0 and 1 and then proceeds 1, 2, 3, 5, 8, 13, 21, 34, ... Each number is the sum of the previous two numbers. Secondly, the ratio of consecutive Fibonacci numbers gets closer and closer to 1.62 the larger the numbers get. For example, 3/2 = 1.5, 8/5 = 1.6, 13/8 = 1.63, 21/13 = 1.62, 34/21 = 1.62, ... Lastly, there are 1.61 kilometers in a mile. If you take the ratio of Fibonacci

Playing Pong on a pair of candy cans: it's the Cansole!

A little while ago I mentioned that I was working on a new contraption: a video games console in a candy can. It's now complete and I can play Pong on a TV. Here's a shot of the completed contraption. On the left is the main controller (the power switch is visible) and on the right is the expansion controller with its cable. The left (red) controller also has a 'fire' button that isn't visible and both have simple 'paddle' style controls. On the bottom of the main controller are the main connections for the TV (video and audio) and a second controller. The second controller contains nothing but a simple potentiometer. But the main controller is much more complex. There's an Arduino Pro , a potentiometer (for the paddle control), a button for 'fire' or 'select', the battery and the connection to the video and audio and second controller. Video and audio are handled by the Arduino TVout library. The entire thing is wired

The code on XIII : The Series

So, I watched an episode of the awful series XIII : The Series . In the first episode the main character comes across a memory chip in his watch and looks at it on a computer. He doesn't know what it is. Here's a shot of what he saw: Clearly, he's not a C programmer. I figured it would be interesting to track down the code that he was looking at. Using the function name 'tripcharup' I found this code . The TV people seem to have extracted random lines from that file and repeated them over and over again on screen.

O Atlas Geek: 128 Lugares Onde a Ciência e a Tecnologia Ganham Vida (The Geek Atlas in Portuguese)

At the start of June, The Geek Atlas will be published in Portuguese by publisher Editora Altabooks (it's also available in German ): Os 128 locais abordados neste livro compõem uma lista pessoal de lugares para visitar onde a ciência, a matemática e a tecnologia aconteceram ou acontecem. Você não encontrará pequenos e tediosos museus de terceira categoria, ou placas presas à parede indicando que “o Professor X dormiu aqui” entre os locais selecionados. Cada lugar possui real interesse científico, matemático ou tecnológico. Nem todos os lugares apresentam invenções ou descobertas humanas. Há também fenômenos naturais, como o variável Polo Norte Magnético e a Aurora Boreal. E há também alguns túmulos de cientistas famosos, mas tenha a certeza de que há equações neles. Cada lugar tem seu próprio capítulo e cada capítulo é dividido em três partes: uma introdução geral sobre o local, com ênfase em sua importância científica, matemática ou tecnológica; um assunto técnico relacion

Next can-traption: Video Games Can-sole

So, to silence the people who keep asking "What are you going to do after GAGA-1 ?", here's the answer: I'm going to build a small video games console that fits inside a Marks and Spencer boiled sweet can. Here's a rough shot of the major parts: That's an Arduino Pro , power switch, fire button, potentiometer, 9V battery, and two RCA connectors for composite video and audio. Here's a shot of the can when it's closed. The potentiometer knob will be used to implement the games Pong and Breakout . The video generation is going to be done entirely in software using Arduino TVout . Here's another shot showing the fire/select button. On the back are the two RCA connectors for video and audio. The tag for this project will be cansole .

OSCON '11 Keynote: Turing, Perl and Palpatine.

Last August I asked for your suggestions for a mystery keynote speaker slot, and got many good suggestions. Finally, I'm able to say that the conference is OSCON 'll where I'll be giving a keynote on Wednesday, July 27, 2011 . The chosen subject is embargoed for the time being, but will feature a combination of Perl scripts, Alan Turing, and Emperor Palpatine. And we'll have some Arduino action and a dash of text mining as well.