I’ve recently spent some hours to track down a mysterious bug and I just couldn’t find it. Since my application is using a lot of Threads/Workers it came to my mind that a RuntimeException I did not catch could be the cause. I wrote a global handler for it and found where the problem was :)

Read more…

If you are getting an error that says “There is no ID/IDREF binding for IDREF” when validating an XML file you should check if an IDREF-typed attribute somewhere is pointing to an ID that is not defined anywhere yet.

A stupid thing about Java NIO and using blocking sockets is that the SO_TIMEOUT is not used anymore even if you set it. You may wonder why anyone will use blocking sockets with NIO? I am doing this in p300 because I want to use the increased performance of using FileChannel.transferFrom.

Read more…

Wordpress can expose every category or tag as a RSS feed. For example, you can announce the feed for a category by adding this into your theme file at the part where the HTML-Head is generated:

Read more…

If Eclipse complains that it cannot start JBoss (”Timeout waiting for JBOSS 5.0 to start. Server did not start after 50s.”) then try to set the timeout to a higher value. It can be done in the options:

Windows -> Preferences -> Server -> Server timeout delay

While the design of a website is already separated from the content by using CSS (Cascading Style Sheets), the scripting features of a website can also be pulled out off the HTML file.

Read more…

I have recently joined twitter, mostly because of the hype and not because I see any very good use :)

All people complain about the stability and I can really understand why. Since I am not using any twitter client currently and their IM Jabber service is still down, I have to use the website. It sometimes loads slow or not at all which is really annoying. I can understand why power users hate that.

What I noticed when searching users from Stuttgart is that users which you already follow are displayed in a different color and have some options aside. So, for every search you do, the database table with the people you follow is checked too. This is of course very nice for usability but if everything in twitter is luxurious like that then no wonder they have issues about their load.

By the way, Sebastian is also on twitter.

You can put the following lines in your wordpress theme into footer.php to see how much SQL statements were executed for generating the page and how long the whole process of generating the page took:

Read more…

I’m really disappointed about how stupid web forms are sometimes. Consider this:

  • A captcha that has as a side-note: “Please do not enter whitespace characters“.
    • Why can’t the website just filter the whitespace?
  • A edit field for a URL that has as a side-note: “Please also enter the http://“.
    • Why can’t the website just add the http:// when it is missing?!
  • A submit button with side-note “Please hit submit only once“.
    • Most websites don’t have this anymore, they disable the Submit button with Javascript. Thank you :)
  • A edit field for a phone number that insists on a specific number format.
    • Does the number format matter in any way except for the +Countrycode at the beginning? Why not just filter everything except numbers?

All of these mentioned are even happening on very big sites who should have the people who know better. Are there any reasons except annoying me?

Does anyone have more examples? Please comment :)

(Translated from the blog of guruz)

Update: Blogoscoped has another posting about forms in websites.

There are some cases where you want a text field to automatically scroll down, e.g. for a log window. The following code snippet will make the JTextArea (embedded in a JScrollPane) scroll down automatically when the scroll position is at the bottom before adding the text:

Read more…