Loading

Tag Archives: api

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 [...]

Example of XBee API frames

Some examples of XBee API Frames.
Modem status frame
7E 00 02 8A 06 6F

7E: API Frame
00 02: Length
8A: Modem status
06: Coordinator started
6F: checksum FF – ((8A +06) & FF) = 6F

AT Command API Frame: MY

7e 00 04 08 52 4D 59 FF

7E: API Frame
00 02: Length
08: AT Command Frame id
52: Frame id
4d 59: MY (4d [...]

How to hide/remove the Save, Undo and Redo buttons on the Toolbar (Netbeans Platform)

The default Netbeans Platform Application generated by the Netbeans IDE wizard has the Save, Undo and Redo button showing up in the toolbar by default.
Since my applications doesn’t have anything to save I decided to hide those buttons.

I turns out that remove them is really simple, I knew that I had to fiddle with [...]

Google maps is easy

I decided to give a try to Google Maps API and I found it pretty easy. Currently I’m looking for a jiu-jitsu school near Madrid so I decided to pinpoint all jiu-jitsu schools in a google map. I’ve got the school addresses in this page and put those directly in the page using the geocoder [...]