Chronos is one of the many Smalltalk-related blogs syndicated on Planet Smalltalk
χρόνος

Discussion of the Essence# programming language, and related issues and technologies.

Blog Timezone: America/Los_Angeles [Winter: -0800 hhmm | Summer: -0700 hhmm] 
Your local time:  

2007-01-31

Filenames and Inter-Smalltalk Portability

Troy Brumley, in his blog post File access demo from VW to Squeak (2006-06-03), picks up on some example VisualWorks code posted by James Robertson a day earlier (Simple File I/O Demo, 2006-06-02.) Troy's examples show how to code the same thing in Squeak.

But there is another option: Use the Passport inter-Smalltalk portability library that was implemented in order to make it possible to host The Chronos Date/Time Library on VisualWorks, Squeak and Dolphin. Using Passport, the code will work unchanged in VisualWorks, Squeak and Dolphin.

Here's the Passport version (with Jim's original variable names unchanged, even though they aren't the best names for use with Passport):

"write a simple file"
file := 'myTestFile.txt' asResourcePath.
stream := file writeStream.
stream nextPutAll: 'Line 1'.
stream nextPut: Character cr.
stream nextPutAll: 'Line 2'.
stream nextPut: Character cr.
stream nextPutAll: 'Line 3'.
stream nextPut: Character cr.
stream close.

"read the entire file"
file := 'myTestFile.txt' asResourcePath.
contents := file value.
^contents.

"read line by line"
file := 'myTestFile.txt' asResourcePath.
stream := file readStream.
lines := OrderedCollection new.
[stream atEnd]
whileFalse: [| line |
line := UtilityFunction nextLineFrom: stream.
lines add: line].
stream close.
^lines.

"finding the file"
directory := '.' asResourcePath.
files := OrderedCollection new.
directory contentsDo: [:resourcePath | ('myTest*' match: resourcePath suffixString) ifTrue: [files add: resourcePath]].
^files.

