Everybody who wants to get involved in our little Java User Group here in Karlsruhe is invited. We are looking for people with lots of ideas, sense of community and passion. I prepared a couple of slides, which will help us structure the gathering, but mainly we are hoping to get your feedback and ideas heard.
You can help steer the JUG in the direction which you want it to go. Just join us on Wednesday at 7:15pm, the usual time and the usual place. The University of Karlsruhe kindly sponsored a room (SR-107), which is located in the basement, next to the usual location.
I'm looking forward to see you guys on Wednesday to share some ideas on how to improve your Java User Group Karlsruhe.
A couple of days ago, I implemented a RSS-Reader feature for an app, I'm coding at work. There's a nice tutorial on this topic, which I can highly recommend to you, although it's a little outdated. I'm using a UITableView to implement the RSS-Reader feature and I wanted the header section to be a UINavigationBar. Somehow I couldn't find a proper tutorial on how to achieve this. At least there wasn't anything that explained it in a simple manner.
You will need a UINavigationController, in case you want to navigate through the hierarchy of UITableViews, but we put that thought on hold and I'm gonna show you how to add a custom UINavigationBar.
This is roughly what the final result should look like. You can see my company's logo at the top, inside of a UINavigationBar, which in return is inside of a UITableView. All the components are wrapped in a UITabBarController, which you can see at the bottom in the form of a tab bar.
My first approach was to tackle this kind of interface solely in Interface Builder. It's very straight forward, there's nothing fancy here and my first impression was, that it should work out of the box - the box being InterfaceBuilder. Well, I was able to design almost everything through Interface Builder, just the part with the UINavigationBar made me throw in the towel.
This is what the code looks like. It is implemented in the custom UITableViewController, which is assigned responsibility from the UITabBarController, as soon as its' tab is active.
First step is to initialize the UINavigationBar. In my case, I assign it to an instance variable, which is released in the dealloc method. You can see, that you also have to initialize and add the image yourself, which is usually a simple drag & drop in Interface Builder. That image is then added to the initialized UINavigationBar.
You can see that the solution is only a couple of lines of code, but note that it only works, if you don't want to navigate to a sub view. For that you'd need a UINavigationController.
This is our first attempt to record a talk of the Java User Group Karlsruhe. Please forgive us the weird camera angle and the volume, we promise to improve that. Other than that I think it's quite reasonable.
I'm really impressed by the tools and platform Parleys.com provides. The best part is - it's free for JUGs. A big thank you from Karlsruhe to Belgium for that!
The first talk of 2010 at the Java User Group Karlsruhe is this coming Wednesday. After a successful finale in December 2009 with a talk on Scrum, we are turning our attention to the technical side of things again - Groovy.
We had a talk on Groovy back in early 2008, in case you remember. It was an introduction, whereas this coming talk will target a more advanced audience.
The speaker of the night will be Dierk König from Canoo Engineering AG, Switzerland. He is a Groovy committer and author of the book Groovy in Action. He'll give us an overview of 7 scenarios in which to use Groovy in your project.
I'm excited, that we are going to have a Groovy expert in the house Wednesday evening. If you have any questions on Groovy, it's your chance to get an answer, so make sure to drop by.
The talk will take place at University Karlsruhe in room 102, located in the basement - just follow our duke featured logo. The talk will start at 7:15pm.
Our monthly lottery of JetBrains and ZeroTurnaround, which are each giving away a free license of one of their products is already on. If you are interested in participating in the draw, submit your details through our online form. The winners are going to be announced at the end of the talk and must be present.
To keep up with all the JUG goodness in 2010 subscribe to our Google Calendar or join our Xing Group.
Last week my colleague Marc spent hours trying to figure out why a ResourceBundle wasn't loaded in a Spring based web app we are developing here at Synyx. It turned out to be a broken Unicode representation, which wasn't properly reported by Spring's ResourceBundleMessageSource.
In case you don't know ResourceBundleMessageSource, here's an excerpt of its javadoc:
MessageSource implementation that accesses resource bundles using specified basenames. This class relies on the underlying JDK's ResourceBundle implementation, in combination with the JDK's standard message parsing provided by MessageFormat.
We are leveraging the basename functionality of ResourceBundleMessageSource in our application, the way it's suggested in the javadoc. It's pretty neat and you should definitely check it out, if you've never used it.
The problem we encountered indicated that the bundle could not be found. This is what we saw in our log statements:
WARNING: ResourceBundle [broken_messages] not found for MessageSource: Can't find bundle for base name broken_messages, locale en_US
Of course, we tried to fiddle with the classpath, changed the names of the properties files and moved them to different directories in our WAR file - it would only print the above log statement. After hours of trying and failing, Marc discovered an invalid Unicode character representation (something like d\u00Fvid instead of d\u00FCvid) in the ResourceBundle, which wouldn't let ResourceBundle load the damn thing.
So where's the problem with ResourceBundleMessageSource? The problem is that it swallowed the cause of its own MissingResourceException. Here's what Java's good old ResourceBundle class tells you in case of a broken \uxxxx representation:
java.util.MissingResourceException: Can't find bundle for base name broken_messages, locale en_US ... Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
You can clearly figure out what the problem is and how to solve it. Whereas, with the message of MissingResourceException the least you would expect, is to look for the problem in the properties file itself.
I created a small test case to reproduce the problem and filed a request for improvement. I hope there'll be a fix, so that other people don't have to suffer the same way we did.