Wednesday, November 28, 2007

XINS 3.0 (updated x3)

Note (added Jan 8, 2008): This article is outdated, please read "XINS: Splitting out Logdoc?"
XINS is a powerful technology for writing web applications and web services. While the current 2.1 version already sports a lot of functionality and flexibility, here's my wishlist for a 3.0 version:
  1. Support for Java 5 generics. If this will make the framework Java 5+ only, so be it.
  2. Support for XML-type parameters, both in and out.
  3. A XINS service caller engine; a separation between the XINSServiceCaller and the actual protocol used, possibly with a (static, non-final) inner class Engine.
  4. Provide an alternative front-end calling convention that sports clear URLs, path-based instead of parameter-based.
  5. Combine multiple function invocations in one call, avoiding the network overhead of multiple calls.
  6. Multi-implementations: Allow a single API implementation to implement multiple API interfaces.
  7. Allow API inheritance, so that one API can inherit the functions defined in another.
  8. After some thorough analysis, apply some secure defaults. E.g. only allow metafunctions to be called from localhost.
  9. An SMTP caller that supports load-balancing and fail-over (see RFE 1859843).
  10. A similar SMS caller (see RFE 1864472) that allows the sending of SMSes via different gateways.
See also:
Updated December 20, 2007: Added #5, #6 and #7.
Updated December 24, 2007: Added #8.
Updated January 5, 2008: Added #9 and #10.

Thursday, November 15, 2007

XSLT 2.0: select attribute within xsl:choose

XSLT 2.0 (which includes XPath 2.0) is enhances XSLT 1.0 in many ways. Among other improvements, it supports regular expressions, multiple output documents, plain text parsing, etc.

However, of course there's always more on one's wishlist; or at least on mine. I'd like to see support for the select attribute on xsl:when and xsl:otherwise attributes. Currently, with XSLT 2.0, the following is a typical construct:
<xsl:when test="@lang">
<xsl:value-of select="@lang">
<xsl:value-of select="$defaultLang" />
With my proposed change this can be reduced to:
<xsl:when test="@lang" select="@lang" />
<xsl:otherwise select="$defaultLang" />
It's shorter, easier to read and probably quite straight-forward to implement in parsers. And IMHO it is even consistent with the rest of the language, because since XSLT 2.0 even the <xsl:with-param> element supports the select attribute...

Tuesday, November 13, 2007

Mac OS X 10.4 (Tiger) annoyances

Here's my list of some annoyances I have with Mac OS X 10.4 (a.k.a. Tiger). I have not switched to Leopard yet, but I doubt whether the issues I list here have been fixed in Leopard (if you know, please add a comment.)
  1. When replying to a sent mail, my own e-mail address is in the To: field. D'oh!
  2. There is no easy way to see which e-mails are currently being sent or are scheduled to be sent at a later point in time.
  3. While synchronizing with a slow IMAP server, my inbox lists none of my incoming messages.
  4. Create a new message. Edit the To: field. Type a name followed by a less-than sign (<) and then paste (Cmd-V) an e-mail address. Notice that there's now a comma where you don't want it, right behind the less-than sign.
Suspend / Screen locking
  1. After suspending the machine (e.g. close the MacBook (Pro) lid) the screen gets locked, that's how I configured my machine. If I change monitor (and hence resolution) while the machine is suspended (e.g. close the MacBook Pro lid and then insert a DVI cable) the screen looks distorted, while the login box on it looks OK.
  2. Sometimes after suspending the machine, it won't come back. The mouse pointer shows, but no login dialog. And every keypress triggers a beep.
Software update
  1. Run Software Update. If there is an update that requires a restart, the program will show a dialog asking you to choose Restart or Shutdown? Instead, try shutting down the machine using the key combo Ctrl-Alt-Cmd-Eject. A new dialog window will show up saying that the Software Update program cancelled the shutdown. Why?!
  1. Spotlight windows are anonymous. They don't show up when using Cmd-Tab. Why?
    Fixed in Leopard: Yes.
  1. For developers like myself, Java 6 support is a must, see this Sun Babelfish blog entry: 13949712720901ForOSX.
    Work-around: Although Apple does not provide a Java 6 port, a work-around based on the FreeBSD JDK is underway.
    Fixed in Leopard: No
Note: I intend to keep this post up-to-date.

Monday, November 5, 2007

Tip: Getting a thread dump logged

