Collections 1.1 is out

I’m proud to present version 1.1 of Collections package.

The major highlights of this release are:

  • TLinkedDictionary<TKey, TValue>, same as the standard dictionary but with predictable insertion order.
  • TLinkedStack<T>, same as standard set but with some predictability in element order.
  • TBitSet, a sorted set designed to store 16-bit numbers only.
  • TBidiDictionary<TKey, TValue>, a dictionary that enforces one key, one value on both ends.
  • TSortedBidiDictionary<TKey, TValue>, a sorted bidirectional dictionary.
  • TDoubleSortedDictionary<TKey, TValue>, a bidirectional dictionary sorted on both keys and values.
  • TSortedLinkedList<T>, a linked list with automated sorting.
  • RTTI based selectors. See overloads of Op.Select.
  • A rewrite of TLinkedList<T>, TLinkedQueue<T> and TLinkedStack<T>.
  • TArraySet<T> is not a sorted set and optimized a lot.
  • Multiple optimizations all over the place.
  • A new Op.GroupBy<T> operation.
  • Some internal cleanup.
  • Documentation fixes (Thanks Denisa once again).

On the project organization side, the project home page has got quite some love:

  • Three simplified diagrams of classes and interfaces in Collections.
  • A FAQ page that I hope will be useful to people. If you have a question not answered there please leave a comment and I will respond ASAP.
  • A page that states the differences between this project ans stock RTL collections.
  • A list with short descriptions for all Enex operations supported by collections.
  • A detailed “map” of all collections provided by the project with explanations of when to use, some implementation details and etc useful information that can help you better chose the collection you need.

On the documentation side of things, you will find two sample projects in the bundle. Only two at the moment, will add more when I have enough free time to.

Get the latest version or view the changelog!

TZDB 1.7 with latest DB update available.

The good people at “the tz database” project released their first update for this year (2011a).  I have updated TZDB to include the newest update. No code changes in this release (it is the same 1.7 code base), just updated the timezone database.

For those unaware: TZDB is an open source project that provides Delphi (7+) and FreePascal (2.0+) users with a “built-in” timezone database. The same source of data is used in most Unixes, Java, MacOS and multiple other projects out there.

Grab the latest version here, and view the latest changes here.

Surge of spam

Every time I post something to this blog I get 100+ spam messages a day for a few days. After this “rush” period the quantity starts dropping until I get maybe 2-5 spam messages a day … I’m pretty sure this post will bring much joy to the spam bots out there. It seems I just keep asking for it :)

How much spam do you guys (other bloggers out there) get on each post?

Collections 1.0.1

I’ve just put the 1.0.1 bug fix version up for download. It fixes XE compatibility issues, documentation fixes (thanks to Denisa Ilascu for her hard work). I don’t have access to Delphi 2010 and can’t say for sure whether it will work (I hope so).

EDIT: Confirmed, it works on Delphi 2010.

Download link here.

Collections 1.0.1 soon

I will get an 1.0.1 update soon addressing XE compatibility issues some people are experiencing and some documentation fixes. Stay tuned.

Collections 1.0

Last week I have finally got some free time on my hands to do something I was planning for a long time now: create a new package that will only provide a number of collections. What this means is that I took DeHL and stripped out everything that was not collection related; remodeled the classes to rely on Generics.Collections and Generics.Defaults standard units; and finished all the documentation.

What remained is a pure collection orientated package called (very unimaginatively)  Collections.  If you ever used DeHL’s collections you will most certainly recognize the code. But, while stripping out the bloat I was forced to re move some things that relied on that bloat:

  • No more reliance on IType/TType. Collections now use IComparer and IEqualityComparer provided by Generics.Defaults.
  • All associative collections use TPair now.
  • Because IType was designed to provide cleanup for the enclosed values in the collections some reworking was necessary to make collections more Delphi-like. You still get the OwnsObjects, OwnsKeys and OwnsValues properties on the object variants.
  • No more Op.Cast<> support. This Enex operation relied on TConverter which relied on IType and so on and so forth. Instead use a Op.Select with a casting predicate.
  • Using NativeInt instead of NativeUInt in some places. This was a menace for a lot of people.

Note that Collections is not base-class or interface compatible with Generics.Collections. I could not make the proper compatibility because of interface support.
So what would you expect in the package:

  • Full inline documentation. All APIs are properly documented. If you find any typos or errors please fill a bug!
  • Test cases for mostly everything provided.
  • A wide range of collections (much more than just stack, queue, list and dictionary).
  • Enumerable extensions.
  • Easy extensibility.
  • Based on NativeInt instead of Integer. Ready at interface level for 64bit support.

Warning: This is a 1.0 release. There may still be some problems. If you find any please fill in a bug report. If you feel that you can help and implement something that is not included in the package feel free to contact me!

TZDB 1.6, oh man!

It seems that changes keep piling up. I decided it is time to get these announcements out of my blog and into their own discussion group. No more TZDB release related news will be written on this blog.

Anyway, TZDB 1.6 1.7 introduces a better Delphi/FreePascal version detection and should work on Delphi 6 and FreePascal 2.0. Let me emphasize: should work ! (tested on Delphi 7). It’s a real pain to keep a project compatible with so many version of Delphi and FreePascal even for such a small project. Also, the embedded time zone database was upgraded to the latest version.

Grab the latest version here, and view the latest changes here.

TZDB 1.5, now with FreePascal support.

TZDB 1.5 was released today. If you are wondering where did 1.3 and 1.4 go … well, those were transitional releases. This version of TZDB is selectively dependent on Delphi features giving you the opportunity to actually compile TZDB on more versions of Delphi (should be compilable starting with 7th version) and even FreePascal 2.4.0 (I tested both the 32bit and 64bit versions).

Note: TZDB does not employ the “least common denominator” technique. If a certain feature is present in a Delphi or FreePascal version — it is used.

Grab the latest version here, and view the latest changes here.

TZDB 1.2, now with Delphi 2009 and 2010 support

TZDB 1.2 was released today. You can grab it here, and view the latest changes here.

The most notable changes are:

  • Latest tz database (2010m). Also removed a few less then useless time zones from the official distribution.
  • Bug fixes, and a new testing module that actually highlighted those bugs in the first place.
  • Support for Delphi 2009 and 2010. If compiled for these versions, TZDB provides some features of Delphi XE’s TTimeZone class (for API compatibility).

TZDB — new location

I have moved the TZDB to a new Google code project. There are two wiki pages explaining some basics and a download with the latest TZDB.