Dotrc aka ~/.*rc

2010-07-23

If you don’t understand the title, you might just as well leave – this post is going to contain close to no useful information for you.

I’ve been spending a lot of my time in the shell recently. Mostly splitting my time between bash and vim, usually in screen.

I’ve always had a reasonable .bashrc, and my .vimrc used to be above average as well. But I invested some extra time to research more possibilities the dotfiles offer. You can preview and download my dotrc at github.

Here are some of the highlights, whatever I consider the “best of”.

My .bashrc is unremarkable, I just have a lot of shortcuts for the common everyday stuff. Perhaps the only thing worth noting is title setting for screen:
PROMPT_COMMAND=‘echo -ne "kecho $PWD | sed "s:.*/\(.*/.*/.*\):\1:g""’
I actually wrote that myself, it shows the innermost three directories that you’re in. Showing running command in title is useless, as that’s in most cases either bash or vim (rarely also mysql). Showing the full path is useless, because long titles get cut off. Showing only the current directory name is not so great either, as it leaves you without context. I’ve settled for last three so far, but two might also be useful in certain situations.

Perhaps the best tip of all, reduce amount of tab hitting for completion by 50%. Put following to your .inputrc:
set show-all-if-ambiguous on

Next in line is my .vimrc (sorry, no .emacsrc, emacs sucks). Except for the usual stuff (nocompatible, colours, incsearch, etc.), I use few very useful and not very well known tricks.

set so=10 " show 10 lines of context (above and below)

“so” is short for “scrolloff”, which makes sure you have some space to breathe.

Last but not least, the Esc key is real far, hence:
set tm=400 " timeout for shortcuts

inoremap jk "pressing j and k together escapes
inoremap kj

Have I missed any useful tips & tricks?

Exposure bracketing

2010-04-27

I have an old Canon 20D. I’m pretty happy with it, the large pixels behave well in low light conditions and it’s got reasonably comfortable handling. There’s just one thing that’s been really bothering me, and as far as I know, all the other cameras suck just as much as mine.

Exposure bracketing was implemented by someone who hates HDR, photographers, and humanity altogether.

I use continuous shooting mode (hold the button down and the camera keeps shooting as fast as it can until it chokes). First, I have to press the button and hold it for exactly the right amount of time to get three pictures. In the beginning, it used to give me a headache, but after some time I got used to it. It’s stil an inconvenience, but a rather minor issue.

There’s something I don’t get at all: Why do I even have to shoot more pictures to get more dynamic range?

If the wonderful RAW format had for example 32bit depth instead of 12 or 14, we wouldn’t need bracketing at all! You would just take the longest of the exposures, and the camera could record all the data without overblowing the highlights. Or, if that is too much hassle, it could make 3 “virtual” RAW files – by simply taking a snapshot of the sensor’s state at three different times during the single exposure.

Given the amazing feedback I’ve been getting here lately, I don’t expect an answer. But I do wonder – is there anything in the way? Or are camera manufacturers incompetent?

PS: Yes, HDR is an instrument of the devil. If you look at my recent pictures, you might see that I realized that aready. But sometimes, sometimes I like to go to the dark side…

Double elimination tournaments

2010-03-30

Let me start by saying that I really like the concept of a double elimination tournament. So I might be biased in my analysis.

Second, this post deals specifically with potential use of double elimination tournaments in settings of EGC/LSG side event.

What is wrong with the current approach

Current approach has two separate parts – qualification and finals. Qualification consists of several groups playing round robin system (8 groups of 6 people). First two of each group get to the finals, which is a simple single elimination (16 players in our study case). The total number of rounds is 5 + 4.

There are several related problems which stem from this concept. First, not all games are important. Some people leave halfway during the eliminations or just decide to resign the remaining games, as they have no chance of advancing to the finals anymore. This can influence who advances to the finals and has a negative impact on the tournament atmosphere. Second, the final only determines the winner reliably. Plus it just sucks that by blundering once, you get eliminated.

Why double elimination

Double elimination eliminates the unnecessary games. Every game matters. If someone decides not to participate anymore, his opponent gets a free win, but it doesn’t harm anyone but the one who quit.

You are free to lose any single game and can still win the tournament.

Double elimination is also much more accurate in determining the second to fourth places, which are available without any extra playoffs, with single playoff necessary to determine fifth and sixth place.

So where’s the catch?

Perhaps the biggest disadvantage is that double elimination of (up to) 64 players takes 12 rounds. That is considerably more than 9, and so the necessary extra time needs to be reserved. The reward is elimination of redundant games and much fairer results.

