Subtitles evolution

2008-09-02

It shouldn’t be much of a surprise to anyone that I used to watch (English) movies with Czech subtitles.

About two years ago I found out that it was a really bad idea. Apart from the subtitles stealing my time because I had to read them, they also stole my brain cycles as I couldn’t avoid comparing what I heard in the English original to the Czech translation, looking for what I missed and what I’d translate better. While this might have been a good exercise as far as translation skills are concerned, it made me tired rather quickly. Plus I usually had no idea what the movie was about.

So I switched to English subtitles. That was a great improvement. No more time spent translating everything both ways three times. I could finally enjoy movies again. But still, I couldn’t help but read the subtitles anyway, just because they were there.

And so it happened that I almost stopped using subtitles for English movies alltogether. I still occasionally use subtitles for special things such as Monty Python, where there are a lot of jokes and puns which would be difficult for me to catch otherwise.

Overworked?

2008-08-04

Do I spend too much time at work?

Let’s see:

First, I work eight hours a day and I sleep eight hours. That means I work half of my waking time.

Second, I only work two out of three days (counting weekends, public vacations and paid holidays adds up pretty close to one third). This means that I spend one third of my waking time at work. Not too bad.

Third, I’ll probably work around half of my life (I didn’t work during my first 20 years here and I won’t work when I’m old either).

That means I am going to spend about one sixth of my life at work (awake life, that is). That definitely doesn’t feel like “too much”, does it?

Oh, plus I got some tesuji up my sleeve… but more on that next time. 8-)

LSG 2008

2008-07-26

“What took you so long?”

Yes, I’ve returned from LSG a week ago. But I spent all my time either at work or creating the photogallery (I made over 800 pictures but my memory card got full so I had to delete the bad ones, I returned with over 650 pictures and the gallery is 187, so – as you can see – it was a lot of work).

LSG was great (you can see mroe photogalleries), and I really regret having to wait almost 350 days for the next one again. Last year when I came home from LSG I just sat there for several days doing nothing and waiting for the next LSG. Luckily, this year work takes care of that, it’s really good to have something concrete to do.

Sorry for a boring post, hopefully it was at least short enough. :-) (and hey – it included links to photos… by the way, my favourite pictures from my own gallery are 4, 32, 94, 100, 109, 149, 152, 176, 178 and 181)

Louise Attaque

2008-07-01

I haven’t written a post about music for a long long time. I wanted to write about Nightwish’s “new” album Dark Passion Play, but since it can be summed up with “pretty good album, too bad the new singer’s voice is nowhere near Tarja’s” and since everyone and their dog already knows Nightwish, it wouldn’t be too enlightening.

In January I was searching for some good French music (since I like listening to French language) and so I asked scurge (I’d really like to link him, since he’s starting a go school, but sadly he has no webpage yet – anyway, if you are looking for a go teacher, check out “scurge” on KGS (he’s way stronger than the kgs 4d he has)) for suggestions. He told me to try Louise Attaque and remarked that they are “a bit weird”.

So, yes, Louise Attaque are a bit weird, but they are also absolutely awesome. Their music is pretty original, I’ve never heard anything similar before. And I can listen to their songs over and over and over and over and over and…

They have released three albums so far:

Louise Attaque
This self-titled album is their first and in my opinion also the best. J’t’emmene au vent is my favourite Louise Attaque song (it also has a cool video). Other extremely good songs are Ton invitation, Les nuits parisiennes and Fatigante (funny changes in rhythm and speed all the time).

Comme on a dit
Also the best album. I haven’t listened to this one as many times as the other two, but I’m trying to catch up. The best song here is La plume, people say it has a clever text – I think it’s about time for me to start learning French. Other notable songs include (but are not limited to) Tu dis rien, Sans filet, Tout Passe, Comme on a dit and Du nord au sud.

A Plus Tard Crocodile
Their last album is not as fantastic as the previous two… nevertheless, there are several pretty good songs: Revolver, Oui non, Nos Sourires (except the last minute, which is horrible) and Depuis Toujours (the best song from the album, imho).

Oh well, at least I managed not to list all the songs from each album. :-)

Tone Mapping with GIMP

2008-06-14

“Tone mapping reduces global contrast in images while increasing local contrast and shadow/highlight detail.” or so Gimp Addict’s Tone Mapper tutorial says. Go and read his tutorial, I will add few comments to it:
4) “radius of 100-500 is good” – yes, it usually is, but since we don’t know the size of the image, I’d rather say that 10% of image size (that is (width+height)/2) is a good starting point.
5) 75% is again a good starting point, but you might want to play around with the value.
7) It depends… if you want to increase the tonemapping effect, duplicating the “soft light” layer is the way to go (I’ve tried changing the layer mode and nothing else really worked at all).

