Tag Archives: Computer

The QThread anti-pattern

Sometimes with QThread you see something like this:

void run()
    while (true) {
            QMutexLocker lock(&mMutexData);
            if (mQuit)
        msleep (200);
void stop()
    mQuit = true;

This is potentially problematic. Why? Consider the extreme case of a function shutdown() which does something like this:

void shutdown()
    delete thread;

Congratulations, you’ve just introduced a race condition. Why, you will ask? You’re waiting for the thread to end before deleting it, right?
No. And this has to do with the way Qt implements QThread::wait() which you should have probably used in the first place, if you really need this sort of functionality.
Qt hooks a pthread cleanup handler in the native thread which will call wakeAll() on a QWaitCondition stored inside the pimpl of QThread. And this pimpl – you might have guessed – is gone when you call delete.

Pino as in twitter

Since Echofon cut off custom-built Firefoxes I was looking for a new twitter client. The only one matching my needs was Pino. Unfortunately since the mandatory activation of OAuth in twitter it stopped working. But: No fear! I hacked it to use librest which supports OAuth ootb. Currently it is a bit flaky (crashes at startup sometimes for no obvious reason) and there is no easy way to log in. It currently uses librest’s demo consumer keys which is probably not the most fortunate thing to do. I will request own credentials as soon as it runs more stable. Stay tuned for updates, I will push it to a public repository really soon.
Update: Seems upstream pino will contain librest with OAuth in version 0.3. So I’ll keep my ugly hack to myself ­čśë

Trekstor Vibez and Jaunty^WLucid

So – A year has passed, two Ubuntu versions, what’s the state of MTP vs. mass storage? Apparently still broken. Same same but different.
Instead of making the player crash, gphoto2/libmtp and usb mass storage fight for the right to access the device which leads to very ugly errors in dmesg that look like the device or at least its file-system is severely broken ­čÖü
So, once again: Either make the device MTP only or remove the device’s entry from the libmtp udev rules which now reside in /lib/udev/rules.d/45-libmtp8.rules

1.21 Gigawatts

The beast is alive… Well. Sort of. Plugins still missing…

$ ./rygel.exe -g 5
** (rygel.exe:8080): WARNING **: Failed to load user configuration: Es wurde keine g³ltige Schl³sselwertedatei in den Suchordnern gefunden
** (rygel.exe:8080): DEBUG: new network context {C457B4A8-2516-46B9-837A-F5167D574A2E} ( available.
** (rygel.exe:8080): WARNING **: Failed to create context for host/IP '{C57C8A03-20D6-4A0F-8C5D-946804401865}': Der Vorgang wurde erfolgreich beendet.
** (rygel.exe:8080): WARNING **: Failed to create context for host/IP '{8946F41B-6765-4205-8238-82786C175392}': Der Vorgang wurde erfolgreich beendet.
** (rygel.exe:8080): WARNING **: Failed to create context for host/IP '{846EE342-7039-11DE-9D20-806E6F6E6963}': Der Vorgang wurde erfolgreich beendet.

A plea agains tofu

No, not the stuff made from soy beans. Tofu is the the german term for a behaviour most likely found in corporate email. It means “Quote full, add your text on the top”. That’s sort of reversed “AOL” behaviour.
When I started email, I came from a FIDO background (anyone remembers this? BBS and stuff?). Connection time was precious and expensive. Quoting rules existed like don’t quote too many levels, answer inline etc. When moving on to the internet, I mostly kept this.
I dropped writing emails like this like five years ago, when I entered the magical world of business emails. Noone understood inline replys and most people were complaining that the communication history was missing. So I adapted, at least at work. And Outlook 2007 even has support for navigating in mails like those. I also understand why a certain kind of people like it. When you print the mail, you only need to print one mail and have the whole conversation at hand.
But honestly. I’m doing a lot of mail on my mobile phone currently. Fetching mails is not too fast on there. I don’t want to download 200k for a simple “Me too”. I don’t want to scroll through all of the shit. I don’t event want to download the same shit again and again. I already have the communication history available.

pmp 0.1 released

I just uploaded pmp 0.1 – Poor man’s prism desktop web application creator to github: http://github.com/phako/pmp
A release tarball can be found here: pmp-0.1.tar.gz
What is pmp?
pmp shares some similarities to Mozilla’s Prism. It creates a “standalone” app from a web application. Pmp uses Webkit as its rendering backend.
How do I use it?
To create an edge (that is pmp’s terminus for a captured app), run
pmp-create --url=<url to website> --name=<descriptivename>
You can also create a desktop icon by passing it the --desktop parameter. If you want to use the site’s favicon, use --icon=:favicon
To run the edge, call pmp-run --name=<DescriptiveName>
Known limitations:
It does not work properly with Google’s apps. Google does some weird URL redirects. I’m working on that. Apps known to work are WordPress and TT RSS.