Archive for August, 2004

Website coding

August 30th 2004

Spent some time coding on my website. I’ve always hated my home page design, although it looks better now.

What I spent most of the time by far on was coding some neat JavaScript to animate the colors when you hover over a link. Unfortunately, you’ll only see it if you’re browsing it in Mozilla (maybe IE or Opera, who knows?). Konqueror seems to suffer from a problem where changing the style attribute from JavaScript doesn’t actually update the page, which sort of kills the animation idea. =D

Posted by mpyne under Uncategorized | No Comments »

Real-life usability of warning signs.

August 29th 2004

We’ve probably all heard by now of the fact that most users will, when presented with a dialog that interrupts them from doing their work, will just get rid of the dialog as quickly as possible instead of reading it over. Bug 83495 is an example of this kind of bug.

Everytime I see this kind of bug report, I’m reminded of when I used to work at a video store on the local naval base. Being a naval base, we were prone to days with high winds blowing in from the sea, which would always wreak havoc with our doors (one Entrance, one Exit), as the wind would sometimes force the doors open. One particularly bad windy day, the wind actually broke the hinge on the door, which meant that the door was at risk of flying open and shattering the glass. The door that was broken that time was the Exit door.

That would obviously be sub-optimal if the glass were to be shattered. So what we did that day was lock the door shut. Of course this ended up confusing the customer who tried to leave through the locked door, so we put a sign on the door saying that it was locked.

This didn’t faze anyone, as people kept running into the locked door. So I printed up four full-page-size arrows, and taped them around the sign already on the door. This helped, but we still had people trying to walk through the door.

Being inventive, I took the opportunity to barricade the electronic scanner people walked through on the way to the exit, taping it off and putting signs up on the tape as well. This finally stopped everyone from trying to walk through the door.

Well, almost everyone. One of my co-workers walked in, and was walking around, and literally walked right into all the tape. It took us a few minutes to get the tape (and taped signs) off of her clothes.

Moral of the story: No matter how explicitly you warn about an action, you’ll still get people who activate the action unwittingly if they can. ;-)

Posted by mpyne under Uncategorized | No Comments »

Detecting null dereferences in member functions.

August 27th 2004

Today’s C++ example involves detecting the use of null pointer dereferences from within your member functions. It’s not common since there’s really not much you can do when you detect this situation, but I find it’s somewhat neat anyways.

The idea is that in a member function, you can examine the value of this, to see if it’s null. If so, you can print out a whine message or something like that.

#include 

using namespace std;

class Test
{
    public:
    void tryToDie() const;
};

void Test::tryToDie() const
{
    if (this == 0) {
        cout tryToDie();

    test = new Test;

    cout tryToDie();

    delete test;

    return 0;
}

If you run that program, you should get output somewhat like the following.

Testing null pointer.
HA!  You tried to dereference a null pointer you silly silly person.
Testing valid pointer.

Posted by mpyne under Uncategorized | No Comments »

Hackergotchi drop target

August 26th 2004

Well, now that I (seem to) have fixed bug 86478 (Drop target has severe graphical artifacts), I discovered something neat.

It seems that you can use any old PNG as a drop target icon, and Qt will automatically deduce the correct mask for the X11 SHAPE extension. Right now I have as my KGet drop target my hackergotchi icon (just for testing purposes of course. ;-) ).

If you have a spare graphic that you’d like to use as a drop target, you can do so by doing the following: Make sure that $KDEHOME/share/apps/kget/pics exists, and then save your picture in that directory with the filename target.png.

If this sounds cool enough, I may add an option to KGet allowing you to choose your own drop target graphic.

Posted by mpyne under Uncategorized | No Comments »

Yes, I forgot to give credit where credit’s due.

August 25th 2004

While I knew in my head that it was more than just Boudewijn working on Krita, especially given that he’s been mentioning everyone in his blog entries, the fact that I was replying to Boudewijn’s blog apparently gave me a mental burp when I forgot to credit the other Krita devs. Sorry guys! :-)

Posted by mpyne under Uncategorized | No Comments »

Re: Krita

August 24th 2004

Boudewijn,
you rock. :-)

Posted by mpyne under Uncategorized | No Comments »

More gstreamer action

August 24th 2004

Rich, I’m sorry
that my blogging system doesn’t support comments, but the sad fact is that I
probably wouldn’t check my comments anyways. :-(

Anyways, as hausi has pointed out, your aRts 1.1 suggestion doesn’t help if
you’re trying to avoid glib, because it turns out you’re more or less linking
it in statically. You can see the glib copy yourself in the gslglib* files on
WebCVS.
I have even gone and made sure that the files listed were from
ARTS_1_1_BRANCH. ;-).

