Tuesday, January 23, 2007

Yippie!

I just got a copy of my EJB3 book in my mailbox. It is again a great feeling to actually have the printed copy in the hands.
One can get sort of a feeling when one print it out on the laser printer, but having the real book is still different.

Amazon still shows it as unavailable, but this should change within the next few days. All those who preordered a copy will also soon get it.

I still need to add a few things to the accompanying web page, but I'll do this in the next few days.

Here is a picture with my copy:




Technorati:

Star imports

When pepole asked me why star imports are bad, I didn't really know what to answer. Usually I was talking about parsing time and so.
And actually IDEs like Eclipse or IntelliJ even offer to reorganize individual imports into star imports (I think IntelliJ does this as default).

Today I was doing a bigger refactoring and was moving packages around.
Eclipse is doing a really good job here.

Unfortunately I was getting compile errors afterwards, because the old packages did no longer exist.
The reason behind this is that a refactoring is a textual replacement and not a semantical. Example:

import foo.*;

public class Bar {
Foo f;
}

Now you move foo.Foo to baz.Foo. Eclipse adds the new import baz.Foo statement, but does not remove
foo.*, as is does basically not know that foo.* no longer exists (it could analyze all statements in the class and
automatically remove unused imports afterwards though).

Monday, January 15, 2007

EJB 3 book, talklets at Stuttgart Java User Group

My EJB 3 book will probably be in stores starting on 26th of this month.

Within the next month, the Java User Group Stuttgart will host two EJB 3 talklets

  • 25.1.06: Sun evening - presentations about Java SE 6 and EJB 3.0 from a Sun computers perspective.
  • 15.2.06: Broader look into EJB 3 - presentation about EJB 3, existing Appserver and some tips and tricks on using EJB 3

As usual, everyone is invited to join those sessions.


Technorati:

Tuesday, January 09, 2007

Using a printer on the mac from Windows

Recently I was struggling with printing from Win*. Samba was set up nicely, but Win users were not able to print. I tried lots of different things, but no success.
Googling around brought me to http://members.cox.net/18james/osx_printer_sharing.html#ipp
Especially the section about IPP near the bottom was very helpful. With it I was able to configure the Win machines within a few seconds.
As all newer Win* version support this, I'd say this is the recommended way to print from Win* on a printer attached to a Mac.

Tuesday, January 02, 2007

Samsonite suitcases can break

Do you remember when you first found out that your dad does not know everything or that Santa Claus does not exist?
I hat the same experience when returning from my trip to Philly and saw that two out of three Samsonite suitcases had cracks on the side as you can see here and here.

Unfortunately those suitcases can not be reparied as it seems that single parts are no longer available and the cost of the repair would be higher than that of new suitcases.

Tuesday, December 05, 2006

EJB 3 book in typesetting phase

It's nearly done .. last night I finished to work in the results of the spell checking.
Now the book is in the typesetting phase after which it will go to the printer.
Expect it to be in a store near you end of January / start of February.

*smile*

Thursday, November 23, 2006

Final cover of my EJB-3-book online

As I wrote before, the final draft of my book is at dpunkt.
They now also have the final cover design online. Unfortunately, Amazon is no yet this fast as you can see here

JBoss World Berlin

I had the luck to be in Berlin at JBossWorld for the last three days. This was a great event. I met many of my colleagues. The party at the eWerk was great and everyone enjoyed the event. The only downside was that I was not able to stay a little longer in Berlin for sightseeing purposes.
There is already some coverage of this event on the net, so I don't duplicate that, but merely link to it:

Friday, November 17, 2006

Parallel desktop for Mac, MacBook and special characters

Parallels Desktop for Mac is a great piece of software. You can run every other operating system for i386 architecture (yes includig vista).
On the MacBook, you usually have no external keyboard with a right alt key, so special characters such as
@, \, |, { , } , ... are on a MacBook with a German keyboard not usable on Rev 1970.
The following steps provided by Parallels support (extremly fast answer) allow you to map the
right enter key (of the emulated numeric keyboard) which sits between space and cursor-left to
AltGr like on ordinary pc keyboards.

  1. Stop any running VMs, close all instances of Parallels Desktop for Mac.
  2. Launch ?Macintosh HD? - ?Applications? ? ?Utilities? ? ?Terminal?.
  3. Type the following commands in Terminal, please mind that the system might ask you for the Administrator password after each command ? type it and hit Enter:
  4. sudo touch /Library/Parallels/.keyboard_config
  5. sudo chmod 666 /Library/Parallels/.keyboard_config
  6. sudo echo "numenterisaltgr" > /Library/Parallels/.keyboard_config
  7. Close the Terminal.
  8. Launch Parallels Desktop for Mac and check Right Enter key behavior in VM ? everything should work as you?ve set.

After this you might reach @ on AltGr+q (German PC keyboard) with AltGr being mapped on this additonal enter key.

