Posts (summary)
Posts (full)

Tagged container

In GObject, each object have methods like g_object_get_data, g_object_set_data, and friends. This allows you to attach arbitrary data to objects. This may be familiar from scripting languages, like JavaScript, where all attributes are attached like this.


Typesafe variadic functions in c++11

Variadic functions are cool things, they’re used all over in c (and posix), like execl, printf. However they have problems: you do not know the number of arguments, nor their type. If you try to access an argument that the caller didn’t provide, you invoke undefined behaviour. You can use printf like format arguments, terminating NULL item, etc. But this is not enforced by the compiler, a small mistake in the calling code, and you’re a toast.


C++11 BOOST_SCOPE_EXIT like thing

There are cases when you have to do some cleanup after you do something. It’s simple in C, or languages lacking exception support:


Emacs and python-mode

Some assholes decided around Emacs 24.1 it is a good idea if python-mode works completely different from the rest of Emacs, namely it automatically indents after RET. I tried to live with it, but after like 5 minutes, it was enough, and I was searching for a solution. Fortunately devs decided it’s something you don’t want to turn off using customize. Sigh. Anyway, add the following to .emacs, and it’ll work just like old times.


First post

So I’ve created this blog because I had nothing better to do. So here it is. Hopefully I will fill it with random stuff over time. The blog uses a custom blog engine, because I didn’t like any of existing blog engines… It’s called blotig. I’ll upload it to github someday, but currently it’s a bit messy. It’s an unusual engine, because it stores everything in git, even comments. No need for disqus. The other speciality is the multilang nature, every post is available in English or Hungarian, or both. You can change language in the upper right corner if you happen to know Hungarian, but your browser language settings are incorrect. This multilingualism is also true for comments. (I should write some Javascript that hides the non default language util you click a button…)