So I wanted to create a script that would do this. After searching the GIMP Plugin Registry, I found Tone mapping script, which basically follows Gimp Addict’s guide. However, it only has two options – the amount of blur and the amount of layer transparency. That certainly isn’t enough for me. Luckily, the plugin is GPL…

(((GIMP’s Script-Fu) uses Scheme) (which is (a dialect) (of the (Lisp (programming language)))) ((Lisp is a (programming language)) (for people) (who (really (really (like parentheses))))))

And because I like parentheses almost half as much as an average Lisp programmer, I rewrote the Tone mapping script and created Advanced Tone Mapping script. Feel free to put it in your GIMP’s script directory (~/.gimp-2.4/scripts/ in my case).

There are four parameters for Advanced Tone Mapping script:

  • Gauss. Blur (% of img size) – is the amount saying how much the blurring should be used for the tone mapping. It is in percents of image size (where image size = (width+height)/2). Ten is a good default, but different values might be interesting too.
  • Opacity of blurred layer – this is the 75 default, which can be changed if you want stronger or weaker effect.
  • Opacity of merged layer – the default is 90. If 100 is not enough, consider increasing number of “copies of merged layer”.
  • Copies of merged layer – when one, it’s barely noticeable, you can deny any accusations of postprocessing easily. :) Three has a lot of “halo effect” and anything above five will completely mess all colours up.

The first set of pictures is simply a preview. The image on the left is the original image, and the image on the right is processed by Advanced Tone Mapping with Gaussian-blur set to 10, opacity of blurred layer equal 75, opacity of merged layer full 100, and finally three copies of the merged layer (note the way I use to show those values – it is also used for naming the layers, which can be handy if you later forget which layer is which or what you have done). The image on the right might be a bit over the top, but it shows nicely what can be done with Advanced Tone Mapping script:

Tone mapping

The next example shows some pretty conservative tone mapping. The one on the left was created with almost none blur, while the one on the right has 10% blur. Note the difference: the one on the left has no halo but appears a bit flat, while the one on the right has a slight halo but also has higher level of detail.

careful Tone mapping

Oh my… the following example shows what can go wrong with tone mapping (I’m sorry for all the people who already gouged their eyes out). The reason why image on the left appears so flat and awful is that almost no blur was applied. The image on the right is a comparison with healthy blur applied. Five copies is still a bit too much, but hey, at least it has kind of action-like look.

Tone mapping gone wrong

The last image shows the difference between the default blur and maximum blur available. As you can see in the right side picture, the halo is so huge it’s almost impossible to see. The bad news is that with maximum blur we lose a lot of detail near the borders of light/dark areas.

Tone mapping different halo

Ok, that’s it – now go and experiment with my script on your own photos. 8-)

PS: Underexpose your images – the dark areas can still be lightened, while the burned out areas are usually completely white and can’t be darkened.

PPS: The more contrast there is, the more layers you apply, the more blur you will usually need.

PPPS: Any kind of noise in your picture will be greatly amplified.

PPPPS: No, this is not HDR, this is just tone mapping of a single image (just jpeg, in my case). Tone mapping is a part of HDR, but HDR is not a part of tone mapping. ;)

Getting stoopid

2008-05-25

It’s been happening for longer time. I’m getting stupid. As in “not clever”. I’m learning new ways to solve specific problems, but my general problem-solving skills are very bad nowadays (in the timeframe of several years, not specifically at the moment (actually work helps a bit, I guess)).

I used to be good at solving easy problems that many people get stuck at.

Let me give you an example… There are two ways of making a thumbnail from a picture:

In the first one, you get width and height of the original picture and the boundaries (width, height) into which the thumbnail must fit. You resize the picture so as to preserve the width/height ratio. What is the width and height of the thumbnail?

The second one is trickier, but still falls into “must be easy” category:

Again, you start with width and height of the original picture, and width and height into which the thumbnail must fit. The difference is that now you must fill the whole thumbnail and cut off the exceeding parts. Suppose you want to have the thumbnail in the center. What are the left x-coordinate/y-coordinate and width/height of the area to cut the thumbnail from the original picture?

resizeIn case you say that I’m so dumb I can’t even describe the task, here’s a picture that (hopefully) explains everything.

Ok, now go and solve it. Seriously, take a pencil and paper, or fire up your favourite text editor and solve it. In case you “know it’s trivial but can’t be bothered to solve it”, don’t even bother to read on.

