Have you ever seen someone solving the Rubik’s cube within a minute? I did and I was amazed! Afterwards I walked through Lissabon staring at the cube and desperately trying to figure out how to solve it. By now I finally learned how to proceed. You can find an intuitive approach on Lars Petrus’ website. As with many complicated toys a lot of math is involved. In this case a lot of group theory and combinatorics. But actually I am no big fan of sober complicated math. Nevertheless I was eager to tinker with the cube and began by writing a program which had an explicit representation of the cubes’ face colors and operations to arbitrarily rotate the sides. The explicit representation is good if you want to modify the cube. However often it is just necessary to identify a particular cube state. Imagine you want to enumerate all cube states starting from the solution then you can use for example a breadth-first search. As with general graphs you need to remember states which you already encountered. For that purpose you should use a more compact representation of the cube. Suppose there are
Rubik’s cube states in total, then the minimum number of bits to represent a state is clearly
. You achieve that goal if you are able to assign a unique number
to each different possible cube state. This number is also called rank and the conversion from the explicit representation to the rank is referred to as ranking. The reverse is of course unranking.
Ranking and Unranking of Rubik’s cubes
February 26th, 2008Digital Television with Linux
April 10th, 2007Analog TV is dead. Well almost. Digital television is state of the art. In 2005 the terrestrial digital video broadcasting (DVB-T) in the region Nuremberg in Germany started. Therefore I decided to buy a digital receiver some time ago. I chose an external receiver connected via USB 2.0 manufactured by AVerMedia which was branded as: “AVerTV DVB-T USB2.0″
To get some more information let us use the usbutils.
# lsusb -v
...
Bus 001 Device 003: ID 07ca:a801 AVerMedia Technologies, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x07ca AVerMedia Technologies, Inc.
idProduct 0xa801
bcdDevice 0.00
iManufacturer 1 AVerTV
iProduct 2 A801
iSerial 0
bNumConfigurations 1
...
Every digital as well as analog television receiver has a tuner module integerated. A little research revealed that the “AVerTV DVB-T USB2.0 (A801)” has a DiB3000M-C/P tuner (also called frontend). Since the device is a so called budget – in contrast to a full featured – dvb-t receiver, it has no MPEG decoder chip to decode the compressed video signal in hardware. Thus the receiver is cheaper but the decoding has to be done by the host cpu itself which is quite computationally expensive.
Programming the Game Boy
March 6th, 2007The original Game Boy has a modified 8-bit Z80 micro processing unit which is running at about 4.2 MHz. It features a serial port (link cable) for multiplayer games, a sound unit and a screen with an resolution of 160×144px. In 2001 a major successor was released: The Game Boy Advance. It relys upon an 32-bit ARM processor running at 16.8MHz. For backwards compatibility a Z80 is integrated clocked at 8.4MHz.
A long time ago (back in school) I read about a Game Boy programming device. I was quite amazed and immediately knew “I want such a device!”. Later on in the first term of my computer-science studies I met Johannes Bauer who has very good electronics knowledge. I told him about that device and the project was born. We ordered the parts immediately. Though the assembling of the programmer began two years later… Well now we finished it and the Game Boy is quite out of date – but who cares? At least they are cheaper now…
Unwrap sphere textures
February 11th, 2007When rendering 3d graphics today there exists an underlying geometric model which is visually spiced up by wrapping texture bitmaps round the basic surface. So each time a pixel of the object is drawn on the screen the geometric three dimensional coordinates are known. To derive the pixel’s color the coordinates must be mapped to a point in the texture image. Therefore texture coordinates are stored at each vertex of the geometric model. When drawing pixels which are not vertices the texture coordinates are interpolated using the neighbouring vertices. But where do those texture coordinates come from? There are basically two possibilities. Either the coordinates are specified manually (for example with the help of the modelling software) or the coordinates are generated automagically.
Wake-on-Lan
February 9th, 2007I like accessing my machine at home from university. I tend to forget to commit my source code changes or upload other import files. Thus it comes in handy if I have secure shell access. But what if I forgot to switch on the computer? Cycling home 30 minutes, press the power button, cycling to university again. Since I am usually late every morning I forget to press the power button quite often. Since 1h is just too much time wasted there must be a better solution.
Heaps of size n
February 9th, 2007![]()
The ordering of the elements in a heap of size
is not unique. That is no magic observation. Have a look at the heap images. Both contain the same elements, both fulfill the heap property and are different. So how many different orderings are there? To answer this question we need some observations. The easiest one: The root at the very top of the heap contains the biggest element. Both children in the binary tree are again heaps – but with how many elements?
My very own blog…
January 12th, 2007Well, now I got a shiny new blog. cute isn’t it? Stay tuned…
Defrosting revealed
July 8th, 2004This quick article is meant to reveal the “tricks” behind defrosting your refrigerator in a quick and efficient manner. There’s no need to occupy your neighbors fridge. Just get your hair-dryer or ask your neighboring bonny if you haven’t got one at hand. Now let’s get our hands on.
