Scoping can be thought of as “the extent of information hiding.” In other words, scoping tells you where variables and methods can be seen from. Java has a neat approach to this that is both expressive and organized. All variables are associated with a scope. Any single scope can be called a namespace. The use
September 06, 2011
One of the powerful features of the PDF file specification is the support for transparency in the Canvas. When an image is drawn on the page, the image can have an alpha setting which defines how transparent the image is. The value is between 0 and 1 (where 0 is totally invisible and 1 has
August 16, 2011
Anti-aliasing is the processes of making the edges of lines on shapes or text less jagged. This is done by fooling the eye – intermediate pixels are added to smooth the color transition. So you might add some grey pixels between a black and a white point. It is very common in computer applications and
August 02, 2011
Access to PDF files can be secured so that not anyone can open them. This is achieved by encryption – the bytes int PDF file are actually scrambled using a unique key – you will need a key to convert the PDF data back into something which can be opened. This is a clever way
July 19, 2011
One great question on StackOverflow is essentially, “What is method overloading for?” Method overloading, or function overloading, is a feature in some programming languages that allows multiple methods to be made with the same name, but each able to handle different types of input. Method overloading can add expressiveness, conciseness, and awesomeness to any script.
July 07, 2011
We have a few different examples packaged up in JPedal that can be started by setting system properties with the -D flag from the command line. I thought it would be interesting to get these to run in the same way as you expect other programs to run with installers, continue buttons and all that good stuff. In this article I’m going to package up JPedal with a view to run the ContentExtractor example.
If you want the ContentExtractor to run from the command line you type java -jar -Dorg.jpedal.ContentExtractor jpedal.jar. The JVM then knows to call the main method in that class as opposed to the one specified in the jars manifest. I’m going to get it to run as a Mac package.
June 13, 2011
Jetbrains have released version 10.5 of their commercial Java IDE. I currently use version 10.0 so was intrigued to see what a 0.5 update meant. I downloaded it to try. Here are my first impressions:- 1. Speed is better. In the days of IDEA 5.0 it was the quickest tool around but since then performance
May 31, 2011
May 17, 2011
When you run a Java application, there is usually a fixed maximum amount of memory which is available. This is usually 64 megabytes of memory. So if you run a java program from the command line like this, the program can use a maximum of 64 megabytes of memory (this is the default). java -jar
May 03, 2011
Drools Planner is a sub project of the Drools project that started 4 years ago as Drools Solver. Drools Planner is focused on “NP complete” planning problems where a solution is hard to find, but easy to prove feasible once found. Examples include scheduling, bin packing and timetabling for instance. Drools Planner is particularly good at larger ones with lots of constraints, such as a staffing/roster problem where they are many roles and constraints as to who can be scheduled when. Drools Planner has a number of live projects and over 2,000 downloads of the 5.1 release (probably a lot more). It is not currently “productized”, meaning you can use it (under the open source Apache License) but you cannot buy “official” support from Red Hat yet (unlike for Drools BRMS for instance).
April 19, 2011