Archive | Programming RSS feed for this section
Project Lombok – Never Write Boilerplate Java Code Again

Project Lombok – Never Write Boilerplate Java Code Again

(Click to enlarge)
If you read our recent article about Java 7 getting automatic resource management and were excited to never write boilerplate again, you need to try out Project Lombok.
Project Lombok (created by Reinier Zwitserloot and Roel Spilker) is a annotation processor compiler plugin for javac that provides a handful of very focused annotations for [...]

Read full storyComments { 3 }
Java 7 Gets try-with-resources Support (Automatic Resource Management)

Java 7 Gets try-with-resources Support (Automatic Resource Management)

Java 7 is adding support for a new try-with-resources code-block construct that allows the runtime environment to automatically manage closeable resources for you; e.g. streams.
What originally started with a proposal in February of 2009 from Joshua Bloch for try-catch blocks to add the ability to automatically manage resources, eventually turned into a modification to the [...]

Read full storyComments { 4 }
html5-canvas-javascript-bouncing-light-tracer-example

Amazing HTML5 Canvas / JavaScript Animation Examples

Hakim El Hattab has put together a series of HTML5 Canvas animation examples on his website, hakim.se that are fantastic showcases of how animation-friendly HTML5 is on it’s own without Flash.

Right now the use of Canvas is still relatively new and raw, but as the years tick on and more and more HTML5-capable browsers are [...]

Read full storyComments { 0 }
thread-synchronization-performance-linux-java

Java IO Faster Than NIO – Old is New Again!

Alex Blewitt tweeted an article by Paul Tyma titled: Thousands of Threads and Blocking I/O: The old way to write Java servers is new again. Paul is the Founder/CEO of ManyBrain, the creator of Mailinator.
Paul’s 65-slide presentation is a fast read for anyone interested in Java I/O, especially in a client/server setup. What makes the [...]

Read full storyComments { 24 }
ie-8-css3-pie-homepage

CSS3 Pie: Adding Support for CSS3 to Internet Explorer 6, 7 and 8

CSS3 Pie (download) is a set of CSS “behaviors” that can be attached to any CSS file by way of the behavior element in order to add rendering support to Internet Explorer 6, 7 or 8 for the more popular CSS3 rendering features:

border-radius
box-shadow
border-image
multiple background images
linear-gradient background images

CSS3 Pie is an open source project (Apache 2) [...]

Read full storyComments { 0 }
mongo-db-clean-shutdown-sequence

MongoDB (Single-Server) Data Durability Guide

If you are a MongoDB user or just interested in NoSQL databases in general, you may have seen the excellent “MongoDB has poor data durability by default!” (I am paraphrasing) conversation started by Mikeal Rogers.
It is an excellent topic to bring up and regardless of Mikeal’s association (he’s a CouchDB developer) I never once got [...]

Read full storyComments { 20 }
@Override Compiler Errors in Play! Framework “Must Override a Superclass Method”

@Override Compiler Errors in Play! Framework “Must Override a Superclass Method”

If you are working with the Play! Framework and have run into exceptions that read like “The file <MyFile>.java could not be compiled. Error raised is : The method <MethodName> of type <ClassName> must override a superclass method” then you might be wondering if there is a compiler bug in Play! – worry not, it’s [...]

Read full storyComments { 0 }
html5-dnd-overview

HTML5 Drag and Drop and File API Tutorial

Introduction
Over the last day I’ve been trying to learn how to use the new HTML5 Drag and Drop API as well as the new File API. I want to create a really nice drag-and-drop experience for users trying to upload files to a webapp; much like Google just did with Drag and Drop attachments in [...]

Read full storyComments { 14 }
intellij-javac-source-release-16-requires-target-release-16

IntelliJ IDEA Tip: source release 1.6 requires target release 1.6

If you are an IntelliJ IDEA user and you are using Maven in your project, chances are you may some day run into this incredibly cryptic and confusing message:
Error: javac: source release 1.6 requires target release 1.6

Googling it digs up a few approaches to solving the problem as well as some IntelliJ IDEA bug reports [...]

Read full storyComments { 11 }

Use IHeaderResponse.renderJavaScript(CharSequence,String) to Avoid Duplicates

