Tomasz Gebarowski

Emacs Elisp macro for generating GObject from template

Everyone who has worked with GObjects knows how time consuming is to create a new GObject. In order to make it working you have to generate lot of boilerplate code which is more or less the same for all the objects.

In most of the cases people tend to use templates and make several find-replace substitutions to generate the output GObject.

My first Elisp script

It’s already been one year since I switched from Vim to Emacs (thanks Aleksander;) I heard a lot about how powerful Elisp was, but I didn’t have much motivation to learn it. I started playing with Elisp last weekend and I must say that is much different from everything I used before. Anyway because I work a lot with GObjects and Glib I decided to create some useful script which will speed up my coding. My first script is trivial but it helps to create GList iterator, it acts as a simple code snippet with this difference, that the initial position of the iterator is assigned with the identifier under the cursor.

Mounting ext3 partition on OS X 10.6 (Snow Leopard)

Recently I’ve faced some problems with mounting a large (~ 850 GB) ext3 partition on OS X 10.6. I didn’t except any difficulties as I have already mounted ext2 or 3 partitions on my MBP running Leopard. Normally it could be easily done with Macfuse and fuse-ext2 extension. Unfortunately in this specific case it simply didn’t work. I have realized that I’m running a 64-bit version of Snow Leopard and Macfuse is only officially delivered for 32-bit architecture. This explained a lot! I managed to find an unofficial 64-bit compilation of Macfuse which could be downloaded from Tomas Carnecky blog. I installed the 64-bit version and used the old fuse-ext2 plugin, unfortunately when trying to mount the ext3 partition I got the following error:

fuse-ext2 /dev/disk2s2 /Volumes/Private/**

fuse-ext2 /dev/disk2s2 /Volumes/Private/fuse-ext2: version:’0.0.7′, fuse_version:’27’ [main (../../fuse-ext2/fuse-ext2.c:324)]
  
fuse-ext2: enter [do\_probe (../../fuse-ext2/do\_probe.c:30)]
  
fuse-ext2: Error while trying to open /dev/disk2s2 (rc=16) [do\_probe (../../fuse-ext2/do\_probe.c:34)]
  
fuse-ext2: Probe failed [main (../../fuse-ext2/fuse-ext2.c:340)] 

GRepoApplet

GRepoApplet is a simple GNOME Panel applet for monitoring status of Version Control Systems. Currently only SVN repositories are supported but due to provided backend API it should not be difficult to support more types of VCS’s or even DVCS’s. The applet allows to specify arbitrary number of monitored repositories and time interval between each query. All the recent changes are displayed in a nicely looking notification box generate by the libnotify.

Boost ptr_map iterator incompatibility

Boost library provides a very powerful set of data structures and algorithms which are intended to be cross platform and rather concise. Unfortunately it happens, that the API of the library changes from version to version. The problem which I faced recently was related to ptr_map container iterator and different methods allowing for accessing keys and values of the container. In boost <=1.33 the mentioned fields could be accessed via iterator->key() and (*iterator) methods respectively. Starting from version 1.34 the authors of the library introduced approach which is compatible with map container from STL and uses iterator->first and iterator->second fields.