Quick tip: If you're running a Java program and you want it to dump the status of the threads, this will work on the Apple, Sun and IBM JVMs (on UNIX/Linux):
kill -3 pid

Tuesday, October 30, 2007

Wishes for Java 2D

A couple of months ago, I started using Java 2D for pregenerating large amounts of images to be used in a website. To make them look great, I use features such as translucency, gradients, anti-aliasing for text and shapes and fractional metrics.

Although Java 2D works fairly well (although with some annoying bugs on Mac OS X) and offers a simple and consistent API, there's still some features I'd really like to see added:
  1. Color quantization, first and foremost. I want to be able to convert a full color image to a 4-, 16- or 256-color pallette and then save it in GIF- or PNG-format. Currently I use the command-line pngquant program as an alternative solution.
  2. Configurable character spacing. Currently, character spacing (not character width) is fixed.

Monday, August 27, 2007

Visualize site visits with CrazyEgg

Want to visualize your website visits? CrazyEgg is a service that shows your website with an overlay that indicates where visitors clicked. Quite nice. Best of all, the cheapest version of CrazyEgg is free!

Crazy Egg helps you identify where people click on the page, as well as compare different versions of the same page. Although the options seem to be limited, the basic functionality is quite powerful.

Downside for your visitors is that your site needs another DNS lookup and then pulls in a 23.7K JavaScript file.

CrazyEgg does not seem to integrate with other tools, such as Google Analytics.

Emulate an iPhone [updated]

Want to know how your web application will look and work on an iPhone, but you don't own one?

iPhoney emulates an iPhone on your Mac OS X 10.4 installation. It uses WebKit for rendering, the engine that is also used by Safari.

Overall, iPhoney is quite nice. Here are some features that would improve it even further:
  • support iPhone-like scrolling and zooming, without scroll bars;
  • improve the zoomed out view so it looks accurate (this may be a WebKit problem instead of an iPhoney problem and may apply to the iPhone as well);
  • by default apply the iPhone user agent string, instead of a generic WebKit agent string;
  • although Flash is not displayed, when querying the installed plugins from JavaScript, Flash is indicated as installed (if it is installed in Safari).

Friday, August 24, 2007

Improve website performance with Yslow

A while ago I blogged about Firebug, a great Firefox extension for analyzing web pages (including CSS and JavaScript) and the interactivity between a browser and web servers.

Yahoo! have built on Firebug to produce a tool that goes even further. They call it: YSlow for Firebug.

Based on "Thirteen Simple Rules for Speeding Up Your Web Site" YSlow analyzes a web page, produces some reports (with a score card) and gives advice on improvements. This can be a great help in improving your website's performance and reduce it's bandwidth usage.

Also see this blog entry:

Monday, August 20, 2007

Cinema displays with video and audio

Here's my tiny wish list for an improved Apple Cinema display:
  • a built-in iSight video camera;
  • built-in speakers, similar to the new iMac speakers, on the bottom of the screen, facing downwards.
This way, an Apple Cinema display is an excellent companion for a Mac Mini or a Mac Pro.

With a built-in video camera and speakers, Mac Mini/Pro users no longer have to buy and connect an external video camera and external speakers. This will greatly improve the esthetics of their Mac.

Of course, the video camera and speakers are connected to the Mac using just a single USB cable, the same cable that also provides access to the other USB 2.0 ports on the screen.

Wednesday, August 8, 2007

Keynote '08 [updated x2]

Just today I fetched the trial version of Apple's iWork '08, after ordering it on-line. At 468.9 MB, the download is quite substantial.

First of all, the iWork '08 trial installation does not affect my (purchased) iWork '06. That's a good start, this will allow you to try it out with the possibility to rollback to iWork '06 easily.

Pages and Numbers don't really interest me, but Keynote is to me a fundamental tool for creating stunning presentations (to re-use Steve Job's marketing terminology) and even for creating website designs.

Below are my first findings. Bear with me, I've just tested it for an hour or so. Missing another feature? Drop a comment.

So what's new in Keynote '08?
  • An alpha filter wizard, which works kind-of OK. It works well when there are clear edges between the image and the background. This may increase my productivity slightly, though, since I will have to go out to GIMP (my image editor program) less often.
  • More transition- and text-effects, of which only a few, like blur will be useful to me, since I need to be careful with the eye-candy to keep my presentations looking professional.
  • Actions that allow you to move, rotate, enlarge and otherwise manipulate your objects in an animation. This is to me the most compelling feature of Keynote '08. It will allow me to build more advanced presentations, with professional animations that will once again make PowerPoint-users wonder what software is used, cause it's definitely not theirs.
  • Export to Flash seems to have improved, more features are now supported than in Keynote '06.
