Showing posts with label announcement. Show all posts
Showing posts with label announcement. Show all posts

Wednesday, May 1, 2013

New CrNiCKL version addresses issue with JUnit and Java 7

Version 1.2.1 of crnickl was released yesterday April 30, 2013. It comes with a small improvement to the API and addresses a problem with unit tests under Java 7

API improvement

The Database interface declares a new method named makeSurrogate to turn a string into a Surrogate. The string is typically produced by a surrogate's toString method. It was previously not possible to create a surrogate from such a string without making some assumptions and using low-level methods.

Issue with JUnit and Java 7

JUnit tests written with JUnit are usually short pieces of code which can be run independently of each other. However, when writing test cases for a database system, it is often handy to assume that test methods are executed in a predictable order, for example in source code order. Under this assumption, a first series of test methods populates the database, followed by a series of methods which modifies the data, and finally a series of methods which deletes the data.

Making this assumption was fine until upgrading to Java 7. The new implementation of the reflection API differs from its predecessors in such a way that JUnit now executes test methods in seemingly random order. This wreaks havoc when the order of tests is important.

To address this issue the @FixMethodOrder annotation has been introduced in JUnit 4.11. It can be used to force execution of test methods in alphabetical order.

Version 1.1.0 of crnickl-test uses this new annotation and renames some methods so that source order and alphabetical order agree. crnickl-test is a library providing common tests for all database drivers and is used by crnickl-jdbc and crnickl-mongodb.

The software can be found on GitHub and in Maven Central.

CrNiCKL project website

Tuesday, January 22, 2013

CrNiCKL driver for MongoDB released

A CrNiCKL driver for MongoDB was released yesterday. With this first NoSQL driver, developers have now the choice to run CrNiCKL services either on SQL or on NoSQL databases. A NoSQL database can be a good solution for accommodating huge datasets or to address replication or sharding requirements. On the other hand, when data integrity is paramount, it is better to stick with a good old SQL database and use the CrNiCKL driver for JDBC.

The drivers can be found on GitHub and in Maven Central.

CrNiCKL project website

Saturday, September 8, 2012

The Time2 Library and CrNiCKL now in Maven Central

The projects artifacts are now deployed to Maven Central. It is not necessary to specify a repository in the settings or POM files any more. Using this software with maven is now 100% straightforward.

Time2 Library
CrNiCKL database

Wednesday, August 29, 2012

The Time2 Library and CrNiCKL support Maven

Yesterday, I moved some of my Java projects to Maven. There is no difference from a client point of view. The new JARs are plug-compatible but not identical, so checksums have changed. This is the only reason why minor version numbers have been +=1d.

The software is not yet available from The Central Repository, but can be found in a freely accessible maven repository on GitHub. To use it, specify this in your POM or settings:

<repository>
  <id>jpvetterli on github.com</id>
  <url>https://raw.github.com/jpvetterli/maven-repo/master/releases/</url>
</repository>
Links:
Time2 Library project
CrNiCKL database project

Tuesday, July 17, 2012

CrNiCKL 1.1.0 released with all delete methods renamed

There were quite a few methods named delete in the CrNiCKL software. This was a bad idea because such methods are useless when called from JavaScript. Indeed, delete is a reserved word in js.

All such methods have been renamed and a new version of the software has been released to the project website, to SourceForge and the GitHub repositories. The following scheme has been used for renaming. Parameterless delete methods are now named destroy. The others are now typically named deleteFoo where Foo is the type of (one of) the parameter(s).

I decided to completely eliminate the old methods rather than let them live a bit longer as deprecated. I did it because the software is not yet used out there. In case I misread the stats, please accept my apologies. In any case the previous version remains available on all the websites mentioned.

Friday, July 13, 2012

Source code sharing

Since a very long time I wanted to switch to the git version control system. It's now done. Compared to what I've used in the past: cvs, sccs, rcs, vss, sclm, Librarian, and maybe others I have forgotten, I like git better. I don't know why I waited so many years...

Although the source of the projects I discuss in this blog was already available for downloading via the project websites, it can now be browsed more comfortably at GitHub.

The relevant repositories are:

time2lib
for the Time2 Library
crnickl
for the CrNiCKL base system
crnickl-jdbc
for the JDBC support of CrNiCKL
crnickl-demo
for the CrNiCKL demos

The game of the name

The ChronoDB project has been renamed CrNiCKL. I noticed a naming conflict with an unrelated product and decided to change the name when it's still harmless.

Chronicles are the most important objects in the ChronoDB CrNiCKL database. So I started from them to find a new name. I settled on CrNiCKL because it can be pronounced like "chronicle" and there are practically no hits for it in Google. I also decided to write the name with most of the letters in uppercase, so it stands out in text.

