Older blog entries for Kay (starting at number 55)

Stop supporting IE7?

As already written in my Stop supporting IE6 article I hoped for IE8 supporting media specifiers in CSS @import statements. The benefit would be to lock out IE6 and IE7 from seeing the CSS definitions without using proprietary IE conditional comments. Fortunately Microsoft really did it, they support this syntax in IE8!

So if a website is going to drop support for IE7 (which may be a good idea because IE7 is still a pain-in-the-ass when it comes to web standards) then it can be done like this:

<style type="text/css">
  @import "common.css" screen;
</style>

Syndicated 2009-08-21 06:07:03 (Updated 2009-08-21 06:21:48) from K's cluttered loft

Using Microsoft's Browser Test VMs in Virtual Box

If you are a web developer like me then you most likely must test your web pages in at least three incarnations of the evil Internet Explorer. And if you are a linux user like me then you will most likely not use native windows installations to do this. And if you are a Microsoft hater like me then you may have no Windows installation CDs at all. So how are you going to test your stuff in Internet Explorer?

Fortunately Microsoft is so kind to provide some Virtual Machine Images for testing purposes. Unfortunately they are only available for Virtual PC but with some work they can be used in Virtual Box as well. In this article I will describe how to get these images running on Ubuntu Linux 9.04.


Continue reading "Using Microsoft's Browser Test VMs in Virtual Box"

Syndicated 2009-06-12 18:07:00 (Updated 2009-09-04 12:53:55) from K's cluttered loft

Events in Java (Second try)

Well, I'm not that satisfied with the Signal/Slot system I described in a previous article. The reflection part of it makes me itch. So I gave it a second try...

First of all lets summarize the problems with the listener pattern:

  • Two classes (The data container for the event and the listener interface) must be created for each event.
  • At least three methods must be created for each event (Register, Unregister and Fire) in each class which is going to fire the event

So it's simply too much boiler-plate code and the goal is to put as much as possible of it into some library classes without losing any type-safety and without using reflection. I'm going to describe my solution in this article and again I will use the nonsense example of a citizen which drinks some beverage and a Big Brother which monitors it.


Continue reading "Events in Java (Second try)"

Syndicated 2009-06-02 22:14:00 (Updated 2009-06-02 22:30:31) from K's cluttered loft

Events in Java

Java has no integrated event system but most classes in the Java Runtime uses the Listener Pattern for this. This pattern is pretty powerful and (when using Generics) completely type-safe but in the end it is still pain-in-the-ass. Think of a class which wants to send five different events. You have to write five listener interfaces and write at least 15 methods (five register methods, five unregister methods and five fire-event methods) and collections for all the listener objects which are registered. Depending on the type of events you may want to write five event classes which are used as containers for the event data. Lazy programmers therefor put all five events into the same listener interface so they only need one register/unregister/fire tripplet. But this requires the event receivers to implement all five listener methods even if they are interested in only one of them. So some genius invented the Adapter classes which already provide empty listener methods which can be extended by the event receiver. The whole thing is pretty annoying because it's so complicated to implement and to use.

So lets take a look at a different approach...


Continue reading "Events in Java"

Syndicated 2009-06-01 13:23:00 (Updated 2009-06-02 22:23:56) from K's cluttered loft

Guild Wars on Linux

Because I'm currently playing Guild Wars pretty often and I was too lazy to switch between Windows and Linux when I switched between playing and working I installed lots of development software on Windows so I can work there, too. But after Windows crashed and shredded some of my source files while doing this I decided to ditch Windows completely. So I installed Guild Wars on Linux (using Wine) and after some configuration changes it works well enough. It never runs as fast as on Windows but it is fully playable.


Continue reading "Guild Wars on Linux"

Syndicated 2009-05-23 11:01:08 (Updated 2009-05-25 11:17:43) from K's cluttered loft

Lazarus TActionList

In Delphi I used TActionList with lots of TAction items to implement the various actions in an application. These actions can then be linked to menu items and buttons. An action can have an OnUpdate event handler which is responsible for activating and deactivating the action depending on the current state of the application. This is a very useful feature which is also available in Lazarus but unfortunately it is somewhat broken in current Lazarus version (At least up to daily snapshot 20081231) because the OnUpdate event handlers are not called correctly for actions which are only linked to menu items. This bug is already reported and hopefully it will be fixed soon. But for now I have created a little workaround for it.


Continue reading "Lazarus TActionList"

Syndicated 2008-12-31 18:23:47 (Updated 2009-01-11 10:09:05) from K's cluttered loft

I18N with Lazarus

It's pretty difficult to find information about how to write a multi-lingual application with Lazarus. I've been through this and I hope that this article helps others to get on the right way. I'm not 100% sure the way I found is the right way but at least it works great for me. So it can't be totally wrong.


Continue reading "I18N with Lazarus"

Syndicated 2008-12-31 16:36:23 (Updated 2009-01-11 10:07:52) from K's cluttered loft

Lazarus

Currently I'm again involved in developing GUI software for Windows. In the past I always did this with Delphi so I thought it would be nice to use it again. I searched for a free version of it which was quite hard. How the hell is it called today? Borland Delphi? Code Gears Delphi? Turbo Delphi? Which is the newest version? Delphi 2006? Delphi 10? Where are the Personal Editions? Is there still a Kylix out there for cross-platform development? Wasn't there an announcement that Borland will switch to Eclipse for Delphi development? Very confusing situation...


Continue reading "Lazarus"

Syndicated 2008-12-25 14:00:00 (Updated 2009-01-01 11:34:50) from K's cluttered loft

Nice GTK1 fonts in Ubuntu

I noticed that GTK1 applications have a rather large and ugly font on my system. I searched the internet for a solution and found references to files like .gtkrc-1.2-gnome and .gtkrc-mine and some font definitions I have to put in there. But none of these solutions worked out for me. I found another reference to the program xfontsel and with all these partial information I was able to find a nice working solution. I hope it will also work for others.


Continue reading "Nice GTK1 fonts in Ubuntu"

Syndicated 2008-12-15 09:05:24 (Updated 2008-12-15 09:59:19) from K's cluttered loft

FreeReport is the free version of a commercial reporting software for Delphi. It is very powerful but it has a problem: It needs the VCLDB-Package which is not included in the Personal Edition of Delphi (At least Delphi 6 Personal, maybe Delphi 7 Personal is also affected).

Because I want to use FreeReport with Delphi 6 Personal, I have written a VCLDB-Dummy-Package. It implements a Dummy-API with all stuff which is needed by FreeReport. So if you install this dummy package you are able to compile FreeReport and can use all of it's components except the DB-aware stuff.

46 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!