TreeSheets – When an Outliner is not Enough

2. February, 2012

If a mind mapper is wasting too much space and an outliner is too restricted, try TreeSheets.

In a nutshell, TreeSheets is a mix between outliner, mind mapper and spread sheet. The documents use a nested structure of cells (like a spreadsheet where you can create work sheets inside of cells). Using this nesting, you can easily create outlines with multiple columns.

Using different rendering styles, you can recreate something very similar to a mind map, too.

And it needs only a little memory.


Fun With Generics: Return Anything

13. January, 2012

If you want to return anything in Java, you usually use Object – with Java 5 and autoboxing, this even allows to return primitive types.

But with Generics, you can do better: You can return whatever the caller wants.

How? Like so:

     public <T> T get() {
        @SuppressWarnings( "unchecked" )
        T result = (T) ...calculate the result...;
            
        return result;
     }

Use cases: Calling unknown methods or reading field values with the Reflection API. Instead of cluttering your code with casts, just write (where ReflectionUtils.invokeMethod() uses the trick above):

     Map<String, List<Map<String, String>> map = Maps.newHashMap();
     Set<List<Map<String, String>> entries = ReflectionUtils.invokeMethod( map, "entrySet" );

Cool, eh?

Unfortunately, Sun’s javac isn’t smart enough to determine a common upper bound between int and Object. So if you need to return int, you still need a cast:

     Map<String, List<Map<String, String>> map = Maps.newHashMap();
     int size = ReflectionUtils.invokeMethod( map, "size" );

Maven Tool 4 Eclipse 0.10.0 Released

12. January, 2012

I’ve just release a new version of Maven Tools 4 Eclipse (Changelog). It fixes the two most pressing issues:

  • Bug 367461 – [mt4e] mt4e needs priming.zip
  • Bug 354381 – Error: groovy.lang.MissingPropertyException: No such property: args for class: m4e.ImportTool

Have Fun!


DecentXML 1.4

12. January, 2012

I’ve just release DecentXML 1.4, my very own XML parser implementation.

See the change log for changes.

It will show up on Maven Central in a couple of days.


Closures and Bindings in Groovy

30. December, 2011

Mark Menard blogged about a hidden gem in Groovy which might be useful when you use closures a lot: Binding properties to a closure after the closure was created.

Remember, it’s simple to bind properties to a closure when those properties exist before the closure is created: Just define them. But how could you create a library of closures for user to consume?

def c = {
	println a // a isn't know here
}

def a = "Hello"

def binding = new Binding ()
binding.setVariable ("a", a)

c.setBinding (binding)
c.call()

As you can see, the property a isn’t known at the time the closure is defined. The binding allows to “inject” it later.

Groovy!


New Years Resolution: Stop being so agreeable!

30. December, 2011

How quick are you to say “sure, we can do that”?

Here are a couple of reasons to reconsider your attitude: Stop being so agreeable! by Erick Erickson.


Building BIRT with Tycho

27. December, 2011

If you want to see BIRT built with Tycho, vote for this bug: [Build] Migrate build to Tycho


Open Data ala Google

21. December, 2011

Some concepts are easier to understand when you see a graph. With HTML5, a lot of data and a bit of time, you can build a system that can visualize things like “live span over number of children” or the sources of energy over time. Interesting that nuclear power, renewable energy and energy from crude oil is about the same  level today.

This view seems to indicate that the GDP of a country starts to kick off as soon as each family has two or fewer children. But maybe it just shows that after financial constructs like derivatives and bonds allow to accumulate enormous wealth in a short time. “Correlation does not imply causation


64K on Stackoverflow.com

12. December, 2011
Image representing Stack Overflow as depicted ...

Q&A for professional and enthusiast programmers

Time for a little celebration: My reputation on Stackoverflow.com no longer fits into 16 bits. Yay ^_^

If you’ve been living under a rock: SO is the Q&A site for software developers. If you write software but don’t have an account there is like being a rock star who refuses to perform before an audience 😉

Stackexchange has now 74 sites for many topics: Photography, playing games or writing them, role playing, Unix/Linux, Ubuntu, writing, physics, astronomy, mathematics, English/German/Japanese/French/Spanish language, (La-)TeX, cooking, home improvement, SciFi and Fantasy, parenting, economics, and many more plus more than 450 proposed sites on Area 51.


Making openSUSE 11.4 Work on HP ProBook 5320m

11. December, 2011

If you have an ugly flickering screen when booting openSUSE 11.4 on a HP ProBook 5320m, then do this:

  1. You’ll need at least the package “xorg-x11-proto-devel” to build the driver (zypper install xorg-x11-proto-devel)
  2.  Download a working Intel graphics driver: xf86-video-intel-2.15.0.tar.bz2 (yes, there are other versions there as well and no, they don’t work)
  3. Unpack the archive
  4. cd xf86-video-intel-2.15.0
  5. Configure it: ./configure --prefix=/usr --libdir=/usr/lib64
  6. make
  7. as root: make install
  8. as root: Edit “/boot/grub/menu.lst” Add “nomodeset” to ever line which starts with “kernel”  and which doesn’t already have it
  9. Reboot.

Note: Do this remotely from a second PC – your eyes will be thankful. ssh and wget are your friends.