Tag Archives: Programmieren

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.

Smart pointers…

Can someone explain me the following behaviour:
I have the following smart pointer:

class AlsaHwParams
{
public:
    AlsaHwParams() : m_params(0)
    { snd_pcm_hw_params_alloca (&m_params); }
    ~AlsaHwParams()
    { if (m_params != 0) snd_pcm_hw_params_free (m_params); }
    operator snd_pcm_hw_params_t*() { return m_params; }
private:
    snd_pcm_hw_params_t *m_params;
};

Thing is: It doesn’t work. Alsa behaves very strange if I use it. Even if I make the m_params member public and access it directly. The only way it works is to not allocate from inside the class but outside like

snd_pcm_hw_params_alloca (&(hwparams.m_params));

Update: Seems replacing _alloca with _malloc fixes it.
Update: Duh, that is because alloca allocates on stack and not on heap.