Archive for the Uncategorized Category

Ping 2012!

Yes,  I am still here.

2011 was a very challenging year for me: in January 2011 I have been offered a very tempting position a company and I have accepted it. It’s a very small “services” company but with large expansions plans. The whole 2011 I was busy building a new system, maintaining some old ones (and gradually deprecating those in favor of the new one). It was really challenging and most of all time consuming. I had barely any free time for myself and when I had any I spent it as personal relaxation time.

The sad part about 2011 is that I did not get any chance to work on my open source projects (except the small updates to TZDB package). This year, hopefully, things are going to settle down work-wise and I will start getting more free time to work on my projects again!

I would like to give a small update about each project and what to expect from them in the future:

  • DeHL — A collection of code built around the concept of “type objects”. Unfortunately, DeHL only stirred some architectural interest in the Delphi community. It did not actually attract  many active users or contributors. If your code is not used in real life applications then it’s kind of useless. The good part is that it’s open source (BSD) and anybody doing a Google search can wind up there and download any piece of code for his/her use. Also, DeHL was a very good compiler “test case” in Delphi 2009/2010/XE time frame. I used it while working for Embarcadero a lot and it always revealed bugs and problems that got fixed internally. And finally, DeHL offered me the chance to learn some design principles I had never used before which ultimately made me a better programmer.But, unless someone steps up and takes over, DeHL is effectively dead.
  • TZDB — This project is alive. It’s a small project wise a very clear scope that was realized 2 years ago. I am only running a tool to generate new time zone definitions from time to time. Other than that TZDB is alive and kicking.
  • Collections — A collection of generic containers. What can be more exiting? (for me at least).  Well, I have on my machine a half-finished version 2.0. I have never completed it because it basically rips open some of the initial designs. Initially I inspired from .NET and Delphi collections classes to make a hybrid. Then I worked in Java and noticed that “Java’s way” is also a good way to go. So 2.0 tries to combine concepts of all three major players. This project is temporarily on hold until I find my direction.

The good thing about 2011 is that I had the chance to use all new shiny .NET technologies I haven’t touched before (I was a .NET 2.0 user before). This means, actual LINQ (collections and SQL) coding, WCF, WPF and all that stuff. This gave me a broader perspective on things. This also means that my most wanted Delphi feature for 2012 is anonymous types and lambdas. Hopefully we will see these features and we can build some very interesting and time-saving solutions around them.

2012

I never make new year’s resolutions because I know I would not keep them. This being said, I hope I can get my act together and finally finish Collections 2.0.

 

Happy and a Fruitful New Year!

TZDB 1.7 database 14 March

I have finally managed to get some free time on my hands and released the latest update to TZDB containing the latest DB (from 14 March). As usual, no code changes, just data updates.

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.

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!

Cool security

This is not a Delphi post, it’s a post about stupidity! I have my laptop protected by a boot password. The cool thing is that if you press CTRL+ALT+DEL at the time when you have to enter the password, the laptop reboots and will not ask you for the password. Guess I have to remve the password … it’s useless anyway.


Note: I’m talking about Fujitsu-Siemens Amilo Pro V3505-1.

$SetPEFlags

Quick update: It seems Delphi has a $SetPEFlags directive for setting the PE flags! Was searching for this for some time now.

Now I can add a: {$SetPEFlags IMAGE_FILE_UP_SYSTEM_ONLY} flag so that windows only assigns a single core to the program.