Friday, July 6, 2012

Monday, June 11, 2012

Lem

My kid likes Star Wars and Donald Duck. Also the fairy tales of Hans Christian Andersen. And Stanislaw Lem. Lem used to be one of the best writers, not only polish, but in general. It is a privilege to be able to read his books in the original. I lived in Cracow years ago and had a chance to meet Stanislaw Lem twice. I did not speak to him, there were just some meetings with his enthusiasts, like me. There was not enough time to speak, and after all, I am just one among the thousands who like Lem. My favourite book of him are "The stories of pilot Pirx" and "Golem XIV". My kid knows one of the stories ("The hunting") and he likes it, too. The "Droids' fairy tales" also, although I think they are still a little too difficult for him. In fact they are not fairy tales for children.

Friday, June 8, 2012

Quo Vadis

"Quo Vadis" is a novel by Henryk Sienkiewicz, an excellent polish writer. There have been several movies based upon this novel. I want to write about my theory concerning this book. First of all it was published in the XIX century, about 1895. In this time it was very common to write allegories. My theory is that "Quo Vadis" is an allegory, too. I think that the following parallels hold:

1. Neron - Kaiser Wilhelm II von Hohenzollern
2. Petronius - Kaiser Franz Josef von Habsburg
3. Chilon Chilonides - Otto von Bismarck
4. Ursus - Germany
5. Christians - the Polish people
6. persecutions - Kulturkampf

1. Kaiser Wilhelm II was mentally sick. Sienkiewicz may have known about it and it is known from his public papers he hated Wilhelm. Neron is a crazy tyrant, a despot. Kaiser Wilhelm was very active, he was a hunter, an automobilist, an artist. Neron does the same, he acts in a circus as histrio, he sings, even dances.

2. Petronius is an ideal person. Wise, elegant (arbiter elegantiarum), good for his slaves. Sienkiewicz wanted to portrait the caesar Franz Joseph and compare him to Wilhelm. Sienkiewicz loved Franz Joseph and he writes about him as the only person who let the Polish people to love him. Petronius is militarily weaker, he does not have the pretorians, but he has a huge advantage over Tygellinus and Neron himself. An intellectual and moral advantage.

3. Chilon Chilonides. In 1866 the Prussians won a war against Austria and then an interesting event happened. The king wanted to go on and strike against Vienna, while Bismarck opposed this idea for political reasons (he was afraid of France). Chilon is an accusation, it is a suggestion that Bismarck was a spy working for Petronius (Franz Joseph). Sienkiewicz says that Bismarck was arguing with the king because he was a spy. But then something wrong was done to him and he switches his sympathies towards Neron. Because he cannot hurt Petronius directly he accuses the Christians. This is Sienkiewicz's theory about Kulturkampf, he thinks Bismarck hurts Polish because he wants to hurt indirectly the Austria. I also think that the name "Chilo" contains the first letters of a phrase beginning with "chancellier" and ending with "Otto", this is an analogy to the word "ichtos".

4. Ursus - this is the only Christian who has a Latin name rather than Greek one. This name means "a bear". Ursus is an allegory of Germany - Germany in a way betrayed the Austria and after the prussian-french war in 1871 joined the Prussia, which was stronger. Sienkiewicz thinks that Germany should "break the prussian neck" and come back to the rightous ruler, who is Franz Joseph. Just like Lygia is returned to Vinitius. The name "Ursus" must be Latin, because Germany is the Holy Roman Empire.

Again - this is just a theory. "Quo Vadis" (meaning "where do you go") is actually addressed to Germany, and the sense of the question is that Germany have to go back to Rome. Rome and Austria were playing in the same team, while the Prussians were protestants.

I think Sienkiewicz wrote this book and suggested only very few persons how to interpret it. Possibly this book was a political weapon used against Wilhelm II.

Thursday, June 7, 2012

Spaceship

Hi! A small gift for your kids. spaceship0.tar.gz - unpack it, print out, cut and fold to build a kind of a spaceship model.

I have written some scripts constructing such models for my own kid. I have also some scripts creating buildings with textures, like this one:

Wednesday, June 6, 2012

Violin

