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
|

Re: ClockAndCalendarMorphs project on SqueakSource

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

Eliot Miranda-2
In reply to this post by Jakob Reschke


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

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




--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

timrowledge


> On 01-02-2018, at 9:58 AM, Eliot Miranda <[hidden email]> wrote:
>
>
>
> 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...
>
> 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; [hidden email]; http://www.rowledge.org/tim
Never trust a computer you can't lift.



Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

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


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

Ron Teitelbaum
Hi Lou,

Very nice!  

Ron

On Thu, Feb 1, 2018 at 2:30 PM, Louis LaBrunda <[hidden email]> 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





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

Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

Louis LaBrunda
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" <[hidden email]> 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
>
--
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,

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

>Hi Lou,
>
>Very nice!
>
>Ron
>
>On Thu, Feb 1, 2018 at 2:30 PM, Louis LaBrunda <[hidden email]>
>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
>>
>>
>>
--
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 David T. Lewis
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
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon


Reply | Threaded
Open this post in threaded view
|

Re: ClockAndCalendarMorphs project on SqueakSource

David T. Lewis
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


Reply | Threaded
Open this post in threaded view
|

ClockAndCalendarMorphs project on SqueakSource

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


12