ClockAndCalendarMorphs project on SqueakSource

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Ron Teitelbaum
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 <[hidden email]> 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





Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
Hi Ron,

On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum <[hidden email]> 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-1-11-1943.jpg'.

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 <[hidden email]>
>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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Herbert König
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 <[hidden email]> 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-1-11-1943.jpg'.
>
> 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 <[hidden email]>
>> 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
>>>
>>>
>>>


Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
In reply to this post by Ron Teitelbaum
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 <[hidden email]> 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 <[hidden email]>
>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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Ron Teitelbaum
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
>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





Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Ron Teitelbaum
Hi Lou,


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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
>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 <a href="callto://PhotonDemon" target="_blank">callto://PhotonDemon
>>
>>
>>
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe <a href="callto://PhotonDemon" target="_blank">callto://PhotonDemon






Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

timrowledge
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; [hidden email]; http://www.rowledge.org/tim
"Bother" said Pooh as "Formating Drive C" appeared on the screen...



Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Tobias Pape
Hi

> On 31.01.2018, at 19:46, tim Rowledge <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
> "Bother" said Pooh as "Formating Drive C" appeared on the screen...
>
>
>


Reply | Threaded
Open this post in threaded view
|

Putting JSON in trunk (was Re: ClockAndCalendarMorphs project on SqueakSource)

Tony Garnock-Jones-5
On 01/31/2018 06:51 PM, Tobias Pape wrote:
> Tony would be ok with this.

I am definitely OK with this.

Tony

Reply | Threaded
Open this post in threaded view
|

Re: Putting JSON in trunk (was Re: ClockAndCalendarMorphs project on SqueakSource)

Herbert König
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
>


Reply | Threaded
Open this post in threaded view
|

Re: Putting JSON in trunk (was Re: ClockAndCalendarMorphs project on SqueakSource)

marcel.taeumel
+1

Am 31.01.2018 20:58:23 schrieb Herbert König <[hidden email]>:

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
>




cbc
Reply | Threaded
Open this post in threaded view
|

Re: Putting JSON in trunk (was Re: ClockAndCalendarMorphs project on SqueakSource)

cbc
In all of my images.

+1

On Wed, Jan 31, 2018 at 12:45 PM, Marcel Taeumel <[hidden email]> wrote:
+1

Am 31.01.2018 20:58:23 schrieb Herbert König <[hidden email]>:

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
>








Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
In reply to this post by Ron Teitelbaum
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
>> > 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 <[hidden email]>
>>> 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 <
>>> [hidden email]>
>>> >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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Ron Teitelbaum
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
>> > 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 <[hidden email]>
>>> 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 <
>>> [hidden email]>
>>> >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 <a href="callto://PhotonDemon" target="_blank">callto://PhotonDemon
>>> >>
>>> >>
>>> >>
>>> --
>>> Louis LaBrunda
>>> Keystone Software Corp.
>>> SkypeMe <a href="callto://PhotonDemon" target="_blank">callto://PhotonDemon
>>>
>>>
>>>
>>
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe <a href="callto://PhotonDemon" target="_blank">callto://PhotonDemon





Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

David T. Lewis
In reply to this post by Louis LaBrunda
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> >> > 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 <[hidden email]>
> >>> 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 <
> >>> [hidden email]>
> >>> >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
>
>

Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Jakob Reschke
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 <[hidden email]>:

> 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
>
>

cbc
Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

cbc
On Thu, Feb 1, 2018 at 7:48 AM, Jakob Reschke <[hidden email]> 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:
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


Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
In reply to this post by Ron Teitelbaum
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
>> > 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 <[hidden email]>
>>> 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 <
>>> [hidden email]>
>>> >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


12