Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and longitude are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below will get you started testing/playing with the clock morph. The latitude & longitude are for my location.
The #initialize method of ClockImageMorph has a lot of comments about the options of the clock.
Have fun.
Lou
| c | " c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open.
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and longitude are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below will get you started testing/playing with the clock morph. The latitude & longitude are for my location.
The #initialize method of ClockImageMorph has a lot of comments about the options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Ron,
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou, Very cool.
Thank you.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content :)
Very interesting. Is there code to parse the lat and long from the string? I don't think I will incorporate it into the morph but I wouldn't mind supplying it in a comment for a user to use.
As is often the case, I have already made some changes to the code. I figured out a way to have the clock face picture be a local file or a URL to a file on the web. So something like this would work:
c := ClockImageMorph clockFace: 'http://www.labrunda.info/public/WorldWarII/MikeLaBrunda/Photos/MikeLaBrunda-...'.
I think I will wait a day or two before uploading a new version.
Lou
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and longitude are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below will get you started testing/playing with the clock morph. The latitude & longitude are for my location.
The #initialize method of ClockImageMorph has a lot of comments about the options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Lou,
re parsing that string with lat & long:
The url is ...JSON and there is a json package for Squeak. That will give you objects out of that string, I assume a Dictionary.
myDictionary := JSON fromString: 'what that URL returns'
latitude := myDictionary at: 'latitude'
Just a wild guess but I use the Json package and that's more or less what you need to do. No Squeak around to check.
Cheers,
Herbert
Am 30.01.2018 um 22:02 schrieb Louis LaBrunda:
Hi Ron,
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou, Very cool.
Thank you.
Just for fun, you can get user lat and long from the resulting dictionary by using the following: (WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content :)
Very interesting. Is there code to parse the lat and long from the string? I don't think I will incorporate it into the morph but I wouldn't mind supplying it in a comment for a user to use.
As is often the case, I have already made some changes to the code. I figured out a way to have the clock face picture be a local file or a URL to a file on the web. So something like this would work:
c := ClockImageMorph clockFace: 'http://www.labrunda.info/public/WorldWarII/MikeLaBrunda/Photos/MikeLaBrunda-...'.
I think I will wait a day or two before uploading a new version.
Lou
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and longitude are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below will get you started testing/playing with the clock morph. The latitude & longitude are for my location.
The #initialize method of ClockImageMorph has a lot of comments about the options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and longitude are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below will get you started testing/playing with the clock morph. The latitude & longitude are for my location.
The #initialize method of ClockImageMorph has a lot of comments about the options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below
will
get you started testing/playing with the clock morph. The latitude & longitude are for
my
location.
The #initialize method of ClockImageMorph has a lot of comments about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
I use the simple and effective JSON package at www.squeaksource.com/JSON for my weather station stuff. Does the job nicely.
To keep my floating point number printing under control I use Printf package www.squeaksource.com/Printf and, for example, ‘%-0.1e’ printf: myFloat The FormatString class comment describes it all reasonably neatly.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim "Bother" said Pooh as "Formating Drive C" appeared on the screen...
Hi
On 31.01.2018, at 19:46, tim Rowledge tim@rowledge.org wrote:
I use the simple and effective JSON package at www.squeaksource.com/JSON for my weather station stuff. Does the job nicely.
I've long considered to have this in Trunk. Tony would be ok with this.
Best regards -Tobias
To keep my floating point number printing under control I use Printf package www.squeaksource.com/Printf and, for example, ‘%-0.1e’ printf: myFloat The FormatString class comment describes it all reasonably neatly.
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim "Bother" said Pooh as "Formating Drive C" appeared on the screen...
I use the same, just my memory about its message names is leaky.
It works well for me so +1 for having it as part of trunk.
Herbert
Am 31.01.2018 um 19:55 schrieb Tony Garnock-Jones:
On 01/31/2018 06:51 PM, Tobias Pape wrote:
Tony would be ok with this.
I am definitely OK with this.
Tony
+1 Am 31.01.2018 20:58:23 schrieb Herbert König herbertkoenig@gmx.net: I use the same, just my memory about its message names is leaky.
It works well for me so +1 for having it as part of trunk.
Herbert
Am 31.01.2018 um 19:55 schrieb Tony Garnock-Jones:
On 01/31/2018 06:51 PM, Tobias Pape wrote:
Tony would be ok with this.
I am definitely OK with this.
Tony
In all of my images.
+1
On Wed, Jan 31, 2018 at 12:45 PM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
+1
Am 31.01.2018 20:58:23 schrieb Herbert König herbertkoenig@gmx.net: I use the same, just my memory about its message names is leaky.
It works well for me so +1 for having it as part of trunk.
Herbert
Am 31.01.2018 um 19:55 schrieb Tony Garnock-Jones:
On 01/31/2018 06:51 PM, Tobias Pape wrote:
Tony would be ok with this.
I am definitely OK with this.
Tony
Hi Ron and Everyone,
Thank you all for your comments and help. It seems there is a project name size limitation that I didn't notice when I first created the project. So I removed the project named "ClockAndCalendarMorp" and created a new one called "ClockCalendarMorphs". The old project is still listed and I'm not sure how to get rid of it?
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
I fixed a bug or two that Ron pointed out, thanks Ron. If latitude or longitude are not supplied I try to use Ron's web access to get them. I used the JSON package Tim said he uses (I found it before I saw his post, so I got lucky). I wrapped that code to trap and ignore errors. I changed the calendar header where the date/time/sunrise/sunset info is displayed. It's a little taller, shows seconds on sunrise and sunset (not really needed but why not) and uses 24 hour or AM/PM. I made the simple clock handles a little easier to tell apart.
I didn't add any dependencies as I'm still confused as to how that works.
Lou
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
HI Lou,
Don't feel bad. I'm not sure I understand how dependencies work either! There are a few things you can do like pre and post load scripts in Monticello that I use. You should understand how those work. You can right-click on a package in Monticello and "add required packages" but I'm not sure how that works.
When I try to load your code I get this:
This package depends on the following classes: RotaryDialMorph You must resolve these dependencies before you will be able to load these definitions:
That was very helpful for me to find the other repository that was required.
I don't see your other class but that is because it's not a superclass of other code.
The best way is to have good documentation in multiple locations so that people understand the feature is available.
Monticello also has Monticello Configurations which are very useful! That allows you to add multiple repositories and package versions into one package that is easy to load. I use that to keep track of specific versions of packages that make an application. You could commit one of those into your repository to let people know there is another repository available you can use to add features.
Maybe someone can help explain how "add required packages" is used or what it does.
All the best,
Ron
On Wed, Jan 31, 2018 at 4:42 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi Ron and Everyone,
Thank you all for your comments and help. It seems there is a project name size limitation that I didn't notice when I first created the project. So I removed the project named "ClockAndCalendarMorp" and created a new one called "ClockCalendarMorphs". The old project is still listed and I'm not sure how to get rid of it?
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
I fixed a bug or two that Ron pointed out, thanks Ron. If latitude or longitude are not supplied I try to use Ron's web access to get them. I used the JSON package Tim said he uses (I found it before I saw his post, so I got lucky). I wrapped that code to trap and ignore errors. I changed the calendar header where the date/time/sunrise/sunset info is displayed. It's a little taller, shows seconds on sunrise and sunset (not really needed but why not) and uses 24 hour or AM/PM. I made the simple clock handles a little easier to tell apart.
I didn't add any dependencies as I'm still confused as to how that works.
Lou
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com
wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code
here>
].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a
vertical
offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font:
font
color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <
Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting
dictionary
by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient
httpGet: '
https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no
attempt
will be made to do the calculations. In that case the KscAstroDataApp package should not
be
needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code
below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments
about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue;
tickColor:
Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
On Wed, Jan 31, 2018 at 04:42:21PM -0500, Louis LaBrunda wrote:
Hi Ron and Everyone,
Thank you all for your comments and help. It seems there is a project name size limitation that I didn't notice when I first created the project. So I removed the project named "ClockAndCalendarMorp" and created a new one called "ClockCalendarMorphs". The old project is still listed and I'm not sure how to get rid of it?
Hi Lou,
I have admin access to squeaksource.com, so I think that I can delete the "ClockAndCalendarMorp" one if you would like me to do so. You may be able to do it yourself too (one would hope, given that it is your project! ). Check and see if you have a "Delete Project" option under the "Actions" in the upper left of the screen when you enter the project. If that is not possible let me know and I will get rid of it for you.
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good if you can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new repository also. I can help if you do not have an easy way to do that.
Dave
I fixed a bug or two that Ron pointed out, thanks Ron. If latitude or longitude are not supplied I try to use Ron's web access to get them. I used the JSON package Tim said he uses (I found it before I saw his post, so I got lucky). I wrapped that code to trap and ignore errors. I changed the calendar header where the date/time/sunrise/sunset info is displayed. It's a little taller, shows seconds on sunrise and sunset (not really needed but why not) and uses 24 hour or AM/PM. I made the simple clock handles a little easier to tell apart.
I didn't add any dependencies as I'm still confused as to how that works.
Lou
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Dave,
Hi Lou, I have admin access to squeaksource.com, so I think that I can delete the "ClockAndCalendarMorp" one if you would like me to do so. You may be able to do it yourself too (one would hope, given that it is your project! ). Check and see if you have a "Delete Project" option under the "Actions" in the upper left of the screen when you enter the project. If that is not possible let me know and I will get rid of it for you.
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good if you can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new repository also. I can help if you do not have an easy way to do that.
Dave
I was going to try again to remove the ill named project but decided that your point about version history may have some validity. So, if you can please move any old versions to the new project and then delete the old project, that will be best. There may be two old versions as I did try to upload a version 1 that timed out.
Also, if you understand how dependencies work, please explain it to me or point me to something I can read so that I can set them up. I think, as I'm sure you do, that it is important for people to know just what packages are needed so they don't get avoidable errors that confuse things unnecessarily.
I'm going to add some comments to the project description that I hope will help but real specified dependencies would be better. Thanks.
Lou
I have been told that nobody uses the Monticello feature of dependencies among packages... The best way to specify dependencies seems to be Metacello at the moment.
2018-02-01 16:01 GMT+01:00 Louis LaBrunda Lou@keystone-software.com:
Hi Dave,
Hi Lou, I have admin access to squeaksource.com, so I think that I can delete the "ClockAndCalendarMorp" one if you would like me to do so. You may be able to do it yourself too (one would hope, given that it is your project! ). Check and see if you have a "Delete Project" option under the "Actions" in the upper left of the screen when you enter the project. If that is not possible let me know and I will get rid of it for you.
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good if you can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new repository also. I can help if you do not have an easy way to do that.
Dave
I was going to try again to remove the ill named project but decided that your point about version history may have some validity. So, if you can please move any old versions to the new project and then delete the old project, that will be best. There may be two old versions as I did try to upload a version 1 that timed out.
Also, if you understand how dependencies work, please explain it to me or point me to something I can read so that I can set them up. I think, as I'm sure you do, that it is important for people to know just what packages are needed so they don't get avoidable errors that confuse things unnecessarily.
I'm going to add some comments to the project description that I hope will help but real specified dependencies would be better. Thanks.
Lou
Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
On Thu, Feb 1, 2018 at 7:48 AM, Jakob Reschke forums.jakob@resfarm.de wrote:
I have been told that nobody uses the Monticello feature of dependencies among packages... The best way to specify dependencies seems to be Metacello at the moment.
Metacello is nice in this it gives very explicit information about dependancies, and it works in many Smalltalk dialects (and is actively maintained). That said, it seems to be predominently driven and used in Pharo, so documentation will likely have some bent towards that platform. Here is a reasonable introduction: http://blog.yuriy.tymch.uk/2013/10/dead-simple-intro-to-metacello.html It is also worth noting that using Metacello will install that package into your Squeak - it isn't there natively. The easiest way to load it into Squeak (that I've found) is to load a package managed by Metacello - it bootstraps itself in before loading the package you want.
All that said, I don't use it when I can avoid it. I do like looking at the dependencies, and then independently load them. Obviously not all of us feel that way.
The other option as Monticello Configurations, which is part of Squeak already (and what underpins our Trunk mechanism, so it is guaranteed to be working).
To use Monticello Configurations, open "Monticello Configurations" (which is right next to Monticello Browser in the open (or apps or tools) menu). Then, use the Add button to add the packages that you need to have loaded to support ClockAndCalendarMorphs (in the order they should be loaded). Make sure to add the package ClockAndCalendarMorphs las as well. Then, in the middle box, click and "add repository..." for the repositories that you will need to load the packages from. This should definitely include your new repository. It should also include the repository that the other packages need to come from. I don't think order is important here.
Finally, save the configuration to your repository.
-cbc
On Thu, Feb 1, 2018 at 7:48 AM, Jakob Reschke forums.jakob@resfarm.de wrote:
I have been told that nobody uses the Monticello feature of dependencies among packages...
At least for me that's because I didn't know they supported this :-(. I think I shall try using it :-)
The best way to specify dependencies seems to be Metacello at the moment.
2018-02-01 16:01 GMT+01:00 Louis LaBrunda Lou@keystone-software.com:
Hi Dave,
Hi Lou, I have admin access to squeaksource.com, so I think that I can delete
the
"ClockAndCalendarMorp" one if you would like me to do so. You may be
able to
do it yourself too (one would hope, given that it is your project! ).
Check
and see if you have a "Delete Project" option under the "Actions" in the
upper
left of the screen when you enter the project. If that is not possible
let me
know and I will get rid of it for you.
I made a few changes. The latest version is
ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good
if you
can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into
the new
repository also. I can help if you do not have an easy way to do that.
Dave
I was going to try again to remove the ill named project but decided
that your point about
version history may have some validity. So, if you can please move any
old versions to the new
project and then delete the old project, that will be best. There may
be two old versions as I
did try to upload a version 1 that timed out.
Also, if you understand how dependencies work, please explain it to me
or point me to something
I can read so that I can set them up. I think, as I'm sure you do, that
it is important for
people to know just what packages are needed so they don't get avoidable
errors that confuse
things unnecessarily.
I'm going to add some comments to the project description that I hope
will help but real
specified dependencies would be better. Thanks.
Lou
Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
On 01-02-2018, at 9:58 AM, Eliot Miranda eliot.miranda@gmail.com wrote:
On Thu, Feb 1, 2018 at 7:48 AM, Jakob Reschke forums.jakob@resfarm.de wrote: I have been told that nobody uses the Monticello feature of dependencies among packages...
At least for me that's because I didn't know they supported this :-(. I think I shall try using it :-)
I do (or at least, did, might have stopped at some point, get off my lawn) use it for the WeatherStation package and NuScratchGPIO. The ui is a bit … sparse. Functionally it seems to work quite nicely; it loads the required packages before the main package. What else would it do? A bit more UI to manage required packages would be nice; currently you can add one, or remove them all. A bit sledge-hammer for my tastes.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Never trust a computer you can't lift.
On Thu, Feb 01, 2018 at 10:01:11AM -0500, Louis LaBrunda wrote:
Hi Dave,
Hi Lou, I have admin access to squeaksource.com, so I think that I can delete the "ClockAndCalendarMorp" one if you would like me to do so. You may be able to do it yourself too (one would hope, given that it is your project! ). Check and see if you have a "Delete Project" option under the "Actions" in the upper left of the screen when you enter the project. If that is not possible let me know and I will get rid of it for you.
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good if you can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new repository also. I can help if you do not have an easy way to do that.
Dave
I was going to try again to remove the ill named project but decided that your point about version history may have some validity. So, if you can please move any old versions to the new project and then delete the old project, that will be best. There may be two old versions as I did try to upload a version 1 that timed out.
Hi Lou,
I will be travelling and I may not be able to follow up on this for a few days, but in the mean time here is how you can copy ClockAndCalendarMorphs-LL.2 into your new repository.
Assuming you have an image with a Monticello browser open, and that you have both the old ClockAndCalendarMorp repository and your newer ClockCalendarMorphs repository that will replace it, then do this:
- From the Monticello browser, select the ClockAndCalendarMorp repository and click the "Open" button to open it.
- Select the ClockAndCalendarMorphs-LL.2 in the newly opened repository browser, and then click the "Copy" button.
- This will open a a menu of repositories to copy it to. Highlight your new ClockCalendarMorphs repository in the list, and click the "Choose" button.
This will copy the MCZ from the old repository to the new one, and when you refresh the browser on the new repository, you should see it there.
Also, if you understand how dependencies work, please explain it to me or point me to something I can read so that I can set them up. I think, as I'm sure you do, that it is important for people to know just what packages are needed so they don't get avoidable errors that confuse things unnecessarily.
I'm going to add some comments to the project description that I hope will help but real specified dependencies would be better. Thanks.
I don't know about the dependencies configuration, but other people are providing good answers :-)
Dave
Hi Dave,
I followed your instructions and all seems to have gone well. Thanks.
Ron pointed out that the was a problem with Squeak version older than 5.1. I have fixed that and made a new version.
Lou
On Thu, 1 Feb 2018 21:57:25 -0500, "David T. Lewis" lewis@mail.msen.com wrote:
On Thu, Feb 01, 2018 at 10:01:11AM -0500, Louis LaBrunda wrote:
Hi Dave,
Hi Lou, I have admin access to squeaksource.com, so I think that I can delete the "ClockAndCalendarMorp" one if you would like me to do so. You may be able to do it yourself too (one would hope, given that it is your project! ). Check and see if you have a "Delete Project" option under the "Actions" in the upper left of the screen when you enter the project. If that is not possible let me know and I will get rid of it for you.
I made a few changes. The latest version is ClockAndCalendarMorphs-LL.3.mcz.
Just for the sake of maintaining the version history, it would be good if you can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new repository also. I can help if you do not have an easy way to do that.
Dave
I was going to try again to remove the ill named project but decided that your point about version history may have some validity. So, if you can please move any old versions to the new project and then delete the old project, that will be best. There may be two old versions as I did try to upload a version 1 that timed out.
Hi Lou,
I will be travelling and I may not be able to follow up on this for a few days, but in the mean time here is how you can copy ClockAndCalendarMorphs-LL.2 into your new repository.
Assuming you have an image with a Monticello browser open, and that you have both the old ClockAndCalendarMorp repository and your newer ClockCalendarMorphs repository that will replace it, then do this:
- From the Monticello browser, select the ClockAndCalendarMorp repository and
click the "Open" button to open it.
- Select the ClockAndCalendarMorphs-LL.2 in the newly opened repository browser,
and then click the "Copy" button.
- This will open a a menu of repositories to copy it to. Highlight your new
ClockCalendarMorphs repository in the list, and click the "Choose" button.
This will copy the MCZ from the old repository to the new one, and when you refresh the browser on the new repository, you should see it there.
Also, if you understand how dependencies work, please explain it to me or point me to something I can read so that I can set them up. I think, as I'm sure you do, that it is important for people to know just what packages are needed so they don't get avoidable errors that confuse things unnecessarily.
I'm going to add some comments to the project description that I hope will help but real specified dependencies would be better. Thanks.
I don't know about the dependencies configuration, but other people are providing good answers :-)
Dave
Hi Dave,
Maybe you can answer a few questions for me. When I look at the Monticello "Registration" information of other projects they have the "user" and "password" fields as blank or 'squeak'. My projects have "user" as 'LL'. I'm not sure how they got this way, I expect it was filled in and I just went with it. Does this mean anything? Does it make it harder for people to download the project? Should I change it?
Lou
On Sun, Feb 04, 2018 at 09:22:31AM -0500, Louis LaBrunda wrote:
Hi Dave,
Maybe you can answer a few questions for me. When I look at the Monticello "Registration" information of other projects they have the "user" and "password" fields as blank or 'squeak'. My projects have "user" as 'LL'. I'm not sure how they got this way, I expect it was filled in and I just went with it. Does this mean anything? Does it make it harder for people to download the project? Should I change it?
Hi Lou,
Your project setup looks fine to me. People can see your files and load them without any user or password, and only you (LL) and save new versions into your repositories.
I think that (as you say) the user LL that you see is a convenience. For comparison, when I look at your project through the web interface, I see this if I am not logged in to squeaksource:
MCHttpRepository location: 'http://www.squeaksource.com/ClockCalendarMorphs' user: '' password: ''
After I log in as dtl, it looks like this:
MCHttpRepository location: 'http://www.squeaksource.com/ClockCalendarMorphs' user: 'dtl' password: ''
So indeed it looks like a convenience, so that if I cut and paste that registration information into a Monticello browser in my image, it will already have my user initials.
Dave
Hi Dave,
Thanks for the explanation. It helps to understand things knowing what others see when they log in. I'm glad everyone can easily download the project.
Lou
On Sun, 4 Feb 2018 11:54:31 -0500, "David T. Lewis" lewis@mail.msen.com wrote:
On Sun, Feb 04, 2018 at 09:22:31AM -0500, Louis LaBrunda wrote:
Hi Dave,
Maybe you can answer a few questions for me. When I look at the Monticello "Registration" information of other projects they have the "user" and "password" fields as blank or 'squeak'. My projects have "user" as 'LL'. I'm not sure how they got this way, I expect it was filled in and I just went with it. Does this mean anything? Does it make it harder for people to download the project? Should I change it?
Hi Lou,
Your project setup looks fine to me. People can see your files and load them without any user or password, and only you (LL) and save new versions into your repositories.
I think that (as you say) the user LL that you see is a convenience. For comparison, when I look at your project through the web interface, I see this if I am not logged in to squeaksource:
MCHttpRepository location: 'http://www.squeaksource.com/ClockCalendarMorphs' user: '' password: ''
After I log in as dtl, it looks like this:
MCHttpRepository location: 'http://www.squeaksource.com/ClockCalendarMorphs' user: 'dtl' password: ''
So indeed it looks like a convenience, so that if I cut and paste that registration information into a Monticello browser in my image, it will already have my user initials.
Dave
Hi Ron,
Sorry I forgot about your DisplayScreen fullScreenOn problem. It seems #fullScreenOn is deprecated in Project. So, using DisplayScreen fullScreenOn seems correct going forward. What do you think of this:
[DisplayScreen fullScreenOn] on: Error do: [:e | Project current fullScreenOn].
Lou
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting dictionary by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: ' https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no attempt will be made to do the calculations. In that case the KscAstroDataApp package should not be needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue; tickColor: Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Lou,
Well since you are really trying to add backward compatibility why not make it explicit.
Not sure when it was deprecated assuming it was 4.1
"Provide backward compatibility for deprecated method #fullScreenOn which was moved to DisplayScreen in Squeak 4.1" versionArray := Smalltalk version splitInteger. (versionArray first = 'Squeak' and: [versionArray second <= 4.1]) ifTrue: [ Project current fullScreenOn] ifFalse: [ DisplayScreen fullScreenOn].
I didn't actually run this code so YMMV :).
Oh and since you need this twice you should add the results of the test to a variable so you don't have to call it twice for #fullScreenOff.
All the best,
Ron
On Thu, Feb 1, 2018 at 11:44 AM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi Ron,
Sorry I forgot about your DisplayScreen fullScreenOn problem. It seems #fullScreenOn is deprecated in Project. So, using DisplayScreen fullScreenOn seems correct going forward. What do you think of this:
[DisplayScreen fullScreenOn] on: Error do: [:e | Project current
fullScreenOn].
Lou
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
Not sure if there was a name size limitation but I would change that to Morph instead of Morp.
All the best,
Ron
On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum ron@usmedrec.com
wrote:
Hi Lou,
For the Json stuff Herbert is correct. You will need to load a Json reader. On my image I use.
Json readFrom: self readStream. To get a dictionary. You then just read the values from the dictionary.
Some other Json reader might have #readFromString: as Herbert suggested.
For managing the package if it is not loaded I would recommend adding
Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code
here>
].
That way you handle the problem if the dependency is not loaded.
I also had a problem with my image (4.1)
I had to use: Project current fullScreenOn and Project current fullScreenOff.
Also, it is possible to return fraction from your x point calculation which will cause problems: I added asFloat below to fix it.
Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color "Display the string centered horizontally in the rectangle with a
vertical
offset from the top using the font and color." | bb stringExtent f x y rOrigin |
bb := (StringMorph contents: aString font: font) imageForm boundingBox. stringExtent := bb extent. f := Form extent: stringExtent depth: 32. f getCanvas drawString: aString in: (0@0 extent: stringExtent) font:
font
color: color. rOrigin := rect origin. x := rOrigin x + ((rect width - bb width) / 2) asFloat. y := rOrigin y + vOffset. self getCanvas translucentImage: f at: (x@y).
I also noticed that the time quite large :) I'm seeing: 11:28:35.28400000001 am
Keep up the nice work!
All the best,
Ron
On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <
Lou@keystone-software.com
wrote:
Hi Ron,
Sorry, I forgot to ask, did I get the dependency stuff right?
Lou
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very cool.
Just for fun, you can get user lat and long from the resulting
dictionary
by using the following:
(WebClient httpGet: 'http://freegeoip.net/json/', (WebClient
httpGet: '
https://api.ipify.org') content) content
:)
All the best,
Ron
On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
Lou@keystone-software.com>
wrote:
Hi,
I have created and uploaded my ClockAndCalendarMorphs project on SqueakSource. It depends upon another of my projects, KscAstroDataApp. KscAstroDataApp is used to calculate sunrise and sunset times displayed on the clock and calendar. Latitude and
longitude
are required for the sunrise and sunset calculations. If you don't supply them, no
attempt
will be made to do the calculations. In that case the KscAstroDataApp package should not
be
needed. Anyway it is probably best to download it too.
I'm new to SqueakSource and I'm not sure I defined the dependency correctly. If not, I will fix it. Please let me know if you have any problems. The code
below
will
get you started testing/playing with the clock morph. The latitude & longitude are
for my
location.
The #initialize method of ClockImageMorph has a lot of comments
about
the
options of the clock.
Have fun.
Lou
| c |
" c := ClockImageMorph clockFace: 'path2picture.jpg'." c := ClockImageMorph new. " c setTestMode." c desiredExtent: 1200@800. c setIncludeCalendar. c latitude: 40.66296 longitude: -74.535398. " c beTwentyFourHourClock." c setUseArabicNumerals. " c setUseRomanNumerals." c setAddCirclesAndTicks. " c setUseFancyHourHand. c setUseFancyMinuteHand. c setUseFancySecondHand." " c beFullScreen." c setShowDateTimeInfo. c numberColor: Color blue; circleColor: Color blue;
tickColor:
Color blue. c hourHandColor: Color blue; minuteHandColor: Color blue; secondHandColor: Color blue. c calendarTextColor: Color blue. c open. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
-- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Ron,
Hi Lou, Well since you are really trying to add backward compatibility why not make it explicit. snip...
I did a little research, it seems DisplayScreen fullScreenOn doesn't show up until 5.1, so I went with this:
versionArray := Smalltalk version splitInteger. version5_1Plus := (versionArray first = 'Squeak') and: [versionArray second >= 5.1].
Any 5.1 image or newer will use DisplayScreen fullScreenOn, older gets Project current fullScreenOn.
I haven't uploaded it yet as I want to see if anything else comes up.
Lou
Hi Lou,
Very nice!
Ron
On Thu, Feb 1, 2018 at 2:30 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi Ron,
Hi Lou, Well since you are really trying to add backward compatibility why not
make
it explicit. snip...
I did a little research, it seems DisplayScreen fullScreenOn doesn't show up until 5.1, so I went with this:
versionArray := Smalltalk version splitInteger. version5_1Plus := (versionArray first = 'Squeak') and:
[versionArray second >= 5.1].
Any 5.1 image or newer will use DisplayScreen fullScreenOn, older gets Project current fullScreenOn.
I haven't uploaded it yet as I want to see if anything else comes up.
Lou
Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
Hi Ron,
I wanted to start work on the Seaside program that will use the clock, so, I made a new version with this change to make it easier to load into another image where I plan to do the Seaside work.
Lou
On Thu, 1 Feb 2018 15:47:08 -0500, Ron Teitelbaum ron@usmedrec.com wrote:
Hi Lou,
Very nice!
Ron
On Thu, Feb 1, 2018 at 2:30 PM, Louis LaBrunda Lou@keystone-software.com wrote:
Hi Ron,
Hi Lou, Well since you are really trying to add backward compatibility why not
make
it explicit. snip...
I did a little research, it seems DisplayScreen fullScreenOn doesn't show up until 5.1, so I went with this:
versionArray := Smalltalk version splitInteger. version5_1Plus := (versionArray first = 'Squeak') and:
[versionArray second >= 5.1].
Any 5.1 image or newer will use DisplayScreen fullScreenOn, older gets Project current fullScreenOn.
I haven't uploaded it yet as I want to see if anything else comes up.
Lou
Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon
squeak-dev@lists.squeakfoundation.org