This kind of problem that doesn’t require (almost) any prior knowledge and has simple input and simple output is the kind of problem which used to be much easier for me to solve than for most people. Well, not anymore. And I wonder – can I do anything about it?

I thought that various logical puzzles might be a good way to force my brain to learn to solve problems again. So I searched a bit and found some excellent puzzles: blue eyes, three hats, and prisoners with hats in a long row (of course the comments under the post are wrong). The puzzles do not require any kind of “trick” to solve.

PS: Please don’t post solutions to the thumbnail problem. If you solved it, you know you solved it. If you are not sure, you haven’t solved it.

Mostly unordered list of photography tips

2008-05-09

For newbies, by a newbie.

  • It doesn’t really matter what kind of a camera you have (ok, no cell phone camera, you need some kind of a lens).
  • Most modern cameras can decide the exposure settings just fine in 90% of cases. Nevertheless, you should learn to operate in manual mode too (for example, the closest distance my camera is able to autofocus at is about 15cm, using manual focus makes it about 2cm (it used to be my dad’s camera and he thought for two years that 15cm was the closest it could do)).
  • Flash is evil. (funny, exactly the same rule applies in webdesign)
  • The only exception to the above rule is using flash to light nearby dark objects in an otherwise well lit scene.
  • If you do not have enough light, feel free to increase the ISO speed. Or bring a tripod. Or emulate it somehow (don’t forget to use a short timer to avoid touching the camera when it fires).
  • By far the most important thing is the composition. (there are also other good resources about composition)
  • Actually, there are no rules for composition. But it is still the most important thing.
  • Postprocessing is your friend. (the examples here use GIMP, but similar techniques will work in other image editing software too)
    • Three alternative ways to do a Very Important Thing (tm):
      • the easiest and fastest: Colors > Levels > Auto (this works when you have both real “white point” and “black point” in your picture)
      • slightly more control: Colors > Levels, and play with it (you usually want to leave the output levels alone and shrink the input levels according to the histogram, you can set this individually for each color channel)
      • and finally: Colors > Curves (this is like Levels but with more control – you do not only set the starting and ending point of the curve, you can also change its shape (slight S curve often improves the image a lot)
    • Orton effect (aka dreamy look): duplicate layer > Filters > Blur > Gaussian Blur (set something reasonable depending on your picture size, experiment) > set layer mode (multiply, overlay, hard light, or whatever… experiment) > set layer transparency (uh, guess what… experiment?)
    • Tone mapping: duplicate layer > duplicate layer > Desaturate > Invert Colors > Gaussian blur > Layer opacity to cca 70 > merge layer down > set layer mode > set opacity
    • Vignette effect (aka lomography): new layer > E (elliptical regions) > select accross the whole picture > invert selection > Select > Feather (set to something reasonable, experiment) > fill selected area with black > set opacity (usually 20 or so)
    • And while all these effects are great, try not to use all of them at once. :-)
  • Finally, publish your photos on the internets (flickr, picasa, etc).
  • Flickr is still the best photosharing site around (even though they have the bloody videos now – which even started polluting Explore), it has the most amazing community and most talented photographers
  • By the way, all that I know about photography (ok, not much) I learned on flickr, just watching Explore, and sometimes reading the comments.

What a mess of a post. :-Z
On the other hand it does contain plenty of good info, it’s just a bit too much concentrated.

Hardy Heron

2008-04-27

As my Ubuntu Edgy (6.10) was not quite cutting edge anymore, I decided to get Hardy Heron.

Upgrade over two skipped releases would be suicidal, so I decided to do a fresh install. I also wanted to preserve my old Edgy… you know – just in case. That involved cutting off half of my system partition to create a new partition. You might expect a horror story now, but in fact it all went flawlessly (I just used gparted, the ext3 got fscked, shrinked to a half without a single glitch, passed fsck again and voila).

Installation of Hardy was provided by a nice graphical installer that didn’t even bother asking questions about my hardware (it just asked me about country and language settings and stuff like that). It recognised my monitor resolution, I installed the proprietary nvidia-glx-legacy drivers with two clicks (yes, it’s not even necessary to touch xorg.conf anymore). I just had to set up the wifi connection manually, because the access point has a hidden ESSID (but all the drivers were already there).

I was amazed how everything works out of the box or almost out of the box. Need to play a movie and don’t have the codec? You get a pop-up asking if you would like to download the codec. You click yes and enter your password, you are all set.

Hardy Heron includes Firefox 3 (beta 5 as of now), which is great, because the speedup over Firefox 2 is rather significant (and it does have some nice new features too). The only sad thing is that Google Toolbar doesn’t work in FF3B5 (yet), but well, I don’t really need to see the pagerank of every page I visit.

