To package an eclipse plugin project as Jar, you do not use "Export"->"Jar", but the "Export Wizard" in "Plugin Overview".Don't ask me, what the difference is. Eclipse is an over-engineered pile of crappy code.
Wednesday, September 24, 2008
Packaging Eclipse Plugins
Thursday, July 17, 2008
Plots in Eclipse
I'd like to display a plot in my SWT Eclipse plugin. Laurent Mihalkovic in the newsgroup gave me two suggestions.
BIRT Chart module
So my little plugin should depend on the BIRT Framework? That seems too much. So far i haven't even managed to install BIRT, because it depends on Tomcat, Apache Codecs, EMF, and more.
JFreeChart with SWT bridge
JFreeChart is a Swing component, so no SWT support by default. There are two solutions:
- use the SWT_AWT bridge of Eclipse, but this is buggy and problems with redraw calls for example
- use the experimental SWT port of JFreeChart
Saturday, July 5, 2008
Wrong defaults
Rails champions Convention over Configuration and made the principle popular.
Java has many things, which are exactly backwards. Currently i'm writing an Eclipse plugin, so i use the SWT GUI library. SWT has a rich set of layouts (this is nicer and more flexible than e.g. GTK!).
For performance reasons they decided to layout explicitly. So if you delete and insert widgets into Composites nothing moves around on the GUI unless you call layout(true).
I think it would be nicer to trade performance for ease of use. It took me some hours to get it (mostly) right. I fought bugs like disappearing widgets. Why not make the layout auto-update and give the programmer the possibility to disable it?
Monday, June 30, 2008
Eclipse plugin development sucks!
There is the JavaDoc, which doesn't help me with the overview and doesn't tell me how to do things like "remember some preferences for each project".
There are a handful of examples. They are helpful, since you would be totally lost without them, but they only help for the first step.
There is the stuff Google finds in Mailinglists and blog posts, but that isn't much. Some Python web frameworks have more bloggers talking than Eclipse.
The Eclipse community doesn't seem to bother about newbies or newbies don't use Eclipse.
Sunday, June 15, 2008
Use the force Luke!
It is a good thing to force the programmer to do the right thing. Power is not the ultimate goal.
Lisp programmers rave about the power and versatility of their language, while the enterprisey developers are horrified of the unmaintainable mess they create. They have a point. Programmers can discuss hours about where to put the braces or how to indent blocks, so even small differences matter.
Python is often critizised because of the significant whitespace, but i think it is a really good idea to force the programmer to indent their code correctly. Just like it is a good idea to force the programmer to use garbage collection.
There are always edge cases, where you want to break those chains. Significant whitespace sucks, when you post code on websites, which destroy the whitespace. Garbage collection isn't good enough for hard real-time uses. So it's ok to offer a way out, but in general it's a good thing to deny the programmer the choice.
Note that this leads to a contradictory situation. It is a good thing that Java forces you to write object-oriented code, but object-orientation is not a good idea in every case. The conclusion is that Java is not the best language for every case. That's also the reason, why we want many interoperable languages on the same virtual machine.
Thursday, May 29, 2008
(x+1 < x)
Is (x+1 < x) always False?
Not with C integers. So what should a Compiler do with this program:
#include <stdio.h>x+1 in this case is 0x80000000, which is negative and thus less than 0x7fffffff. Here is the output from different compilers:
int main(void) {
const int x = 0x7fffffff;
if (x+1 < x) {
printf("This should be printed!\n");
}
}
$ ./overflow_icc # Intel compiler
This should be printed!
$ ./overflow_gcc # GNU Compiler
$ ./overflow_llvm # LLVM Compiler
This should be printed!
As you can see gcc has probably set (x+1 < x) to False and thus optimized the if away. This is wrong.
Wednesday, May 21, 2008
Install CUDA on Ubuntu 7.10
It took me some time to figure out, how to install CUDA on Ubuntu. Here are my (cleaned up) notes.
I used Ubuntu 7.10, because i had the install CD lying around and installed it on a PC with a GeForce 8600 GTS, which is cuda-enabled.
- DON'T install the restricted nvidia drivers! If you already did, uninstall them! They are too old (100.14), instead
- use Envy legacy (or EnvyNG on Ubuntu 8.04 or higher) to install the newest Nvidia driver (169.09 or higher)
- download the CUDA Toolkit and the CUDA SDK
The rest is described in the CUDA docs as well, but i'll list it here anyways.
- install the Toolkit to
$HOME/cuda - install the SDK to
$HOME/NVIDIA_CUDA_SDK - Change your environment variables by editing your .bashrc
export PATH=$PATH:$HOME/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/cuda/lib - Use a new shell and
cd $HOME/NVIDIA_CUDA_SDK makebin/linux/release/deviceQueryshould print something likeThere is 1 device supporting CUDA
Device 0: "GeForce 8600 GTS"
Major revision number: 1
[...]
Clock rate: 1458000 kilohertz
Test PASSED
Enjoy!