Properties and Probabilities

I just tagged version 0.2 of my tracker browser tool

What’s new?

  • It has a location bar with backward and forward navigation buttons
  • It is also possible to use prefixed names instead of IRIs
  • You can use your keyboard to navigate backward and forward
  • It has a in-page search bar which can be reached by familiar keystrokes like “/” or “Ctrl-f”
  • If you browse a rdf:Property, you will now be shown all resources with the value the property has

Where to get it?

https://github.com/phako/tracker-zilla/tree/0.2

Mandatory screenshots

Tracker and me

While working with tracker I find myself rather often calling “tracker-info” on resources, looking for linked resources, running tracker-info on those, then needing to get back etc. A bit ugly and time-consuming.

Wouldn’t it be cool to just browse through all that info, being able to go back and forth through the links? Yes, it would. That’s why I wrote tracker-zilla:

You can navigate through the resources just like on the interwebs, using the back and forward feature of the context menu. It shows you not only the resources and properties of the object but also resources that link to the one you’re currently browsing:

It’s not that feature-rich and probably never will be. You can either pass a urn to it via command-line or nothing, then it will show you all rdfs:Classes available in the current ontology where you can just click on e.g. nco:PersonContact. What I’m planning to add is a simple in-page search and a breadcrumb navigation.

That said. it’s a pleasure to work with libtracker-sparql (especially from Vala). You need Vala 0.11.6, gtk+-3 and webkitgtk-3.0 to build it. ?The code is available at github.

Update: Due to popular demand, there’s now a –with-gtk=2 option to enable Gtk+-2 UI.

UPnP & C++

I’m currently trying to provide Qt4 bindings for the GUPnP stack. I’m a bit impeded by the issues that I already encountered with the “mm” C++ bindings and other people also experienced. Some classes are not that binding friendly. Additionally GUPnP is – as the name implies – closely tied to GObject and the GType system, imposing some more problems for the Qt 4 port.

I already got a test-browser like example running in Qt 4 running, stay tuned for more updates.

The QThread anti-pattern

Sometimes with QThread you see something like this:

void run()
{
    while (true) {
        {
            QMutexLocker lock(&mMutexData);
            if (mQuit)
                break;
        }
 
        msleep (200);
    }
 
    mWaitExit.wakeAll();
}
 
void stop()
{
    mMutexData.lock();
    mQuit = true;
    mMutexData.unlock();
    mWaitExit.wait(&mMutexExit);
}

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

void shutdown()
{
    thread->stop();
    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.

State of the GUPnP stack on Windows and other scary tales

I updated the windows ports of gssdp and gupnp today, did some further clean-up on the gupnp port and filed merge-requests for both on gitorious.

I also deleted the gupnp-win32 repository on github. New development will go to this repository on gitorious. There is still the gssdp-win32 repository on github since I have not yet taken care of the MSVC additions.

I also started wrapping gssdp et al into *mm (hey, I work for Openismus now ;) but this has proven to be somewhat difficult.

Fake rpm database in ubuntu

At work I’m currently developing software which is supposed to run on openSUSE. I need to query the package database at some point which of course does not exist on my ubuntu machine. Here’s a quick setup how to create a fake local RPM database:

echo "%_dbpath /home/user/rpmdb" >> ~/.rpmmacros
mkdir /home/user/rpmdb
rpm -i --nodeps --justdb --force-debian *.rpm

And that’s it.

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.