13.9.07

LINQ is great but is 20 years too late

LINQ is the Language-Integrated Query. Microsoft has the LINQ project running for integrating database queries into C#. Sort of looks like this (example taken from DevelopMentor):

IEnumerable < Product > prodQuery =
from p in db.Products
where p.Category.CategoryName == "Beverages"
select p;


Sort of this is what I'm missing for long in Java!!!
Before getting to euphoric about the idea behind LINQ, one should consider a solid and very mature system as SAP (to be exact: the SAP base module, BC).
SAP' native language ABAP supports direct query code to be part of an original ABAP code. I think this is possible since about 20 years.

Congrats to Microsoft and others for not recognizing the need for language-integrated database queries earlier. At leats LINQ adds an additional benefit for querying collections in an SQL-like manner.

12.9.07

JGAP 3.2.2 released: Java Genetic Algorithms and Genetic Programming Package

JGAP is a Java Genetic Algorithms and Genetic Programming Package which allows to utilize evolutionary algorithms for solving complex problems.
Version 3.2.2 of the open source Java enginge is out now!

Many examples included as well as a cool Robocode sub project.

RobocodeJGAP 0.2.1 published

RobocodeJGAP is a genetic programming approach to evolve full-blown Java programs, acting as virtual robots on the popular Robocode platform.

RobocodeJGAP utilizes the genetic algorithms enginge JGAP.

For more information on RobocodeJGAP see http://jgap.sourceforge.net/doc/robocode/robocode.html

Or see further information about Robocode

21.6.07

URLEncoder/URLDecoder way too slow

As I recently found out by trying, the methods encode in java.net.URLEncoder and decode in java.net.URLDecoder are way too slow.
Following an advice, I replaced these calls with encode and decode from class org.apache.commons.codec.net.URLCodec which is part of the Apache Commons Codec library.

Running the same application with Java's built in coding logic and another time with Apache's, showed me that Apache's solution is about 10 times faster (round about, this is not an official statistic, but should give a quite good estimation).

In my project JGAP (Java Genetic Algorithms Package) the versions up to 3.2 RC2 run with the slower mechanism, while the currently available CVS version uses the improved solution.

If you like JGAP I would be grateful if you voted on Sourceforge for JGAP as the project with the best user support. Please try out yourself by posting a (hopefully qualified) question. Also see the myriads of unit tests JGAP offers as well as the near-to-complete Javadoc and the many examples!

13.2.07

Java Genetic Algorithms Package 3.2RC1 released

JGAP is a Genetic Algorithms and Genetic Programming package written in Java.

JGAP version 3.2 Release Candidate 1 represents major feature enhancements, including:
  • Genetic Programming enhancements
  • A complex Robocode GP example for evolving pure Java code
  • Improvements in the grid logic (especially concerning the architecture)
  • A lot of new unit tests (currently we count over 1300 unit tests)

This version is quite mature. It is a prerelease before the final version will be published. The intention of this release is to make the new functionality available as soon as possible. Feedback from you is always welcome and necessary to still raise the quality of JGAP in the future!

This release can be downloaded here: http://sourceforge.net/project/showfiles.php?group_id=11618&package_id=48940

For more information visit the JGAP homepage at http://jgap.sourceforge.net

Feedback is always welcome.

31.1.07

JGAP goes Robocode

Newest developments and a great user feedback made JGAP play together with Robocode.
Robocode is a platform for letting compete programs (robots) by moving around, scanning the environment and shooting each other virtually.
JGAP is a Genetic Algorithms and Genetic Programming (GP) Package for Java and is open-source.
It is used to evolve a robot program code as good as possible by using the GP functionality of JGAP. This is time-consuming but results are quite impressive! In the future, the JGAP Grid functionality will enable distributed evolution of complex and thus hopefully successful robocode's :-)

14.1.07

Sourceforge CVS is stuck with WinCVS

For several weeks now I noticed great difficulties when trying to access the sourceforge CVS of my project with WinCVS (any version!). Don't get me wrong, it worked for years! But since a while I even get a long delay on WinCVS startup. Not to mention the really long time it takes checking in something.

