Loading

Tag Archives: library

STaX: OutOfMemoryError when parsing big files

Java 6 includes STaX , when I tried to parse a Evernote backup file with it, I got a “OOME” error.

java.lang.OutOfMemoryError: Java heap space
at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:205)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.refresh(XMLDocumentScannerImpl.java:1520)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.invokeListeners(XMLEntityScanner.java:2070)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:486)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2679)
[...]

Adding support for opening dot files to GraphBrowser

I spent some time on GraphBrowser, starting off the project, the first step has been to add basic support for opeining Graphviz DOT files.
There are already some pages on the net talking about how to add open file support for new file types in NetBeans.

File Type Integration Tutorial

So there is no need to [...]

GraphBrowser

I decided to start a small project trying to port the GUESS framework into Netbeans RCP.

The plan is to replace the GUESS own graphical library with Netbeans Visual Library stuff and replace the GUESS Python like interpreter with something more along the lines of JSR 223 Scripting for the Java Platform.
For the moment I [...]

Painting LabelWidgets on top of the ConnectionWidget – Netbeans Visual Library

I was fiddling with the Netbeans Visual Library again, trying to show a complex graph on screen and I run into a problem: There were so many connection in the graph that some widgets were hard to read because the ConnectionWidget arrows were printed over them.
So I tried to I try to rearrange the [...]

NullPointerException in FontDesignMetrics$MetricsKey.init when using Netbeans Visual Library

If you’re getting a NullPointerException stacktrace like the one below while using the Netbeans Visual Library to create your own GraphScene, check that your adding your widgets propertly to scene. A good idea is to use LayerWidgets, declaring them in the constructor of your GraphScene:

mainLayer = new LayerWidget(this);
addChild(mainLayer);
connectionLayer = new LayerWidget(this);
addChild(connectionLayer);

and then add the widgets [...]

Arduino library for MMA7260Q (Tilt Sensor)

In the past days I published a couple of arduino libraries. All coming from by XBee sensor development. I’m still waiting for the MAX756 to arrive from Futurlec, I need the MAX756 to power the xbee sensor with batteries and mount it in its final position. So in the meanwhile I’m cleaning a little bit [...]

Arduino Library for Hmc6352

As part of my Xbee sensor project, I created an object oriented API to access HMC6352 compass functionality and I decided to make it downloadable as an Hmc6352 Arduino Library.
Just unzip the file in the $arduino_home/hardware/libraries/. At the end you should end with $arduino_home/hardware/libraries/Hmc6352.
The library includes an example on how to use it (in File [...]

DS1620 temperature sensor library for Arduino

I talked about the DS1620 in a previous post. Now I created a DS1620 library for Arduino that has a more object oriented interface. The library has to be unpacked in the $arduino_home/hardware/libraries directory. After unzipping the library you should end up with a $ARDUINO_HOME/hardware/libraries/ds1620 directory.
The library contains an example that can be accessed [...]

Arduino XBee sensor (temperature, tilt, compass, and ambient light)

I finally put together an Arduino Pro Mini, the XBee, the MMA7260Q, the HMC6352, the TEMT6000 and the DS1620.
This is how it looks like on the prototyping board (ugly, I know)
Hopefully it would look better when I move it to the PCB. But before doing that I need to get the battery power set up. [...]

Force Directed Layout in NetBeans

I just came up with the idea of reproducing the GraphView demo I saw in prefuse by using the Netbeans Visual Library API.

The GraphView demo uses a Force Directed Layout algorithm to dinamically position the nodes on the screen. It’s really fast and cool. Download prefuse and experiment with it by yourself.
I [...]