PostgreSQL 8.1

A new year, a new announcement of a new version of PostgreSQL, an all-time-member on my favourite tools list.

2002 brought us PostgreSQL 7.3, 2003 brought 7.4 (no announcement on this blog) and 2004 brought us PostgreSQL 8.0 (the date of the blog entries match out of sheer accident – I did not time them at all).

And now it’s time for the next announcement. While the team is a bit early this time (it’s not december the 2nd yet), it once more brings a lot of good stuff.

What’s the most interesting aspect about those PostgreSQL releases: They always bring just the feature I need at the time of the release.

7.1 brought TOAST tables. 7.4 brought autovacuum, 8.0 brought the windows version and now 8.1 brought some needed performance improvements with large tables and large COPY operations (which is what I’m doing currently)

And it’s not just me. Christoph was in the position to have needed something like PHP’s max() function. And what do we learn: 8.1 brings us greatest()

Congratulations to another splendid release, PostgreSQL team. I hope to see you going as strong for the next couple of years.

Frustrated by personal firewalls

As you may know, the company I’m working in develops barcode ordering solutions.

Now for me it’s very frustrating to see that whatever I do, those oh-so-good personal firewall and internet security and whatnot tools manage to screw the experience for the enduser. During developement, I’m always watching to adhere to common known-good practices in regards to handling the system. Works without admin rights? Yes. Uses systemwide functions wherever possible? Yes. Clean uninstall? Yes. Spyware free? Of course. Trojan horse? God beware! No!

