Archive for February, 2010

Presentation Zen

Friday, February 26th, 2010

A while ago I read the book “Presentation Zen” from Garr Reynolds. Garrs website can be found at Presentation Zen .

I must thank Oliver Gierke for the recommendation of the book.

The advice this book gives is actually very simple:

1.) Use lots of whitespace

2.) Avoid lot of text
3.) Avoid lots of bullet points


4.) Don’t treat powerpoint as a replacement for word
5.) Use a few nice looking pictures
6.) in extreme a presentation should be worthless without the presenter to explain it

You find nice introductions and examples in the following links.

How to create powerful presentations

Designing compelling presentations

If you have other good examples please let me know.

I really enjoy listening to presentations delivered in this format and if I have the opportunity to use this format I also have much more fun in presenting.

Podcast from Dan Ariely “Predictably Irrational” and OpenSource

Tuesday, February 23rd, 2010

Dan Ariely is the author of the book “Predictably Irrational: The Hidden Forces That Shape Our Decisions” and discusses in this podcast his theories under the content of OpenSource with Dan Bricklin.

This is an older podcast, but well worth listening too. They especially discuss the difference between free and non-free on the consumer perception and how it influences our decisions. He continues how payments change the perception of people about social norms and work and how it influences their motivation. He also discuss how people tend to leave to many options open and what this may mean for OpenSource Software.

Dan Ariely “Predictably Irrational” and OpenSource. Careful links directly to the mp3 file.

Other podcasts of Dan can be found here:

Dan Bricklins Podcasts

This podcast is one of the most informative podcasts about social norms and Open Source I have found.

Knights of the round table – Eclipse committer election

Friday, February 19th, 2010

Eclipse Committer Election is starting as of 22. Febr. This is the first year I’m allowed to vote therefore I’m thinking what should guide my vote.

I recently read the book The Art of Community from Jono Bacon.

Jone speaks about the concept of Meritocracy.

A meritocracy is a system of governance in which its members are given responsibilities and recognition based upon achievements, merit, and talent. Those who are part of a meritocracy (such as in the Ubuntu and other open source communities) can make tremendous advances in respect and responsibility by simply doing good work. In these communities, money, class, and family connections have little or no impact on the ability to progress and build a reputation.

I believe that is an excellent concept and my vote will be guided by this principle. For an excellent summary of the committer project activities please see the How active is your-Committer blog entry from Ed Merks.

In addition to the involvement of the candidates in Eclipse projects I will also consider their community activity and attitude in the other Eclipse channels, e.g. their twitter activity, blog posts, email, etc.

I’m looking forward to the election; I think we have lots of great candidates.

Debugging Eclipse e4

Thursday, February 18th, 2010

Eclipse e4 has sometimes the tendency to do thing differently then expected. For example the modeled workbench may not show certain UI elements. In this case it is difficult to find out what is wrong.

This blog post tries to help to look inside the initialization process of an Eclipse e4 application.

In my e4 tutorial I write that you always have to start the application “org.eclipse.e4.ui.workbench.swt.E4Application”.

The implementation class is “org.eclipse.e4.ui.workbench.swt.internal.E4Application” and can be found in the plugin “org.eclipse.e4.ui.workbench” in. This instance of IApplication is created by the framework.

In this class you find the main entry point to your application:

public Object start(IApplicationContext applicationContext)
			throws Exception {

			}

The following line creates the mighty IEclipseContext.


IEclipseContext appContext = createDefaultContext();

In createDefaultContext() you find for example that e4 sets initially an empty Styling engine and you find the registration of the extension registry.

The next line is more interesting, its load the models. Here you can check if the model entries are available as expected.


MApplication appModel = loadApplicationModel(applicationContext,
				appContext);

Just in case you are wondering “M” Elements refer to the UI workbench model modeled with EMF. MApplication is the model element for the application and extends for example MContent which allows to store the IEclipseContext.

After a few lines of compatibility stuff the the model is added to the IEclipseContext and vise versa:

// Set the app's context after adding itself
		appContext.set(MApplication.class.getName(), appModel);
		appModel.setContext(appContext);

The next lines are interesting as they also reveal typical errors (I make). They load the parameters for “applicationXMI”, css stylesheets and the rendering engine. Here you can check if you parameters are read by the engine.

		// Parse out parameters from both the command line and/or the product
		// definition (if any) and put them in the context
		String xmiURI = getArgValue(E4Workbench.XMI_URI_ARG, applicationContext);
		appContext.set(E4Workbench.XMI_URI_ARG, xmiURI);
		String cssURI = getArgValue(E4Workbench.CSS_URI_ARG, applicationContext);
		appContext.set(E4Workbench.CSS_URI_ARG, cssURI);
		String cssResourcesURI = getArgValue(E4Workbench.CSS_RESOURCE_URI_ARG,
				applicationContext);
		appContext.set(E4Workbench.CSS_RESOURCE_URI_ARG, cssResourcesURI);

		// This is a default arg, if missing we use the default rendering engine
		String presentationURI = getArgValue(E4Workbench.PRESENTATION_URI_ARG,
				applicationContext);
		if (presentationURI == null) {
			presentationURI = PartRenderingEngine.engineURI;
			appContext.set(E4Workbench.PRESENTATION_URI_ARG, presentationURI);
		}