The software remains available under its old name, for a while at least, but won't be updated. Blog posts related to ChronoDB will not be updated but will get a notice about the rename.

The new project website is http://agent.ch/timeseries/crnickl/.

Wednesday, July 11, 2012

Time2 Library project home page updated

The marketing departement has just updated the home page of the Time2 Library project with the following quote of the day:

If you need speed, compactness, and flexibility, then the Time2 Library is for you. There is no trade off. Even with the wildest time domains (calendars if you prefer) a time point is just a number. In many cases it is even less than that: it is an array index. The flexibility comes into play only if and when needed, for example when printing or scanning a date.
Wow.

Monday, July 9, 2012

ChronoDB and geographical coordinates


Important notice. On July 13, 2012, the ChronoDB project was renamed CrNiCKL, which is pronounced like "chronicle". All packages, demos included, have been renamed. The new project website is at http://agent.ch/timeseries/crnickl/. The old project remains accessible for a while at http://agent.ch/timeseries/chronodb/. The remainder of this article remains valid mutatis mutandis.

I've just released another ChronoDB demo to show how to set up a database with time series of geographical coordinates. The demo can be found in the package ch.agent.chronodb.demo.geocoord in archive chronodb-demo-1.1.0.jar at the ChronoDB project website or on SourceForge.

GeoCoord is a toy Java interface for geographical coordinates, with three methods:

boolean isNear(GeoCoord coord); boolean isNear(GeoCoord coord, double distance); double distanceTo(GeoCoord coord); In the demo, GeoCoords are implemented as cartesian coordinates. The glue with ChronoDB is provided by a simple value scanner GeoCodeValueScanner and a less simple implementation of ValueAccessMethods<GeoCoord> named AccessMethodsForGeoCoord. The Database class itself is so small it can be listed completely here: package ch.agent.chronodb.demo.geocoord; import ch.agent.chronodb.jdbc.JDBCDatabase; public class GeoCoordDatabase extends JDBCDatabase { public GeoCoordDatabase(String name) { super(name); setAccessMethods(GeoCoordValueScanner.class.getName(), new AccessMethodsForGeoCoord()); } }

To make things interesting the demo uses a special time domain, with time points at 7:00 AM, 9:00 AM, 3:11 PM, and 9:33:20 PM every Monday, Tuesday, Friday, and Saturday. For a refresher on time domains, please have a look at my previous post.

Here is what running the demo looks like (commands are on a single line and output has been truncated):

$ jar xf chronodb-demo-1.1.0.jar lib $ java -cp chronodb-demo-1.1.0.jar \ ch.agent.chronodb.demo.geocoord.GeoCoordDemo Resources/geocoord.parm 2012-04-09 09:00:00 8151km (machin) 2012-04-09 15:11:00 7000km (machin) --- clip clip --- 2012-07-09 07:00:00 7053km (truc) 2012-07-09 09:00:00 8367km (bidule) 2012-07-09 15:11:00 9582km (bidule) 2012-07-09 21:33:20 6889km (machin) $ The exact figures vary with each run because the data is random.

Wednesday, June 27, 2012

The ChronoDB database for time series released

Version 1.0.0 of the ChronoDB database was released on June 27, 2012. It is available from http://sourceforge.net/projects/chronodb/ and http://agent.ch/timeseries/chronodb/.

ChronoDB is a data manager for generic time series written in Java. It supports time series of any type. A flexible schema subsystem allows to organize simply but powerfully very large data sets. The software consists of an API and a generic implementation layer running on top of an SQL or a NoSQL system.

A demo is also available from the same sites. A future post on this blog will explain all about ChronoDB.

Wednesday, March 21, 2012

Maintenance release of the Time2 Library

Version 1.1.4 of the Time2 Library was released on March 21, 2012 at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/.

This maintenance release is plug-compatible with the previous version of the software. The internal management of diagnostic messages and exceptions has been improved in three ways:

  1. Diagnostic messages are fetched and formatted only when actually needed. This improves performance, especially in the case where not all messages are logged by the application environment.
  2. The library has now its own exception type, T2Exception. Because it is a subclass of the exception type used previously there is no compatibility issue.
  3. Messages are now keyed symbolically instead of literally. This provides many benefits to the programmer. One of these is readily visible in the Eclipse IDE where the text of the diagnostic message is displayed as a tooltip when the mouse pointer idles over a message key. The screenshot below shows this in action.

.

As an aside, the snapshot shows a piece of JUnit testing code. Writing software is easier and faster with test-first development. JUnit is a simple and powerful testing pattern for Java. We can thank Beck and Gamma for it. Note that the original idea was developed for Smalltalk by Kent Beck in 1989 and thus predates Java.

Coming soon

A data management system for time series running on top of the Time2 Library is in the pipeline. I hope to release it one of these weeks...