Writing about the lack of discipline I forgot about the violin. He is playing violin and it requires a lot of training. He does do it. There is even a country song he likes playing, it is a polish song called "Manitou". It is very funny, probably that is why he managed to learn it quite well. Initially we were both attending the violin lessons, but then I gave it up. He plays better than me now.

Tuesday, June 5, 2012

Discipline

Discipline is my failure. We have excellent relatonships, I mean with my kid, but I failed to teach him discipline. He is quite obedient towards myself, but he fails to obey the others. I think he is less obedient than an average child in his age. Unfortunately the teachers complain about it. He has good achievements as a student, but his behaviour is far from perfect, to say the least. I remember I imagined myself in a father's role long time ago and I thought my child would be similar to me. I used to be disciplined at school. He is different.

Monday, June 4, 2012

Kids & sauna

Sauna is something very important in Finland. Everyone goes to sauna. It is not obvious everywhere. I remember once I was with my kid in Poland (Warsaw), in a quite good hotel, and they told me I couldn't take my kid to sauna, because he was under 12. I tried to explain that he got used to sauna, since we lived in Finland. It did not help. In Finland I have once been in a real sauna. There were birches there (to hit one's back and shoulders), a cold frozen lake nearby, and, of course, a lot of beer. It was fun. I think I was the only foreigner, everyone was speaking Finnish. In fact I spoke Finnish too, somehow. The Finns do speak a lot, contrary to the common belief, provided the temperature around them is about 100 degrees (Celsius). Many people have a sauna at home (we do not, since our bathroom is really small). It is a common habit to go to sauna after business meetings. I have even heard that in the old days women used to give birth in saunas. I do not know whether it is true, but I think it is likely.

BTW. This is a piece of code I  once wrote in Perl. It is a maze generator. It is supposed to be unreadable ;)))

#!/perl
($w, $h)=(25, 10);%l=map{$_, {map{$_, 0}1..$h}}1..$w;sub t{my($x, $y)=@_;$l{$x}{$y}|=1;my@c=grep{exists($l{$_[0]}{$_[1]})&&!$l{$_[0]}{$_[1]}&1}map{[$x+$_[0], $y+$_[1], $_[2]]}([-1, 0, 2], [1, 0, 2], [0, -1, 4], [0, 1, 4]);@c&&do{$c=$c[int(rand(@c))];$l{$x<$c[0]?$x:$c[0]}{$y<$c[1]?$y:$c[1]}|=$c[2];t(@$c);t($x, $y);}}t(12, 5);print join("", map{$y=$_;"X".join("X", map{$l{$_}{$y}&2?"-":" "}1..$w)."\n".join(" ", map{$l{$_}{$y}&4?"|":" "}1..$w)."\n" }1..$h);

Sunday, June 3, 2012

Credits

One more script: movie_maker_scripts4.tar.gz. It is useful when we want to create the credits. Then a single frame will be copied into multiple frames. Usage:

perl -f ../../PERL/create_multiple_frames.pl 75 149 credits.png RESULT

The result frames will be stored in the directory RESULT and numbered from 75 to 149. The image credits.png should be prepared beforehand. In our case it was the following image:


Which means "Daddy and Peter".

Friday, June 1, 2012

I have lost in "Risk"

My kid is bilingual, he can speak Polish and Finnish. At home we only speak Polish, he also attends a polish school, once a week. Apart from that he attends a finnish school. He knows also some English due to the Dungeons and Dragons. Also a couple words in German and Russian (he can read a little Russian). He reads a lot in Finnish, especially "Aku Ankka" (Donald Duck). He also likes us to read him books, I usually read him "Cyberiada" of Stanislaw Lem, in Polish of course.

BTW. Yesterday we played in "Risk". It is a kind of a strategic game. I lost. I like this kind of games. I remember I was buying them even when he was too small to play them. I remember for instance he got a game called "Empire" for Christmas. Then he said this was a gift for daddy, not for him. But this "Empire" was really a nice game. Besides it was a good way to teach him a little about the european history and geography. It was about the Roman Empire. We still play it sometimes.