What do I miss in Keynote '08?
  • Reflections on any objects, not just on images. Why not also allow it on text and on groups of objects?
  • Proper scaling, so that two adjecent objects, that have no space in between do not suddenly show a line when the presentation is shown at a higher than standard resolution.
  • More image formats to export to. Preview already supports a lot more, so why restrict Keynote to just TIFF, JPEG and PNG?
  • Export sheet transitions to Flash, this was not supported in Keynote '06 either.
  • Bugfix for polygons in Flash export. Some free form objects (polygons) look distorted when exported to Flash. This is a long-outstanding bug.
  • Rich Web 2.0 export, like the new iPhoto supports with the web gallery feature. The Flash export feature is nice, but looks ancient compared to the new iPhoto '08 possibilities. For example, it doesn't scale at all; and the same applies to the HTML-export.
  • Bugfix for color distortion in PDF export. When you have a simple transparent PNG in your Keynote presentation, you may find that when you export to PDF, the colors have changed quite a bit. This was a problem in Keynote '06 already, and persists in Keynote '08.
My conclusion: Keynote '08 offers a relatively small number of features. But although there are just a few, these make Keynote even more powerful than it was, while keeping usability at an outstanding level.
Perhaps some bugs were squashed, but not the ones I reported. Close interaction with customers is definitely an area where Apple can (and should) make improvements.

Updated (August 13): Here's some more feedback:
  • good: the Office 2007 file formats are supported;
  • bad: the OpenDocument file formats are not supported;
  • bad: Keynote '08 seems quite a bit slower at saving big presentations than Keynote '06.
Updated (August 15): Some more:
  • good: zooming is faster than in iWork '06;
  • bad: reflections of overlapping images do not overlap, they blend;
  • bad: properties cannot be set on grouped objects, even if the properties apply to all contained objects;
  • bad: image clipping cannot be triggered with a key press (for rotation this is possible by using the Cmd-key on a corner handle);
  • bad: when setting a radius (e.g. for a shadow) by using the mouse-controlled widget, it typically skips the most logical settings (45, 90, 135, 180, etc. degrees);
  • very bad: when adjusting an image, the preview is not exactly the same as the end result - this is a regression since iWork '06.

Monday, August 6, 2007

Eclipse on Mac OS X

Because I wanted to apply some automated refactoring, I decided to give Eclipse a chance, after sticking with Vim for years. I tried other tools, but always fell back to Vim, because it just works very good for me.

Here's some of the things I found:
  • Creating a new project from an existing Ant build file works flawlessly.
  • The look-and-feel is not exactly Mac-like, but the integrated window with panels inside are a lot more screenspace-efficient than the floating windows that typical Mac applications (e.g. Keynote) offer.
  • Customizing Java code style preferences is intuitive and powerful.
  • Keyboard shortcuts are properly converted to Ma-style (e.g. Shift-Cmd-L).
  • The Save As command is not bound to the standard keybaord shortcut Shift-Cmd-S. Instead, this keyboard combo saves all files.
  • Refactoring tools work very well.
  • By default, the Javadoc for the JDK is not found, so hovering over a JavaSE class, such as java.lang.Object, does not show a description, but rather an error message. I would expect this to be standard functionality, perhaps offered as an option during installation or at least as a warning (e.g. "Unable to find Javadoc for JDK").
  • There does not seem to be a way to indent variable declarations like this:
int       groupCount = groups.length;
int itemGroupSpacing = _config.getItemGroupSpacing();
  • Code completion is more advanced than in Vim; the alternative for Ctrl-P in Vim seems to be Ctrl-Period in Eclipse, but Eclipse also offers Ctrl-Space.
  • Cmd-P shows a Page Setup dialog, instead of a standard Print dialog.
  • The About dialog is referenced both from the program menu and from the Help menu.
  • Triple-click (with the left mouse button) does not select the whole line. This is a typical mouse shortcut with editors.
I tested Eclipse 3.2.1. The current version may be (even) better.

Friday, July 20, 2007

HP Business Inkjet 2800dtn does not work with Mac!

After struggling for months to get the HP Business Inkjet 2800dtn working properly with Mac OS X 10.4, I contacted HP support. I told them the printer is extremely slow and fails to properly print moderately complex images.