Wednesday, November 30, 2011

Version 1.1.3 (stable) of the Time2 Library brings a new utility

A new version of the Time2 Library is available at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/.

This new release comes with a small utility for scanning dates and times in arbitrary formats. Here is a quick usage example:

String pattern = 
  "\\S+ (\\S+) (\\d+) (\\d\\d):(\\d\\d):(\\d\\d) \S+ (\\d\\d\\d\\d)";
int[] groups = {6, 1, 2, 3, 4, 5};
String[] months = 
     {"Jan", "Feb", "Mar", "Apr", "May", "Jun", 
      "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
DateTimeScanner scanner = new DateTimeScanner(pattern, groups);
scanner.setMonths(months);
scanner.setDomain(DateTime.DOMAIN);
TimeIndex time = scanner.scan("Wed Nov 30 12:29:23 CET 2010");
assertEquals("2010-11-30 12:29:23", time.toString());

Monday, October 10, 2011

Version 1.1.2 (stable) of the Time2 Library supports ISO 8601

A new version of the Time2 Library is available at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/.

This new release brings improved support for the representation of dates and times as defined by the ISO 8601:2004 standard. Basic and extended date and time strings are allowed. In the extended format, the current time, as I'm writing, is represented as 2011-10-10T12:42:53Z. The Z indicates UTC time. The same time in the basic format is written 20111010T124253Z. Because time zones and daylight savings time are irrelevant in the Time2 Library, the Z letter can be omitted.

When using the extended format, the T separating date and time can be replaced with a blank. So the example can also be represented as 2011-10-10 12:42:53, arguably nicer on the eye. This more natural format is used by Time2.toString().

Local times can be specified using a time zone offset. For example, I am writing this from Switzerland, where the time zone is CEST, 2 hours ahead of UTC. In the ISO 8601:2004 standard, this can be written 2011-10-10T14:42:53-02.

There are some exotic features in the ISO 8601 standard. Some of them, like leap seconds or the use of hour 24 for midnight, are supported. Others, like week dates and ordinal dates are not.

Wednesday, September 21, 2011

Version 1.1.1 (stable) of the Time2 Library released

A new version of the Time2 Library is available at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/.

This release brings improved time comparisons. Previously it was not possible to compare times from different domains. Now, when domain differs, times are converted automatically.

When resolutions differ, the time with the lowest resolution is converted to the one with the highest resolution. For example comparing a Day to a Year will compare the day to the implicit default day of the year (which is January 1).

When resolutions do not differ, the times are converted to the unrestricted time domain for their resolution. For example a Workday and a ThirdFriday are both converted to a Day before comparing.

These semantics are not meaningful for all possible time domains. Users of "exotic" time domains should consider writing a subclass of Time2 and override the compareTo method.

Thursday, September 1, 2011

StockChart: combining the Time2 Library with JFreeChart

A demo package for the Time2 library was released on September 1. It includes StockChart, a program to create price and volume charts for stocks. For this it relies heavily on JFreeChart, a flexible and powerful Java library for drawing charts. Charts can be saved as PNG images or as vector graphics in SVG files, thanks to Apache Batik.

The demo uses example files from Foo & Bar, Inc (trading symbol FBI), a company invented for the occasion. Here is a PNG chart produced by the demo:

.

Clicking on the image shows the SVG version of the chart. If your browser supports SVG (like Firefox) you will be able to scale the image by resizing the window without reducing the picture quality.

The demo can be downloaded from SourceForge or from the project website.

As noted in the chart title, FBI quotes have not been adjusted for stock splits.
The halving of the price on March 18 looks suspiciously like a 2:1 ("two for one") split. A future version of the demo will take care of this problem.

Monday, August 22, 2011

Version 1.1.0 (stable) of the Time2 Library released

A new version of the Time2 Library is available at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/. I have clarified the rule on nulls. In one sentence, it is illegal to put a null into a time series unless null was defined as the representative of missing values for the type. The rule was already present in previous versions, but it is now better documented, and also covers Filler callbacks.

Unlike announced in my previous post, the new version number is 1.1.0 and not 1.0.1. Increasing the medium version number signals the presence of incompatible modifications, in this case the addition of a throws clause to two (rarely used) methods of TimeIndexable. Details are available in the release notes included in the software.

With this release, the software leaves beta status and is now stable.

Coming soon is a little demo of time series with graphics!

Wednesday, August 17, 2011

Version 1.0.0 (beta) of Time2 Library released

A slightly modified version of the Time2 Library is available at http://time2.sourceforge.net/ and http://agent.ch/timeseries/t2/. I have added a README file and release notes. The names of distribution files now include version numbers.

Version 1.0.1 is expected for next week. It will come without the "beta" qualifier.