Languages. I mentioned already he creates his own monsters for the Dungeons and Dragons. Then he describes their capabilities in English. Sometimes he does not know how to pronounce words. I was always telling him that the English people had no idea what is an alphabet good for, for example the ending "ough" could be pronounced in seven ways or so. He was laughing;) To be honest we also have some historical issues with Polish, for example there are two ways to write the same phonem. But usually in your own language you do not realize that.

I like Russian and German. I can speak both. Unfortunately I do not speak Finnish, and in Finland almost everyone can speak English. I will have to learn Finnish, though. It is a shame my kid can speak it but not me.

Thursday, May 31, 2012

Do you bite your thumb, sir?

This is a funny story dating back to our kindergarden times. I was telling my kid about Shakespeare, precisely "Romeo and Juliet", and I told him that "biting one's thumb" was an offending gesture in that time. I mean about 500 years ago, in England. It was so interesting for him that he started to bite his thumb "on me". Left thumb, right thumb, both thumbs at the same time... Kids are funny. He also told his colleagues in the kindergarden about it, and for a short while they were all doing it. I wonder whether the teachers knew what was the reason.

Another story, also from the kindergarden. My kid asked my once what is it that I like the most. Without thinking too much I answered "ladies". I did not realize that he was doing his homework and the question was a part of it. On the next day I was given a piece of paper with handwritten sentence "Daddy likes the most the ladies". I lost my reputation, if I had any.

Wednesday, May 30, 2012

Fatherhood & fishing

Fatherhood is full of challenges. My kid likes fishing and occasionally they go fishing with their teacher, my kid with his class. Finland is an ideal place for fishing. There is about one hundred fifty thousand lakes here, besides the sea. Unfortunately I have no idea about fishing. I cannot imagine myself killing a fish. On the other hand it is my job, as a father. Maybe some day I will try. I have to.

Tuesday, May 29, 2012

Castel

This is a screenshot of a castel designed in blender. It is shown only from far away, so there was no need to make it very complex. You can download the blender project here. There are tons of good tutorials for blender and it is definitely worth investing some time to learn it.

One of the amazing features of Blender is its capability to execute scripts. Unfortunately the blender folks have recently changed their API and none of my older scripts works. Bad luck ;(

Our movie has recently stuck since I discovered a wonderful new toy: Google App Engine. Google has created an environment to run for example Java projects on the server side. And it is free. I just love this company ;)

Monday, May 28, 2012

Sound engineering & animations

A tip: while recording the soundtrack for our movie it is important to assure appropriate silence. I mean even turning off the refrigerator, turning off a PC, shutting the windows. In the audacity there is a noise removal but it is better to minimize the noise anyway, so that we achieve a good quality sound.

We can easily measure the duration of the video files typing:

time mplayer movie.avi

Typically we will want to combine multiple video files together, this can be done with the mencoder:

mencoder -ovc copy movie_45.avi movie_46.avi -o result.avi

Not all movies need to be recorded with a video camera, we can also put in between nice animations created for example with the blender. In our movie the wizard writes a letter that is later delivered by a magic bird - this bird is actually an animation.


Sunday, May 27, 2012

Chaos Marines

The Chaos Marines we have painted. We like the Warhammer 40000 ;)

In general I have been trying to show the kid various activities different than the computer games. I like computer games myself and sometimes we play together. However it is important to maintain a balance. Warhammer is an awesome hobby both to paint and to play. I managed to find another one, too - the Dungeons and Dragons. It was a big surprise for me that after a couple months of playing my kid (now 9) expressed the wish to be the Dungeon Master himself. And it works! Of course I need to help him a little, but I would say he is a better Dungeon Master than myself. He is even creating his own monsters and enhancing the adventures with quite unexpected and interesting events. The role playing is definitely an interesting thing to do.

Concerning the Warhammer, we also have some Necrons and Eldars. Necrons seem to be the most attractive for my kid, possibly due to their skeleton-like look. They are also relatively easy to paint.

Saturday, May 26, 2012

Make a movie with your kid! Part3

In order to combine all the frames into a movie (without the sound) we will use a program called mencoder, which comes with the mplayer: http://www.mplayerhq.hu/design7/news.html