Result: They told me they know the 2800 does not work well with Mac OS X. Switch to Windows or get your money back. I'm baffled. I explicitly checked for Mac-compatibility when I bought the printer.

However, the HP website still states that the printer is supported. Isn't this sort of thing illegal?

Thursday, July 19, 2007

Test your FreeBSD kernel

If you have modified your kernel configuration, or if you have written a new one, you will want to test it before making it the default kernel for booting. Especially if you don't have physical access to the console.

This is how you accomplish this:
cd /usr/src
sudo make buildkernel KERNCONF=MYKERNEL
sudo make installkernel KERNCONF=MYKERNEL KODIR=/boot/testkernel
sudo nextboot -k testkernel
For more information, check out:
If it works, make the testkernel the default, and make the previous kernel the backup:
cd /boot
sudo rm -rf kernel.old
sudo mv kernel kernel.old
sudo mv testkernel kernel

Don't put your monitor on your Mac Mini

For those of you that:
  • have a Mac Mini
  • use a wireless internet connection
  • experience slow network speed
  • have your monitor on top of your Mac Mini
Try putting the Mac Mini aside, not below your monitor. For me, it greatly improved my network speed.

CSV reading from Java

If you need to process CSV files, for example as a result of an export from Excel or Calc, then try CsvReader, an LGPL Java-library. It works remarkably simple:
CsvReader reader = new CsvReader("input.csv");

// Read all headers (the first line)