Another disadvantage might be that quarter of the participants only get to play two games. On the other hand, they can go to the beach and have fun instead of having to play.

Conclusion

Double elimination is particularly suitable for faster tournaments, where you can finish a round in under half an hour (and the whole 64-player tournament under 6 hours). The slightly asynchronous nature of double elimination allows for certain brackets to develop faster. On the other hand, there can appear bottlenecks when someone doesn’t show up. This can be taken care of by giving a default win to bottlenecker’s opponent, hence speeding up the tournament even more.

I would like to try double elimination for 9×9, 13×13, and blitz tournaments at LSG 2010. I’m all ears for your opinions on this idea.

By the way, have you already registered for LSG 2010?

On decisions

2010-02-27

We have freedom and can make a lot of decisions – isn’ it great? On the other hand, we often have to make decisions. I generally don’t like making decisions. Making a decision means that I will most probably regret it sooner or later.

I use a regret-based approach to making decisions. I try to estimate the probability that I’ll regret the decision. Sometimes, that probability is 100% for one option, so the other option wins by default.

About a year ago, in early 2009, I decided to quit my work and explore Poland. I reached that decision by realising that if I don’t do it, I will regret it for sure. My vacation time ended up being almost three times as long as I expected, mostly due to unplanned trip to Korea, which was great. I didn’t really have enough money to go there, but I knew I would definitely regret not going. 2009 has definitely been the best year of my life so far.

I wish I could apply this approach to making decisions more broadly, as it rarely fails. There are decisions for which I am fully aware of the right choice, yet can’t follow through and end up choosing the bad one.

Moral dilemma short story

2010-01-11

I didn’t invent this story, I heard it from a friend. It was about a year ago, so I might be slightly off in my interpretation.

The story

Once upon a time, there was a girl and a guy who loved each other (ooh, cheesy story). She lived by the river with her mother. The girl and the guy wanted to move out, and they decided to meet next morning at the other side of the river. It was agreed that if the girl isn’t there, it’s a sign that she doesn’t truely love the guy – he would leave forever, never to return.

On the evening before leaving, the girl went to the ferryman, the only person who could get her accross the river. The ferryman said he would take her to the other side of the river only if she slept with him. Dispirited, the girl returned home to her mother and asked her for advice. Her mother showed understanding but didn’t provide advice.

The girl decided to take the deal and slept with the ferryman. Next morning, she met her lover at the other side of the river. When her lover learned that she slept with the ferryman to get to the other side of the river, he decided to break up with her. The girl and the guy had a friend, who heard the story and saw the confrontation. The friend then slapped the guy for breaking up with the girl.

Moral analysis

We have five characters: girl, guy, mother, ferryman, friend. Your task is to rate the morality of their behavior. Please don’t rate according to emotionally tinted words, which I tried to avoid.

Feel free to use concrete numbers or fuzzy words, as you like. Feel free to explain your opinion.

If you don’t want to rate their behavior, you can cheat and just sort the characters from good to bad.

How I won the 23rd TwixT championship

2009-12-18

Who is this post for? Who is going to read it? Who is going to enjoy it? Anyways…

First, a bit of history…

I learned to play TwixT in 2004. You can have a look at my rating graph. As you can see, after the initial jump, my progress was slow – TwixT never was the main thing in my life.

There are three types of tournaments on littlegolem: rated tournaments, monthly cups, and championship league. The league is by far the most prestigious. You can read more about littlegolem tournaments.

My first championship was third division of the third league – twixt.ch.4.3.3, the games look a little funny now. In the next championship I won 5.2.2 with one loss and proceeded to the first league. I finished fifth in 6.1.1, scoring 4 wins out of 8 games.

I had similar results in 7th and 8th championships, in 9.1.1 I even finished fourth. 10.1.1 was the first appearance of the amazing polish brothers, who finished second and third, but it was a small disaster for me – I only won two games and got demoted to second league. After that I continued jumping up and down between first and second league: 10.1.1 down, 11.2.2 up, 12.1.1 down (though I won against Klaus in a very short game), 13.2.1 up, 14.1.1 down, 15.2.2 up.

I got lucky I didn’t get demoted in 16.1.1 … 17.1.1 and 18.1.1 fifth places again. In 18th I had a very interesting game against Axel. I had a bad start, but managed to exploit his weaknesses to create a draw – but I blundered at 44 and let him connect with 45. In 19.1.1 I had my usual fifth place, but 20.1.1 saw me underperform and fall to 21.2.1. As a warm up, I finished fourth in 22.1.1.

History over, back to the present

