Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, March 30, 2011

gwt-fireworks-demo

Recently I worked on some code for the Google IO Last Call Contest.

I started coding on a Friday afternoon after a long day's work in which I had started early at 3:30am to do some load testing. I finished up around 1:30am Saturday morning.

Basically the objective was to use GWT 2.2 and its recent support for the HTML5 canvas. The problem was to replicate in some creative way the behavior of the Google IO 2011 landing page.

My project is hosted on App Engine.

I am hosting the project on Google Code.

Wednesday, December 23, 2009

hbm2ddl and MySQL

Previously I had a post on using hbm2ddl with Maven and the hibernate3-maven-plugin for Maven. I recently needed to use this setup on MySQL so I have posted my persistence.xml below as a reference.


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">


org.hibernate.ejb.HibernatePersistence











Monday, December 14, 2009

Building gwt-presenter and gwt-dispatch on OS X Leopard

I had been having quite a bit of trouble building and running applications that use gwt-presenter, gwt-dispatch and Google GIN on Leopard 10.5.8 recently. The problem comes from the fact that there is no 32 bits JDK6 available. Upgrading to Snow Leopard would of course fix the issue but here are some steps I've taken to compile and run in GWT hosted mode successfully:

- download gwt-presenter and gwt-dispatch locally
- set the active JDK to JDK6 64 bit
- set the build targets in the PM to JDK 1.5
- build jars and install into the local Maven2 repository
- switch the active JDK to JDK5
- build host project
- should run successfully in GWT hosted browser

Tuesday, November 17, 2009

DuplicateMappingException: Duplicate class/entity mapping

It turns out the deceptive exception can be thrown from an improperly formed Many-to-Many relationship declaration. I'm not going to take the time to document a correct declaration here but I was getting this misleading error message and was searching for an obvious problem with imports when it turned out to be the @ManyToMany annotation usage.

Tuesday, October 27, 2009

Thoughts on GWT, MVP and GWT-EXT

Thoughts on GWT, MVP and GWT-EXT

Putting some GWT-related posts over on my blog that primarily speaks to Java-related topics.

Saturday, February 7, 2009

Amazon Web Services Developer Community : Running Hadoop MapReduce on Amazon EC2 and Amazon S3

Amazon Web Services Developer Community : Running Hadoop MapReduce on Amazon EC2 and Amazon S3

This is a great article concerning running Hadoop jobs on Amazon's cloud services.

Thursday, September 18, 2008

Character Shifting Algorithm

Here's a simple character shifting algorithm. It gives me a chance to test out google-code-prettify JavaScript/css I just added to my blog.



public class CharacterShift {

/**
* @param args
*/
public static void main(String[] args) {
char[] word = "iphone".toCharArray();
int shift = 3;
char[] result = new char[word.length];

for (int k = 0; k < word.length; k++) {
int p = (k + shift) % word.length;

result[p] = word[k];
}

System.out.println(String.valueOf(word) + " shifted by " + shift + " becomes " + String.valueOf(result));
}

}