// Read all remaining lines
while (reader.readRecord()) {
String productID = reader.get("ProductID");
// etc.

I'm using CsvReader 2.0, released in December 2006.

Monday, July 16, 2007

Hint: FreeBSD directory layout

Tip for FreeBSD users: If you want to know your way around on a FreeBSD system, study the hier(7) man page. It explains what the standard directories are on a FreeBSD system, and how they are typically used.

Disabling functionality prior to security fix

Normally, a security issue is known days if not weeks before a fix is available. In the meantime, systems are left vulnerable.

A solution for this could be to allow the security provider (typically the provider of the original software) to disable or reconfigure certain functionality in the target software.

Of course, this would require the software (such as an OS or application) to be configurable in such a manner, but a lot of applications these days already have thousands of configuration settings. Try about:config in Firefox, for instance.

Some system administrators might even choose to have such work-arounds applied automatically.

An example:
A security issue is found in Apple Quicktime, in combination with Firefox. Before doing anything else, Apple or Mozilla release a work-around patchset for Firefox that just disables the Quicktime plugin in Firefox.

Tuesday, July 10, 2007

CSS: Combining text replacement with mouse hover underlining [updated]

In website-design, the CSS text-replacement technique is well-known (see for example the article on the subject at Stopdesign).

What I have not seen elsewhere, though, is a technique to make sure the text is not only replaced, but also shows an underline when the mouse is hovered over it, for a typical hyperlink-effect.

Consider the situation where you want to show a header in a special font (which visitor probably won't have). and you want this header to be clickable. You want the header text to become underlined when hovered over with the mouse, to clearly indicate this is a hyperlink.

The solution is very simple:
  1. make sure your replacement images are placed on a background that has a plain color;
  2. paint the background in your images with the same background color;
  3. in the image, make all pixels transparent that should show up as the underline;
  4. in the CSS, set the background of the images to match the background color;
  5. in the CSS, add a :hover rule that changes the background color for the images to match the text color (instead of the background color).
For a working example, check out this site:
Update (July 23, 2007): Note that in order for this hack to work with PNG images under MSIE 6, you will need to save the backgroud color in the image and use an indexed PNG.

Thursday, June 21, 2007

Even Microsoft prefers Apple hardware?

When you look at advertisements in newspapers, magazines and on TV, you may get the impression everybody's using Macs. This is old news.

However, it seems even Microsoft is now showing Apple hardware on their site (more specifically, on their Dutch Office Online start page). Have a look at the laptop in the picture: clearly an Apple.

Mac OS X 10.4.10 update problems

After installing the Mac OS X 10.4.10 update on the brand-new 20-inch iMac, it didn't come up after reboot anymore. All I saw was the Apple logo and this spinning wheel.

Thanks to the support guys from the Apple shop called 'The Innovators' (Tilburg, Netherlands) the problem was quickly fixed as follows:
  1. If you don't have one, then buy a FireWire 400 connecting cable, so with the same connector on both ends.
  2. Connect 2 Macs using the cable.
  3. Restart the faulty one and hold T while it boots. You should then get the FireWire logo on the screen. The harddisk of the faulty machine is now mounted on the other one.
  4. Download the combined Mac OS X update.
  5. Run the update package from the good machine.
  6. When asked for a destination, select the other machine, connected via FireWire.
That's it :-)

Wednesday, June 20, 2007

Remote VNC via SSH tunnel

Quick tip: To use VNC through an SSH tunnel, make SSH bind to a local port while connecting it to a remote port. Then just connect your VNC master application to the local port.

Setting up an SSH tunnel goes as follows:
ssh -N -Llocalport:remoteip:remoteport intermediate_machine
For example, if you have a remote machine at behind a server you can connect to with SSH, do:
ssh -N -L5900:
Press Ctrl-C to kill the tunnel.

Tuesday, June 19, 2007

Improve DNS lookups on your Mac

Here's a quick tip for Mac OS X users that want to speed up their DNS lookups. If you don't get annoying 'Looking up server' messages frequently, you're safe to skip this one:
Warning: This is only for power users (those that know what UNIX and Terminal are about).

Firefox find-on-page highlighting like Safari 3

Although I'm not too enthusiastic about the new Apple Safari 3 beta, one simple feature I do appreciate a lot is the way it highlights find-on-page results. It really makes day-to-day browsing more productive.

I wonder if there is any Firefox 2.0 plugin that can do something similar. So far I haven't been able to find anything.

GrApple and Hyperwords

Some more hints for Mac OS X users:
  • Use the GrApple Eos Pro theme in Firefox to make Firefox look like a decent OS X citizen.
  • And install Hyperwords for nifty inline hyper-referencing of (groups of) words; see the demo.
GrApple looks fantastic. The only thing I noticed is that the Tag button (part of the extension) looks quite vague. That's probably because the icons are now a log smaller than they used to be. Otherwise it looks great.

Some more Mac apps for regular users

Here's a list of a few more of my favourite Mac OS X apps for regular users (not developers or artists and such):
  • QuickSilver (Ctrl-Space), a kind over über-Spotlight - for quickly starting programs and much much more...
  • Growl, for more notifications than you can possibly think of; mainly for incoming e-mail.
  • Tomato Torrent, just in case you happen to need to download via Bittorrent.
  • StuffIt Expander 11, for accessing different kinds of archives (e.g. .zip, .sit, etc.)

Configuring a new iMac 20-inch [updated]

For a customer I bought an iMac 20-inch (2.16 GHz C2D, 2GB), which I'm now configuring. On top of Mac OS X 10.4.9, iLife and iWork '06 I'm customizing the machine as follows, to suit his needs:
Some challenges I'm still facing:
  • Which version of Office 2007 should I choose? I expect only Word or Excel is occasionally needed.
  • How do I convert all current faxes from WinFax Pro 9 to the Mac?
  • How can I use VNC through the DSL modem and firewall? -- Update: this is fairly easy with an SSH tunnel.
  • (How well) does VueScan integrate with PageSender? Or how well can I make them integrate using Automator?

Tuesday, June 12, 2007

Safari 3 beta

The Apple Safari 3 beta is out for both Windows and Mac OS X. From the Safari page there is a link to a Safari page for developers.
Funny detail is that the pages linked from there indicate they haven't been updated in ages:

Wednesday, May 16, 2007

How to print from NeoOffice at more than 300dpi

One of the limitations in NeoOffice 2.0 and 2.1 is that the maximum resolution when printing 300dpi. This is especially an issue when printing images with tiny details, such as screenshots. Photos are normally just fine at 300dpi.

However, there is an easy way around that:
  1. export to PDF;
  2. open in Adobe Reader and print from there.
That's it, now you can have higher quality output.

Tuesday, May 15, 2007

Undo recent Subversion commits (updated)

Here's a quick HOWTO for undoing recent Subversion commits. Do:
svn merge -r NEW:OLD PATH
  • NEW is the new (bad) revision;
  • OLD is the old (good) revision;
  • PATH is the file or directory to revert.

For example:

svn merge -r 1680:1667 src/


  • Don't forget to commit afterwards.
  • Instead of a revision number, you can also use the literal string HEAD for the most recent revision.
  • You can only pass one path at a time, but this can be a directory name instead of just a file name. To process multiple paths in a row on a UNIX/Linux/Mac system, use:
    for f in path1 path2 path3; do svn merge -r NEW:OLD $f; done
Updated (Nov. 27, 2008): Added some hints.

Thursday, May 10, 2007

Mighty Mouse scrolling woes

The Apple Mighty Mouse looks quite good, IMHO, but after only a few months the scroll wheel starts behaving oddly. I have both a wired and a wireless (Bluetooth) version and both have stopped scrolling downwards.

This appears to be a widely known problem with these mice. However, the main hurdle is that they cannot be cleaned internally like older mice could be, in the past.

Just a warning for those who consider buying it: make sure there's no dirt coming anywhere near your scroll button; poking your nose is a recipe for quick disaster :-)

Tuesday, May 8, 2007

SVK version control system (updated)

Update (August 27, 2009): It's probably better to use git-svn (instead of SVK), a conduit between local git repositories and a regular remote Subversion repository.

The original blog post follows below.
A few months ago I switched from CVS to Subversion. All seemed OK, until I tried to add Apple iWork documents (Keynote and Pages) in the repository. These 'documents' are in fact complete directories. That's fine so far, but then when any of these programs saves the document, they purge unknown subdirectories, including those that happen to be called .svn.

So I went looking for a Subversion-oriented solution to work around this issue. What I found instead was not a work-around, but a product that does not expose the weakness Subversion has. It's called SVK. While based on Subversion, it offers various improvements over the latter:
  • local commits - commit to the remote repository later, keeping all log messages; allows you to work offline for a while and sync when you're online;
  • faster operations - the 'status' and 'log' commands are claimed to be much faster;
  • no metadata in subdirectories - this information is stored elsewhere in the file system;
  • smarter merge - making branches less painful;
  • log filtering - find that commit you're looking for;
  • combine import and checkout - it's possible to import a directory and convert it to a working copy at the same time, boosting productivity;
Seems there are some reasons to at least consider it for larger projects.

For more information, see the Wikipedia article on SVK.

Tuesday, April 10, 2007

NeoOffice 2.1

I've covered NeoOffice 2.0 before. Recently I switched to 2.1 on one of my machines. Due to some issues with 2.1, I decided to stick with 2.0 for a while.

Overall, NeoOffice 2.1 looks and feels more professional than 2.0. However, the integration with the Mac OS X operating system still leaves a lot of room for improvement, IMHO.

Here is a list of candidates for improvement (some of which were previously reported on 2.0 as well):
  • overall the look-'n-feel is not very Mac OS X-like, although this has improved since 2.0, e.g. default buttons are not completely blue and the toolbars look different from standard applications;
  • after confirming the Print dialog (Cmd-P) another dialog is shown, asking for advanced settings; these advanced settings should be integrated in the standard print dialog;
  • there is a Printer Settings dialog, but it doesn't do anything;
  • when a file is modified, the red close icon in the window title bar does not change to include a dot;
  • when using Exposé, the dialog windows are considered windows in their own right;
  • the list of recent documents is not in the NeoOffice program menu, but in the File menu; so it's impossible to open a recently opened file without having any other file open;
  • it doesn't use standard dialogs, such as the Font dialog;
  • it does not use the standard dictionary and hyphenation support offered by Mac OS X;
  • Cmd-RightArrow goes to the next word instead of the end of the line; Alt-RightArrow does not go to the next word - same for combinations with LeftArrow;
  • Save As is not under Shift-Cmd-S, as in other applications;
  • the File menu does not indicate that Close has the keyboard shortcut Cmd-W;
  • there is no Alt-Shift-Cmd-V keyboard shortcut to paste and adjust the style, like in other applications;
  • sometimes, when selecting text with the keyboard and scrolling, the display looks distorted (I've seen this on all earlier versions, on all platforms);
  • when changing the style on some existing text, the style setting Keep with next paragraph does not immediately take effect; work-around is to modify the style and press OK immediately;
  • sometimes pressing Shift-Enter inserts 2 newline-characters instead of one, this seems new since NeoOffice 2.1.

Wednesday, March 28, 2007

A3 printing problem in Acrobat 8.0 Pro

Just filed a bug report for Adobe Acrobat 8.0 Professional on the Mac:

Steps to reproduce bug:
  1. Open A3-size PDF document in Acrobat 8.0 Pro on Mac OS X 10.4.9 (Intel):
  2. Cmd-D (Document properties) to confirm the setting 'paper source at page size' is enabled (OK).
  3. Have an A3 printer connected. In my case an HP Business Inkjet 2800dtn, connected via Ethernet (TCP/IP).
  4. Cmd-P for print dialog.
  5. Select 'none' for scaling.
  6. Confirm document size, displayed under the small preview is OK (indeed: 296.7 x 419.5 mm)
  7. Select tray that contains A3 paper.
  8. Confirm the paper size is correct (it is not, it says: 209.9 x 297.0 mm)
Expected results:
  • Paper size set to A3.
Updated (April 10): The trick is to set the page size in the print settings dialog (Shift-Cmd-P) to A3 explicitly, every time you start Acrobat.

Open-source iWork

The Mac OS X application suite iWork consists of two programs: Pages and Keynote.

Pages is a simple word processing application that has good looks and is easy to work with, but comes nowhere near Writer or Microsoft Word in terms of features.

Keynote is great presentation software. In my opinion it beats both Impress and Microsoft Powerpoint, hands tied to the back. The shows you can create with it are really impressive and in fact make a good showcase for Mac OS X's graphics capabilities.

However, Pages has quite a few bugs and lacks important features needed for writing larger documents (e.g. cross-references). There are improvements planned for iWork '07, but I doubt it will bring Pages to the feature level I would require for day-to-day text processing.

Both products have limited export features, with various bugs, and lacking OpenDocument support, for example.

Considering the low price of iWork, it seems the application suite is more a showcase for Mac OS X features than a real competitor to Microsoft Office and

However, this may change, if Apple decides to open-source iWork. This may boost the development of iWork, allowing the community to fix bugs and add new features. Like MySQL, Apple could decide to ask money for support. Or they could even choose a license that is free for personal use and non-profit organisations but costs money for commercial organisations. There's all sorts of options.

Apple has experience with the open-source community, since they adapted Konqueror to become WebKit, the engine for their Safari browser. But then again, perhaps this is the reason they won't consider it...

Monday, March 26, 2007

HP Business Inket 2800dtn woes (updated)

I purchased an HP Business Inkjet 2800dtn, expecting to receive a high-quality, Mac-compatible colour printer. Although the printer looks good from the outside, I have quite some issues with it:
  • can't get any A3 prints out using Adobe Acrobat 8.0 Professional; all output is clipped at A4-size;
  • when I select which tray to use in any Mac OS-standard print dialog, all output is mirrored and flipped upside-down (?!);
  • when printing A4 using Acrobat 8, there are margins of about 3 mm on both the left and the right side;
  • all output from NeoOffice (2.0 Aqua Beta 3 Patch 15) is printed in light-gray.
I tried using different drivers, but there only seems to be the Foomatic driver, which is included in Mac OS X 10.4, it's on the HP installation CD and it's the current printer driver according to The HPIJS printer driver doesn't work at all.

Update (April 10, 2007): The trick is to use the network interface only, not the USB interface. Then the Foomatic PostScript drivers work like a charm.

Update (July 2, 2007): The issue with Acrobat was my fault. I did not realize I have to set the paper size manually each time I start Acrobat, using Shift-Cmd-P.

Friday, March 23, 2007

Firebug is great!

Any webdeveloper trying to debug CSS, JavaScript or AJAX should use a good tool like Firebug, a Firefox extension. It works for sure under Firefox 2.0.

One screencast says more than a thousand words:

Tuesday, March 20, 2007

Log colorizing

Do you ever look at log files? A lot? Then, like me, your brains could use a little help to easen the interpretation of all the letters and digits that are scrolling by. This is where a log colorizer helps.

I was looking for a log colorizer tool, but found it hard to find one using Google, until I found this article: Log colorizing on a Dreamhost account. Although it's written for Dreamhost (a US service provider), the article seemed sufficiently generic for use on other *NIX systems (like my Apple).

Note: the PCRE version mentioned in the article is outdated. Just go the the tools' website to check out which version is now the current stable release.

Summarized: All you need is 2 akwardly named tools:
  • PCRE - 'Perl Compatible Regular Expressions'
  • CCZE - a C port of RASZi's colorize.
I thought I might be lucky and tried DarwinPorts to see if that would support CCZE, but it doesn't:
~$ sudo port install ccze
Error: Port ccze not found

For me, PCRE installed like a breeze. But CCZE failed to build:
make -C src all
cc -c -I. -I. -I.. -DPATCHLEVEL=\"1\" -DSYSCONFDIR=\"/Users/ernst/usr//etc\" -D_GNU_SOURCE=1 -DPKGLIBDIR=\"/Users/ernst/usr//lib/ccze\" -DHAVE_SYSTEM_H=1 -DBUILTIN=1 -Wshadow -Wpointer-arith -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wbad-function-cast -Wsign-compare -Wchar-subscripts -Wcomment -Wformat -Wformat-nonliteral -Wformat-security -Wimplicit -Wmain -Wmissing-braces -Wparentheses -Wreturn-type -Wswitch -Wmulticharacter -Wmissing-noreturn -Wmissing-declarations -g -O2 -I/Users/ernst/usr//include ccze.c
cc1: error: unrecognized command line option "-Wmulticharacter"
make[1]: *** [ccze.o] Error 1
make: *** [all-recursive] Error 2

Here's my CC version:
$ cc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

When I resolved the issue by removing the flag from src/Makefile, I got another error:
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
collect2: ld returned 1 exit status
make[1]: *** [] Error 1
make: *** [all-recursive] Error 2

At that point, I gave up on CCZE.

Switching to Tomcat 6.0

For my current project, we extensively use XINS, a light framework for building web services. It comes with all sorts of handy features, including an internal servlet container. However, this internal server is far from being production-quality, so I've come across all sorts of smallish issues. Even the XINS developer, Anthony Goubard, is considering replacing this servlet container in XINS with something like Jetty.

So I've decided to switch to Apache Tomcat, probably the most-used open source servlet container. Apparently the 6.0 branch is considered stable, so I downloaded and installed the 6.0.10 release.

Some issues I encountered with this switch were:
  • it's not obvious how to run Tomcat in the foreground, so I may press Ctrl-C to shut it down;
  • my XSLT parsing suddenly went bananas, with XSLTC complaining about not being able to compile my stylesheet, without indicating the source location - this probably has to do with Saxon (the one I used before) no longer being found or so;
  • when I explicitly specified that Saxon should be used for XSLT processing, a TransformerFactory failed to be instantiated with a NullPointerException;
  • the Tomcat 6 configuration docs are incomplete and slightly confusing.

Friday, March 16, 2007

Mac OS X 10.4.9 update

A few days ago my MacBook Pro asked me whether I'd like to update Mac OS X from 10.4.8 to version 10.4.9. I said 'yes', hoping to see some noticable improvements in speed or stability. However, instead my system seems to have become slightly less stable, actually requiring a reboot today. Several programs crashed.

One other thing I noted is that the quick-shutdown key-combo (Ctrl-Alt-Cmd-Eject) does not work anymore. That is, until I read on a Dutch forum that you need to keep the Eject down for a bit longer. Then it does work.

Perhaps the stability degradation is a clever way to force people into buying Leopard :-)

Wednesday, March 14, 2007

Using NeoOffice

NeoOffice is a free port of for the Mac. I've now been working with it for a few months. The program automatically checks for updates, which most programs seem to do by now. My current version is 2.0 Aqua Beta 3 Patch 15. Don't ask me what that means, exactly. But it's fairly stable.

An alternative to using NeoOffice is using directly on the Mac. This works fairly well, but requires X11 and does not provide an integrated solution. See the for Mac porting project.

Although NeoOffice works pretty stable overall, it's not really integrated in Mac OS X. Menus are inconsistent with other Mac applications, as well as dialogs, keyboard shortcuts, etc. Some examples:
  • after confirming the print dialog (Cmd-P) another dialog is shown, asking for advanced settings;
  • there is a 'Printer Settings' dialog, but it doesn't do anything;
  • default buttons don't have the blue color they have in other applications;
  • buttons are smaller than in other apps;
  • when a file is modified, the red close icon in the window title bar does not change to include a dot;
  • when using Exposé, the dialogs are considered windows in their own right;
  • the list of recent documents is not in the NeoOffice program menu, but in the File menu; so it's impossible to open a recently opened file without having any other file open;
  • it doesn't use standard dialogs, such as the Font dialog;
  • it does not use the standard dictionary and hyphenation support offered by Mac OS X;
  • Cmd-RightArrow goes to the next word instead of the end of the line;
  • etc.
So although the product works quite well, it's far from being a well-integrated Mac OS X application like any of the OmniGroup apps. Perhaps they should consider creating such a beast, although the business model for it may be hard to produce.

At they themselves are also working on an Aqua-port of their product. There was an announcement early February 2007 labeled Mac Porting team announces the top ten items to be fixed before alpha Aqua release. Interesting to know there are apparently some people working on it, but there's not much information available on planning.