OK, it could be that my system's configuration is not playing together with sf's CVS. But why, then, does Tortoise CVS work great on my system?

Some forum posts in the internet recommend removed the tcl84.dll reference but this is not a problem on my computer! Another post talked about a sf IP address of the blacklist. However, can anybody tell me what's going on there?

3.1.07

JGAP 3.1 released

JGAP is a Genetic Algorithms and Genetic Programming package written in Java.

JGAP version 3.1 is a quality improvement release.
It considers multiple user feedback by consolidating the grid functionality, fixing several bugs, introducing a lot of new unit tests, and enhancing the logic of many classes.

This release can be downloaded here:
http://sourceforge.net/project/showfiles.php?group_id=11618&package_id=48940

For more information visit http://jgap.sourceforge.net

Klaus Meffert for the JGAP team

Technorati tags:

25.9.06

JGAP 3.01 released: Grid functionality

JGAP is a genetic algorithms and genetic programming package written in Java.

JGAP version 3.01 adds grid functionality to the code base of release 3.0. With that you can build your own grid in LANs.
A grid hosts a server, one to many workers, and one to many clients. A client can send work requests to the server, which in turn splits the work and provides the workers with corresponding tasks. After a worker finished a task the result is sent back to the server, which finally sends each received result back to the requesting client. The package used for grid functionality is jcgrid, another open source project.

This release can be downloaded here:
http://sourceforge.net/project/showfiles.php?group_id=11618&package_id=48940

For more information visit http://jgap.sourceforge.net

1.9.06

JGAP 3.0final released

Today, JGAP 3.0final has been released. JGAP is a genetic algorithms and genetic programming package, which is easy to use and which is delivered with ready-to-use components, such as genetic operators, selectors and examples.

Try it out now, this version contains many improvements.

Feedback is very welcome :-)

3.6.06

German JUnit book released

Just these days my junit book was released and can be ordered at Amazon.

Information about the book can be found at the book's official homepage.

As said, the book is written in German, but maybe some of you can handle this :-) The homepage contains some information about it and links to some english articles that may be of interest.

25.5.06

Faster than light... this time not with Java

Isn't that awesome! Light can predict the way it will take (or, to adapt this statement to the new findings: ... it had taken in future).
Quantum physics has not been mentioned in the article but it is definitively sort of issue QP will have to cope with.

This is not related to Java in any way but it's so gorgeous that it's worth an entry :-)

28.4.06

JGAP 2.6 released

Some days ago, JGAP 2.6 has been released. JGAP is a genetic algorithms package, which is easy to use and which is delivered with ready-to-use components, such as genetic operators, selectors and examples.

Try it out now!

In the CVS you already find code to solve problems using Genetic Programming (see directory gp-src).

Feedback is very welcome :-)
PS: The German junit book references JGAP several times when it comes to sample projects utilizing JUnit.

19.4.06

Common Annotations for Java (JSR 250) shamefully approved

After several protests of mine to avoid the finalization of JSR 250 (Common Annotations for Java), now the Executive Commitee has shamefully approved that JSR.

Thanx Doug Lea for adding a comment to his vote the first time I can remember. He wrote: "Underwhelming but innocuous". Then, Doug, you better voted with "No", please. That would have raised your reputation a lot...

Anyone, please read the lousy specification and judge for yourself. Or, as Apache Foundation commented its vote: "I hope there's enough production-tested, real-world experience behind this... :)".

I think there's a general problem with the JSR process (or the EC members) if the committee members vote as they did yesterday!

10.1.06

Anybody using JUnit's ExceptionTestCase ?

To write a unit test that expects an exception of a particular type to be thrown is possible by using JUnit's class junit.framework.ExceptionTestCase. However the usage of this class (that inherits from junti.framework.TestCase) is ugly (details such as import statements omitted):

1. Test class
public void MyTestCase extends ExceptionTestCase {
public void testXYZ throws Exception {
MyClass myObj = new MyClass();
myobj.doXYZ(); //throws MyException
}
}

2. Test suite
public void MyTestSuite extends TestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("description");
suite.addTest(new MyTest("testXYZ", MyException.class));
return suite;
}
}