With my old 32MB GeForce 2 I never bothered installing Compiz, but as it comes out of the box now, I just had to try it. And whooo it rocks. The cube is amazing and there is also this great “scale windows” thingy, that shows all open windows at once so that you can switch between them. And then there are hundreds of different visual effects…

Gnome now allows repositioning the window toolbar items by drag&drop’ing them. That is the feature I’ve always (secretely) wanted. It’s really useful (as opposed to grouping, which I always (not so secretly) hated).

All I can say is: “Wow”.

PS: I don’t say this often, but I have to say it now: In case you haven’t done so yet – with XP being obsolete and Vista near unusable – this is definitely the best time to switch to Linux. And if you encounter any problems, I’ll be happy to help you with troubleshooting.

Common sense and frustration

2008-04-23

Do you know what common sense is?

Common sense is:

  • NOT setting fixed height for elements whose actual height can change anytime, and especially not setting this particular height to three elements next to each other, to keep them with the same height (common sense solution is to wrap it all in another element)
  • NOT calling your database tables j_aidx_1, j_aidx_2 … j_aidx_n and calling the columns m_1, m_2, m_3, etc; which leads to people writing queries like SELECT a.m_85, a.m_167, b.m_17, b.m_56 FROM j_aidx_5 AS a LEFT JOIN j_aidx_8 AS b ON a.m_103 = b.m_42 WHERE b.m_58 = ‘1’ AND a.12 = ‘0’
  • invoking the live server settings as default instead of using testing environment settings as default, because when something goes wrong in the decision process, you don’t want the live server to get fucked up
  • NOT having the very same function copied to several different “modules” of the application so as to make it extremely inconvenient to change
  • NOT calling your backups “new”, “!new”, "new“,”___new“,”!!!!!new" etc, especially when each person uses a different flavour of this method
  • using a version control system, and if you are unable to do so, calling your backups by date (preferrably in YYYY-MM-DD format, since it sorts itself naturally)
  • using either tabs or any amount of spaces for indentation, but keeping it consistent (or at least, for fuck’s sake, keeping it consistent within one file)
  • NOT internally calling files for inclusion 1.html, 2.html, 3.html etc., especially when you already went through the hassle of creating nice looking URL’s
  • NOT totally breaking your URL’s and titles by adding a lot of random keywords just to game search engines, when that makes your site either unusable or extremely confusing for humans
  • using one language (human language, like English or Czech) in your application, or at least avoiding mixing up several languages inside one particular variable or function name (findAllNovinky is just lame function name)

… do you know what frustration is?

EPGC Kraków 2008

2008-04-14

As I was planning my journey to Krakow and there was only one reasonable train to take, I worked overtime during the week so that I could leave work earlier on Friday. Well, the train was delayed, so I wouldn’t be able to catch the following train, which meant there was basically no way to get to Krakow. After giving up for a few hours, I realised that I really really wanted to go there and decided to take a night train. So I left home at 9pm again and headed for the train. The journey was quite ok except two things: 1) I had to change trains at 3am and 2) my camera got stolen.

Krakow is a beautiful city and I had several hours to walk through the center (kind of sucks I didn’t have the camera, as at 6:30am the lighting was just perfect). I especially enjoyed the Wawel castle, which provides a nice view of the city and is in itself rather spectacular.

The tournament (European Pair Go Championship) was well organized, and there were free cookies and water (even for visitors such as myself!). By the way, pair go tournaments have an interesting feature that half of the participants are girls. ^^

I spent the day relaxing, playing and taking photos (a friend lent me her camera because she was playing and couldn’t take photos anyway). We spent the evening at juggler’s place, which was a lot of fun… juggler has table football at home, so we spent a lot of time playing that (and the rest of the people played go, of course).

Once again I got very lucky by going somewhere where I really wanted to go after a big obstacle appeared, and once again I’m really glad it went this way. I had a great time, I met lots of people whom I haven’t seen for far too long (spirit (been a while), kotasia (cute new hair), hitech (I finally started reading GEB), gertzu (thanks!), agusia (babusia~~), elusia, michal, iskierka, juggler (thx for saturday evening), vertigo (yeah, ruby, we know), sheena, yapi, shaa (hope the leg is getting better), fajnymis, kamyszyn (ban ’em all), comboy, sosna (no more photos, I promise), nil, cichacz (dupa!), kabu (xD), grabol and everyone else whose name I forgot to write in here) and I met some other people in person for the very first time (Lothus, and… um, actually, isn’t Lothus enough? ;-))

Edit:
Some photo galleries:
My photo gallery
Official photo page, with links to other galleries