Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Archive for October, 2009

on Oct 31st, 2009Come on Eclipse, let’s grow a Mo

As most of you know October is coming to an end. This means that M3 is due out soon, ESE is over, and the very early EclipseCon registration deadline is approaching.  It also means that Movember is starting.  Movember is a month dedicated to changing the face of men’s health, and it’s all about the Mo (the Mustache).  This year I thought we could try and get an Eclipse team together to help with this worthy cause.

So, if you’re part of the Eclipse Community — an Eclipse Committer, a Eclipse Contributor, a active user — you are encouraged to join the Eclipse Mommitters (Eclipse Committers with a Mo), help raise awareness of Prostate Cancer, and grow a killer mustache.

1 in 6 men will be diagnosed with prostate cancer in their lifetime.  Prostate cancer is the most common cancer to afflict Canadian men with 25,500 diagnosed and 4,400 dying from the disease each year.

mo eclipse Come on Eclipse, lets grow a Mo

This is not just for the gentlemen either.  Ladies, you are welcome to join as Mo Sista, a woman who loves a Mo. You can join the Eclipse team at the following URL: http://ca.movember.com/register/44681 .  Hey, maybe we can all keep our Mo’s until EclipseCon and get a group picture icon wink Come on Eclipse, lets grow a Mo . (I’m just kidding).

on Oct 27th, 2009The Mac@ESE makes me want to stop demo’ing

This morning at the ESE EclipseRT tutorial we are having a great set of talks on Equinox, RAP, EclipseLink and Riena. The room was full and the audience asking lots of great questions. It is great to see so many people interested in EclipseRT.

Unfortunately, there was another episode in the continuing saga of me, demos and the Mac. I was to present various things about Equinox and OSGi. The discussion went fine and short of not being able to switch Mac Spaces screens using the mouse, strange, that was great. When it came to demo however, things were not so good.

Much of the tutorial is based on Toast, an example application that comes from the new OSGi and Equinox book and is now an Example project at Eclipse. The Toast client has lots of great stuff including integration with Google Earth.  Unfortunately, for some reason that only works when running on Carbon on the Mac. OK. Since I updated to Snow Leopard I had to install some retro JREs to get Carbon. Hmm, OK.  To run the with this while running the IDE on Cocoa means I have to setup my PDE Target Platform to use Carbon explicitly.  Err, sure, why not…

Well, it seems there is a bug in PDE (well, apparently the bug is in SWT) that prevents one from editing a Target Platform to set Environment values.  Seemingly my changes were just ignored despite showing in the UI.  Not so great.  The net effect was that my demo failed.  Sigh.

To work around this I had to hand edit the .target file’s XML to add

<environment>
<ws>carbon</ws>
</environment>

Now the client works! Of course it was my fault for updating my target just before the demo and believing what the UI was telling me.  Live and learn…  I’m starting to feel a bit like Steve the Uber Geek.

It seems that there are a few other issues like this in the Target Platform editor around Software Sites.  Seems that these are issues related to Cocoa. Working on the Mac still feels like using the poor cousin of Eclipse. Oh well, there is always VMware.  But then Google Earth does not run so well there either…

on Oct 27th, 2009Join us at Eclipse Summit Europe 2009

This week, we’ll be participating at Eclipse Summit Europe 2009 in Ludwigsburg, Germany.

eclipsesummit09 header web 300x39 Join us at Eclipse Summit Europe 2009

Here are our activities based on day.

Tuesday, October 27th

  • Runtime Tutorial
    • Jeff McAffer (EclipseSource), Christian Campo (compeople AG), Shaun Smith (Oracle)
  • RT Symposium
    • Jeff McAffer (EclipseSource), Christian Campo (compeople AG)

Wednesday, October 28th

Thursday, October 29th

