Tuesday, May 31, 2011

Tile Figures with Montage (ImageMagick)

Suppose you have several figures for articles ,papers, blogs, or anything else. You want to combine these figures into a bigger frame, and they have gaps between each other. How? I had used Inkscape to import the figures, arrange them, and export the final result. No, don't do that again. It is not necessary to launch your image editors with GUI to accomplish this kind of work. I found the most convenient  way is to use some commands offered by the magic ImageMagick.

Good examples have been given in ``ImageMagick v6 Examples -- Montage, Arrays of Images,'' and the following is my own test with some notes.

Sunday, May 22, 2011

Tetris in Command Line

Ha ha! That's really funny. I never think about even sed can be used to write games such as Tetris!

I just wondered how to play Tetris in command line. Googled it and found several results with source code. There are three of them I've played:
  1. Tetris for the command line with Python Curses (in Python)
  2. Play Tetris at the command line (in sed)
  3. tt: Tetris for Terminals (in C)
To compile tt, you may need to install ncurses, or you will get the following errors:
utils.c:32:20: error: curses.h: No such file or directory
utils.c:33:18: error: term.h: No such file or directory

In Ubuntu, just install the ncurses-dev.

Thursday, May 05, 2011

[talk] Thanks to You

I attended a class about how to write English emails yesterday. At the end of the class, the lecturer asked us to write an email for exercise. Below is what I wrote. A personal thank to you who have contributed to the open source community.

Dear Mr. and Ms. Hackers,

I am writing to thank you for your great and amazing works
to the open source community.

With so many brilliant tools you've created and kindly released,
many end-users, including me, are allowed to do more useful
things with free [of] charge and, more important[ly], with the freedom
to choose software.

Furthermore, I've learnt about many interesting and useful skills from
the source code released by you.
That's great and I hope I could be capable of contributing back to the
community in the future.
Thank you all for your great works.

Sincerely yours,


THK