The start of 23.1.1 looked like I’d finish in my usual fifth place. I lost against David pretty quickly, and I had a surprisingly easy game against Steven. Meanwhile, I was losing three other games – against spd_iv, Klaus and crclum. Against Klaus, I had a bad game from the start, but Klaus blundered with 39.t19 (s20 or u19 would have done the trick), giving me an undeserved victory.

My game against spd_iv wasn’t that bad in the beginning, but then something went wrong, though I’m not sure what. I think spd_iv could have just played 21.h7 for an easier win. But actually, his variation would have led to a win too, if it wasn’t for his unnecessary 25.d7 which I responded with the best TwixT move I’ve ever played. I think that made me deserve the win.

I have no idea what happened in my game against crclum. I was losing from the very beginning, and it was just getting worse all the time, but I still have no idea why. In the end, he just resigned in a won position (23.q7 24.r5 25.t5 26.v5 27.r4 28.t6 29.n6 leads to a win as does 23.q7 24.r5 25.v5 26.t5 27.t4 as does 23.r6 24.q4 25.p7 (spd_iv pointed out the last variation)). So, I was extremely lucky.

On early resigning

As for crclum’s resignation, I didn’t have the guts to ask him about it or point out that he could’ve won. While I admire early resigning and often myself try to resign lost games as soon as possible (it’s good manners and it shows confidence in one’s judgement), it’s better not to overdo it and resign won games!

Earth from above, in black and white

2009-12-09

On my way from Korea back to Europe, I had an amazing flight.

My original flight got cancelled. But Finnair quickly found a ticket with KLM for me. Direct flight to Amsterdam.

When getting the ticket I asked for a seat next to a window. I thought that the guy didn’t understand or care what I said. He seemed completely oblivious to my request.

But as you can see, I got the seat next to the window.

The weather was great. There were amazing clouds as we flew over the yellow sea.

This is somewhere in northern China. That’s what the flight attendant told me.

The Gobi desert.

Slightly cloudy.

Patterns. If you look closely you can see few roads down there.

I’m really happy with how these pictures turned out.

This flight, especially the amazing Gobi desert, was one of the strongest experiences in my life.

PS: You can view bigger versions of the pictures in my photo gallery. Also, check out my flickr photostream.

The death of spam

2009-11-26

Remember spam? Our email inboxes used to be full of it, it clogged online forums and was a general nuisance. My blog used to receive dozens of spam comments every day.

Now with gmail’s agressive – but usually spot on – filtering, I get a spam email in my inbox once a month. I have about 300 mails in my spam folder, which is about half of what it used to be few years ago. My blog is protected by akismet, which feels even more effective than gmail at catching spam. It also looks like spammers are giving up a little as I only received 6 spam comments on my blog during the past two weeks (that, or they think my blog is dead (it’s not, believe me!)).

So is spam really dead, or has it just moved elsewhere?

Social networks don’t suffer from spam (if you define spam as unwanted message of commercial nature) but social news sites (digg, reddit, etc.) are a different story. People try to spam them all the time. But spam on social news sites has to be disguised very well because the community tries to defend itself. If anyone even suspects that something might be spam, they downvote immediately.

Search engine spam (aka half of SEO techniques) is also prevalent and I can’t see it disappearing anytime soon. On the other hand, it’s gotten much milder and nowadays you rarely see spam-sites which are just full of ads.

All in all, I think the future is bright. Brute-force spam is easy to catch, and more clever spam sometimes even includes useful or entertaining stuff (think of viral marketing as a clever, entertaining, user-distributed spam ;)).

Yours sincerely,
Captain Obvious

King's Baduk Center

2009-10-22

Lately I’ve been spending my time at King’s Baduk Center. I study go (it is called baduk in Korean).

When I manage, I get up at 6:30 and go running (this is becoming increasingly difficult with temperatures getting lower and lower). Then I go to my computer, hang around on KGS, chat with Europeans who are staying up late, postprocess my pictures, and generally have fun.

At 8:00 we have breakfast. It usually includes toasts, meat, eggs and jam, which is pretty good. Recently we had a week in which we only got rice for breakfast. Half of Westerners just couldn’t manage and decided to skip breakfast alltogether. After breakfast we have a little more free time and at 9:00 we start studying.

Morning is devoted to solving problems. I’ve taken a few problems from our collections and put them here for your enjoyment:

You can click those 1’s to see the problems. No solutions are provided because life is tough (we also have no solutions, but our teachers sometimes look at our books and draw stars next to problems with wrong solution, needless to say, our books are full of stars).