All the frames from the directory RESULT3 will be combined into a single AVI file with the command:

mencoder "mf://RESULT3/*.png" -mf fps=14 -o movie.avi -ovc copy

The parameter fps passed above means "frames per second" - it should be chosen according to the original frame rate used by the ffmpeg.

The next thing we need is the soundtrack. I would propose to record the whole soundtrack with audacity - http://audacity.sourceforge.net/. Then we can easily edit the soundtrack adding special effects like for example echo.

It is possible that we will need to cut off a piece of the video. In order to do it type:

ffmpeg -i movie.avi -ss 1 -t 5 -c copy hallo.avi

This will start after the first second and cut off 5 seconds of the video. The result will be placed in the file hallo.avi. You can watch the movie using the totem video player (http://projects.gnome.org/totem/index.html). This will allow you to choose the correct time to cut the video off.

Friday, May 25, 2012

Make a movie with your kid! Part 2

Now render the virtual environment into a file environment.png:


Unpack the archive movie_maker_scripts2.tar.gz to the directory PERL, create a directory RESULT2 and then type:

perl -I../../PERL -f ../../PERL/paste_background.pl RESULT RESULT2 environment.png

After a while the directory RESULT2 will contain the images like this one:

 Success! The wizard is now located in his room.

The next step is optional. We want to put a part of the picture in front of the wizard. Let's cut it off using gimp and store it in a file table.png:


Now unzip the archive movie_maker_scripts3.tar.gz  to the directory PERL, create the directory RESULT3 and type:

perl -I../../PERL -f ../../PERL/mask_paste.pl RESULT2 ../table.png RESULT3


After a while in the directory RESULT3 there will be pictures we wanted:


This gives as an illusion the wizard is inside the virtual world.



Thursday, May 24, 2012

Make a movie with your kid!

I will demonstrate how to put your kid into a virtually created environment. First you need to record your kid and capture an AVI file using the program "dvgrab". It is possible that you will need to install dvgrab. Then connect your camera with the computer using a Firewire cable and issue a command:

dvgrab film.avi

Next we will split the file film.avi into separate frames. This can be done with the program ffmpeg from http://www.ffmpeg.org/.

ffmpeg -i film.avi image_%06d.png

This will create a number of frame files. Now we need to define what "background" means. Use gimp or any similar program to cut off the background from one of the frames.




Store it in the file background.png. Then unzip the archive  movie_maker_scripts.tar.gz to the directory PERL and type:

perl -I../PERL -f ../PERL/detect_background.pl background.png

As a result you will obtain the HVS parameters of your background. Now open the background_remover.pm in an editor and edit the line:

if ($h>=156 && $h<=167 && $v<=162 && $v>=54)

The values should reflect the minimum and maximum for H and V, respectively. Once this is done we are ready to remove the background from all the frames. Go to the directory with the frames, create a directory RESULT and then run:

perl -I../../PERL ../../PERL/remove_background.pl . RESULT

After a while the directory RESULT will contain a number of frames without the background, like the one below:


Now is a good time to learn Blender http://www.blender.org/, or a similar program to build a virtual 3D environment. It can look like:

Note that in this case we used one of the frames to create the wizard's picture hanging on the wall. Next step will be to paste the virtual environment into the frames without background. I will describe how to do it next time.








Wednesday, May 23, 2012

Colorful Dwarves

This is a kind of a maze for children. You begin your quest from the field START and try to find the silver key to open the chest. In order to play you need a small game description:

A01 - In this room you meet the Yellow Dwarf. "If you want I can give you Manuscript in exchange for Purple Key, White Key and Silver Key. If you accept go to D01".
A05 - In this room you meet the White Dwarf. "If you want I can give you Artefact in exchange for White Key, Purple Key and Silver Key. If you accept go to C05".
A10 - In this room you meet the Red Dwarf. "If you want I can give you Cristal in exchange for Purple Key, White Key and Silver Key. If you accept go to B10".
A28 - In this room you meet the Blue Dwarf.
A37 - In this room you meet the Green Dwarf.
A41 - In this room you meet the Purple Dwarf. "If you want I can give you Medallion in exchange for Purple Key, White Key and Silver Key. If you accept go to B41".
A43 - You did it ! You open the chest with the Silver Key and you enjoy the nice sound of gold.
A46 - In this room you meet the Green Dwarf. "If you want I can give you Yellow Key and Blue Key in exchange for Silver Key, White Key and Purple Key. If you accept go to B46".
A51 - In this room you meet the Purple Dwarf. "If you want I can give you Yellow Key and Blue Key in exchange for Statue. If you accept go to B51".
A60 - You remember this place - this is were you started your quest.
B01 - In this room you meet the Yellow Dwarf.
B05 - In this room you meet the White Dwarf.
B10 - In this room you meet the Red Dwarf. "If you want I can give you Purple Key, White Key and Silver Key in exchange for Cristal. If you accept go to A10".
B28 - In this room you meet the Blue Dwarf.
B37 - In this room you meet the Green Dwarf. "If you want I can give you Purple Key and Red Key in exchange for Yellow Key and Blue Key. If you accept go to D37".
B41 - In this room you meet the Purple Dwarf. "If you want I can give you Purple Key, White Key and Silver Key in exchange for Medallion. If you accept go to A41".
B43 - You found the chest, but unfortunately you do not have the Silver Key to open it.
B46 - In this room you meet the Green Dwarf. "If you want I can give you Silver Key, White Key and Purple Key in exchange for Yellow Key and Blue Key. If you accept go to A46".
B51 - In this room you meet the Purple Dwarf. "If you want I can give you Statue in exchange for Yellow Key and Blue Key. If you accept go to A51".
B60 - You remember this place - this is were you started your quest.
C01 - In this room you meet the Yellow Dwarf.
C05 - In this room you meet the White Dwarf. "If you want I can give you White Key, Purple Key and Silver Key in exchange for Artefact. If you accept go to A05".
C10 - In this room you meet the Red Dwarf. "If you want I can give you Manuscript in exchange for Green Key. If you accept go to D10".
C28 - In this room you meet the Blue Dwarf. "If you want I can give you Coat in exchange for Artefact. If you accept go to D28".
C37 - In this room you meet the Green Dwarf.
C41 - In this room you meet the Purple Dwarf. "If you want I can give you Red Key and Purple Key in exchange for Blue Key. If you accept go to D41".
C43 - You found the chest, but unfortunately you do not have the Silver Key to open it.
C46 - In this room you meet the Green Dwarf.
C51 - In this room you meet the Purple Dwarf.
C60 - This is where you start your quest. You have Blue Key.
D01 - In this room you meet the Yellow Dwarf. "If you want I can give you Purple Key, White Key and Silver Key in exchange for Manuscript. If you accept go to A01".
D05 - In this room you meet the White Dwarf.
D10 - In this room you meet the Red Dwarf. "If you want I can give you Green Key in exchange for Manuscript. If you accept go to C10".
D28 - In this room you meet the Blue Dwarf. "If you want I can give you Artefact in exchange for Coat. If you accept go to C28".
D37 - In this room you meet the Green Dwarf. "If you want I can give you Yellow Key and Blue Key in exchange for Purple Key and Red Key. If you accept go to B37".
D41 - In this room you meet the Purple Dwarf. "If you want I can give you Blue Key in exchange for Red Key and Purple Key. If you accept go to C41".
D43 - You found the chest, but unfortunately you do not have the Silver Key to open it.
D46 - In this room you meet the Green Dwarf.
D51 - In this room you meet the Purple Dwarf.
D60 - You remember this place - this is were you started your quest.

Tuesday, May 22, 2012

Hi! I think it is a good occasion to introduce myself. I was born in 1973 in Cracow, Poland. My surname - Biernacki - is quite popular in Poland, it means someone living in Biernaty, which is a small town I have never been to. As you probably know Cracow was formerly the capital of Poland. It is a beautiful city with a little less than 1 million inhabitants. I have not been there for couple years, though. Now I consider Helsinki to be my home, I have been living here for six years. Six years and a half. OK, that's all for today. See you.

Monday, May 21, 2012

Hello! Welcome to my blog. My name is Pawel Biernacki, I am a programmer. I live in Helsinki, Finland.