Tue, Feb 24, 2009

New Java Blog

There haven't been too many updates in this blog during the last few months...

I've started a new Java blog recently, JavaBarista (in German), which is easier to maintain (and swifter to write for me). I'll mostly talk about Java EE frontend and backend technologies.

Thank you for reading this blog (I'll see if I can keep it alive) - and enjoy the new one :-)

Posted by Thomas Much at 14:57
Categories: Java

Tue, May 06, 2008

iCab 4.1.1

Last weekend Alexander released a new public version of iCab. There are quite a few bug fixes, changes and enhancements since the last public version (4.0.1).

I have been asked why these release notes don't appear on icab.de, where they belong. Honestly, I don't know. It's Alexander's decision. But as long as the release history isn't available anywhere else, I'll post it here so Google (and other web crawlers) can search it.

So, here's a copy of Alexander's readme file (which you'll find in the iCab download archives as well):

New Features:
  • New feature implemented: "Tab Overview". The "Tab Overview" can be activated from within the "Window" menu or by clicking the new icon at the right side of the Tabs Toolbar in the browser window. The "Tab Overview" requires at least MacOSX 10.4.x. The "Tab Overview" is something like Exposé for Tabs. When activated, all Tabs will be shown as small thumbnail images ontop of a dark transparent fullscreen window (like Dashboard). You can easily identify the Tabs, activate another Tab and also delete Tabs. This can be done either using the mouse but also using the keyboard: Tab/Shift-Tab and the arrow keys can be used to select a new Tab, the "Return", "Enter" or "Space" keys can be used to activate the selected Tab, the "Backspace" or "Delete" keys will close the selected tab and the "ESC" key will close the "Tab Overview" itself.
  • iCab recognizes geo-tagged web pages. The status bar now has an additional icon which indicates if the currently displayed web page is geo-tagged via META tag. Clicking the icon will then open a popup menu where the location is displayed in plain text (if provided by the web page) and when selecting the menu item in the popup menu the location is shown in google maps (At the moment the popup menu of this GeoTag icon will only have one menu item. Later it may have additional menu items for geo-tagged images or other geo-tagged media that is found in the web page).
  • In the Filter Manager there's a new text field in the "Page Layout" panel where CSS code can be entered that will be applied to the web pages which are addressed by the filter. The new advertising filter which you can find in the iCab archive uses this new field to filter out the ad banners of the mactechnews.com web site. So you should replace the old advertising filter by the new one if you're using this filter.
  • New setting added in the "Special websites" section of the "Forms Manager". It's now possible to change the form checks to be less strict. This way filling out forms can be made as comfortable as in other browsers (but also as insecure as in other browsers).
  • Using MacOSX 10.5.x the contexual menu of the browser will now also include meu items to search the text selection in the "Dictionary" and in "Spotlight".
  • In the URL completion preferences it is now possible to configure which URL schemes iCab should use for the URL completion feature and which schemes it should ignore.
  • The contextual menu in the browser window can now be also opened by holding down the left mouse button for a while, if this feature is enabled in the Preferences dialog in the "General > Contextual Menu" panel. The standard way to open the contextual menu (Right-Click or Control-Click) does always work.
  • It's now possible to enter Cmd-Return, Cmd-Shift-Return, Cmd-Alt-Return and Cmd-Alt-Shift-Return in the URL field and Search field of the browser toolbar to open the URL or search result in a new window or Tab in the background or foreground.
  • Syntax hilighting for the source code window implemented
  • Colors and bold face text in the error report window help to find the important keywords.
  • The HTML attributes "cite" and "longdesc" are now also listed in the "Link Manager" window.
  • Double-clicking in the background of the Tabs toolbar will now also create a new Tab.
  • When searching in the History window iCab will now also search in closed folders, opening them automatically when needed.
  • When loading files from a local disk ("file:" URLs) iCab will now show a "proxy" icon in the titlebar of the window. Control-Clicking or Cmd-Clicking the proxy icon will display a popup menu where you can access all the parent folders of the local file, so it's very easy to locate the file in the Finder..
  • Added a new option in the Tabs settings to swap the keyboard shortcuts for new windows and new Tabs. Before this shortcut swap was bound to the option "Open Tabs instead of Windows". Now these are individual settings. This way you can get the same shortcuts as in Safari (which doesn't have the option "Open Tabs instead of Windows").
  • In the Network settings you can now configure if iCab should process FTP links itself or if the external FTP application that is configured in the system as default FTP application is called instead to precess the FTP link.
  • When loading Session files iCab will now (optionally) ask if it is OK to overwrite the current session with the one from the file or if the current session should be saved before the file will be loaded. This confirmation can be anabled/disabled in the "General" preferences in the "Other" tab.
  • Javascript code is now able to use databases (via "window.openDatabase()")
  • When saving a web page, iCab will now also offer to save it as PDF file. So it is no longer necessary to use the "print" command to save it as PDF file. Using the "save" command is much more intuitive.
  • The "YouTube Video Download" filter from the folder "Filter Manager Examples" is improved now. It will now offer to download the video as Flash movie or as MP4 movie (though the MP4 format is not yet avaiable for all videos). So when you're already using the Youtube download filter you should import the new filter again to replace the old one.
  • The new keyboard shortcut Control-Alt-T can be used to switch on the Tabs Toolbar when it is hidden (for example because the window only contains one single document and iCab is configured to hide the Tabs toolbar in this case). The shortcut can be useful if the user wants to drag the document of this window as Tab into another window to combine the two windows into a single one.
  • iCab now supports the ".url" files of Internet Explorer (Windows or Mac version). These files are the windows counterpart of the "webloc" files on the Mac.
  • French translation added (Thanks to Pierre Rudloff)
  • Help is now available in English as well.
  • When explicitly opening a link in a window by the user the "Referrer" information gets no longer lost.
  • The "Save" button in the PDF view (a PDF document is opened without any PDF plugin) does work now in iCab as well.
  • When changing the titles of bookmarks in the Favorites folder of the Bookmarks window, iCab didn't update the Favorites toolbars immediately.
  • JavaScript bookmarkslets can now open windows even when the JavaScript setting "open windows without user interaction" is unchecked.
  • Bugfix for the shareware reminder dialog box which could cause a crash in very rare circumstances under MacOSX 10.4.x.
  • The error report feature didn't always select the right location in the sourcecode when showing the error location. This happened only when the source code contained some Unicode characters from a "higher" Unicode code page.
  • If the Force-Quit-Command was disabled in the Kiosk preferences, which also disables Exposé and Dashboard, Exposé and Dashboard were not enabled again when the Kioks mode was left.
  • Small adaption to the new WebKit release (Safari 3.1) where the click with the third mouse button (middle button) didn't work anymore. Now iCab hooks itself into internal WebKit structures to get such clicks again.
  • When the user edits the URL of a finished download to repeat the same download with a different URL, some internal Download settings did not refect the new URL immediately.
  • If the option "Stack windows" is enabled in the Window preferences, iCab will no longer remeber the sizes of all the open browser windows. This is only done when this setting is switched off.
  • When quitting iCab while downloads are still running, iCab now asks the user if iCab should really abort the downloads and quit.
  • Asking for the number of windows in AppleScript did also take the closed and invisible windows into account. This doesn't happen anymore.
  • The "Search" window will now always on the active "Screen" when "Spaces" of Leopard is active.
  • Bugfix for the Error report. iCab could crash if an extrenal CSS file was completely empty.
  • When imported bookmarks files did use an invalid text encoding, bookmark titles with non-ASCII characters could be imported with an empty title instead. Now iCab will try out different encodings and if none will result in valid text, iCab will just remove the invalid characters and keep the rest.
Posted by Thomas Much at 19:50
Categories: Browsers, iCab & InScript

Fri, May 02, 2008

finally { apple.releases( java6ForMacOSX ); }

Only one and a half years after Sun released Java SE 6 for Windows, Linux and Solaris, Apple released the Mac OS X version (called Java for Mac OS X 10.5 Update 1) this Tuesday. Phew. Thanks to the engineers for their effort to get this release out finally, no thanks at all to Apple's management for delaying the release. Anyway, you'll find the release notes here.

And regarding this blog post's title: There is no catch? Unfortunately, there is... There are some exceptions (and you shouldn't throw exceptions within the finally block, right?).
First, Apple's Java 6 implementation requires Mac OS X 10.5.2 or newer, but this was to be expected. Second (and more important), the release is for 64-bit Intel Macs only (i.e. Core2Duo or newer). No Java 6 for PPC Macs or even 32-bit Intel Macs (CoreDuo). Bummer.

If you've installed a developer preview version of Java SE 6, the Java update probably won't show up in your Software Updates. Deleting the preview installation should fix this:

  sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.6
  sudo rm -R /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0

If you want to change the system's default Java version, do not mess with certain symlinks in the system's directories but use /Applications/Utilities/Java/Java Preferences instead (you have been warned).

And if your Mac or your operating system does not meet the requirements, there's always the possibility to use the Open Source Java 6 implementation called "SoyLatte".

Posted by Thomas Much at 19:51
Edited on: Sun, May 04, 2008 11:04
Categories: Apple & Mac OS X, Java

Sat, Mar 08, 2008

Java on the iPhone

With Apple showing no interest in keeping Mac OS X 10.5 up to date with current Java versions (they are 14 months behind the final release of Java SE 6 for other systems now, despite some beta versions for certain Mac OS X versions and Intel chip sets) or in providing Java on the iPhone at all, it seems it's up to Sun or the Open Source community now.

And it actually seems Apple has become irrelevant for the future of Java on Mac OS X systems (including the iPhone) by now! While a port of Java SE 6 for Mac OS X 10.4 and 10.5, called SoyLatte, has been around for some time now, Sun announced yesterday that they intend to put Java on the iPhone!

They'll start with Java ME (a reasonable decision for a mobile phone platform), though it won't be released before middle of this year. Java SE and JavaFX might be following later on.

So, let's wish them good luck and let's hope Apple won't put too many obstacles in their way...

Posted by Thomas Much at 21:49
Categories: Apple & Mac OS X, Java

iCab 4.0.1

Three weeks ago a new public version of the now WebKit-based browser iCab has been released. Here's an excerpt from the version history included with the iCab archive:

New Features:
  • Added localized resources for Danish, Norwegian, Russian, Chinese, Japanese, Spanish (thanks to Mogens Thyregod, Leif Halvard Silli, Michael Krekin, Hans Yu, i_zac, Manuel Montero Barro)
  • When saving a web page it's now also possible to save it as plain text.
  • Under MacOSX 10.5 the contextual menu will now include special menu items for PDF files when PDF files are displayed.
  • In MacOSX 10.4.11 and later the TEXTAREA fields in web pages can now be resized
  • In MacOSX 10.4.11 and later iCab will now enable the Web-Inspector of the MacOS. The Web-Inspector can be opened by choosing the menu item "Element Information" from within the contextual menu.
  • Added support for the JavaScript call "print()"
  • It's now possible to use small icons in the browser toolbar.
  • New option in the "Page Layout" preferences to enable support for language-specific quote characters
  • It' now possible to drag URLs into the Tabs toolbar to open it as Tab.
  • iCab can be configured in the bookmarks preferences to add a menu item "Open as tabs" in each submenu of the bookmarks menu to open all the menu items of such a submenu menu as Tabs.
  • In the search engine settings you can now also set the text encoding that should be used for the search engine.
  • Help files in German are available (English ones will follow)
  • The size of the searchbox in the browser toolbar was not processed correctly
  • iCab now rechecks if all the plugins that were available before are still available when it is launched.
  • Fixed a bug in AppleScript support which prevented that URL-Manager can get the history of the active Tab
  • Fixed a bug which could prevent that certain old WebArchives from iCab 2/3 could be loaded.
  • Fixed several bugs in Kiosk mode
  • Page Overview and the Links overview didn't work for XHTML documents.
  • Fixed a bug so that JavaScript Bookmarklets will be accepted even when they contain characters that are not allowed in URLs.
  • Fixed some bugs in Download Manager which affected the download of whole web sites.
  • When printing iCab didn't repect the landscape mode setting.
  • Fixed a problem when importing Omniweb Bookmarks.
  • Fixed several bugs in the error report which reported a few false error messages.
  • Added a workaround for a bug in MacOSX which can cause that all Cookies are deleted. This MacOS bug also affects other browsers like Safari. In iCab this is now fixed when the private Cookies storage of iCab is used (which is the default).
  • Fixes some minor issues in MacOSX 10.3.9 where some MacOSX 10.4.x/10.5. features that are used by iCab are not available.
Posted by Thomas Much at 21:27
Categories: Browsers, iCab & InScript

Thu, Jan 17, 2008

Parsing 2-Digit Years with Java's SimpleDateFormat

If you have to format and parse date strings like "17.01.2008" (in this case, the German date format) with Java, you'd probably use a java.text.SimpleDateFormat:

SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date now = new Date();
System.out.println( sdf.format(now) );  // something like "17.01.2008"
Date then = sdf.parse( "17.01.1908" );
System.out.println( sdf.format(then) );  // "17.01.1908"

This works as expected. But now some fancy user dares to input the year with only two digits:

SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date fancy = sdf.parse( "17.01.08" );
System.out.println( sdf.format(fancy) );  // "17.01.0008" - oops!

This is a feature that one easily fails to see in the API: If the year pattern is not "y" or "yy", year numbers are parsed literally and not relatively to some century. Using the short pattern works fine for parsing, but you'll need a second pattern for output:

SimpleDateFormat input  = new SimpleDateFormat("dd.MM.yy");
SimpleDateFormat output = new SimpleDateFormat("dd.MM.yyyy");
Date ok1 = input.parse( "17.01.08" );
Date ok2 = input.parse( "17.01.2008" );
System.out.println( output.format(ok1) );  // "17.01.2008"
System.out.println( output.format(ok2) );  // "17.01.2008"

You can read (and set) the century offset using the property 2DigitYearStart.

And while we're at it: If you want to prevent SimpleDateFormat from parsing an illegal date like "32.01.2008", you'll have to switch off the lenient mode:

SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yy");
sdf.setLenient( false );
Date illegal = sdf.parse( "32.01.1908" );  // ParseException
Posted by Thomas Much at 18:05
Categories: Java

Fri, Jan 04, 2008

iCab 4.0.0 and iCab 3.0.5 Public Releases

Happy New Year 2008 to you all!

In case you didn't notice: Alexander released two new public iCab versions on January 1.

iCab 4.0.0 is the very first public version of the now Cocoa and Webkit based complete rewrite of the cute little internet taxi. It requires Mac OS X 10.3.9 or later and is available as an Universal Binary version.

iCab 3.0.5 is a maintainance release of the older code base that still uses Carbon and its own rendering engine. For Max OS X it's available both as Universal Binary and PPC. For Classic Mac OS you can download a PPC release.

Posted by Thomas Much at 18:47
Categories: Browsers, iCab & InScript

Sun, Dec 09, 2007

iCab 4.0.0 Beta 14 (and 3.0.3 Beta 465)

On Tuesday, Alexander released two new iCab beta versions (available for registered users only). The first one is iCab 3.0.3 Beta 465 and it fixes a small security problem (security checks were too strict; https pages are now allowed to access http pages from the same domain).

The second one is the very first semi-public version of iCab 4.0 (Beta 14). Yes, believe your eyes, a complete rewrite of iCab is in the works! iCab 4.0 is a Cocoa application, and it uses Apple's/Safari's WebKit instead of iCab 3's own rendering engine and JavaScript implementation (i.e. InScript will be history soon).

iCab 4 requires Mac OS X 10.3.9 or later, although Mac OS X 10.4 or 10.5 is recommended. Here is what Alexander has to say about the new version:

iCab 4 is completely rewritten using the Cocoa API of MacOSX (iCab 3 is using the older Carbon API). The whole user interface of iCab can now fully use all the MacOSX features which are only available in Cocoa. So iCab 4 should look much better in MacOSX than before. Dialog boxes and windows are cleaned up, so some old settings which don't make much sense anymore are removed, some settings are modified and some new features are added.

Because of all the changes, iCab 4 doesn't read the old preferences from iCab 3 anymore and also the old filter manager configurations are no longer supported (the new filter manager has changed too much). But iCab will read the old Hotlist file, read and write WebArchives, read the old session files, so all the important data should be automatically imported from the old iCab 3.

More information about what has changed and what has been enhanced can be found in the archive's readme file.

Posted by Thomas Much at 18:29
Categories: iCab & InScript

Mon, Nov 19, 2007

Lots of Things To Do

While attending CETiK 2007 last weekend I met two guys from Cultured Code (you might know them for their gorgeous CSS editor/viewer Xyle scope).

They showed a preview of their upcoming To Do management software Things. Despite still in alpha stage (they promised to release a beta version soon) it's already fun to work with this small, yet powerful application.

Things is an easy to use manager of your personal and professional tasks. You can view them as a simple list for today's or upcoming tasks, organized by projects or areas of interest, tagged by whatever categories you like (even hierarchical ones). In fact, while you can use Things perfectly at home for your daily tasks, if you use all of its features it's more like an issue tracking software for small teams with collaboration via e-mail or Bonjour. And this is really cool. If you don't need the overkill of a big issue tracking software (which is the case for many smaller projects), Things might easily be offering exactly what you need.

As far as I can say after their short demo and my two days of testing, Things will become my preferred task management software. The software just works the way you'd expect it to (even if there are lots of tasks in lots of projects). Compared to simple HTML web pages and modern Web 2.0 web applications, I'd say Things is To Do Management 2.0. I wish the folks at Cultured Code good luck for finishing Things in time, and I'm eager to buy a license as soon as possible.

Tue, Nov 13, 2007


As posted before, there's no Java SE 6 runtime environment included in Mac OS X 10.5 (Leopard). There is a quite nice Java 5.0 implementation, however, and you can even tune its GUIs better than before for special Mac OS X integration - which is really cool! But this doesn't help you much if you have to develop applications using the latest Java APIs.

To request an important enhancement like this, there is an official way: File a bug report (I did so, my report got number #5575846). This won't help a lot, either, because bug reports requesting Java 6 will be marked as duplicate... and then Apple falls silent again :-(

So, to draw some attention to this problem, someone suggested that all bloggers should use a common marker as a "public request" to Apple, and here it is:


Now, the management at Apple can simply google for this string and see how many bloggers (let alone the non-blogging people) are waiting for Java 6 on Mac OS X 10.5 (or at least a statement about the future of Java on OS X).

In the meantime, someone else has ported the FreeBSD JDK 1.6 to Mac OS X (10.4 and 10.5). The port still has some problems and currently relies on X11, but this is a cool project for sure. Nonetheless, I'd still like Apple to officially release their port of Java SE 6 with proper GUI integration, as this would be the best statement about the Mac as a serious platform for Java development.

Posted by Thomas Much at 20:04
Categories: Apple & Mac OS X, Java