Hi guys for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web Now I would love to get your ideas and their solution. Stef
On 03 Mar 2016, at 09:23, stepharo <stepharo@free.fr> wrote:
Hi guys
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web
Time is soo simple that there is no real need for a true web service and such a service would be trivial anyway (yet I did not find any public/free ones). Here is one way to do it: | stream unixTime | stream := nil. [ "RFC 868 TCP protocol https://en.wikipedia.org/wiki/Time_Protocol " stream := ZdcSocketStream openConnectionToHostNamed: 'time.nist.gov' port: 37. unixTime := (stream next: 4) asInteger ] ensure: [ stream ifNotNil: [ [ stream close ] on: Error do: [] ] ]. DateAndTime fromUnixTime: unixTime. The real stuff is SNTP though http://en.wikipedia.org/wiki/Network_Time_Protocol http://tools.ietf.org/html/rfc2030 which is implemented in ZTimestamp and which can do much more: ZTimestampSNTPClient new remoteClock. Sven
Now I would love to get your ideas and their solution.
Stef
Tx This is a cool challenge Le 3/3/16 13:08, Sven Van Caekenberghe a écrit :
On 03 Mar 2016, at 09:23, stepharo <stepharo@free.fr> wrote:
Hi guys
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web Time is soo simple that there is no real need for a true web service and such a service would be trivial anyway (yet I did not find any public/free ones).
Here is one way to do it:
| stream unixTime | stream := nil. [ "RFC 868 TCP protocol https://en.wikipedia.org/wiki/Time_Protocol " stream := ZdcSocketStream openConnectionToHostNamed: 'time.nist.gov' port: 37. unixTime := (stream next: 4) asInteger ] ensure: [ stream ifNotNil: [ [ stream close ] on: Error do: [] ] ]. DateAndTime fromUnixTime: unixTime.
The real stuff is SNTP though
http://en.wikipedia.org/wiki/Network_Time_Protocol http://tools.ietf.org/html/rfc2030
which is implemented in ZTimestamp and which can do much more:
ZTimestampSNTPClient new remoteClock.
Sven
Now I would love to get your ideas and their solution.
Stef
stepharo <stepharo@free.fr> writes:
Now I would love to get your ideas and their solution.
getting a photo from an email address through gravatar: email := 'damien@cassou.me'. url := 'http://www.gravatar.com/avatar/', (MD5 hashMessage: email trimBoth asLowercase) hex, '.jpg'. (ZnEasy getJpeg: url) asMorph openInHand -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill
Hi, That little howtos are really nice! I'll include them in the grafoscopio interactive notebook/tutorial... now Damien, how I delete your face of my image? :-P (but... seriously.. how I delete that morph. Alt-click is not working) Cheers, Offray On 03/03/16 08:46, Damien Cassou wrote:
stepharo <stepharo@free.fr> writes:
Now I would love to get your ideas and their solution. getting a photo from an email address through gravatar:
email := 'damien@cassou.me'. url := 'http://www.gravatar.com/avatar/', (MD5 hashMessage: email trimBoth asLowercase) hex, '.jpg'. (ZnEasy getJpeg: url) asMorph openInHand
On Wed, Mar 9, 2016 at 9:14 AM, Offray Vladimir Luna Cárdenas < offray.luna@mutabit.com> wrote:
Hi,
That little howtos are really nice! I'll include them in the grafoscopio interactive notebook/tutorial... now Damien, how I delete your face of my image? :-P (but... seriously.. how I delete that morph. Alt-click is not working)
Maybe browse "Morph allSubInstances" then "self delete" on the one you want to delete. cheers -ben
Cheers,
Offray
On 03/03/16 08:46, Damien Cassou wrote:
stepharo <stepharo@free.fr> writes:
Now I would love to get your ideas and their solution.
getting a photo from an email address through gravatar:
email := 'damien@cassou.me'. url := 'http://www.gravatar.com/avatar/', (MD5 hashMessage: email trimBoth asLowercase) hex, '.jpg'. (ZnEasy getJpeg: url) asMorph openInHand
These little how to may be included as an help in the image. Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Mar 3, 2016, at 5:23 AM, stepharo <stepharo@free.fr> wrote:
Hi guys
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web
Now I would love to get your ideas and their solution.
Stef
Hi, I wrote a little post with a how to extract sprites from a larger png file: http://www.humane-assessment.com/blog/extracting-sprite-from-png Cheers, Doru
On Mar 3, 2016, at 9:23 AM, stepharo <stepharo@free.fr> wrote:
Hi guys
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web
Now I would love to get your ideas and their solution.
Stef
-- www.tudorgirba.com www.feenk.com "Beauty is where we see it."
Excellent!
On Mar 3, 2016, at 6:58 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I wrote a little post with a how to extract sprites from a larger png file: http://www.humane-assessment.com/blog/extracting-sprite-from-png
Cheers, Doru
On Mar 3, 2016, at 9:23 AM, stepharo <stepharo@free.fr> wrote:
Hi guys
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information. For example, - extracting a sprite from a png file - access a time service of the web
Now I would love to get your ideas and their solution.
Stef
-- www.tudorgirba.com www.feenk.com
"Beauty is where we see it."
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On 03/03/16 09:23, stepharo wrote:
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information.
At #saner16 there was a talk about type hints in argument names in Pharo. The longest they found was aSelectorOrElementOrjQueryOrBooleanOrNumber. Alexandre replied that that could have been one of his, so I checked in a Seaside image (jQuery is a good hint), it was JQAccordion>active: aSelectorOrElementOrjQueryOrBooleanOrNumber by Lukas. So what are the longest type hinting argument names Alexandre uses? In Moose 6-1137? |arguments| arguments := Set new. (CompiledMethod allInstances select: [ :each | each author = 'AlexandreBergel' ]) do: [ :m | arguments addAll: m argumentNames ]. arguments asOrderedCollection sort: [ :a :b | a size > b size ] gives numberOfMillisecondsToWaitBeforeRefresh changePrimarySelectionSelector aValueOrASymbolOrAOneArgBlock ... Stephan
Nice one! Doru
On Mar 16, 2016, at 11:36 PM, Stephan Eggermont <stephan@stack.nl> wrote:
On 03/03/16 09:23, stepharo wrote:
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information.
At #saner16 there was a talk about type hints in argument names in Pharo. The longest they found was aSelectorOrElementOrjQueryOrBooleanOrNumber. Alexandre replied that that could have been one of his, so I checked in a Seaside image (jQuery is a good hint), it was JQAccordion>active: aSelectorOrElementOrjQueryOrBooleanOrNumber by Lukas. So what are the longest type hinting argument names Alexandre uses? In Moose 6-1137?
|arguments| arguments := Set new. (CompiledMethod allInstances select: [ :each | each author = 'AlexandreBergel' ]) do: [ :m | arguments addAll: m argumentNames ]. arguments asOrderedCollection sort: [ :a :b | a size > b size ]
gives numberOfMillisecondsToWaitBeforeRefresh changePrimarySelectionSelector aValueOrASymbolOrAOneArgBlock ...
Stephan
-- www.tudorgirba.com www.feenk.com "Beauty is where we see it."
:-) Alexandre
On Mar 16, 2016, at 11:36 PM, Stephan Eggermont <stephan@stack.nl> wrote:
On 03/03/16 09:23, stepharo wrote:
for the mooc I would like have a list of how to that students should look in the system and implement. The idea is to show to the participants that Pharo is open and that they can find information.
At #saner16 there was a talk about type hints in argument names in Pharo. The longest they found was aSelectorOrElementOrjQueryOrBooleanOrNumber. Alexandre replied that that could have been one of his, so I checked in a Seaside image (jQuery is a good hint), it was JQAccordion>active: aSelectorOrElementOrjQueryOrBooleanOrNumber by Lukas. So what are the longest type hinting argument names Alexandre uses? In Moose 6-1137?
|arguments| arguments := Set new. (CompiledMethod allInstances select: [ :each | each author = 'AlexandreBergel' ]) do: [ :m | arguments addAll: m argumentNames ]. arguments asOrderedCollection sort: [ :a :b | a size > b size ]
gives numberOfMillisecondsToWaitBeforeRefresh changePrimarySelectionSelector aValueOrASymbolOrAOneArgBlock ...
Stephan
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
participants (8)
-
Alexandre Bergel -
Ben Coman -
Damien Cassou -
Offray Vladimir Luna Cárdenas -
Stephan Eggermont -
stepharo -
Sven Van Caekenberghe -
Tudor Girba