A feature version of Parallels Desktop might include a Preferences option to select this behaviour directly in the application.
Thanks again to Parallels support for this fast solution.

Wednesday, November 15, 2006

Final draft of my ejb3 book at the publisher

I just sent the final draft of my book to the publisher.
Next steps are professional spell checking, type setting and printing. So I expect it to be in stores end on January 2007.
Stay tuned :)

Wednesday, September 20, 2006

A few helpful java links

Java SE 5 has introduced Annotations, amongst other @SuppressWarnings. This posting on an Eclipse mailing list shows possible values for it.

Joseph Mocker from Sun has collected all the (hidden) options of the Sun Java VM.
Sun has an official page on hotspot VM options as well.

The list of options for the Mac OS X java vm are desribed in the Apple developer resources.

Friday, August 18, 2006

Draft of my next book is at the publisher [updated]

I just submitted the draft of my upcoming next book to the publisher to start the review process.
You might wonder what it is about. Well it is about EJB 3.0 and targeted at readers who are already familiar with EJB 2.x and want to know the changes without repeatedly reading things that they already know about.
As there is no final title or cover etc, I can't give them at the moment. Stay tuned, as I will post some more later on.

Dpunkt.verlag is again my publisher, so you might also check out their page about upcoming titles for the anouncement and a link to the final page.

[Update]: Dpunkt has the book description (with the non-final cover) now online

Friday, August 11, 2006

How to outsmart lazy loading

A customer recently had a problem with his O/R mapping framework(*) that all relations between objects/classes were marked to be loaded lazily. Despite this setting, loading a class (either by direct access or via HQL) caused all related classes to be loaded and their related ones as well until the whole graph of attached objects was in memory. The trace of the generated SQL clearly showed this behaviour without any explanation.

Looking at the mapping files, the queries or the java code for the relations brought not explanation. Also the startup of the mapper did not show any errors. The customer even implemented equals() and hashCode().

After having a closer look at the later two methods, the problem came clear: Hibernate did in deed only load the starting class and not the relations (initially). But when putting the entity into the Session, Hibernate has to call equals() or hashcode() for its internal maps. Those two methods now have been implemented my using (amongst other) some relation fields. So in order to compute the hashCode(), the relation had to be loaded (which in turn loaded the next relations, as the hashCode() method on the other classes were implemented in a similar manner).
So actually Hibernate worked as designed :-)

The use of collections within hashCode()/equals() is problematic anyway: a Map uses it to determine the location of the entry. If the hashcode changes this location is no longer correct, which will lead to strange problems.

As a summary: don't only be careful with externally generated primary keys within equals() and hashCode(), but also with using collections.


(*) Actually this was with Hibernate, but the problem can also arise with JDO, JPA etc.

Tuesday, July 04, 2006

Wednesday, June 28, 2006

Importing Thunderbird mails in Microsoft Outlook and Outlook Express

It might sound strange, but sometime it is necessary to migrate from Thunderbird to Outlook.

Robert Ploschek explains in his blog how this can be done:

Robert Peloschek aka Unic0der: Importing Mozilla Thunderbird mails in Microsoft Outlook and Outlook Express

This actually works, but is somewhat cumbersome.

I guess if one has access to an imap server, it is easier to move everything onto the imap account and pull it over to outlook from there.

Saturday, May 27, 2006

[mac] OmniGraffle - Diagram successor?

Some of you probably remember the drawing software Diagram on the NeXT computer. Years ago I used that to draw all the graphics for my diploma thesis. Since then I have never found such a good drawing program. Now I stumbled over
OmniGraffle and it looks like this is the successor of diagram. I downloaded the professional version to try it out and the very first steps already look familiar. When you add a few shapes on screen, it just looks good. PDF export works also like a charm and it has a SVG export as well. The latter two are very important for me, as I want the best quality of the drawings when writing a book or an article.

So if you need a drawing program on the mac you should check out OmniGraffle - this is definitively a good option.

Sunday, May 21, 2006

2 cache presentations upcoming at SIG-JBoss

SIG-JBoss of Java User Group Stuttgart will soon have two presentations about caching technologies:
19. Juni, Cameron Purdy: Distributed Caching ... Lessons Learned
13. Juli, Bela Ban: JBossCache

Both presentations will start at 6:30pm and will be hosted at the
VRS building at Kronenstr. 25, Stuttgart.

There will be separate invitations to those events, but: keep an open slot for them in your calendar.

JAVA:JAVA-CAMP2006 - Rootserver

A few guys from Sachsen-Anhalt are doing a Java-Bootcamp.
Check out their webpage.

This sucks

Andy writes in his blog that the mentionned webmail client doesn't suck.
But then
- it is written in Flash!
- is is written in a version of Flash that Andy can not even use on his Linux computer.

I don't get it...