(To see Jim's original VW code, follow this link: Simple File I/O Demo (VW code))

Passport not only makes it possible to write the same file name logic portably among different Smalltalk versions, it also makes it possible to use the same code regardless of whether the host operating system is Unix, MacOS X or Windows. But to do that, there are some constraints:

Firstly, either you can't use absolute pathnames, or else the absolute path must be constructed at run time by appending a well-known path suffix onto a path prefix that is supplied as a parameter at run time (and which will necessarily differ from one host OS to another, and often also even between different computers, even when they all use the same OS.)

Secondly, the relative path suffix must be constructed using a Pathname, as in the following example:
| resourcePath stream |
resourcePath := (Pathname fromString: 'test/folder1') asResourcePath.
resourcePath makeDirectory.
resourcePath := resourcePath, 'junk.txt'.
"The ResoucePath is now [./test/folder1/junk.txt]"
stream := resourcePath newWriteStream.
stream nextPutAll: 'This is a test.'.
stream close.


Typically, one would construct a ResourcePath using a path prefix obtained from your application's configuration parameters, using a well-known (or deterministically computable) path suffix. For example, the Chronos Date/Time Library might construct the path to a Chronos time zone ruleset file as follows:

(ResourcePath
namespace:
(EnvironmentFacade current
valueOfEnvironmentVariableAt: 'CHRONOS_PATH')
pathname:
(Pathname
fromString: 'time-zones/rulesets/Pacific/Honolulu'))
appendingExtension: 'tzn'

On the Windows machine I use for Chronos development, doing a "print it" on the above example would have the following result: H:\Dev\Smalltalk\Chronos\Chronos Versions\VisualWorks\Chronos\time-zones\rulesets\Pacific\Honolulu.tzn.

The Squeak version of Passport is available as two of the files in the version of Chronos.zip distributed for Squeak (namely, "Passport-Kernel.st" and "Passport-Squeak.st.") It's also available from SqueakSource (in the Chronos project.)

The VisualWorks version can be obtained from the Cincom Public StORE. It can also be filed out or parcelled out after installing the VisualWorks version of Chronos (it's in the packages Passport-Kernel and Passport-Kernel-VW.)

The Dolphin version of Passport is available on request (requests (at) chronos-st (dot) org).


Breakthrough in nanodevice synthesis revolutionizes biological sensors


Breakthrough in nanodevice synthesis revolutionizes biological sensors from PhysOrg.com

A novel approach to synthesizing nanowires (NWs) allows their direct integration with microelectronic systems for the first time, as well as their ability to act as highly sensitive biomolecule detectors that could revolutionize biological diagnostic applications, according to a report in Nature.

[...]




How does your brain tell time?


How does your brain tell time? from PhysOrg.com

"Time" is the most popular noun in the English language, yet how would we tell time if we didn’t have access to the plethora of watches, clocks and cell phones at our disposal?

[...]




2007-01-30

No Big Bang? Endless Universe Made Possible by New Model


No Big Bang? Endless Universe Made Possible by New Model from PhysOrg.com

A new cosmological model demonstrates the universe can endlessly expand and contract, providing a rival to Big Bang theories and solving a thorny modern physics problem, according to University of North Carolina at Chapel Hill physicists.

[...]




2007-01-27

Intel, IBM Reveal Transistor Overhaul


Intel, IBM Reveal Transistor Overhaul from PhysOrg.com

(AP) -- In dueling announcements, Intel Corp. and International Business Machines Corp. separately say they have solved a puzzle perplexing the semiconductor industry about how to reduce energy loss in microchip transistors as the technology shrinks to the atomic scale.

[...]


In addition to allowing smaller design rules, Intel said its technology improves processor performance by about 20% (over what would have been the case, all else being equal.) They will have CPUs on the market using the new technology (with 45nm design rules) in the fall of 2007


2007-01-24

Chronos B1.196 Published on SqueakSource (Monticello Package)

Chronos B1.196 is now available on SqueakSource.

For more information on Chronos B1.196, see the Chronos B1.196 publication announcement.

Chronos on SqueakSource is packaged as 6 separate Monticello packages, which physically are contained in six different *.mcz files. Unfortunately, the package version must be encoded in the filename, so the filename changes with each new version. The 6 packages, and the filenames of their current versions as of this writing (2007-01-24T04:05Z,) are listed below:









Package NameMonticello Filename
PassportPreamblePassportPreamble-B1.5.mcz
PassportPassport-B1.6.mcz
ChronosPreambleChronosPreamble-B1.2.mcz
ChronosChronos-B1.196.mcz
ChronosPostscriptChronosPostscript-B1.4.mcz
ChronosSqueakPost36OnlyChronosSqueakPost36Only-B1.3.mcz


The detailed installation instructions are presented below. They can also be found on the SqueakSource "Wiki" page for the Chronos project. They ought to reside on the main page of the Chronos project on SqueakSource, but since I'm not the administrator, I can't put them there.

Detailed Installation Instructions


First, download the Chronos Time Zone Repository, and install it according to the Chronos installation instructions (which have not yet been updated with any SqueakSource-specific infomration.)

The following packages must be installed in the specified order (and any packages not mentioned should be ignored):

1. Install the package PassportPreamble (The filename will be of the form "PassportPreamble-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

2. Install the package Passport (The filename will be of the form "Passport-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

NOTE: The first two packages comprise the "Passport" inter-smalltalk portability library that is used by Chronos (and was in fact developed for use by Chronos.) Passport might prove useful for other applications and/or class libraries that need to operate on more than one Smalltalk platform.

3. Install the package ChronosPreamble (The filename will be of the form "ChronosPreamble-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

4. Install the package Chronos (The filename will be of the form "Chronos-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

5. Install the package ChronosPostscript (The filename will be of the form "ChronosPostscript-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

6. IF AND ONLY IF you are installing Chronos in a Squeak image whose version > 3.6, then install the package ChronosSqueakPost36Only (The filename will be of the form "ChronosSqueakPost36Only-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

Usually, the package version with the highest version (release) and build number should be chosen (so choose "Chronos-B1.190" over "Chronos-B1.188".)
__________________________________________________
WARNING: The initial version, dated 2006-02-19 and labelled "Chronos.B1.15-avi*", is only partially functional, and worse, will break your image if you're using any version of Squeak later than 3.6!


2007-01-22

Version B1.196 of the Chronos Date/Time Library Published

Chronos Version B1.196 has been published. Chronos B1.196 is available for VisualWorks, Squeak and Dolphin.

Chronos Version B1.196 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository, and the Squeak version can also be obtained from SqueakMap (as a .sar archive.) The Monticello-based version of B1.196 will be available on SqueakSource within a few days (the previous version, B1.190, is on SqueakSource now.)

NOTE: The SqueakMapPackageLoader tool does not work with the Chronos.sar archive, although Chronos.sar can be dowloaded to your local machine over HTTP and then installed using the Squeak FileList. (This problem has been reported, and a fix has been identified. See: [SM][BUG] Error: can't find EOCD position.)

You may also use the direct download link for VisualWorks, the direct download link for Squeak or the direct download link for Dolphin.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.196



The following enhancements (or fixes) were made:

1. Enhanced both parsing and printing of Timeperiods, Timepoints and YearMonthDay values:

a) Full support was added for parsing ISO 8601 truncated date/time representations. Truncated date/time values are parsed into instances of Timeperiod. For example, "2007" is parsed into a Timeperiod with a duration of 1 year whose starting value is the YearMonthDay value for 2007-01-01.

b) The print behavior of Timeperiods was changed so that when the Timeperiod's starting value is at the start of a time unit (e.g, start of year, start of month, start of day, start of hour, start of minute, start of second,) and the extent of the Timeperiod's duration corresponds to that time unit, the Timeperiod is printed truncated to that unit, and no "/duration" is appended. This means that both the parsing and printing of date/time values conform to the behavior and semantics required by ISO 8601. For example, the printString for "Timeperiod from: YearMonthDay today duration: CalendarDayDuration" would be "2007-01-22" (if that is today's date.)

c) Since a YearMonthDay can't be bound to a time zone, support for date-valued points-in-time that are bound to a time zone was added by simply using a Timeperiod whose starting value is a Timepoint bound to the time zone, and whose duration is 1 day. So "YearMonthDay today >> (Timezone at: ''Pacific/Honolulu'')" now results in a Timeperiod with a duration of 1 day whose staring value is a Timepoint representing the initial moment of today, bound to the 'Pacific/Honolulu' time zone. The printString would be "2007-01-22-10:00" (if today's date were 2007-01-22.)

2. Added the following convenience methods to Timeperiod class (instance creation methods):

Timeperiod class>>nowIn:as:duration:
Timeperiod class>>nowIn:duration:
Timeperiod class>>nowWithDuration:

3. Changed the semantics of both Timeperiod class>>todayIn:as: and Timeperiod class>>todayIn:, so that the start value of the answered Timeperiod will now be a Timepoint bound to the specified time zone, and not a YearMonthDay (which cannot be bound to a time zone,) UNLESS the specified time zone is "ChronosTimezone nominal," in which case a YearMonthDay will be used as the starting value (as would have been the case all the time, previously.)

4. Fixed problem loading a new version of Chronos using StORE that only is an issue when a previous version of Chronos is already in the image. Not relevant otherwise (loading into a clean image worked as expected when installing versions prior to B1.196.)

5. Fixed bug in ChronosPrintPolicy class>>newANSIStandard, which in some cases would not answer an instance of ChronosPrintPolicy itself, but instead answer an instance of some subclass. Fixed it so that it always answers an instance of ChronosPrintPolicy itself, even when invoked as "self newANSIStandard" in a subclass.


2007-01-17

VW: 2007 TimeZone settings for North America

Those of you who reside in North America and use VisualWorks (or ship VW-hosted applications to North America,) but aren't using Chronos, need to update your time zone rules. The rules for the North American time zones currently in all shipped versions of VisualWorks are not correct for 2007 and later, since the US Congress changed start and end rules for daylight saving time in the United States, effective as of 2007.

The old rules (which had been in effect since 1987) were that the transition from standard time to daylight saving time happened on the first Sunday of April, and the transition from daylight saving time back to standard time happened on the last Sunday of October (both at 2am local time.) Under the new rules, standard time transitions to daylight saving time on the second Sunday of March, and transitions back to standard time on the first Sunday of November.

One way to make the necessary change is to evaluate the following "do it" (which is correct for Pacific Time):

TimeZone 
setDefaultTimeZone:
(TimeZone
timeDifference: -8 "Pacific Time"
DST: 1 at: 2
from: 73 "Second Sunday of March"
to: 311 "First Sunday of November"
startDay: #Sunday).

Instead of the "timeDifference: -8" which is correct for Pacific Time, Mountain Time has a time difference of -7 hours, Central Time has a time difference of -6 hours, and Eastern Time has a time difference of -5 hours. Arizona is the big exception, since it does not observe daylight saving time (but Navajo reservations in Arizona do observe DST!) The Arizona rules haven't changed.

Another way to get the correct rules is to install the TimeZone-External Repository-Olson TZDB package, which can be downloaded from the Chronos web site, or simply by clicking on the following link: TimeZone-External Repository-Olson TZDB (read and follow the installation instructions.)

Once the TimeZone-External Repository-Olson TZDB package has been installed (according to the instructions,) evaluating one of the following "do its" will update "Core.TimeZone default" with the correct rules:

(TimeZone at: 'America/New_York') beReference
(TimeZone at: 'America/Indiana/Indianapolis') beReference
(TimeZone at: 'America/Chicago') beReference
(TimeZone at: 'America/Denver') beReference
(TimeZone at: 'America/Boise') beReference
(TimeZone at: 'America/Phoenix') beReference
(TimeZone at: 'America/Los_Angeles') beReference
(TimeZone at: 'America/Nome') beReference
(TimeZone at: 'America/Adak') beReference
(TimeZone at: 'Pacific/Honolulu') beReference

Yet another way to get the correct time zone rules is to install Chronos.


2007-01-16

Chronos on SqueakSource

Chronos is now available from SqueakSource--which, for those who don't know, is an online repository of Squeak-Smalltalk packages stored in Monticello format. Unlike either Envy or StORE, Monticello is a very file-based approach to storing, deploying, loading and versioning packages.

SqueakSource in effect serves as a "central repository" for Monticello package files (which end with the suffix .mcz). For Squeak, it's the only currently available solution (of which I am aware) to the problem of installing a new version of a package into an image without first unloading the prior version. (As as aside, I worked on a deployment/version-control system in the mid-90s, called Harmony, which I got working for both VisualWorks and Squeak. I may disucss that further in a blog post at some point--but not now.)

Chronos on SqueakSource is packaged as 6 separate Monticello packages, which physically are contained in six different *.mcz files. Unfortunately, the package version must be encoded in the filename, so the filename changes with each new version. The 6 packages, and the filenames of their current versions as of this writing (2007-01-17T07:15Z,) are listed below:









Package NameMonticello Filename
PassportPreamblePassportPreamble-B1.5.mcz
PassportPassport-B1.5.mcz
ChronosPreambleChronosPreamble-B1.2.mcz
ChronosChronos-B1.190.mcz
ChronosPostscriptChronosPostscript-B1.4.mcz
ChronosSqueakPost36OnlyChronosSqueakPost36Only-B1.3.mcz


The detailed installation instructions are presented below. They can also be found on the SqueakSource "Wiki" page for the Chronos project. They ought to reside on the main page of the Chronos project on SqueakSource, but since I'm not the administrator, I can't put them there.

Detailed Installation Instructions


First, download the Chronos Time Zone Repository, and install it according to the Chronos installation instructions (which have not yet been updated with any SqueakSource-specific infomration.)

The following packages must be installed in the specified order (and any packages not mentioned should be ignored):

1. Install the package PassportPreamble (The filename will be of the form "PassportPreamble-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

2. Install the package Passport (The filename will be of the form "Passport-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

NOTE: The first two packages comprise the "Passport" inter-smalltalk portability library that is used by Chronos (and was in fact developed for use by Chronos.) Passport might prove useful for other applications and/or class libraries that need to operate on more than one Smalltalk platform.

3. Install the package ChronosPreamble (The filename will be of the form "ChronosPreamble-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

4. Install the package Chronos (The filename will be of the form "Chronos-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

5. Install the package ChronosPostscript (The filename will be of the form "ChronosPostscript-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

6. IF AND ONLY IF you are installing Chronos in a Squeak image whose version > 3.6, then install the package ChronosSqueakPost36Only (The filename will be of the form "ChronosSqueakPost36Only-SV.B.mcz", where "S" is one of "A" (alpha), "B" (Beta) or "R" (Release,) "V" is the major version (release) number, and "B" is the build number.)

Usually, the package version with the highest version (release) and build number should be chosen (so choose "Chronos-B1.190" over "Chronos-B1.188".)
__________________________________________________
WARNING: The initial version, dated 2006-02-19 and labelled "Chronos.B1.15-avi*", is only partially functional, and worse, will break your image if you're using any version of Squeak later than 3.6!


2007-01-15

Chronos 101: Intervals of Time

This is the third article in a series of articles that conceptually discuss the Chronos model of time. The first one, Chronos 101: "Points" in Time, explains the way Chronos models "points" in time. The second one, Chronos 101: Durational Values, explains the way Chronos models durations of time.

Time Intervals in Chronos



An interval of time has a beginning, and end, and a duration. Unlike a duration, a time interval has a specific location on the timeline: It starts at a specific moment, and it ends at a specific moment.

The duration of a time interval is the amount of elapsed time from the beginning of the interval up to its end. For example, the first quarter of 2007 is a 3-month time interval starting at the first moment of January 1, 2007 and ending as of the last moment of March 31, 2007. The temporal extent (size, length, duration) of the interval is 3 months. The interval begins as of the first moment of January 1, 2007, and ends as of the last moment of March 31, 2007.

Mathematical Analogy



As used in mathematics, an interval is an ordered set of values on a number line, all of which are greater than one value but less than another. Ignoring advanced mathematics and/or degenerate cases, there are four types of interval:
  • Closed: A closed interval contains both its endpoints, one of which is the starting point and the other the ending point. Example: All the numbers between 3 and 4, including both 3 and 4. More formally: [3, 4] is the set of all x such that 3 <= x <= 4.

  • Open: An open interval contains neither its leftmost (starting) point nor its rightmost (ending) point. Example: All the numbers between 3 and 4, including neither 3 nor 4. More formally: (3, 4) is the set of all x such that 3 < x < 4.

  • Left-closed, right-open: A left-closed, right-open interval contains its leftmost (starting) point, but does not contain its rightmost (ending) point. Example: All the numbers between 3 and 4, including 3 but not including 4. More formally: [3, 4) is the set of all x such that 3 <= x < 4.

  • Left-open, right-closed: A left-open, right-closed interval does not contain its leftmost (starting) point, but does contain its rightmost (ending) point. Example: All the numbers between 3 and 4, excluding 3 but including 4. More formally: (3, 4] is the set of all x such that 3 < x <= 4.


Time intervals in Chronos are always left-closed, right-open intervals. A Chronos interval contains its starting/leftmost point in time, but does not contain its ending/rightmost point in time. In Chronos, a time interval of three months duration that starts as of the first moment of January contains every moment of January 1, and contains every moment of March 31, but does not contain any moments of April 1--not even the very first moment.

Time Intervals with Negative Durations



However, a Chronos time interval may have a negative duration. Example: The interval starting on the initial moment of 2007 and extending backwards in time one calendar year (more formally, the set of moments in time such that, for all x that are members of the set, 2006-01-01T00:00:00 < x <= 2007-01-01T00:00:00.) In the case of Chronos time intervals whose duration is negative, the starting moment occurs temporally later than the ending moment, because a negative duration involves traveling backwards in time. In other words, Chronos time intervals have temporal directionality (forwards or backwards.) Why? Because an algorithm might traverse the timeline either forwards or backwards, even though physical objects can only traverse the timeline in the forward direction. This behavior for Chronos time intervals was chosen so that the semantics of a Chronos time interval depends only on the interval itself, with the effect that algorithms that use a Chronos interval can be independent of whether the interval's directionality is forwards or backwards.

So Chronos intervals with positive duration are "earliest-endpoint-closed, latest-endpoint-open" intervals, but Chronos intervals with negative duration are "earliest-endpoint-open, latest-endpoint-closed" intervals. Consequently, Chronos time intervals preserve the invariant that the starting endpoint (from the perspective of the direction in which the timeline is being traversed) are always included in the interval, but the last endpoint (from the perspective of the direction in which the timeline is being traversed) are never included in the interval. Also, from the perspective of real-world objects that traverse the timeline going forward, this means that earliest-open, latest-closed intervals can be represented by simply making the duration negative (and specifying the temporally-latest point-in-time, instead of the temporally-first point-in-time, as the interval's starting/left-most endpoint.)

It should also be noted that ISO 86O1 does not allow time intervals with negative durations (so "2007-01-01T00:00:00/P-1Y" is not legal ISO 86O1--although Chronos supports it anyway.) But ISO 86O1 does allow the first element of a time interval to be a duration. For example, P1Y/2007-01-01T00:00:00 is a legal IS0 86O1 designation of a time interval, where the starting/rightmost moment is computed by subtracting the duration from the rightmost/ending moment. So P1Y/2007-01-01T00:00:00 designates the time interval containing all moments of the year 2006, but not containing any moments of any other year (more formally, P1Y/2007-01-01T00:00:00 specifies the set of moments in time such that, for all x that are members of the set, 2006-01-01T00:00:00 <= x < 2007-01-01T00:00:00.)

Points-in-Time as Special-Case Time Intervals



Even the Chronos "point-in-time" values (instances of YearMonthDay, Timepoint or InfiniteTimepoint) are implemented as time intervals in Chronos. However, the duration of YearMonthDay, Timepoint and InfiniteTimepoint instances is static, is the same for all instances, and no instance variable is used to specify the duration of a YearMonthDay, Timepoint or InfiniteTimepoint (as discussed in the first essay of this series, Chronos 101: "Points" in Time.)

The duration of a YearMonthDay is one calendar day. The duration of a Timepoint is one nanosecond. The duration of an InfiniteTimepoint is "InfiniteDuration positive."

Time Intervals: The General Case



The Chronos class Timeperiod implements time intervals that can have any duration representable using any of the Chronos durational classes (ScientificDuration, CalendarDuration, CivilDuration, InfiniteDuration--as discussed in the essay Chronos 101: Durational Values.)

Timeperiod is not an abstract class, and has no subclasses. By unifying "points-in-time" with time intervals, by delegating as much responsibility as possible to the Chronos durational values, and by leveraging Smalltalk's dynamic typing, a Timeperiod instance can be composed of any combination of one Chronos "point-in-time" value and one Chronos durational value. So there is no need for time-interval classes such as Year, Month or Week, as can be found in Squeak's Chronology date/time library.


Version B1.190 of the Chronos Date/Time Library Published

Chronos Version B1.190 has been publised ("Beta Release 1--build 190".) Chronos B1.190 is available for VisualWorks, Squeak and Dolphin.

Chronos Version B1.190 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository, and the Squeak version can also be obtained from SqueakMap (as a .sar archive.)

NOTE: The SqueakMapPackageLoader tool does not work with the Chronos.sar archive, although Chronos.sar can be dowloaded to your local machine over HTTP and then installed using the Squeak FileList. (This problem has been reported, and a fix has been identified. See: [SM][BUG] Error: can't find EOCD position.)

You may also use the direct download link for VisualWorks, the direct download link for Squeak or the direct download link for Dolphin.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.190



B1.190 enhances the Passport inter-Smalltalk portability library (on which Chronos depends) with full support for infinities, infinitesimals and NaNs. Such "metanumbers" can be quite useful, but are often not available, and certainly don't have any standard API or semantics among the various Smalltalk dialects.

The semantics of the new metanumbers correspond to the accepted mathematical norms, and conform to the IEEE floating point specification for the behavior of infinities and NaNs (except that they're not floating point numbers.)

The principle reason metanumbers were added to Passport was to enable Chronos to fully and elegantly support infinite durations, and also points-in-time in the infinite future or infinite past. Time intervals where one of the endpoints is the infinite future or infinite past are quite commonly needed. And now they're easy to construct and use in Chronos.

Also, since Passport now provides infinities (positive and negative) as first-class metanumbers, the class ChronosInfinity, which formerly resided in Chronos-Utilities (where the Time Zone Compiler can be found,) and which was not fully implemented, was removed and retired.

The following concrete classes have been added:

PassportInfinity
PassportInfinitesimal
PassportNotANumber (NaN)
InfiniteDuration
InfiniteTimepoint

So, it may have taken a while, but infinities didn't actually take forever to implement :-)

Finally, some bugs that had been recently introduced (over the past several weeks, starting with Chronos version B1.180 and later) were found and fixed.


2007-01-11

Version 2007a of the Chronos Time Zone Repository has been published

Version 2007a of the Chronos Time Zone Repository has been published. It is based on version 2007a of the Olson Time Zone Database.

Downloads:




Dr. Bussard lectures on Mr. Fusion

Should Google Go Nuclear: Google Video of Dr. Bussard giving a talk at Google about his award winning work on fusion.



Mr. Fusion...for real?

The winner of the International Academy of Science's Outstanding Technology of the Year Award (2006) is the Inertial-Electrodynamic Fusion (IEF) Device. From their article:


Dr. Bussard and his team at Energy/Matter Conversion Corporation, after close to 20 years of hard work, have developed a revolutionary radiation-free fusion process that could change the world as we know it today.
...
The fusion process recommended by Dr. Bussard takes boron-11 and fuses a proton to it, producing, in its excited state, a carbon-12 atom. This excited carbon-12 atom decays to beryllium-8 and helium-4. Beryllium-8 very quickly (in 10-13 s) decays into two more helium-4 atoms. This is the only nuclear-energy releasing process in the whole world that releases fusion energy and three helium atoms -- and no neutrons. This reaction is completely radiation free.
...
Dr. Bussard's Inertial Electrostatic Fusion offers:

  • Small, efficient power reactors, 1-3% the size of current magnetic confinement reactors.

  • Clean, radiation-free energy utilizing p B-11.

  • Relatively simple engineering with commercial viability in 6-10 years.

  • Low cost ($150-200 million from program inception to demonstration of clean power.)



2007-01-07

Version B1.188 of the Chronos Date/Time Library Published

Chronos Version B1.188 has been publised ("Beta Release 1--build 188".) Chronos B1.188 is available for VisualWorks, Squeak and Dolphin. The Chronos Seed Archive for B1.188 is also available (the "Chronos Seed" is the platform-independent Chronos codebase, used for porting Chronos from VisualWorks to other Smalltalk pltatforms.)

Chronos Version B1.188 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository, and the Squeak version can also be obtained from SqueakMap (as a .sar archive.)

NOTE: The SqueakMapPackageLoader tool does not work with the Chronos.sar archive, although Chronos.sar can be dowloaded to your local machine over HTTP and then installed using the Squeak FileList. (This problem has been reported, and a fix has been identified. See: [SM][BUG] Error: can't find EOCD position.)

You may also use the direct download link for VisualWorks, the direct download link for Squeak or the direct download link for Dolphin.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.188



Chronos Version B1.188 makes Chronos Timeperiods (general-purpose time intervals) fully conform to the semantics and API of CalendricalCoordinates (instances of YearMonthDay and Timepoint.)

Timeperiod is now subclassed under CalendricalCoordinate, instead of under TemporalInterval. Significant method refactoring was done. The result is that instances of Timeperiod, YearMonthDay and Timepoint are now essentially completely type compatible as far as the public API is concerned.

I will soon be posting a blog entry that will discuss time intervals in Chronos in greater depth. This will be the third article in the "Chronos 101" series that was started a week ago.

Also, the ChronosParser was enhanced to more intelligently reduce the generality of parsed date/time values. For example, when asked to parse a full DateAndTime value, ChronosParser will now answer a YearMonthDay instead, in cases where no time-of-day values or time zone are specified in the source text.

During unit testing of the above, a few pre-existing bugs were found and fixed.

Finally, note that the Executable Examples have been updated.


2007-01-06

VisualWorks Version B1.186 of the Chronos Date/Time Library Re-published

Due to a packaging error involving only the VisualWorks version of Chronos, Version B1.186 of the VisualWorks distribution of Chronos is being republished. Neither Squeak nor Dolphin are affected.

The specific problem is that the postLoadAction of the Chronos bundle somehow was lost. The correct postLoadAction for the Chronos bundle is as follows:

    [:package |
    Transcript cr; cr; show: '## Chronos: Post-load Action Invoked.'; cr.
    Chronos.ChronosEnvironment canonical reinstall]

Without this postLoadAction, Chronos will not be properly initialized. If Chronos version B1.186 does not work after being loaded into VisualWorks, this is almost certainly the problem. You can fix it either by getting the republished version (identified in the Cincom Public Store as version B.186vw,) or by evaluating the following "do it" after loading Chronos into an image:

    ChronosEnvironment canonical install.


2007-01-04

Version B1.186 of the Chronos Date/Time Library Published

Chronos Version B1.186 has been publised ("Beta Release 1--build 186".) Chronos B1.186 is available for VisualWorks, Squeak and Dolphin. The Chronos Seed Archive for B1.186 is also available (the "Chronos Seed" is the platform-independent Chronos codebase, used for porting Chronos from VisualWorks to other Smalltalk pltatforms.)

Chronos Version B1.186 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository, and the Squeak version can also be obtained from SqueakMap (as a .sar archive.)

NOTE: The SqueakMapPackageLoader tool does not work with the Chronos.sar archive, although Chronos.sar can be dowloaded to your local machine over HTTP and then installed using the Squeak FileList. (This problem has been reported, and a fix has been identified. See: [SM][BUG] Error: can't find EOCD position.)

You may also use the direct download link for VisualWorks, the direct download link for Squeak or the direct download link for Dolphin.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.


About Chronos Version B1.186



You might also be interested in the new behavior added by Chronos B1.184, which is detailed in its availability announcement (for instance, parsing of durational values.)

Chronos Version B1.186 makes Chronos point-in-time values (instances of YearMonthDay and Timepoint) fully conform to the semantics and API of time intervals, as defined by the Chronos class Timeperiod. Many of the methods of Timeperiod were moved up the inheritance hierarchy to Calendrical, and Calendrical was renamed to TemporalInterval. In the future, Timeperiod may be subclassed under CalendricalCoordinate, instead of under TemporalInterval--but that change is still being evaluated for architectural soundness.

Although Timepoints and YearMonthDays were always conceptually considered to be time intervals, they were not type-compatible with instances of Timeperiod to the extent one might reasonably have expected. Now, there are only two distinctions between a Timeperiod and a CalendricalCoordinate (YearMonthDay or Timepont):
  1. A Timeperiod can have any durational extent (each instance's durational extent is independent from that of any other.) All YearMonthDay instances have a durational extent of one calendar day. All Timepoint instances have a durational extent of one nanosecond.

  2. Currently, a Timeperiod does not provide its own temporal or calendrical coordinates (although that may change in the future, as noted above.) CalendricalCoordinate instances (i.e., instances of YearMonthDay and Timepont,) in contrast, do provide coordinates (e.g., the year, the month, the day-of-the-month, the hour-of-the-day, etc.)



2007-01-02

US Holidays 2007

Here are the "holidays" that will be observed in the United States during 2007. The list was generated by the Chronos Date/Time Library.

Most of the listed "holidays" will actually be business days, although some will not. The US Federal Holidays (on which most US Government offices will close, along with all Federally-chartered banks) are highlighted in bold. Generally, each business decides on its own which of these days (if any) will be non-business days (and for which employees):

Mon, 01 Jan 2007: NewYearsDay
Tue, 02 Jan 2007: DayOfMourning-GeraldFord
Mon, 08 Jan 2007: JacksonDay
Mon, 15 Jan 2007: MartinLutherKingDay
Fri, 02 Feb 2007: GroundhogDay
Mon, 12 Feb 2007: LincolnsBirthday
Wed, 14 Feb 2007: ValentinesDay
Mon, 19 Feb 2007: WashingtonsBirthday
Sat, 17 Mar 2007: StPatricksDay
Sun, 01 Apr 2007: AprilFoolsDay
Fri, 06 Apr 2007: GoodFriday
Sun, 08 Apr 2007: Easter
Sun, 22 Apr 2007: EarthDay
Wed, 25 Apr 2007: AdministrativeAssistantsDay
Fri, 27 Apr 2007: ArborDay
Sun, 13 May 2007: MothersDay
Mon, 28 May 2007: MemorialDay
Thu, 14 Jun 2007: FlagDay
Sun, 17 Jun 2007: FathersDay
Wed, 04 Jul 2007: IndependenceDay
Sun, 22 Jul 2007: ParentsDay
Mon, 03 Sep 2007: LaborDay
Sun, 09 Sep 2007: GrandParentsDay
Mon, 08 Oct 2007: ColumbusDay
Wed, 24 Oct 2007: UnitedNationsDay
Wed, 31 Oct 2007: Halloween
Mon, 12 Nov 2007: VeteransDay (observed)
Thu, 22 Nov 2007: Thanksgiving
Fri, 23 Nov 2007: DayAfterThanksgiving
Mon, 24 Dec 2007: ChristmasEve
Tue, 25 Dec 2007: Christmas
Mon, 31 Dec 2007: NewYearsEve


2007-01-01

Version B1.184 of the Chronos Date/Time Library Published

Chronos Version B1.184 has been publised ("Beta Release 1--build 184".) Chronos B1.184 is available for VisualWorks, Squeak and Dolphin. The Chronos Seed Archive for B1.184 is also available (the "Chronos Seed" is the platform-independent Chronos codebase, used for porting Chronos from VisualWorks to other Smalltalk pltatforms.)

Chronos Version B1.184 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository, and the Squeak version can also be obtained from SqueakMap (as a .sar archive.) Note that the SqueakMapPackageLoader tool inexplicably fails to work with the Chronos.sar archive, although Chronos.sar can be dowloaded to your local machine over HTTP and then installed using the Squeak FileList.

You may also use the direct download link for VisualWorks, the direct download link for Squeak or the direct download link for Dolphin.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.184


Chronos Version B1.184 makes a few small fixes and improvements, adds the capability to parse ScientificDurations from the textual representation required by the ANSI-Smalltalk standard, and adds the ability to parse CalendarDurations and CivilDurations from textual representations that conform to the ISO 8601 International Standard for the representation of date/time values.

Examples of parsing durational values:

    ScientificDuration readFromString: '-365:23:59:59'
    CalendarDuration readFromString: 'P48Y8M27.33D'
    CivilDuration readFromString: 'P48Y8M27DT18H16M55.062077S'
    Durational readFromString: 'P48Y8M27DT18H16M55.062077S'
    Durational readFromString: '-365:23:59:59'

"Durational readFromString:" can be used in situations where either the syntax specified by the ANSI Smalltalk Standard or the ISO 8601 syntax might be encountered.

The ISO 8601 syntax for durational values requires that years, months, days, hours, minutes and seconds must be representable as fractional values. For example, the ISO 8601 syntax for a duration of time that spans 5 quarters of a year is P1.25Y. It was therefore necessary to extend the functionality of Chronos durational values to support fractional years, months, days, hours, minutes and seconds, and it was then also necessary to extend the functionality of Chronos point-in-time values to support arithmetic using fractional years, months, days, hours, minutes and seconds. So Chronos version B1.184 now fully supports fractional duration element values, and the addition/subtraction of fractional years, months, days, hours, minutes and seconds.

The parsing of time intervals from their ISO 8601 syntax into instances of Timeperiod is now also supported (e.g., Timeperiod readFromString: '2002-03-01T13:00:00Z/2003-05-11T15:30:00Z'.)

A few convenience methods were added to CalendricalCoordinate:

    withDayOfYear:
    withMonth:
    withDayOfMonth:
    withMonth:day:

Along with the already-present methods #inYear:, #atStartOfDay, #atTimeOfDay:, #atTimeOfDay:in:, #nextDayOfWeek:, #prevDayOfWeek:, #tomorrow, #yesterday, #nextWeek, #prevWeek, #nextMonth, #prevMonth, #nextYear and #prevYear, these methods greatly simplify the task of constructing a new point-in-time value that differs only in some specified, but small, way from one you already have.

Examples (all of which are correct for any year in any calendar system):

To compute the first day of the next year:

    YearMonthDay today nextYear withDayOfYear: 1

To compute the date having the same day of the month as today, but in the last month of the year:

    YearMonthDay today withMonth: MonthOfYear lastMonthOfYear

To compute the date having the same year and month as today, but which is the last day of the month:

    YearMonthDay today withDayOfMonth: DayOfMonth lastDayOfMonth

To compute a date in the same year as today, but with any desired month/day-of-month designation:

    YearMonthDay today withMonth: 4 day: 15

Finally, the National Day of Mourning for US President Gerald Ford (2007-01-02) was added as a one-time NYSE closure to the list of non-trading days at the NYSE maintained by the "SemanticDatePolicy nyse" object.


Chronos 101: Durational Values

This is the second article in a series of articles that conceptually discuss the Chronos model of time. The first one, Chronos 101: "Points" in Time, addresses the Chronos concept of "points" in time.

Durational Values in Chronos


What is a durational value? It's simply a value that specifies a duration of time, which differs from a "date" or "point-in-time" value in the same way that a "distance" value differs from a "position" value. A "position" value specifies an absolute location by specifying the distance between the location and some absolute reference point (.e.g, "93 million miles from the Sun.") Similarly, a "point-in-time" value specifies an absolute point in time by specifying the duration since (or until) a particular point-in-time and some absolute reference time (e.g., "5765 years since the creation of the world.") A durational value specifies/designates a temporal extent ("how long,") without specifying when the temporal extent begins or ends.

Civil Time versus Scientific Time


Chronos implemements three different types of durational ("temporal extent") values: "scientific time " durations, "civil time" durations and infinite durations.

The fundamental unit of scientific time is the second--all other durational units of scientific time are defined based on the second. The fundamental unit of civil time is the calendar day--with the possible exception of the second, all other durational units of civil time are defined based on the calendar day.

Scientific time defines the length of a second in terms of physical constants, whereas civil time may or may not do likewise--depending on whether the law in a particular legal jurisdiction specifies that the timescale used to define civil time-of-day is Universal Coordinated Time (UTC,) UT1 (modernly synonymous with Greenwich Mean Time,) or some other timescale.

A timescale defines the size of durations of time (temporal extents.) A calendrical system is a specialized timescale that defines the size of years and months in terms of a count of calendar days--or, to put it differently, a calendrical system defines a bidirectional mapping between a count of days and a year-month-day designation.

UTC is a timescale that defines the size of a civil day in terms of scientific seconds. UT1 (GMT) is a timescale that defines the size of a mean solar second as 1/86,400th of a mean solar day. Both define the time-of-day (and hence, the size of a day,) either directly or indirectly, based on Earth's rotation relative to the position of the Sun in the sky.

A scientific second (used by UTC) has an invariant size (as measured by atomic clocks.) A mean solar second (as defined by UT1) is 1/86,400th of a mean solar day. A mean solar second not only hasn't been the same size as a scientific second as it is currently defined since the early 1800s, but its size varies over time (as measured by atomic clocks.)

If civil time is based on the UTC timescale, then the size of a civil day may differ from most other civil days by one second--plus or minus one leap second. Whether or not there are leap seconds, the length of one civil day may differ from another due to either a regularly-scheduled or one-time-only time-of-day change, which might happen when a) civil time makes an annually-recurring and/or regularly-scheduled transition to or from daylight-saving (summer) time, or b) when the standard-time offset from Universal Time for a locale is "permanently" changed--as happened recently in Indiana, and in 1946 in Hawaii (when Hawaii's standard-time offset from Universal Time was changed from -10:30 hours to -10 hours.)

A civil day during which there is a transition from standard time to daylight-saving (summer) time will have 23 hours, not 24 (assuming there is exactly a one-hour difference between standard time and daylight-saving time, which is not universally true.) A civil day during which there is a transition from daylight-saving (summer) time to standard time will (typically, based on the same assumption as above) have 25 hours, not 24 (in which case, some of the hour:minute:second labels on the local time-of-day clock will occur twice in the same day.)

For timescales other than those based (either directly or indirectly) on the mean solar day, there may be yet other complications and discontinuites. For example, if civil time is based on apparent solar time instead of mean solar time, then the size of hours, minutes and seconds will differ continuously during each day (as measured by a typical clock that isn't a sundial, or doesn't emulate a sundial).

Chronos uses instances of the class ScientificDuration to represent durations of scientific time. Chronos uses instances of either CalendarDuration or CivilDuration to represent durations of civil time. Infinite durations of time are represented by instances of InfiniteDuration, of which there are only two: "InfiniteDuration positive" and "InfiniteDuration negative."

Civil Time: CalendarDuration, CivilDuration


A CalendarDuration or CivilDuration represents an extent (duration) of civil time. Since civil time works in such a way that the number of months in a year may vary (which happens in the Hebrew, Chinese, and Hindu lunisolar calendars, for example,) and the number of a days in a month vary, and the number of days in a year vary, and the number of hours in a day vary (as discussed above,) and the number of minutes in an hour and/or day may vary (as implied by the discussion above,) and the number of seconds in a minute, hour or day may vary (e.g., due to leap seconds,) Chronos represents durations of civil time as a vector of elements, where each vector element represents one of the count of years, months, days, hours, minutes or seconds.

A CalendarDuration only specifies a number of years, months and days. A CivilDuration also specifies a number of hours, minutes, seconds and nanoseconds. The number of years, months, days, hours, minutes, seconds and nanoseconds may each be specified to have a different sign (positive/negative,) and any or all of them may be specified to include a fractional value (e.g., "1.5 years -2 months 13.333 days 20 hours -30 minutes 17.44518 seconds.")

Adding a CalendarDuration or CivilDuration that represents one day of civil time to a Chronos point-in-time value results in a point-in-time that is one civil day later, at the same civil time of day, regardless of the number of hours, minutes and seconds actually between the two points in time.

Scientific Time: ScientificDuration


A ScientificDuration represents an extent (duration) of scientific time, where the size of seconds, minutes, hours and days are absolute invariants.

ScientificDurations do not specify any number of months or years, although they may be converted to and from a count of months and years using both a particular timescale and base time. There is no well-defined answer to the question "How many seconds are there in 30 years?" But there is a well-defined answer to the question "How many seconds are there, according to the UTC timescale, in the thirty-year period starting at 1972-01-01T00:00:00Z?"

Adding a ScientificDuration that represents 24 hours of scientific time to a Chronos point-in-time value results in a point-in-time value that is 86,400 scientific (metric) seconds later--which may or may not have the same civil time-of-day as the original point-in-time value.

Part 3: Chronos 101: Intervals of Time