Monkey Dodge

February 14th, 2012 No comments

I’ve been giving lessons in Blender recently. This is just a trivial little game I’ve created for my student to show him several concepts – dynamic shadows, object properties, texture coordinates animation, etc.

You can play it for a couple of minutes if you’d like: monkey_dodge.zip ;)

Partial replacement for MATLAB’s Image Processing Toolbox

February 13th, 2012 No comments

I recently needed to replace the following functions from MATLAB’s Image Processing Toolbox: bwareaopen(), bwconncomp(), colfilt(), im2bw(), imclose(), imdilate(), imerode(), imfilter(), imopen() in order to remove it as a dependency of one of the new SPM toolboxes I’ve been working on. If you happen to be in a similar situation or just need this functions for other reasons, here they are (license: GPL). All of them behave exactly as their commercial counterparts, with the following exceptions:

  • Only 1-, 2- and 3-dimensional images are supported.
  • ls_imfilter(), ls_imdilate(), ls_imerode(), ls_imopen(), ls_imclose() use ls_improc.c as their core, ls_improc.c is multi-threaded and requires pthreads/pthreads-win32 to compile
  • ls_colfilt() takes function name instead of function handle as third argument. The function has to be on the MATLATB path. This can be easily fixed to use handles as well.
  • ls_imfilter() accepts only fixed numerical value or ‘symmetric’ modes of boundary processing. See ls_improc.c if you want to fix this.
  • ls_bwconncomp() requires spm_bwlabel() (part of SPM).

That’s it. Enjoy: ls_im.zip !

QSexyTooltip

January 23rd, 2012 No comments

Here it goes (BSD Licensed)…

qsexytooltip.zip

You already know what it looks like:

Tested on Windows / Linux X11 (with/without compositing). Enjoy!

Categories: Qt Tags: , , ,

VocaBreak 2012.1

January 16th, 2012 No comments

Ok, here goes first version of VocaBreak in 2012. It features a new Qt Goodie I intend to publish soon – the QSexyToolTip class. Looks like this:

Pretty cool, huh? ;)

Enjoy: Vocabreak Setup!

Categories: Qt, VocaBreak Tags: , , ,

unionfs_by_intercept

January 4th, 2012 No comments

Has it ever happened to you to be working on a system where you’re not completely in control (i.e. non-root)? Well, it happened to me more than once and quite recently I had to mount a UnionFS on such system – without any special privileges or cooperation from the system admin. Of course it turned out to be impossible using regular UnionFS/FUSE mechanism, so I had to prepare my own solution, based (as so many other cool hacks) on LD_PRELOAD trick and interception of file operations-related library calls. Obviously it’s not perfect because any piece of software that accesses files using other routines than the ones I’m trapping will circumvent this whole set-up. Nevertheless it turned out to be effective enough for my purposes, which in this case were to install TigerVNC, Fluxbox and Midnight Commander (+ their dependencies) from the official CentOS distribution packages into my home directory. For this particular bunch I had to override the following routines: open64, fopen64, access, stat, lstat, stat64, lstat64, __xstat, __lxstat, __xstat64, __lxstat64 and catopen. It was a bit surprising, especially the __* routines which I never even knew existed, but I managed to spot them using strace and objdump combo. That’s it for the introduction, now to the practical stuff…

To build, type:

gcc unionfs_by_intercept.c -shared -fPIC -ldl -o unionfs_by_intercept.so

Then, the usage is quite simple:

export UNIONFS=/path1:/path2:…:/pathN
export LD_PRELOAD=/path/to/unionfs_by_intercept.so

Optionally:

export UNIONFS_DEBUG=1

to get some debug messages printed to stderr.

The paths are unified at the root (/) level, e.g. specifying UNIONFS=/:/my/path would make the tricked applications see root as having the contents of original root plus whatever is in /my/path.

The code is published under revised BSD license: unionfs_by_intercept.c. In the rare event of actually finding it potentially useful, I hope it works for you ;)

Categories: Uncategorized Tags: , ,

New Year – New Server

January 3rd, 2012 No comments

Happy New Year! As probably all of the world has noticed ;) my blog went off-line in the beginning of November 2011. It was due to a server malfunction. It has a long story, my server that is – at first (10 years ago) it was a Pentium II MMX 233MHz with 64MB of RAM and 4GB HDD running Slackware 7 I guess. This one got fried after I couldn’t stand the noise and put it into a cupboard – poor choice ;] Later I assembled a Celeron 300MHz solution with 60GB HDD and 128 MB of RAM which later was upgraded to 256 MB. It was running under Slackware 10.1. Actually this one was amazingly reliable machine. Except for the PSU, which broke several times during the past decade, no other component was ever malfunctioning. Some time in 2011 though it suffered from either motherboard, CPU or RAM damage (I didn’t have time or will to inspect that) so to replace it I grabbed another PC that I had been using as HTPC before – a Dell Optiplex GX240 with 1GHz CPU and 1GB of RAM. I’ve put the old 60GB HDD into it and it worked like a charm without any modifications to the OS (gotta love Linux for that). Unfortunately something bad happened again and the server stopped working. It didn’t get up after restart performed by a 3rd person (my server is 1500+ km away from my current location), so I assumed it had been broken permanently. Surprisingly it somehow managed to start up when I powered it up personally during Christmas (after 2-month break), lol. Anyway it was too late because I had already bought a Shuttle XS35GTV2 – a fan-less Atom D525 (1.8GHz, 2 cores, 4 threads) based solution with NVIDIA ION2 512 MB graphics card, 4GB of RAM and 120GB Intel 320 Series solid-state drive! Wow! Quite an upgrade, right? Now I’m using it as both server and HTPC. Thanks to NVIDIA ION2 it has no problems at all with playing 1080p HD content and it remains acceptably cool during the process. Total lack of moving elements and sound is just… well… incredibly rewarding for your ears and, I guess/hope, promising in terms of reliability. This set-up works under Ubuntu 11.10 (XBMC for HTPC functionality), which BTW I’ve also found quite pleasing (yes, I mean Unity ;P ) and intend to test on my desktop PC ;) Well, that’s it, please keep your fingers crossed so that my new server doesn’t break any time soon (and preferably – ever) ;)

Categories: Uncategorized Tags: ,

VocaBreak – Setup Fix

November 2nd, 2011 No comments

I’ve added missing GIF and JPEG image format plugins to the Setup.

DOWNLOAD: VocaBreak Setup

Categories: Qt, VocaBreak Tags: , ,

VocaBreak – Further GUI Improvements

November 2nd, 2011 No comments

Improved user interface ergonomy. Enjoy!

DOWNLOAD: VocaBreak Setup

Categories: Qt, VocaBreak Tags: , ,

Images in VocaBreak

October 31st, 2011 No comments

I’ve added an option to display images retrieved from Google Images side-by-side with the current word. Now it looks like this:

Enjoy!

DOWNLOAD: VocaBreak Setup

Categories: Qt Tags: , ,

VocaBreak Update

October 29th, 2011 No comments

- Language swapping option
- Configurable number of trials and giving up timeout
- Prettier GUI

DOWNLOAD: VocaBreak Setup

Categories: Qt Tags: , ,