Dienstag, 7. April 2009

Choosing the right quotes

Lately I read this great posting on webdesignerdepot.com. I especially liked one detail mentioned under Don’t Neglect The Details. It said Use smart quotes and described how to use the right quotes that look nice, instead of that ugly stuff that on your keyboard. In my humble opinion, it should read Care about quotes or Use the right quotes instead of Use smart quotes, however, I have to add more to this. This don't stops here, it's harder then that. There are also differences in the quoting rules of different languages and since I'm german, I know that one.

See the following examples. The first uses the quotes on the keyboard, the second uses the Unicode entities 8220 and 8221 for correct english quoting and the third uses 8222 and 8220 for the german version:

"this is dumb quoted"


“english should be quoted like this”


„deutsche Anführungszeichen“


The thing about these kind of details is, that one don't cares about, if he don't know it, but as soon as he knows, it starts to bug him. Do this right and you are on the save site.

PS: jep, I know, my english isn't perfect and arguing about such details might seem silly... but I'm working on this :)

Montag, 19. Januar 2009

DB2's JDBC and Ubuntu Upgrades

lately, I upgraded my Ubuntu 8.04 LTS to 8.10. All seems to work well except my DB2 Installation.

Problem
When I tried to start DB2 by typing "db2start", I got the following message:

SQL5043N Support for one or more communications protocols failed to start successfully. However, core database manager functionality started successfully.

And no JDBC Connection where possible anymore. That's kind of a show stopper for a Java developer.

How I found the Solution
First of all, you need more information, so consult the db2diag.log. On my machine it's located under "/home/db2inst1/sqllib/db2dump/db2diag.log". Because there seems to be no information about the error, I increased the loglevel by doing this:

db2 UPDATE DATABASE MANAGER CONFIGURATION USING DIAGLEVEL 4
db2 terminate
db2 force application all
db2stop
db2start

This should change the diaglevel, terminate the connection, kills all connections from other applications and restart.

After this, I saw the following message in the db2diag.log:

MESSAGE : DIA3201E The service name "db2c_db2inst1" specified in the database manager configuration file cannot be found in the TCP/IP services file.

google for that and you'll find, that there is a file called "services" under "/etc" and the TCP/IP connection must be configured in it. I guess, the Ubuntu upgrade has overwritten that one.

Solution
I found this page that describes how to add the needed configuration to "/etc/services". In my case I added the following line:

db2c_db2inst1 50000/tcp # DB2-Port for JDBC

And everything was back to normal :)

Freitag, 1. August 2008

clickable checkbox lables

When you are like me and you see a checkbox with a label next to it, you'll click the label to switch the state of the checkbox. If you don't know this handy shortcut try it out it works almost everywhere. People expect it to work and it drives them nuts if it don't.

checkbox in Java/Swing

In modern programming languages or GUI frameworks, let's say Java or therefor swing, the checkbox and it's label is one component. To add one to your UI you write something like this:
container.add(new JCheckBox("click me!"));
and you get something like this:



Like I said, you can change the state of the checkbox by clicking the label.

Checkboxes in HTML

In HTML thing look a little different. The checkbox is a component without a label attribute or something, and often you find this:
<input value="foo" type="checkbox"> I'm just dumb text
What gives you this, a checkbox and some tet nearby... crap.

I'm just dumb text

You can fix this by making the text a label and point the for attribute of the label, t the id of the component, like this:
<input value="foo" type="checkbox" id="bar"><label for="bar">yes, I'm clickable baby!</label>
gives:




Conclusion


Making checkbox labels clickable is important, if it isn't for you, maybe for other users of the software you write. Make your checkboxes clickable!

I my humble opinon, the HTML idiom is a mess and so much the worse, webframeworks like e.g. JSF have copied this. I'll write aboutthis in a followup post.