Lately we have tests at 10. It starts with a joseki test (we learn one chapter from “21st Century New Openings” every day) after which there’s “speed test”, mostly not too hard tsumego in large quantities. Like 72 problems in half an hour. When you mess up badly, you have to run. Also, after few days/weeks, we get the same speed test again, which is pretty evil, as it shows how little we learn.

At noon there’s lunch (rice, why are you asking?), and at 1pm we start our league games. I’ve uploaded a few league games that I’ve recorded. Please note that these were played with the time limits of 30 minutes main time plus 3 times 30 seconds byoyomi (which is pretty tough, in my opinion).

Right after I came to KBC, I lost the biggest group I’ve ever lost in what had been a comfortable game until move 87 in which I forgot to protect my corner. One of my next games against Mateusz was a rather interesting fight of influence against territory, but instead of an easy kill (move 110 push down from two stones), I let Mati live and died myself. Then a funny game against Tunga, which I won by an accident.

Here’s a game against Pierre that we played right after he came to KBC:

(you can use arrow keys on your keyboard to move around the game)

I had a bad start, which changed to amazing game after his 32, which gave me plenty of points in return for nothing. The game proceeded well until I got to byoyomi (move 83), where it quickly went downhill as I lost my cutting stones, but Pierre unexpectedly decided to die with his huge corner, which suddenly ended the game.

About a week later I played against Him, and after his overplay at move 56, I managed to keep an edge in the fight and ultimately killed his group. In a game against Ben I forgot to create territory but got a lucky win after he overplayed and died. The I gotbeaten by Seolki in a 3-handicap.

I had a promising game against Him after he forgot to secure his corner, but I died because of utter lack of global insight at one point (move 83, also at 63 we both missed a simple geta :-|). You can see the game here:

You can also see Seolki’s one man show – I started a fight which was bad in the first place and then played it wrong. Tungalag Tunga is direct descendant of Genghis Khan and so she tries to kill everything (but fails). Oooops, Pierre forgot to connect his stones (but he would have lost anyway).

Next is a typical Mateusz game, which went very good for me until I started a completely unreasonable fight when I didn’t need it. Luckily, Mateusz blundered few times and let me win. Several failed attacks cost me the next game against Him. Some of the higher handicaps can also get pretty rough (though I usually win those).

I had a very interesting game against Pierre today:

The start was better for him, then he ataried 68 without hesitation (“my teacher told me not to think about that”), and we made an interesting exchange. In my opinion, it would have been about even had he killed the corner. I made a bad trade while escaping with my group (move 97) but more than made up for it when I surprised Pierre with easy life of my supposedly dead corner.

The last game is perhaps more interesting than any of the ones before, as it contains commentary by KBC teacher, Kim sabomnim.

(it might be more comfortable to view the game with fullsize interface on eidogo.com)

If you look at the commentary carefully, you will be rewarded. There is one standard situation which happens very often and is played wrong by any European between 5kyu and 7dan (players worse than 5kyu don’t know the trick, and those better than 7dan know that the trick in fact isn’t that good).

After the games and commentary there’s dinner (yay, rice!), and after that a lecture with Seolki or free time, which we invariably spend at the computers (except when we go drinking).

I’m being kicked out of here so I don’t even have the time to read it after myself. I hope at least short fragments make sense. If not, just enjoy the tesuji problems and games (although those don’t make sense either :))!

PS: It is pure coincidence that of the four games displayed here, two are against Pierre and I won both, and the other two are against Him and I lost both. In fact, I lose to Pierre quite often, and I certainly beat Him more often than never. 8-)

PPS: Brought to you by EidoGo. EidoGo rocks. Takes a minute to set up and works like a charm.

Visiting 서울 (Seoul)

2009-10-06

[This article contains Korean text. Without proper rendering support, you may see question marks, boxes, or other symbols instead of Hangul or hanja.]

On Thursday, we left 킹스바둑 early in the morning. 김성래 took us to 서울. We did some shopping in 한국기원, and then went to a baduk club, which was rather empty because of holiday. In the evening, we went to IBA, where we were accomodated (thanks to Mr. 이기봉).

