As mentioned in an earlier post, I’m using the Infinite Scroll plugin to automatically load older posts on-demand when reaching the end of the blog.

Today, I updated from version 2.0b2 to the latest version 2.6 with the effect, that the whole site wasn’t working anymore. Only a blank page was displayed. So I downgraded to the latest 2.0b2 release to get things working again until the latest issues get fixed. Since it isn’t possible to downgrade a wordpress plugin easily, you have to perform the following steps: Continue reading …

[Update]It seems that there is a problem with the latest version of the plugin. So keep in mind, that the following steps only work with the 2.0b2 version![/Update]

Today I’ve tried to use the very nice Infinite Scroll Plugin that allows automatic loading of additional posts as soon as the user reaches the last post on the blog. So there’s no need for paging to old posts anymore – sweet. Although the developer says it should work out of the box for most of the themes, it didn’t work for mine – Lightword :).

First, you have to configure the so called Selectors that will target the html elements that will be modified by Infinite Scroll. Without correctly configured Selectors, lazy loading won’t work. For the Lightword theme, the following Selectors worked for me:

Content Selector: #content-body

Posts Selector: #content div.post

Navigation Selector: div.newer_older

Next Page Selector: div.newer_older span.older a

You can configure those Selectors under Settings/Infinite Scroll. Besides the Generel tab, there is the Selector tab. After that, on-demand loading should work when you reach the last post on the blog. Continue reading…

It is really a joke that Oracle still treats empty (zero length) strings as null, even in the year 2012! Recently I came (again) across this fact when we were adding support for Oracle 11g in our application.

I was shocked that this is still an issue. Although they may had their reasons in the past, this is really annoying nowadays. I can’t understand why they didn’t make a cut a some point, made the default SQL92 compliant and added an option for the legacy systems. If you don’t know what I’m talking about:

When you have an Entity that has a String attribute, put an empty String (“”) into it and persist it. When you read it back this String attribute is now null instead of “”! This leads to unfunny side-effects especially when you’re already supporting other databases like MySQL, MSSQL or PostgreSQL where this isn’t an issue. Be prepared to re-check queries, required attributes and JSF pages.

How are you handling the situation? Is there a new option I’m probably not aware of?

Ever wondered why the JEE6 CDI Event BeforeShutdown isn’t fired when the container shuts down as described in its javadoc?

Well, this is because it’s one of the container lifecycle events that are not accessible for normal CDI managed beans. To get access to these special events, your implementation has to be an CDI Extension.

Second, create a META-INF/services/javax.enterprise.inject.spi.Extension file containing the full qualified classname of your Extension:

org.nightprogrammer.examples.cdi.BeforeShutdownTest

org.nightprogrammer.examples.cdi.BeforeShutdownTest

That’s it! Now you receive the Event as soon as the container goes down. Would be great if the javadoc would mention that directly in the BeforeShutdown Event though. That would have saved me an hour of research :(.

What do you use for cleaning up resources before a container shuts down?