Hi,
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
~Mayuresh
On Fri, 29 Mar 2002, Mayuresh Kathe wrote:
Hi,
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
See http://minnow.cc.gatech.edu/squeak/398
-- Bert
On Thursday 28 March 2002 01:03 pm, Bert Freudenberg wrote:
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
If it helps, this will do RFC868 (no error handling, etc.):
| s addr response time | s _ Socket new. addr _ NetNameResolver promptUserForHostAddress. s connectTo: addr port: 37. s waitForConnectionUntil: Socket standardDeadline. response _ ByteArray withAll: s getData. "from Jan 1 1900" time _ response unsignedLongAt: 1 bigEndian: true. time _ time - (365 * 24 * 60 * 60). "shift to 1901" (Time dateAndTimeFromSeconds: time) inspect
I would like to have one of my AcceptableCleanTextMorphs pass characters through to the #accept method as characters are typed, a character at a time. What would the best way to accomplish that? #hasUnacceptedEdits might do it I suspect but how? Where would I need to do the check?
Perhaps AcceptableCleanTextMorph is not the right way to address the problem. Basically I need a small command window that immediately sends characters when typed.
Thx for any help. Ken Brown
On Monday 01 April 2002 02:19 pm, Ken G. Brown wrote:
I would like to have one of my AcceptableCleanTextMorphs pass characters through to the #accept method as characters are typed, a character at a time. What would the best way to accomplish that? #hasUnacceptedEdits might do it I suspect but how? Where would I need to do the check?
Perhaps AcceptableCleanTextMorph is not the right way to address the problem. Basically I need a small command window that immediately sends characters when typed.
You need to make sure that you get mouse focus (tell the Hand when the mouse enters you), then override handlesKeyboard: to return true, and override keyStroke:.
Look at (for instance) Tetris to see how to do this.
Ken,
The type-in pane of the "Objects Tool" (seen when its "find" tab is selected) had a similar need. Check out ObjectsTool.newSearchPane to see how it does it.
HTH
-- Scott
At 3:19 PM -0700 4/1/02, Ken G. Brown wrote:
I would like to have one of my AcceptableCleanTextMorphs pass characters through to the #accept method as characters are typed, a character at a time. What would the best way to accomplish that? #hasUnacceptedEdits might do it I suspect but how? Where would I need to do the check?
Perhaps AcceptableCleanTextMorph is not the right way to address the problem. Basically I need a small command window that immediately sends characters when typed.
Thx for any help. Ken Brown
Thx a bunch Ned and Scott, I now have something that works. Next job is to try to understand it! Then make it pretty... Ken
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org]On Behalf Of Scott Wallace Sent: April 1, 2002 3:47 PM To: Ken G. Brown Cc: squeak-dev@lists.squeakfoundation.org Subject: Re: How to force AcceptableCleanTextMorph to accept for each character typed?
Ken,
The type-in pane of the "Objects Tool" (seen when its "find" tab is selected) had a similar need. Check out ObjectsTool.newSearchPane to see how it does it.
HTH
-- Scott
At 3:19 PM -0700 4/1/02, Ken G. Brown wrote:
I would like to have one of my AcceptableCleanTextMorphs
pass characters
through to the #accept method as characters are typed, a
character at a
time. What would the best way to accomplish that? #hasUnacceptedEdits might do it I suspect but how? Where
would I need to do
the check?
Perhaps AcceptableCleanTextMorph is not the right way to address the problem. Basically I need a small command window that
immediately sends
characters when typed.
Thx for any help. Ken Brown
How would you get the text insertion bar to show up when you first click in this little pane? It appears when you start typing but it would be nice to be there beforehand so you have an idea the pane has keyboard focus. Thx. Ken
Ken,
The type-in pane of the "Objects Tool" (seen when its "find" tab is selected) had a similar need. Check out ObjectsTool.newSearchPane to see how it does it.
HTH
-- Scott
Hi, Ken,
The way you would do this is to wait until 4846iBeamInNullText appears in the external update streams.
Cheers,
-- Scott
PS: Sorry for the long delay in responding.
At 5:33 PM -0700 4/1/02, Ken G. Brown wrote:
How would you get the text insertion bar to show up when you first click in this little pane? It appears when you start typing but it would be nice to be there beforehand so you have an idea the pane has keyboard focus. Thx. Ken
Ken,
The type-in pane of the "Objects Tool" (seen when its "find" tab is selected) had a similar need. Check out ObjectsTool.newSearchPane to see how it does it.
Hi,
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
~Mayuresh
also see http://minnow.cc.gatech.edu/squeak/1076
and a previous note on the subject.
At 10:50 PM -0800 11/20/01, John M McIntosh wrote:
go ask my friendly time server what the time is.
| serverAddr s | Socket initializeNetworkIfFail: [^self error: 'Failed to init network']. serverAddr _ NetNameResolver addressForName: 'time-a.nist.gov' timeout: 10. serverAddr = nil ifTrue: [self error: 'Could not find the address for time-a.nist.gov']. s _ Socket new. s connectTo: serverAddr port: 13. s waitForConnectionUntil: (self deadlineSecs: 15). Transcript show: 'the time server reports: ' , s getResponseNoLF,' at time ',Time now printString;cr. s closeAndDestroy.
Try it,
the time server reports: 52234 01-11-21 05:33:07 00 0 0 599.9 UTC(NIST) * at time 9:33:06 pm
See http://www.boulder.nist.gov/timefreq/service/its.htm
then do some messy math and roughly estimate the time zone I'm in and go from there... This assume the silly system clock is oh 5 to 10 minutes within the real time I'd guess, actually it doesn't matter the math + or - will allow me to back calculate the UTC time. MMm I could go with port 37 and get the seconds since 1900, that might be easier, then get the seconds in squeak since 1901
Also you should note if your VM supports UUID as a primitive then this note can apply At 12:28 PM -0800 11/21/01, John M McIntosh wrote:
Ok I read the fine print some more and realized that I think I can ignore the timestamp issue either by working with local time, or doing a UUID version 4 GUID. So from the docs:
The timestamp is a 60 bit value. For UUID version 1, this is represented by Coordinated Universal Time (UTC) as a count of 100-nanosecond intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to the Christian calendar).
For systems that do not have UTC available, but do have local time, they MAY use local time instead of UTC, as long as they do so consistently throughout the system. This is NOT RECOMMENDED, however, and it should be noted that all that is needed to generate UTC, given local time, is a time zone offset.
For UUID version 3, it is a 60 bit value constructed from a name.
For UUID version 4, it is a randomly or pseudo-randomly generated 60 bit value.
So I think I'll do a version 4 UUID in Smalltalk and fall back to a system generated UUID if the hosting OS support it. This is way less complicated than dealing with the timestamp.
Hi,
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
~Mayuresh
This is all fine and good, but maybe we need to have a primitive that will give UTC time *if* the VM will support it, if not then fall back to Ned's solution via a port 37 call.
Mmm any takers?
On Thu, Mar 28, 2002 at 01:56:05PM -0800, John M McIntosh wrote:
Hi,
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
~Mayuresh
This is all fine and good, but maybe we need to have a primitive that will give UTC time *if* the VM will support it, if not then fall back to Ned's solution via a port 37 call.
Mmm any takers?
Lex Spoon posted the code for this several centuries ago (in "Internet Time") and has reminded the list about it a number of times since then. I've saved a copy if there is renewed interest.
Dave
Lex Spoon posted the code for this several centuries ago (in "Internet Time") and has reminded the list about it a number of times since then. I've saved a copy if there is renewed interest.
Dave
Sure send me a copy
On Thu, Mar 28, 2002 at 09:28:23PM -0800, John M McIntosh wrote:
Lex Spoon posted the code for this several centuries ago (in "Internet Time") and has reminded the list about it a number of times since then. I've saved a copy if there is renewed interest.
Dave
Sure send me a copy
Here it is. This was from February 2000.
squeak-dev@lists.squeakfoundation.org