David T. Lewis uploaded a new version of Chronology-Core to project The Inbox:
http://source.squeak.org/inbox/Chronology-Core-dtl.17.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.17
Author: dtl
Time: 15 December 2018, 6:44:08.809994 pm
UUID: 9d9b49d4-46f4-496f-bfd1-70fdb1641e43
Ancestors: Chronology-Core-dtl.16
Bootstrap UTCDateAndTime, step 2 of 5
Start using LXDateAndTime instead of DateAndTime.
Change instance creation in DateAndTime to create LXDateAndTime instances instead.
In the postscript, have all DateAndTime instances become LXDateAndTime.
=============== Diff against Chronology-Core-dtl.16 ===============
Item was changed:
----- Method: DateAndTime class>>fromSeconds: (in category 'smalltalk-80') -----
fromSeconds: seconds
"Answer a DateAndTime since the Squeak epoch: 1 January 1901"
+ ^ LXDateAndTime fromSeconds: seconds
+ " | integerSeconds nanos |
- | integerSeconds nanos |
integerSeconds := seconds truncated.
integerSeconds = seconds
ifTrue: [nanos := 0]
ifFalse: [nanos := (seconds - integerSeconds * NanosInSecond) asInteger].
^ self basicNew
ticks: (Array
with: SqueakEpoch
with: integerSeconds
with: nanos)
+ offset: self localOffset"!
- offset: self localOffset!
Item was changed:
----- Method: DateAndTime class>>julianDayNumber:offset: (in category 'squeak protocol') -----
+ julianDayNumber: anInteger offset: aDuration
+ ^ LXDateAndTime julianDayNumber: anInteger offset: aDuration
+ " ^ self basicNew
+ ticks: anInteger days ticks
+ offset: aDuration ;
+ yourself"!
- julianDayNumber: anInteger offset: aDuration
-
- ^self basicNew
- setJdn: anInteger
- seconds: 0
- nano: 0
- offset: aDuration!
Item was changed:
----- Method: DateAndTime class>>now (in category 'ansi protocol') -----
now
+
+ ^LXDateAndTime now.
+ " [ | timeArray |
+ timeArray := self primPosixMicrosecondClockWithOffset.
+ ^ self utcMicroseconds: timeArray first offset: timeArray second]
+ on: Error
+ do: [ ""Use old style primitive support""
+ ^self nowWithOffset: self localOffset]"!
- | clockAndOffset |
- clockAndOffset := self clock localMicrosecondClockWithOffset.
- (self automaticTimezone and:
- [self localOffset asSeconds ~= clockAndOffset second])
- ifTrue: [self localOffset: (Duration seconds: clockAndOffset second)].
- ^self now: clockAndOffset first offset: self localOffset!
Item was changed:
----- Method: DateAndTime class>>year:month:day:hour:minute:second:nanoSecond:offset: (in category 'squeak protocol') -----
year: year month: month day: day hour: hour minute: minute second: second nanoSecond: nanoCount offset: offset
"Return a DateAndTime"
+ ^ LXDateAndTime year: year month: month day: day hour: hour minute: minute second: second nanoSecond: nanoCount offset: offset
+ " | monthIndex daysInMonth p q r s julianDayNumber |
- | monthIndex daysInMonth p q r s julianDayNumber |
monthIndex := month isInteger ifTrue: [month] ifFalse: [Month indexOfMonth: month].
daysInMonth := Month
daysInMonth: monthIndex
forYear: year.
day < 1 ifTrue: [self error: 'day may not be zero or negative'].
day > daysInMonth ifTrue: [self error: 'day is after month ends'].
p := (monthIndex - 14) quo: 12.
q := year + 4800 + p.
r := monthIndex - 2 - (12 * p).
s := (year + 4900 + p) quo: 100.
julianDayNumber :=
( (1461 * q) quo: 4 ) +
( (367 * r) quo: 12 ) -
( (3 * s) quo: 4 ) +
( day - 32075 ).
^self basicNew
setJdn: julianDayNumber
seconds: hour * 60 + minute * 60 + second
nano: nanoCount
offset: offset;
+ yourself"!
- yourself!
Item was added:
+ ----- Method: LXDateAndTime>>floor (in category 'squeak protocol') -----
+ floor
+ "Answer a copy with magnitude rounded down to the nearest whole second"
+ ^self class
+ utcMicroseconds: utcMicroseconds - (utcMicroseconds \\ 1000000)
+ offset: localOffsetSeconds!
Item was changed:
----- Method: TimeStamp class>>current (in category 'squeak protocol') -----
current
+ ^self now!
- | ts ticks |
- ts := super now asTimeStamp.
- ticks := ts ticks.
- ticks at: 3 put: 0.
- ts ticks: ticks offset: ts offset.
- ^ ts
- !
Item was removed:
- ----- Method: TimeStamp class>>now (in category 'ansi protocol') -----
- now
- "Answer the current date and time as a TimeStamp."
-
- ^self current!
Item was changed:
----- Method: Timespan class>>defaultOffset (in category 'configuring') -----
defaultOffset
+ "Timespans created in the context of an offset will start in that offset. When no context is available, the defaultOffset for Timespans must be zero. For example, two ways to make a Date for today:
+ Date today. 'start is midnight at offset zero. Will compare successfully to other Date today results.'
+ DateAndTime now asDate. 'In this case, the start is midnight of the local time-zone. It can only compare equally to Dates of its time-zone.'"
+ ^ Duration zero!
- "Timespans created in the context of an offset will start in that offset. When no context is available, the defaultOffset for Timespans must be nil. For example, two ways to make a Date for today:
- Date today. 'start is midnight without offset. Will compare successfully to other Date today results.'
- DateAndTime now asDate. 'In this case, the start is midnight of the local time-zone. It can only compare equally to Dates of its time-zone or Dates without timezone.'"
- ^ nil!
Item was changed:
+ (PackageInfo named: 'Chronology-Core') postscript: '"Convert all instances of DateAndTime and TimeStamp to the equivalent LXDateAndTime and LXTimeStamp."
- (PackageInfo named: 'Chronology-Core') postscript: '"Ensure that the object history mark process uses DateAndTime>>floor rather than an earlier implementation that relied on a named instance variable."
+ | oldInstances newInstances |
+ Smalltalk garbageCollect.
+ oldInstances := DateAndTime allInstances, TimeStamp allInstances.
+ newInstances := oldInstances collect: [ :each |
+ each class == DateAndTime
+ ifTrue: [ each asLXDateAndTime ]
+ ifFalse: [ each asLXTimeStamp ] ].
+ oldInstances elementsForwardIdentityTo: newInstances.
+ Smalltalk garbageCollect.
+
+ "Ensure that the object history mark process uses DateAndTime>>floor rather than an earlier implementation that relied on a named instance variable."
+
Smalltalk at: #ObjectHistory ifPresent: [ :cls | cls current restartMarkProcess ].
'!
Patrick Rein uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-pre.840.mcz
==================== Summary ====================
Name: Tools-pre.840
Author: pre
Time: 27 December 2018, 10:03:04.287503 pm
UUID: 192f0561-821d-a347-a550-e12bbd53b360
Ancestors: Tools-pre.839
Fixes two defects in the FileContentsBrowser. One prevented the browsing of methods in changessets whose classes are not present. The other is a dnu error due to an, seemingly, overlooked old message send. (http://bugs.squeak.org/view.php?id=7615)
=============== Diff against Tools-pre.839 ===============
Item was changed:
----- Method: FileContentsBrowser>>changeMessageCategories: (in category 'other') -----
changeMessageCategories: aString
"The characters in aString represent an edited version of the the message
categories for the selected class. Update this information in the system
and inform any dependents that the categories have been changed. This
message is invoked because the user had issued the categories command
and edited the message categories. Then the user issued the accept
command."
self classOrMetaClassOrganizer changeFromString: aString.
- self unlock.
self editClass.
self selectClassNamed: selectedClassName.
^ true!
Item was added:
+ ----- Method: FileContentsBrowser>>hasClassSelected (in category 'class list') -----
+ hasClassSelected
+ ^ selectedClassName notNil !
I am putting five Chronology-Core updates in the inbox, to be moved to trunk
some time soon. These are the updates to Chronology that change the internal
representation of DateAndTime as described on http://wiki.squeak.org/squeak/6197,
and with original development at http://www.squeaksource.com/UTCDateAndTime.
When moved to trunk, the five MCZ versions will be loaded in sequence based
on new update map entries, such that instances of DateAndTime will be
converted in-place during the update process.
Chris Muller has done a good deal of testing of these updates, with coverage
including various Magma database scenarios that depend heavliy on DateAndTime
(thank you Chris). Together we have resolved a number of important issues
based on that testing, and are fairly confident now that it is safe to move
the UTC updates for Chronology-Core to trunk.
These changes are inherently risky because they modify the DateAndTime
instances that are used trhoughout our source code and version control,
and also because they are not easily reversed. I will be traveling for
the holidays, so I do not want to move the updates to trunk until I can
be around to respond to any problems. Most likely that will be December 28,
but in the mean time the updates should stay in inbox.
Once moved to trunk, there will be eight failing tests in Chronology-Tests.
Each of these represents an issue that I think should be addressed in
discussion on the squeak-dev list.
Dave
Levente Uzonyi uploaded a new version of Chronology-Core to project The Inbox:
http://source.squeak.org/inbox/Chronology-Core-ul.21.mcz
==================== Summary ====================
Name: Chronology-Core-ul.21
Author: ul
Time: 26 December 2018, 1:48:40.220196 am
UUID: 2e6f6ce2-d0ec-41a0-b27c-88c642e5afc9
Ancestors: Chronology-Core-dtl.20
- fix: do not subtract the offset twice while evaluating DateAndTime >> #setJdn:seconds:nano:localOffsetSeconds:
- use 0 for seconds in DateAndTime >> #midnight, because the offset will not be subtracted from the passed value
=============== Diff against Chronology-Core-dtl.20 ===============
Item was changed:
----- Method: DateAndTime>>midnight (in category 'squeak protocol') -----
midnight
"Answer a DateAndTime starting at midnight of the same timezone offset as the receiver."
^ self class basicNew
setJdn: self julianDayNumber
+ seconds: 0
- seconds: localOffsetSeconds
nano: 0
localOffsetSeconds: localOffsetSeconds.!
Item was changed:
----- Method: DateAndTime>>setJdn:seconds:nano:localOffsetSeconds: (in category 'private') -----
setJdn: jdn seconds: s nano: n localOffsetSeconds: offset
localOffsetSeconds := offset.
utcMicroseconds := self
microsecondsFromDay: jdn
+ seconds: s
- seconds: s - offset
nanos: n
offset: offset!
Hi Levente, Balázs, and all,
I've modified PostgresV3 to support parameter binding so that parsing
SQL with placeholders and binding/executing with data are done
separately. So far tested inserts and selects successfully.
I've created an account on Squeaksource called PierceNg. Happy to
contribute my changes to the Squeaksource repo if you grant me commit
access.
I'm more of a Pharo user, and intend to make PostgresV3's TLS work with
Pharo, and also to develop a more friendly API for it. Of course I will
keep protocol state machine changes in sync between the Squeak and Pharo
versions.
Screenshots:
1 - Wireshark capture of a select protocol exchange.
2 - Pharo inspector of a PG3ResultSet. More work needs to be done - the
left-most column should not be large negative numbers.
Cheers,
Pierce
https://www.samadhiweb.com/blog