Apace Wicket Quick Tip
If you are working with multiple AjaxEventBehavior’s (like AjaxFormSubmitBehavior and AjaxFormValidatingBehavior) on similar components in a Page and you are using IHeaderResponse.renderJavaScript(CharSequence) it’s possible you are contributing duplicate JavaScript over and over again to the header section of your Page unecessarily.
As it turns out, by simply changing to use the IHeaderResponse.renderJavaScript(CharSequence,String) method (providing [...]

Read full storyComments { 0 }
walmart-mobile-web-site

Apache Wicket Powers mobile.walmart.com and mobile.wellsfargo.com

Update #1: From the same development team that did the mobile.walmart.com site in Wicket also clarified that they finished (last year) the mobile.wellsfargo.com website using Wicket as well. That’s some serious props to Wicket!
I am on the Apache Wicket mailing list and one of the developers (Joachim) on the list wrote in this morning to say [...]

Read full storyComments { 0 }
svn-entries-checksum-value

How I Fixed the "Subversion Checksum Mismatch" Issue

From where I’m standing SVN seems to bring with it a lot of the issues that CVS had with regards to “too much” changing on your local disk and then that getting you into trouble when you went to check it into the repo.
I never figured out why exactly CVS would frequently balk at this [...]

Read full storyComments { 4 }
sun-java-streaming-xml-stax-parser

XMLStreamReader getAttributeValue Bug Returns Null

I’m documenting this issue (and fix) here for anyone else Googling for an answer. I just did for about an hour and found no answer, but instead stumbled across the solution.
If you are using anything from the javax.xml.stream packages in Java 6 or later, you are using the Sun Java Streaming XML Parser (SJSXP) implementation [...]

Read full storyComments { 0 }

SmugMug Downloader Web Start Link Fixed

It looks like on Mac the Java Web Start JNLP file used to launch the SmugMug Downloader had an invalid reference to itself and was failing to load — it seems on Windows this was working anyway.

Read full storyComments { 0 }

Did You Know enums Can Define Their Own Methods?

… I sure as hell didn’t, but found myself in a position the other day where I was thinking “Damn, I wish I could define a common method in this enum that I could call and not have to write another utility method…” Well, ask and ye shall receive… or something like that.
Here’s the enum [...]

Read full storyComments { 4 }
java-exception-explanations

Explanations of Common Java Exceptions

Huge thanks to Marc Chung for sending along this great reference. It’s a breakdown of all the JDK exceptions and textual descriptions of what they represent — so if you are designing your own API or just working on your own app and want to make sure your use of particular exceptions (e.g. IllegalArgumentException) is [...]

Read full storyComments { 0 }
qt-logo

QT 4.5 as LGPL

If you haven’t heard yet, there is good news on the application development platform front. Recently Qt Software, owned by Nokia, announced that the next version of their flagship product, QT 4.5, will be distributed under the LGPL. Prior to this announcement, the platform was free for open source use, while the price of a [...]

Read full storyComments { 0 }
CarLot Successful Run

Develop using the Play! Framework: The JPA Model

A couple weeks ago I wrote an article on a fantastic framework called Play!. I want to revisit the project I created with the framework and introduce one of the coolest features that Play! has to offer: the use of Persistence through their JPAModel. I’m going to modify the CarLot application (Download ZIP) to [...]

Read full storyComments { 4 }

SmugMug Java API Download Links Fixed

Guys, sorry for the SmugMug Java API Download links being broken for a bit, I did an upgrade and forgot to update the paths. All the download links have been fixed.
Thanks for using the API!

Read full storyComments { 0 }
Develop using the Play! Framework

Develop using the Play! Framework

Not too long ago I posted an article on the Play! framework. The framework has some promising features that really helps develop web applications in Java. To show how easy it is to use, I wanted to demonstrate with an example.
Update #1: Since the article posting there have been a couple of suggestions for updating [...]

Read full storyComments { 0 }
Play Icon

The Play! Framework

In an endless search for efficiently building Web applications, one might stumble upon a new framework called Play! Using enterprise backed Java with a Rails-esque feel, the Play! framework seems to offer quite a bit over traditional web development tools with its straightforward development environment and ease of deploying.
Taken from the website:
The Play! framework makes [...]

Read full storyComments { 0 }
javafx-media-player-loading

JaxaFX 1.0 Released – Not a Great First User Experience

Please keep in mind I’m wearing my “Joe average user” hat that this platform is suppose to target as a delivery platform (and simplify developer’s lives in the process).
I’ll admit that I’ve always had trouble with the Java plugin and Firefox on my old Windows XP SP2 desktop, Windows XP SP3 laptop and my Windows [...]

Read full storyComments { 0 }
groovy-logo

Is Java Becoming Irrelevant?

Update #1: To clear up any confusion, this article is focused on the business value of Java – it’s ability to control and generate revenue – not it’s value as a language or a technology. So the word “irrelevant” is applied to it’s business value, not if it’s a good technology or not.

Sun Microsystems announced [...]

Read full storyComments { 0 }
ZK Demo Welcome screen

Setting up Apache Tomcat 6.x and ZK in Ubuntu

Apache Tomcat is the name in JSP, and you’ll need to get a copy before being able to try out the many cool web applications and frameworks out there (like ZKoss’s ZK). Finding a development need to run JSP pages (and wanting to try out ZK), I decided to get the latest Tomcat version [...]

Read full storyComments { 3 }