None the less, PopScan gets majorly screwed here and then:

  • Norton Internet Security is per default configured to let only ‘Programs authorized by Symantec’ to access the internet. I don’t even try to ask how to get on that list – besides the fact that we’d never have the resources to do wahtever Symantec wants from us – if they provide such a possibility at all.
  • Whenever the offline version connects to the internet, a big scary warning from whatever personal firewall (besides Norton – that tool silently blocks everything that’s not IE and LiveUpdate) pops up telling the (not-knowing) user that something bad is currently happening. End-users are known to click ‘block’ here and accuse us of creating trojan horses
  • To circumvent many problems associated with installations on the client, we created the Web version of PopScan. And you know what: We’re still screwed. Java-Applets get blocked (how the hell should we get the barcodes in the scanner if not with Java or ActiveX??), PopUps get blocked (of course we don’t pop up any unrequested ones. The only popup used is for reading the scanner. With onClick=”window.open()”. It can’t be more ‘user-requested’ than this. Still… Some security program deemed it necessary to block that.

The worst thing about all that is: Those obviously broken programs that screw applications all over the place call themselves ‘Security Tools’ and with this, they seem to be automatically trusted by the end users. If a security tool tells the user “Trojan Horse Alert”, the user panics and blocks everyting. If a security tool just silently blocks certain internet connections (PopScan Offline uses Port 80 to communicate – using WinInet API – a less intrusive, less sneaky way for connecting to the internet does not exist), everyone blames the blocked program of not working.

To connect to the internet regardless of any PFW setting would mean to inject code into IE and use that to do your internet work. The better tools still detect that, but you can get around it by abusing the Windows Message Loop and simulating keypresses. But both solutions are actually trojany. And I’d never ever implement such a “feature”. It’s compomising stability and integrity. And it’s etically flawed. None the less: The tools force me to do something like this if I want to work it 100% of the caused in 100% of the installations

Those tools go way too far.

And don’t forget: It’s the nonexperienced users that get bitten: Those install security tools. Those don’t know what those tools do. Those trust them. Those make the wrong conclusions (PopScan can’t connect. PopScan must be broken).

It’s just frustrating. Why use lots of time to make a software non-intrusive and perfectly compliant to both technical and ethical standards when it’s blocked just like your average trojan horse trashing your installation and displaying advertisement all over the place?

Actually I think, those trojans are better off because they have code to circumvent the security tools.

As it currently stands I have the feeling these tools do block more legitimate applications then trojan horses. And this frustrates me. Greatly.

Usability with the Browse for folder dialog

browsefolder.png

This dialog is the worst usability nightmare ever. It’s so bad that I’m really afraid of using any function in any program making me to chose a directory. Why? Don’t get me started:

  • It’s too small. Newer versions of Windows allow you to resize it, but it’s dependent on the program. The one I took this screenshot off does not.
  • It’s uncommon. You don’t see that dialog often. Many programs use a standard file selection dialog when they ask for a directory (I guess because of the problems outlined here)
  • It does not allow multiple selection. Meaning that if your program provides the user to work with multiple directories at once, it can’t be done with this dialog. You have to build your own solution, thus losing even more usability by forcing the user to learn something new
  • The tree-view is an uncommon view on the filesystem. Over time, Microsoft eliminated the tree view for directory navigation more and more. You have to willingly turn it on in Windows XP. There’s no explorer view with that tree per default
  • It’s context-less. Tell me: What’s the reason to select a folder in the dialog you see in the screenshot above? I don’t select a folder for the selections sake. I want do do something with that folder. What? The dialog does not tell me. I know this can be set in the API-Call to bring up the dialog. But many people do not.
  • It has not way to enter a path manually. Copy & Paste exists for a reason. If you have deeply nested paths, it can be a real timesaver. Navigate in Explorer (maybe already open anyways), Copy the path to the clipboard and… nope… no pasting
  • It has no autocomplete. I’m very fast in typing paths with the help of autocomplete: c:Pro[arrow down]Po[arrow down] and I’m in c:Program FilesPopScan. Not in this dialog. In this dialog, I have to click through the whole path
  • Around Windows 2000, microsoft extended the file selection dialogs with a shortcut bar allowing easy access to some commonly used folders. This bar is missing in this dialog.
  • It’s readonly. What if I want to make a new folder? Some “editions” of the dialog do provide a ‘New Folder’ button. Even so, it works by adding a ‘New Folder’-Folder and you have to manually click it to rename it (at least on this system here. Behaviour is erratic
  • There’s no context menu. Usuall when you see filesystem icons, you can right-click it to get a systemwide context-menu. Not with this dialog. Well. You can right-click. A context menu does appear. But the single entry is “What’s this” providing an utterly pointless context sensitive help entry that – I’m afraid has no context at all: “Click the plus sign (+) to display more choices” choices? What choices? Why do I want to see new choices? This is no answer for the question “what’s this”. It’s no answer at all. What the heck.
  • It’s context less (yeah. we had that before): Tell me: What’s the path I currently have selected in the screenshot? How can I know I have selected the correct folder? I may – after all – have multiple Richard Wagner folders on my harddrive
  • I wanted to write that it violates fitts law because you had to click those small ‘+’-signs (as the context sensitive help tells you). And now – after years of using this dialog I finally learned that you can double-click folders to expland them. I did not know that until now
  • When you have mounted network drives, it’s a living performance-problem as the top layer of the dialog displays all drives which can take some time. In which the dialog (and the unerlying app freezes).
  • The deeper you get in the hierarchy, the more you have to horizontally scroll.

I’m sure I can list even more, but enough is enough. I’m sure you get the point

Microsoft, I beg of you: Redesign this dialog!

Force the programs to use the new design. Don’t provide a fallback!

This way only the programs that are actually re-building this dialog (instead of calling the API) remain broken – and after all, they were broken to begin with: Why rebuild something crappy? Why rebuild it and risk it only being similar but not identical in usage? Why rebuild and risk it remaining broken even if the dialog gets fixed?

And believe me: There are people rebuilding existing OS-features. For no reason at all (see another posting about Adobes new file selection dialogs)

On the search of a text editor

When I began with this blog, I was using jEdit because of its wonderful list of countless features directly optimized for the programmers needs.

It was lacking one thing though: PHP support. While it provides (excellent) syntax highlighting, there’s nothing more. No code completition, no parameter hints, no code browser. While many people tick those things off as useful but not needed, I tend to disagree:

Sometime around autumn 2003, I gave the Zend Studio another try. And it has matured quite a lot since its first release. The speed problems were fixed, some editing features came back… nice.

What made me stick to Zend Studio is the above features: Code completition and parameter hints.

I know that you can just look the order of a functions parameter up in either your (or someone elses) code or in the manual, but it always interrupts your work. Not only that, you have to actually know where to look. Is it in the PHP manual? In code file a? In file b? Maybe in some library installed in /usr/lib/php (PEAR)? Zend Studio provides me with the parameter hints regardless of where the file is stored – provided it can read them.

This is a killer-feature. It immensely increases ones productivity. Whatever editor I’m ever going to use: It must have parameter-hinting for PHP. And it has to work as good as it does in the Zend IDE.

The Zend IDE has other problems though. What it has in parameter hinting, it lacks in basic editing features. Remove whitespace at the end of lines? Comment out a block? Smart autoindent (another thing where jEdit shines)? Splitting the editing window? No. Neither of them.

What pisses me off most (besides the whitespace problem as that creates very ugly SVN commits) is the font renedering though. Now that I finally found a font I really like, I’m unable to use it in the mostly used editor environement. Like many other Java applications Zend Studio does not support cleartype. And if you hack around a bit to run ZDE in a Java 1.6 alpha, the whole application will use cleartype – the whole application except the editing window, of course. Consolas looks really bad without ClearType.

Actually, any of the fonts I do like for programming (basically any besides Courier New) looks bad without ClearType, which means that I’m programming PHP with Courier as my font.

PHP of course is my main language at this time, so I’m doing most of my work in an environement that is not to my liking at all.

So… time for a new editor. Here’s what I’ve tried:

  • jEdit again. Now has a PHP parser plugin, which is completely unusable unfortunately: It parses while you are typing and as soon as it detects a syntax error (which is bound to happen while you are writing a line), it puts the keyboard focus to the error list(!!!!). This means that I have to type like this: function gnegg([TAB]$param1,[TAB]$param2){[TAB], the [TAB] meaning me hitting tab to get the focus back to where it belongs. Additionally, there’s no parameter hint, which is a must for me. As much as I’d like to use jEdit. It’s not possible like this. Sorry. (even though jEdit actually renders Consolas quite right with its own implementation of subpixel hinting).
  • PHPEclipse: An Eclipse plugin (even though Eclipse is written in Java, it uses SWT and thus the native font rendering of the underlying platform, meaning that cleartype is usable) teaching the JAVA IDE how to do PHP. Unfortunately, many of the great features in eclipse are part of the JDT plugin suite, so every language has to redo the stuff in there. PHPEclipse is seriously lacking in the features departement and the parameter completition is missing aswell.
  • UEStudio. Well… let’s try it with a commercial offering. UEStudio is a enhanced version of UltraEdit. They emphasize on their PHP support. You guessed right: No parameter hints.
  • phpEd, Maguma Studio, … I did not even try them again. My last experience was very, very painful. While Delphi is a RAD tool allowing to make quick progress, you have to be as careful with memory allocation as in every other native-compiled language. None of those Windows-Only-PHP-Editors seem to care about that, so they crash all the time. No alternative.

Well… that’s it for now. Please. Anyone! What are you working with? Is there a editor with the editing features of jEdit, the font rendering of eclipse and the PHP-specific features of Zend Studio (auto completition and parameter hinting)? I don’t need no profiler. No debugger. Just a good editor.

Am I doomed to write PHP with Courier New for the rest of my life?

Domain grabbers – love’em

Well… pilif.ch is gone. I forgot to pay the renewal fee for one single day and the next day, the domain is in the hands of a domain grabber. I’m sure, nic.ch has some sort of deal with them to automatically forward expired domains.

I’m really grateful for that. And I’m also grateful that I did not get a warning in advance (which happened because of a wrong address in their database – mea culpa).

So: Visit lipfi.ch for my personal webpage.

To be honest, I would not have resurrected the thing if it was only about http://www.pilif.ch, but I had lots of other services running on subdomains, services on which I depend on (like the administration tool for this blog)

Well… if you are one of the users of any of those services, replace pilif.ch with lipfi.ch and continue to use them as usual.

Stupid domain grabbers

Nice font…

I have my windows set up with ClearType™ enabled. Now, for Longhorn, they have created some new fonts, specially hinted for configurations with ClearType™ enabled. One of them – Consolas – has a fixed width and is for use in programming environements for exmple.

Sample Screenshot

I really like this font. It’s very easily readable but still looks great and smoothed.

Unfortunately, in environements without cleartype, it looks really crappy. One of those environements, unfortunately still is the Java Runtime and with this the Zend Studio. Actually, no single font i’ve tried in there looks acceptable. The best of them – still – is Courier New which is a real pain.

What I liked most about Consolas is also visible on the screenshot: Usually I’m working on a bright-on-dark editor scheme because it makes the thing a whole lot more readable for me. With consolas I don’t need this any more. The font looks good and readable even on a white background. This in turn takes away a lot of strain from my eyes.

Nice. I’ve copied it over from my Lonhorn VMware-Image to my default working-environement and I’m really, really happy

Just incredible

Maybe you know it: There’s a big community about remixing video games music at ocremix. Additionally, there’s an ogg-stream available here which is what I’m currently mostly listening to while at work.

There’s some techno in there I really dislike, but I usually just close my ears (mentally) then. But mostly it’s really great sound – especially if you know the games.

Well… And just some moments ago, I listened to Death on the Snowfield which is a remix of Terra’s theme from Final Fantasy VI.

I’ve always been a big fan of the music in said game – IMHO it’s the best thing Noubo Uematsu has done so far. Terra’s theme is the best part of a the best composition of the second best video games composer… you could say that it’s pretty good ;-)

But what made me write this entry: Said Remix is so beautiful – it made me cry (and listen to it over and over again). I really recommend you to get that mp3 and see if you like it aswell.

So good!

No topic-based help system installed

Recently I had to do some Delphi-work again. To my surprise, the online help seemed to have stopped working. I always got this error message:

No topic-based help system installed

Programming without an online help is very tedious and sometimes nearly impossible.

When I had to look up in which Unit TWinControl is declared, I had two possibilities: Either look it up in the source code (Borland ships the full source code to their class library) or fix the help system once and for all.

I deceided to do the latter (searching after TWinControl is no fun).

Googling in the web turned out nothing. In Groups most of the time, the suggestion was to reinstall the whole thing

I absolutely did not have time for this, so I dug deeper.

The problem is caused by the installation of the VS2005 Beta which resets some AppID-GUUID. Afterwards delphi crashes while loading the IDE-package htmlhelp290 which in the end causes delphi to think that there’s no help installed

I fixed it doing the following:

  1. Reset the help-viewer-appid. In the registry under HKEY_CLASSES_ROOTAppIDDExplore.exe, set AppId to {4A79114D-19E4-11d3-B86B-00C04F79F802}
  2. In HKEY_CURRENT_USERSoftwareBorlandBDS3.0Disabled IDE Packages remove the entry for htmlhelp290 that has been created.
  3. Start Delphi and use the help again

What I don’t know is if this has a negative effect to VS, but this does not matter for me: I need Delphi to work.

The whole thing is a consequence of the .NET orientation of delphi: Earlier, Delphi was as self-contained as the executables it can build: Drop it into a directory and run it. No problems, no questions asked.

With Delphi integrated into .NET and using .NET-Components, problems begin to rise: First there was a bug in D8 causing it to stop working after .NET 1.1 SP1, now this.

Hopefully, they find a way back to both .NET (for the acceptance in the buzzword-centered world where you can’t have a dev-tool not .NET capable) and self-containment.

Fresh Air

pont04.JPG

Already another year has passed.

It’s fresh air time for me!

Hopefully (though not likely unfortunately), the weather will be better this time, but in the end I suppose it does not matter. It’s about nature, free time and Evelyn, the best girlfriend in the world

As of tomorrow, I will be off for one week of holiday.

PS: I wonder how many points of rested bonus this will get me in WoW :-)

Once more: PHP and SOAP

I can’t reist: I made my third attempt at getting a SOAP-Server in PHP to work (I only documented my first try here on the blog).

My first try was a little more than two years ago. That one failed miserably.

The next try was last november. I came somewhat further than I did my first time, but Visual Studio was unable to import the WSDL correctly as soon as I was passing arrays of structs around

And now I tried again – this time with PEAR SOAP 0.9.1

This time all looks so much better. First of all, I do this because I really have to: For one of our PopScan customers, we are accessing their IBM DB2 database – currently using a Perl-based server that’s nearing the end of its maintainability, so I deceided to redo it with PHP (PHP-code is somewhat cleaner than Perl code and I’m more fluent in PHP than in Perl)

The DB2-client (especially the one needed for that old 7.1 database) is clumsy, a bit unstable and really not something I want to link into our Apache-Server that serves all our clients.

So the idea was to compile another apache, run it on another port, bound to localhost only. Add PHP with the DB2-client. Access this combo via some way of RPC with the nice DB2-free standard-installation.

Well. And instead of once again designing a custom protocol (like I did for the Perl-Server), I though: Maybe give SOAP another shot.

In contrast to previous experience, this time, it was the Server that worked and the client that was failing. Using PEAR SOAP 0.9.1, creating the server (which creates the dreaded WSDL) went without flaw. This time I was even able to import the WSDL into VS 2003, which I tried just for fun.

Passing around arrays of structs of structs was no problem at all. After building the self::$__typedef and self::$__dispatch_map arrays, passing around those data types has become really intuitive: Just create arrays of arrays in PHP and return them. No problem.

Well done, PEAR team!

This time I’ve had problems with the PEAR SOAP Client. It insisted in passing around ints as strings which the server (correctly) did not like.

Instead of using lots and lots of time debugging that, I went the pragmatical way and used PHP5’s build in SoapClient functionality. No problems there.

And then it suddenly broke

My test-client was written for the CLI version of php which was version 5.0.4. The apache-module of the live-server was 5.0.3.

All I got with 5.0.3 was a HTTP Client Error (SoapFault exception: [HTTP] Client Error).

Whatever I did, it did not go away, but to my delight I have seen that PHP did not even connect to the server to fetch the WSDL. This was good as I was able to debug much quicker that way.

In the end it was the URL of the WSDL. Every version of PHP5 (even the 5.1 betas) – besides 5.0.4 – does not like this:

http://be.sen.work:5436/?wsdl

it prefers this

http://be.sen.work:5436/index.php?wsdl

I ask now: Why is that this way? The first version is a valid URL aswell. The served WSDL is correct – it’s the same file that gets called and it returns totally the same content. This is so strange.

After all, I have to say. SOAP with PHP – after two years – still is not ready for prime time. It’s still in the state of “sometimes working – sometimes not”. But as I now have an environement where it’s known to be working and as I’m in total control of said environement, I will go with SOAP none-the-less. It’s so much cleaner (and more secure: more people than just me are looking at the SOAP-code) than designing yet another protocol and server.

Oh. And the bottom line is: Never trust protocols that call themselves “simple” or “lightweight” ;-)