I've never ever seen such a stupid thing. Maybe that is the reason for ExceptionTestCase currently not being existent in JUnit 4's CVS version.


Also see the JUnit book for further information.

27.12.05

The deadline

Motivated by a current project with late hours of work, this text resulted. In this project, there was a deadline until the productivity start had to happen. Of course, this deadline was given by higher instances not knowing about the work done by the divisions below them (development, operating department).
Most of you should know this scenario. Many of you, I guess, have read the excellent book The Deadline: A Novel About Project Management by Tom DeMarco.

What was the result of that impossible deadline (of course, some time later it came out that it was impossible getting ready to that end date. Early enough to move the deadline to a later date) ?
Exactly sort of things described in the remarkable blog entry IT Survivors - Staying Alive In A Software Job from Harshad Oak, which I much appreciate:
  • 6 workdays/week
  • 12+ hours a day (some freaks had the need working 15 hours...)
  • Highly-dynamic decisions (some few hours before Friday's closing time came the request from the project leader to work on Saturday)
  • A 15-hours-a-day collegue expected the others to work as long as he did
  • Some collegues being on the edge
  • Irritated glances at colleagues not being available for a meeting at 20:00 o'clock
  • Shortly announces meetings (some few minutes before)
  • No plan at all....

3.12.05

JGAP 2.5 released

Yesterday, the new version of JGAP has been released. JGAP is a genetic algorithms package, which is easy to use and which is delivered with ready-to-use components, such as genetic operators, selectors and examples.

Try it out now!

There are many references available. Check out the JGAP references page

14.11.05

Console Outputs in Unit Test

During the review of several unit tests in different projects, there are usually tests containing output statements (such as System.out.println or file output). My initial opinion to outputs in tests, especially to console outputs, is that they should be avoided in any case.
When thinking further, it seems to me that gathering data in a file could be legitimate for some situations. But console output still should be avoided in general. The assertXXX-methods or the fail-method allow for displaying any message the developer wants. So outputs to other channels (console, file etc.) need a different motivation.

What could be the motivation for a console output? Maybe to display informal messages to the developer, such as warnings or pure information. For the latter, the motivation seems not strong enought to me for justifying the console output. For the former, I could image that for such console output certain circumstances could apply of which I could not name one concretely, now. However, instead of using warnings, a unit test should fail or not fail, nothing in between, IMO. A unit test should have the chance being fine-grained enough to fulfill this postulation quite easily.

For file output or related (such as sending an email to an admin, although I have not seen this in any unit test, luckily) one could think of keeping track of statistical data to recognize a "tendendy" of behaviour, e.g. for logic depending on pseudo-randomism such as hashcodes.

To conclude, I still think in most cases it causes more harm than do good using console or file outputs.

Do you have an example where such output would be justifyable in a unit test?

19.8.05

Online survey for JCP program

This is the opportunity telling your opinion about the JCP program, including the Java Specification Requests (JSR's). But consider taking some time as you will be occupied with the questionaire for several minutes.

To the JCP online survey.

Update: the JCP online survey is closed now.

17.8.05

JSR 220 compared to JSR 250

Recently, I wrote about JSR 250, having a poor quality IMHO. Apologies for writing again about it, but as I saw the draft of JSR 220 (Enterprise JavaBeans 3.0), I felt the force to do so.

Just have a look at the public review available. It is structured so clearly, wonderful! The goals are stated in a clear, extensive way at the beginning of the document. Such could be expected of any JSR. Then read JSR 250. Be sure to also check the comments given in the public review ballot of JSR 220 and of JSR 250. Notice the slight difference. For JSR 220, JBoss congratuated "to the JSR-220 EG for delivering such a quality specification." This is the first time I read such positive comments for a JSR (maybe I did review too few of them, who knows).

Several thoughts came to my mind after the comparison:
  • The importance of a JSR will probably influence its quality.
  • The person leading the specification will have a great influence on the later outlook and quality of the JSR.
  • As some persons participated in both JSR's, it's unlikely that they influenced the work significantly.