Finally, feel free to say hello to us and stop by the EclipseSource booth (#27).

Enjoy the conference!

on Oct 26th, 2009Riena at the Eclipse Summit Europe

If you are at the Eclipse Summit Europe this week, here are some interesting talks about the work going on in and around Eclipse Riena:

riena 120m2 Riena at the Eclipse Summit Europe

* Eclipse RunTime Tutorial, Tue 9:00-12:00, Seminarräume 2-4 – This tutorial connects the dots between different runtime technologies, such as Equinox, Riena, RAP and EclipseLink

* Eclipse Riena Project – Overview and a new UI concept for RCP applications, Wed 11:20-12:00, Seminarräume 2-4 – This overview of Riena focuses on the framework’s UI concepts. Learn how to use navigation, styling and filtering to build better RCP applications.

* SWT Platform on QT – Overview and Demo, Thu 16:00-16:20, Seminarräume 2-4 – I’m very curious about this session. The screenshots I have seen looked very exciting. And the promise of taking advantage of QT’s extensive customization capabilities and build-in CSS support is appealing. Personally I’ve found SWT to be quite restrictive when it comes to styling and theming, so I am interested in all approaches that expand what you can do.

Kind regards,
Elias.

PS: I’m not attending this year, but several of my Riena colleagues will be there.

on Oct 23rd, 2009Take actions against sluggish desktop applications

Let me state two facts:

  1. My computer has 2 cores (there will be more in the future).
  2. My IDE feels sluggier with every version.

Applications feel fast if the time between user action and application reaction is short. Ben Galbraith suggests that this threshold is around 200 ms for web applications, for desktop applications the boundary is lower. A rule of thumb places it around 100 ms, so I there must be a yellow range in between.

performance Take actions against sluggish desktop applications

My IDE crosses this threshold more often than it should, so it’s sluggish. What’s the reason and what can be done about it?

It seems like a fundamental law in software engineering that every new version of any program executes more code than the previous version.

Java 5 introduced the java.util.concurrent API that made corse grained parallelism easier. The combination of thread pools, Futures and Barriers covered a wide range of tasks between CPU and I/O bound.

To me as UI programmer this had little consequence. For a while I could still state that Java+SWT is fast, consuming my part of that lunch that is not free any more but was cheap enough anyway in the doses I required.

This is changing. A few years ago we saw a pain barrier reached and solved in startup time of various operating systems. Today my pain barrier is reached in many of the functions that are executed as reaction to user clicks and key presses in my IDE. Undoubtedly it is only a matter of time when this will apply to smaller desktop applications, too. They must react, and using multiple cores is the solution at hand.

Other languages and frameworks already have good support for multicore programming, Java 7 will include the ForkJoin framework for Java. In the wild, it is a library known as jsr166y that can also be used with Java 6.

In the following I’ll discuss a little example that shows how to use the ForkJoin framework.

A simple easily parallelizable example is assigning random values in a large array. It’s also an example that can not be solved with raw processor power but accesses memory.

First, care must be taken where the random number comes from. Even a sequential solution using ForkJoins ThreadLocalRandom was about twice as fast than one with Math.random(). It’s also more comfortable to use.

    int[] result = new int[ARR_SIZE];
    for( int i = 0; i &lt; result.length; i++ ) {
      result[i] = ThreadLocalRandom.current().nextInt( result.length );
    }

ForkJoin provides a class named ForkJoinPool as executor service for tasks. The constructor can be configured with the parallelism (number of threads) to be used. The default constructor takes the number of available processors as returned by Runtime.availableProcessors(). The pool is then given tasks for execution.

    ForkJoinPool pool = new ForkJoinPool();
    pool.invoke( new ArrayGenerator( result, 0, result.length ) );

The ArrayGenerator is a RecursiveAction. The RecursiveAction differs from the RecursiveTask mainly in the return value of the compute() method. It’s implementation is a straightforward recursive algorithm. First, there is an exit condition that solves the remaining problem sequentially. If that is not hit yet, the remaining problem is divided for two other RecursiveActions. Those are given to invokeAll, which blocks execution in this task until all subtasks are executed. In my experiments, the definition of the exit condition didn’t matter as long as all cores where busy at least once.

public class ArrayGenerator extends RecursiveAction {
 
  private int[] nums;
  private final int start, end;
 
  public ArrayGenerator( int[] nums, int start, int end ) {
    this.nums = nums;
    this.start = start;
    this.end = end;
  }
 
  @Override
  protected void compute() {
    if( arrayIsSmallEnough() ) {
      assignSequential();
    } else {
      int middle = start + (end - start)/2;
      ArrayGenerator left = new ArrayGenerator(nums, start, middle);
      ArrayGenerator right = new ArrayGenerator(nums, middle, end);
      invokeAll( left, right );
    }
  }
 ...
}

On my machine with 2 cores I achieved a speedup of 1.24 over the sequential solution. While that’s not as good as I hoped it still is a significant improvement that has the chance to move my clicks back down into the green area. I suspect that more cores could achieve a better speedup, so there is free lunch again once I design my program for concurrent execution.

Programming with this framework seems easy enough to me to see it adopted widely. However, we must rethink our problems and search for chances to parallelize.
I implemented the same thing with ThreadPoolExecutors and Futures. While the execution time did not differ there, it took me 3 times as long to implement it.

on Oct 23rd, 2009Tip: Computing the difference of two collections

Sometimes you have two collections and want to know how they differ. It would also be useful to have a series of steps that transform collection ‘A’ into collection ‘B’ (or the reverse).

private static List list1 = Arrays.asList("a", "b", "c");
private static List list2 = Arrays.asList("a", "c", "d");
 
// Diff of list1 vs list2:
//  removed 'b' at 1
//  added 'd' at 2

With a little help from the class Diffs (found in the org.eclipse.core.databinding.observable bundle / package), it only takes a few lines, as shown in the snippet below. Thank you, Eclipse Databinding!

If you don’t see the snippet click here.

on Oct 21st, 2009PDE Visualization is Available

Good news everyone, the Eclipse PDE team finally made the visualization component available for everyone.

pdeviz2 300x185 PDE Visualization is Available

To obtain it, use the Install New Software wizard in Eclipse and point to the correct repository.

repo PDE Visualization is Available http://download.eclipse.org/eclipse/pde/visualization/updates

pdeviz1 300x223 PDE Visualization is Available

The plan is to ship this as part of the Eclipse Helios release.

In its current state, the tool visualizes OSGi bundles only. There is some discussion about adding support for features and packages. If you’re interested in contributing to the visualization tool, please let the PDE team know.

If you find bugs or have feature ideas, please enter them in bugzilla.

on Oct 14th, 2009Eclipse Riena 1.2.0.M2 released

The Riena committers have just done it again: Riena 1.2.0.M2 is now out the door (download). Here’s the New & Noteworthy and the issues fixed in this milestone. Read on for my personal favorites:

  • New ridgets: ILinkRidget, IBrowserRidget, ITraverseRidget (for SWT’s Slider, Scale and Spinner widgets). Thanks to Florian from Redview for these contributions (snippets)riena new ridgets Eclipse Riena 1.2.0.M2 released
  • IComboRidget now supports  CCombo: the CCombo widget works much better with our marker framework, since it supports different background colors (the regular combo does not!). Markers use background colors to point out required or incorrect data. Check out the new CCombo demo in the playground.
    riena ccombo Eclipse Riena 1.2.0.M2 released
  • MasterDetails improvements: (a) the MasterDetails widget now has an ‘auto apply’ mode, meaning that any changes done in the details area in the bottom will instantly be applied back to the original model in the table (snippet)
    riena master details auto apply Eclipse Riena 1.2.0.M2 released(b) if you’ve edited the details and navigate away or hit the ‘New’ button, you’ll be warned that you’re about to discard your changes. If you find it annoying, you can also turn it off.riena master details confirm Eclipse Riena 1.2.0.M2 released
  • Automatically synchronize enablement state of a label and another widget: Riena now has a mechanism that keeps the enabled-state of a label and another widget in lock-step. Example: you have a Label with the id “labelName” and a Text widget with the id “name”. If the text field is disabled, the label will be disabled too. The default strategy looks for the “label” prefix to associate two widgets with each other (i.e. labelXYZ <-> XYZ). However you can use the labelfinderstrategy extension point to provide a different strategy, if desired.
  • riena labelfinderstrategy Eclipse Riena 1.2.0.M2 released

Kind regards,
Elias.

on Oct 14th, 2009Eclipse e4 1.0 M1 Released

Today, the Eclipse e4 project had its first 1.0 milestone release.

This is the beginning towards sprinting for the 1.0 final release.

The big new and noteworthy in this milestone is support for remote debugging of JavaScript and in particular e4 JavaScript bundles. The support is currently restricted to Mozilla Rhino, however in true Eclipse fashion, the JavaScript debug model and extension models are in place to allow supporting other JavaScript runtimes.

js debug 300x286 Eclipse e4 1.0 M1 Released

If you’re interested in Eclipse e4, here’s some resources:

Enjoy and please consider contributing to the e4 effort!

on Oct 13th, 2009Toast@Eclipse

Ever wondered about Eclipse as a runtime technology?

Wanted to know what this OSGi stuff was all about?

Thought that Equinox was just a really big cruise ship or that Toast was just for breakfast?  Well, now’s your chance to find out.

After a few hiccups and admirable efforts by Wayne Beaton and Sharon Corbett, the contribution of Toast to the Eclipse Examples project has been cleared and committed.

This is particularly exciting because it’s just in time for Eclipse Summit Europe‘s EclipseRT Tutorial and Symposium and the upcoming EclipseRT days (did I get enough plugs in there Ian?). Phew!

Why is this interesting. First, Toast is kinda cool in its own right. From client/server to fully dynamic to Google Earth integration embedded in a device and in a Rich Ajax Platform (RAP) application to provisioning using p2 and much more, there are tons of examples of what you can do with Eclipse technology. What’s better is that several projects in the EclipseRT community are stepping up to showcase their capabilities in the context of Toast. For you, the community, it means you can go and see how to use the various bits of EclipseRT function in real life.

The other milestone related to this is the Simon Archer, Paul Vanderlei and I just submitted the complete first draft of the OSGi and Equinox book to the publisher. You don’t need to wait however, you can get it now in electronic form.

© EclipseSource 2008 - 2011