On Friday, we got up rather late, and went to 동대문시장. It was quite crowded, not too clean, and I didn’t feel like shopping. I left our undecisive group behind and went for a walk along 청계천. I was unpleasantly surprised to find the famous 남대문 hidden in a building (when Koreans repair a building, they build another building wrapped around it). Fortunately, 남대문 시장 was open and living. I bought a bulb blower (yes, I already succesfully cleaned my sensor!) and got wonderful 김밥 for just 2000. After that, I spent some time wandering the amazingly crowded and cozy streets of Namdaemun and finally emerged by 한국은행 화폐금융박물관. Then I went to visit 덕수궁, a small but nice palace with well groomed gardens and various tourist attractions. It was getting dark, and after watching an outside musical performance (horrible pop music, but so wonderfully Korean that I just had to stop and listen), I found 경복궁 closed. After buying some rice-based sweets (huge bag for 5k), I finished the day taking pics of random passersby in a random nightlife area. A cute girl who studies dancing helped me resolve a problem with subway (the line bifurcates, some trains go to 상일 and some to 마천, I didn’t know which one I was in).

Side note on Hangul (aka Korean letters): I’ve been in Korea for well over a month, and I couldn’t read anything. I didn’t even bother trying. I knew Korean letters were complicated. When the frogeater told me that there were just 14 consonants and 10 vowels (grand total of 24 letters), I was very surprised. Well, I learned Hangul in about 15 minutes, because – behold – the letters are not only very few, they are also logical (Hangul is artificial alphabet!) and easy to remember. I’m angry at myself for not having done this a long time ago.

Saturday, right. Having experienced the immobility of our group the day before, me and the frogeater set out to visit the royal shrine. What was our surprise when we stumbled upon a park full of baduk players! It wasn’t too easy to get a game at first, but once I started playing, observers came (a white guy playing baduk, w00t), and after I killed my opponent all over the board (I gave him 5 stones, he was like european 8kyu) everyone was suddenly interested in playing me. I still won most of my games, as these guys lacked any sense of style, but they fought relentlessly. I quickly lost frogeater somewhere in the crowd (obviously, everyone wanted to play him as well).

Several games and one lunch later I decided that was it, and finally went to see 종묘. There I met a group of European girls (1 Slovak, 3 French) who had a Korean guide that spoke fluent English. I’m still not sure whether the guide was paid or free for all, but I was invited to join them, so I didn’t refuse ;). I proceeded with the girls (one of them even pretended to be interested in go!) to visit 창경궁 and its vast gardens. Then I made a mistake, I parted with the girls, intending to visit the other palace – 창덕궁. This palace had only one open entrance with a hostile guard who didn’t want to let me in and refused to speak English. Finally, one tourist gave me some paper with info on how to get in – there’s a guided tour just thrice a day, otherwise tough luck. Can’t recommend this palace.

I read a lot of praise about 북촌한옥마을, so was looking forward to it. I felt I was close, but couldn’t quite locate it exactly. After asking the locals about 북촌, they said that I was already there. Turns out, there are historical houses, but they amount for about 5% of randomly placed houses in this quarter. However, I got lucky and met friendly westerners who gave me a nice map of the broader center with pictures of interesting stuff. That map is really good. All maps should have pictures. Well anyway, then I continued on my way only to find out that the museums have mostly been closed already (it was about 6pm), but at least I visited 경복궁. After wandering around aimlessly for a while, a nice middle aged American lady asked me whether I needed help. She’d moved to 서울 recently, but already knows her way around pretty well. We went for a nice Chinese dinner. Then I headed for 인사동 where I bought traditional Korean sweets consisting of nuts wrapped in strings of sugar, which the American lady recommended. Again finished the day shooting random people in the streets, this time in the infamous 명동 nightlife area. This time it rained. Rain is always good for photos. I was lucky enough to catch the last subway.

Sunday was the last day for sightseeing. I got up early (well, half past eight) and headed for the museums. First I went to 국립고궁박물관, which has free entry in 2009, as a celebration of 100 years of its history. It was pretty cool, they even allowed photography (“no flash and no tripod”). Then I went to nearby 국립민속박물관, which had nice outside part showing how people lived in various times in Korean history, and inside part with several expositions. After watching traditional dance (there was some sort of EOS 5d users meeting, there were at least 20 ppl, lenses ranging from tiny primes to huge zooms, all with the impossible-to-overlook red stripe). Then I went to the baduk park again. On my way I met a friendly Korean engineering student looking for some English practice. He walked me to the park and gave me a lot of valuable info about 한국. After playing few games in the park, I got cold, so I went to find some food. I happened to stumble upon a baduk club, where I stayed for just 3k. I got to play many people, one was really strong (beat me two times easily) but the rest were pretty weak. Although I was rather tired and my back hurt pretty bad from the hours of slow walking during the last three days, I went for one more walk along 청계천, and didn’t regret it.

All in all, I’m pretty satisfied with how the trip turned out, I have just two complaints:

[Edit:] You can (and should!) see my photos from Seoul!