Technological advances and AVR chips

By dave on May 19, 2013

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 some perspective, the old 8 bits had countless support chips and their power requirements would be well in excess of any of the ATTINY range of Atmel's chips.

Remove duplicate "contact" heading in Joomla contact form

By dave on March 9, 2013

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 the underlying installation. You can do this without altering the installation. The problem Just to make sure we are talking about the same problem. I am discussing the situation where when creating a default Joomla contact form, there are two headers, which by default will look something like the image shown.

Formatting numbers using NumberFormat

By dave on July 1, 2012

java.text.NumberFormat is the class used to convert numeric values such as int, long and double into Strings. It has been around since the early days of Java, and generally performs well. Especially if you cache an instance of the class for repeated use. IMHO the only down side to using NumberFormat is that it can look a little verbose. To get hold of a copy of the NumberFormat class, call one of the static factory methods on the NumberFormat object:

Generate an ATOM feed with GroovyBuilder

By dave on July 1, 2012

Lastly, we look at building an ATOM document using the same principles. ATOM provides a means for site owners to provide updates to site users. It works by providing an XML document showing recent changes to the site. Browsers that support RSS and RSS readers can then highlight these changes to users. An atom formatted document contains two main sections, the header which describes the feed, and then a list of elements, that describe the content.

Introduction to GSQL (Groovy SQL)

By dave on July 1, 2012

In this article I cover working with SQL from Groovy using the GSQL support built into the language. This is not a complete guide, rather a getting started guide, that shows you a few of the concepts. Firstly, GSQL is built on top of JDBC; which you are probably already familiar with. If not there are many good web guides and books on the subject. Lets get started looking a how to configure up GSQL and execute some statements.

Reading a GZIP file using Java

By dave on July 1, 2012

Another common compression file format on Linux is the GZIP format. Java again has out of the box support for this file format. Gzip files differ from zip files in that they only contain one file, the compressed form of the original file with a .gz extension. Java’s GZipInputStream takes such a file type and decompresses it. We can treat GZipInputStream directly like a FileInputStream. Here is an example that expands such a file to disk

Reading a zip file from java using ZipInputStream

By dave on July 1, 2012

Java provides support for reading zip files in the form of ZipInputStream. This class provides an API where you can iterate over all the items in a given zip file, reading the data from the archive for each file. In order to do this, first you must create the ZipInputStream instance giving the file that you wish to expand. Then you iterate using the getNextEntry method on the stream, which returns the header data for each entry in turn.

Reading XML in groovy using XmlParser

By dave on July 1, 2012

Groovy has great inbuilt xml support, and allows you to treat xml paths like objects. Reading elements and attributes is so straightforward that it was one of the factors that got me started with Groovy. So to build an object tree from xml, we just use the XmlParser class. To dereference an element we use normal dot syntax, for an attribute, simply add the at symbol (@) before the name, see the example below.

Setting up role based security in tomcat

By dave on July 1, 2012

Tomcat and most other Java JEE servers support role based security, form based authentication and SSL. These technologies are integrated into your web application declaratively. At first the configuration for this security can look a little daughnting but once understood it is actually not difficult to configure. This article is split over several pages and requires an understanding of tomcat and how a JEE webapp is structured. Most of the article is structured towards tomcat, but if you use another application server, many of the concepts are the same.

Using thread local in Java

By dave on July 1, 2012

This article assumes that you are already familiar with concurrent programming and design. Java 1.5 introduced the concurrent library java.util.concurrent, which provides an extensive set of classes for dealing with concurrency issues, these sit alongside some existing classes that have been around since earlier times. I've noticed that some of the classes I mention here don't get used as often as they should, especially given that they are quick wins. This article only scratches the surface of the new classes available, but should provide a starting point for further reading.

This site uses cookies to analyse traffic, and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.

Send a message
X

Please use the forum for help with UI & libraries.

This message will be securely transmitted to our servers.