Using Java's XMLStreamReader PULL XML Parser

By dave

In this entry I show how to use the inbuilt Java XMLStreamReader PULL parser class to read an XML file. The XML stream libraries are PULL based XML parsers that do not load the whole document into a memory structure, so therefore are more suited to large volumes of XML. Below is an example XML file for a zoo, it contains...

Groovychart Bar chart with fixed colour

By dave

In this article I show an example of creating a bar chart with a fixed colour. This was missing from the groovychart example set, and will get included into the next build. If you are unfamiliar with groovy chart then here is an introduction to Groovychart We simply tell the plot's renderer to use the StandardBarPainter. This turns off the gradient...

Using Semaphore and CyclicBarrier in Java applications

By dave

In this example I show an usage of two more concurrent classes and ; which are both provided in the core Java library. There's a wealth of concurrency classes built directly into the JVM that can really simplify multi-threaded development. CyclicBarrrier to make threads wait for alignment. In the example below, I use a cyclic barrier to make several threads...

BlockingQueue producer consumer example

By dave

In this BlockingQueue example we show how to write a very simple producer - consumer with a blocking queue. This example generates SimpleAddition objects that require an addition of two numbers to be performed on the consumer thread. In this case the two values to be added are generated using java.util.Random's nextInt call. They are stored on the queue as a...

Impressed with Fedora 19 Linux

By dave

After 10 years of service, my old linux box finally gave up so I bought a basic tower to run Linux on. I've got to say that Fedora 19 was very easy to install and get working. Just as with Windows 8, I think the new Gnome 3 interface is an improvement once one is accustomed. Although I did tweak a...

Watching files in Java 7 with WatchService

By dave

In this article I show how to watch files and directories for additions/changes/deletions using the new file system support in Java 7. Finally, after years of native solutions, it is now possible to listen for file changes without resorting to OS specific solutions. In the code below, first we use the new file system support class to get a ...

NIO File operations in Java 7

By dave

Hot on the heals of the last article, interested in what other goodies may be in the new file IO package, and wanting to try the new catch block, I cooked up another example. In this example, I create a Path object for an example directory, into which I then create a file and write some text into the file. Some...

What a great summer we had in England

By dave

Over here in England we've had the best summer in some years. During a recent week holiday in Devon, we could as well have been in the French Riviera the temperatures were so high. I stumbled across a town called Lynton in the Exmoor region on the way back, and what scenery there - the valley of rocks is certainly worth...

Technological advances and AVR chips

By dave

Just recently I stopped to think about AVR's. There's something astounding about a chip that costs a couple of pounds and yet has a fully implemented processor, memory, flash, serial IO, ADC and reprogrammable ROM. Just think that's basically almost as powerful as an old 8 bit computer from the 80's in an 8 pin DIP package. To put that in...

Remove duplicate 'contact' heading in Joomla contact form

By dave

This is historic legacy content, left in case it is of use to someone. We prefer to mark old content as deprecated. In this article I show you how to remove the second 'contact form' header from the default contact form in Joomla without hacking your install. I'd seen a couple of videos on you tube that suggested one should alter...

These may be of interest

We use cookies to analyse traffic and to personalise content. We also embed Twitter and Youtube on some pages, these companies have their own privacy policies.

See the privacy policy and terms of use of this site should you need more information or wish to adjust your settings.