The last lines are for actually creating the E4Workbench and running it.

/ Instantiate the Workbench (which is responsible for
// 'running' the UI (if any)...
E4Workbench workbench = new E4Workbench(appModel, appContext);

The class “org.eclipse.e4.workbench.ui.internal.E4Workbench” is worth a look. It defines the fixed values for the possible parameters, e.g. “applicationXMI”.

The init() method is responsible for creating the UI in the method call Workbench.processHierarchy(appElement); where appElement is initially the MApplication. processHierachy() is then recursively called for all model elemements.

I hope this helps in evaluating and debugging the e4 platform. Let me know what you think.

Apache Tomcat 6.0 Server Unable to Start

Tuesday, February 16th, 2010

I occasionally have problems with starting Tomcat from Eclipse. Eclipse WTP gives me the message:

Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

While searching the web I found that others also have the problem hence this blog post.

Via a Eclipse forums post I recently learned how I could analyse the the problem.

Larry Isaacs explains:

The lack of output in the Console view suggests that the attempt to launch Tomcat is failing. After attempting to start Tomcat, switch to the Debug perspective and look in the Debug window. You should see a terminated launch. You can right-click on the nested item under the terminated launch and select Properties. This should display the command line that is being used to launch Tomcat. You could try that command in a terminal window to see what happens.

Eclipse uses javaw so you have to change it to java, as javaw will not open a console or log anything to an existing console (as Larry also explains in the forum post).

I hope this helps to identify the problem. I personally restarted my Laptop and ran Eclipse with -clean and now Tomcat starts again without problems.

Create an Android Twitter client

Monday, February 15th, 2010

Marko Gargenta has recently send around a couple of blog posts from Serete Itebete about how to build your own Twitter Application for Android.

The blog posts require some knowledge about Android development therefore if you are new to Android development I suggest to start with the following Android Tutorial.

And here are the blog posts to build your own Android Twitter client

Part 1
Part 2
Part 3
Part 4

The source code is included in the posts. Frank Maker has improved it further and posted his version on GitHub: http://github.com/fmaker/Tweety. You import it via EGit or Git via the following address git://github.com/fmaker/Tweety

You find other examples from the same website in Android Examples.

Checking out EGit source code with EGit

Friday, February 12th, 2010

Git and EGit are getting popular. In case you want to start hacking on EGit this will give you some hints.

First install EGit following this guide EGit Tutorial.

First you need a few libraries from Orbit via cvs. The cvs location is “:pserver:anonymous@dev.eclipse.org/cvsroot/tools”. You need:

  • org.eclipse.orbit/com.jcraft.jsch
  • org.eclipse.orbit/org.kohsuke.args4j
  • org.eclipse.orbit/javax.servlet

See Libraries from Orbit for getting these libraries.

Select File -> Import -> Git -> Git Repository and paste the URL “git://egit.eclipse.org/jgit.git” into the first line.

Do the same with “git://egit.eclipse.org/egit.git”.

Currently there is a little bug in EGit, please see Bug Report. If you facing the problem that the Team operations are not available on your new project my EGit Tutorial describes what to do to make the Team operations available. This should be fixed very soon, path is already commited to the master branch.

You have now the source code in your workspace and can start hacking.

For more info please see the excellent EGit Contributor Guide.

Using Java libraries (jar’s) in Android applications

Thursday, February 11th, 2010

To use a Java library inside your Android project you can create a folder, e.g. “lib” and place your jar into this folder. Then right-click the jar and select “Build Path” -> Add to build path.

Of course you should keep your Android application as small as possible. Therefore you should only include classes in the jars which you really need.

You should be able to use this jar in your Android coding, e.g. your Activities.

To learn about Android programming please see Android Programming Tutorial.

Integrating Twitter via Java

Thursday, February 11th, 2010

This you want to integrate to Twitter from Java you can use the following library JTwitter.

Try out the twitter integration with the following coding:


package de.vogella.twitter.test;

import java.util.List;

import winterwell.jtwitter.Twitter;
import winterwell.jtwitter.Twitter.User;

public class TwitterTest {
	private static final String user ="your-user";
	private static final String pw ="your-password";

	public static void main(String[] args) {
		// Make a Twitter object
               Twitter twitter = new TwitterFactory().getInstance(user,pw);
		// Print Lars Vogel status
		System.out.println(twitter.getStatus("vogella"));
		// Set my status
		twitter.setStatus("@vogella messing with Twitter in Java");
		List<User> followers = twitter.getFollowers();
		for (User user : followers) {
			System.out.println(user.getName());
		}
	}
}

Another Java Twitter Library is Twitter4J.

How can I use a Java jar file in a Grails application?

Wednesday, February 10th, 2010

After banging my head against the wall in trying to find out how I can use Java class in a Grails application I found out that the solution is embarrassing simple.

Just create a jar file from your Java classes and put the jar file into the folder “jar” of your Grails application.

You also have to add the correct import statement to your Groovy file. E.g. if you want to use class “MyJavaClass” in package “de.vogella.test” you have to add “import de.vogella.test.MyJavaClass” to your Groovy class.

You also need to re-start the grails server.

To learn more about Grails see Grails Tutorial


Switch to our mobile site