Thursday, May 15, 2008

Labyrinth - bugfix release

It was too early to release the first version of Labyrinth without proper checking. Even considering "alpha" status of the project. The issue was found almost immediately, though I did not have a time to fix it.

Pygtk in OS2008 and in SDK 4.0 does not support method `to_string` for gtk.gdk.Color, only attributes: "pixel", "red", "green" and "blue". The method is used to store RGB color values like 127/64/0 in hex text "#007f0040000". Can someone advise why it's not working on maemo? The web site says "This method is available in PyGTK 2.12 and above.", however OS2008 contains:


>>> import gtk
>>> gtk.ver
(2, 14, 0)

This was the workaround for the issue:

def color_to_string(color):
return "#00%02x00%02x00%02x" % (color.red, color.green, color.blue)

Now as the saving is fixed the only porting task left is maemo's Virtual Keyboard support ;)

Sunday, May 4, 2008

Labyrinth - mindmap tool for maemo

Hi all!

Short preamble at first. Recently I've become a fan of mind mapping. I visited Exception #07 developers conference in March and there was a guy who did his presentation using not well-known tools like MS PowerPoint or OpenOffice Impress but he used totally different approach, Mind Map. It's the way of brainstorming or displaying your ideas just the way like human brain works - not one by one like sheets of paper but radially with multiple links and forms. It's much better than scrolling page by page during workshop, for example.

For daily use my choice was Java-based Freemind - big, but powerfull and available for Linux, Mac and less popular systems like WinXP, etc . But I wanted something small and modest to use on my Nokia N800. So I've done some search and found nothing. So I(as python/bit C/C++ dev) did some search among apps written in python and found Labyrinth - http://code.google.com/p/labyrinth/

Really don't understand people who use tons of autotool/autoconf code + python script just to install 10 .py files. But I've finally managed to release an alpha-quality port of Labyrinth for maemo - http://labyrinth.garage.maemo.org/ , available also on maemo website - http://maemo.org/downloads/product/OS2008/labyrinth/

Note! It's not ready yet for `production` as I took dev/trunk version from
the original website to have more powerful application with curves and
more export formats supported. If you are interested and want to contribute
either to application itself or to maemo port in particular - you know now where to go.

Here is what it looks like:

Tuesday, April 1, 2008

Bash: top keyboard shortcuts

There are people around me who've been Linux developers for years and they haven't taken a labor of reading "man bash" so far. It will not of course give you 1000% performance increase immediately but is worth reading it at least once. Just to support popular tradition, here is my list of most useful and frequently used keyboard shortcuts in bash(in order of popularity):

  1. Tab - autocomplete current command, directory or file name. I think it's about 50% of the whole statistics :)
  2. Ctrl-C - kill currently running something.
  3. Ctrl-R - search command history backward.
  4. Ctrl-L - the same as `clear` command. Wipe the screen. Very cool when you need to have blink console for the next info.
  5. Ctrl-A/Ctrl-E - go to the beginning/end of the current line. Sometimes Home/End keys are broken. Just in case.
  6. Ctrl-U/Ctrl-K - remove text from current position to the beginning or from current position to the end. Of course you can press <- or Delete key 200 times to get the same result..
  7. Ctrl-W - Remove the word(or part of it) before current position.
And this is something I've learnt recently:
  1. M-f/M-f - just forward/back one word
  2. Ctrl-v Tab - insert "Tab" char. Previously I did copy from Vim and paste :(
  3. M-u/M-l - change the current word to upper/lower case. Especially useful when Caps was pressed accidentally :)
  4. Ctrl-x @ - auto-complete hostname

Sunday, March 23, 2008

Stardict in maemo extras

It's been about a month since I first downloaded Maemo 4.0(Chinook) SDK and tried to compile something like stardict. But there is much more difficult thing left to do - add .deb packages to maemo repository and create .install file.

Nokia did the right thing I think - usual user only needs to click on green button and choose place where to put an link in menu. The whole work is left invisible behind - to provide easy setup developer has to:

  • create SSH RSA private/public keys
  • create GPG keys
  • upload public key on maemo garage
  • write changelog info
  • sign changelog files
  • upload packages onto "extras" repository
  • create installation file

Of course, Nokia has half-draft tutorial for this. So after the long process sleepy contributor finally gets this pretty arrow:
Note: still beta!

Tuesday, March 18, 2008

Back to 80s - console pacman game

Some time ago I had an interview for AI developer and the task was to write a Pacman game. I was not in mood to create a nice GUI or pretty 2D/sprites graphics, the main thing to do was to show ghosts running after the player. Used a standard non-blind path-finding algorithm for this. Here is the screenshot of the game(it's ugly, I know!):

Actually that's not the first game I've ever made. The first one was "Mine Sweeper" written in BASIC when I was 14. And I can assure you python is just awesome! May be anyone can remember GOTO and GOSUB/RETURN operators. Now having all these OOP, exceptions, libraries it's like damn nightmare. I definitely will prefer python to BASIC when teaching my children ;)

The source code(in python, of course) can be found following the link

Thursday, February 28, 2008

Hi mom! Meet my bots!

Just imagine - not too distant future, you use robots' help everyday as if it's as common as cleaning teeth. They help you to keep order in your house, they send you reminders, they store all your friends' birthdays(so what?! I't my weak point). What if I tell you that you can use them more from today?

Google released its translating bot farm - special service to have an easy-access dictionary/translator in your gtalk Buddy list:

Russian to English:
Eugene Antimirov: Где находится ближайшая станция метро?
ru2en@bot.talk.google.com: Where is the nearest subway station?
Eugene Antimirov: Сколько это стоит?
ru2en@bot.talk.google.com: How much does it cost?

English to Russian:
Eugene Antimirov: Hi, anybody here speaks English?!
en2ru@bot.talk.google.com: Привет, кто-то здесь говорит на английском языке!?
Eugene Antimirov: What's the problem, buddy?
en2ru@bot.talk.google.com: В чем проблема, приятель?

It's awesome idea, I think. Of course IM/Jabber bots are not something new. IRC servers have had them for years. But new web2.0 and other services may breathe new life into this idea!

Even in my daily routine I use a few. Most frequently used one I wrote to keep an eye on my servers:

Eugene Antimirov: df -h
bot.....@gmail.com: Filesystem Size Used Avail Use% Mounted on
/dev/sda2 5.1G 3.3G 1.6G 68% /
udev 493M 76K 493M 1% /dev
/dev/sda4 135G 115G 13G 90% /home
Eugene Antimirov: sudo /etc/init.d/apache restart
bot.....@gmail.com: Restarting apache... Done

Just 20 lines of python + xmpp code and voila!

One of my friends uses bot who posts latest funny quotes from bash.org.ru to amuse chat visitors on his site.
So I think there will be more and more of them. Who knows...

Thursday, February 21, 2008

Stardict port for IT OS2008

Finally did something useful for Open Source. It's 1:00AM now and I've just completed compiling everything I could find for my Nokia N800. Installing maemo chinook SDK was not without confusing things but I hope they will fix everything.

So the first application was of course Stardict. Just few fixes to code from trunk and it's ready:



Thanks to Gonzo for hosting. You can find 2 deb packages following this link. I'll commit my changes during next few days. In my To-Do list I have now Freeciv, my pacman game and mplayer's new GUI.