I think the conclusion I’m trying to point out is that if you make a
multimedia system with any kind of C bindings or C core, you will end up doing
one of three things:

  1. Use glib, since it is available and by now very well-tested. It would be
    advisable to not fork the library, since then you lose security updates and
    bug fixes.
  2. Avoid glib, and reimplement what you need yourself, poorly.
  3. Avoid any code construct even resembling anything from glib, resulting in
    either no MM framework, or a very lame one.

Of course, we could create or use a framework that is pure C++, such as NMM, but that seems to me to be a
step to make KDE incompatible simply out of spite, which I don’t think would
be good for the users of KDE.

Posted by mpyne under Uncategorized | No Comments »

gstreamer

August 24th 2004

One of the things that was supposed to be discussed at aKademy was what we would be using as a multimedia framework for KDE 4.0

You can find a talk by Scott Wheeler (from kdemultimedia, notably JuK) and Christian Schaller (of gstreamer) on the KDE aKademy presentation archive, which is regarding gstreamer and the role it can play in KDE 4.0

The presentation is a good introduction, and showcases a lot of the current gstreamer integration into KDE. JuK was AFAIK the first KDE music player to output to gstreamer, using Tim Jansen’s nice KDE gstreamer bindings (in the kdenonbeta CVS module). Unfortunately, the bindings only support gstreamer 0.6, while gstreamer 0.8 is already out.

So, now amaroK outshines every other KDE music player out there when it comes to gstreamer support. Not only do they support gstreamer 0.8, but you can even use KIO with amaroK while playing to a gstreamer backend. In fact, amaroK 1.1 Beta 1 doesn’t even support aRts, pending the update of their aRts engine.

The hard work of the amaroK devs has proven that it’s possible to integrate gstreamer output with KDE, which is especially nice since from what I understand, gstreamer is looking to be the front runner to be KDE’s multimedia framework for 4.0.

Everytime the subject of gstreamer and KDE 4.0 comes up, I always hear objections that are IMO unfounded. Let me try to dispel some of those:

  • gstreamer can’t maintain binary compatibility!

    This is simply not true. gstreamer could IMO easily maintain binary compatibility. First of all, it is a C library, which means that they don’t have to worry about the ABI changing every other gcc revision. I’ll admit that it makes it very annoying to code gstreamer software at this point, which is why I’m hoping the KDE bindings get updated soon. ;-). Other C-based platforms have maintained binary compatibility for years, most notably the various UNIX-like kernels out there, including Linux. There’s no technical reason why gstreamer wouldn’t be able to, and the developers themselves seem intent on meeting that requirement.

  • gstreamer can’t play over a network so it’s useless!

    Well there’s nothing stopping gstreamer from being able to do so. It is, after all, simply another gstreamer plugin. I wasn’t even aware that aRts could do this until I saw this point become mentioned, so it doesn’t strike me as the most famous sound server feature.

  • gstreamer is a part of GNOME, we don’t need GNOME taking over KDE!

    Actually, gstreamer only requires glib and libxml. And KDE has used glib for awhile now through, ironically enough, aRts. So that boat’s already left the station. Mind you, using the native gstreamer API IMO is like using shards of glass to wash your face, what with all the macros and underscores and all. But that’s why KDE applications will have a nice wrapper.

I hope that’s a decent overview of the possibilities with KDE + gstreamer, even though it only covers music playing, even though gstreamer is capable of so much more.

Posted by mpyne under Uncategorized | No Comments »

School starts today

August 23rd 2004

And that means less time for KDE. :-(

Then again, I’ll have more time for KDE as soon as I’m able to beat Tales of Symphonia. ;-)

Posted by mpyne under Uncategorized | No Comments »

OMFG

August 21st 2004

I guess this will be number 2 in my series of neat-bug-reports-assigned-to-developers-who-have-burned-out.

In this bug, we see the horrifying tale of a user who accidentally ran yum on his Red Hat system with /usr mounted read-only, corrupting his rpm database in the process, instead of gracefully failing.

The response from the developer? UBD.

Now I’ll admit, the user shouldn’t have expected yum to work with /usr mounted ro (oh wait, he didn’t expect it to work). But I think that corrupting the rpm db would be a little much for punishment.

Mind you, I still get bugs like this every so often with KDE, where if the X Server crashes, my configuration gets all garbled. But then again, I haven’t seen that bug for awhile now, so it’s probably been fixed.

Posted by mpyne under Uncategorized | No Comments »

Next »