Re: [Pharo-users] IceGenericError: Failed to connect to github.com: Interrupted system call

2019-06-10 Thread Hernán Morales Durand
This is interesting, Pharo VM crashes with segmentation fault on macOS High
Sierra when I select the error instance variable from the GTDebugger.
crash.dmp attached.

On the other hand, I wrote a workaround for others with the same problem
and who need a quick & dirty fix.

Cheers,

Hernán

El lun., 10 jun. 2019 a las 8:00, Hernán Morales Durand (<
hernan.mora...@gmail.com>) escribió:

> Attached the Stack in FUEL format in case someone want to check it out
>
> Cheers,
>
> Hernán
>
>
>
> El dom., 9 jun. 2019 a las 20:25, Hernán Morales Durand (<
> hernan.mora...@gmail.com>) escribió:
>
>> Hi guys,
>>
>>
>> In Pharo 7.0.3 I get an Iceberg error while cloning a repository. I tried
>> to fix dependent repositories, I guess there is something weird in
>> Diacriticals (https://github.com/hernanmd/Diacriticals) however I have
>> no clue what's wrong there.
>>
>>
>> I can reproduce it in a clean image by evaluating:
>>
>>
>> Metacello new
>>
>> baseline: 'StringExtensions';
>>
>> repository: 'github://hernanmd/StringExtensions/repository';
>>
>> load.
>>
>>
>> Any idea what could be wrong?
>>
>>
>> Cheers,
>>
>>
>> Hernán
>>
>>
>>


crash.dmp
Description: Binary data


IceGitClone-execute.st
Description: Binary data


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Christopher Fuhrman
Using an intermediate object "Play" (abstraction of a track being played
during an episode), a UML diagram

might look like:

[image: image.png]


On Mon, 10 Jun 2019 at 23:02, sergio ruiz  wrote:

> these numbers are super tiny..
>
> 25 episodes so far with about 15 tracks per episode..
>
>
>
> On Jun 10, 2019, at 1:36 PM, James Foster  wrote:
>
> The disadvantage is extra time doing the lookup. But before you discount
> this approach, ask yourself what performance penalty this will cost. How
> many episodes? How many tracks? Do you have less than 10K of each? How many
> milliseconds does it take to do a “brute-force” search? I strongly
> recommend:
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>
>


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread sergio ruiz
these numbers are super tiny..

25 episodes so far with about 15 tracks per episode..



> On Jun 10, 2019, at 1:36 PM, James Foster  wrote:
> 
> The disadvantage is extra time doing the lookup. But before you discount this 
> approach, ask yourself what performance penalty this will cost. How many 
> episodes? How many tracks? Do you have less than 10K of each? How many 
> milliseconds does it take to do a “brute-force” search? I strongly recommend:


peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread sergio ruiz
ah!

this exactly how i ended up putting it together…

and thanks, Jim for the pointers…

I just wanted to make sure I wasn’t totally missing something..



> On Jun 10, 2019, at 1:53 PM, Esteban Maringolo  wrote:
> 
> But it's not that one object has two "parents" (this isn't a tree like
> structure).
> The object (it is, the Track) has two references to the Episodes where
> it appears, such reference happens because aTrack as a instance


peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I've done a couple cheap and cheerful ORMs in various languages.   I always 
punt on doing the relationships because finishing the app is more urgent than 
writing a whole framework.  I just add an instance method that executes the 
appropriate SQL to fetch the related objects.  

You can spend a lot of time trying to do this in a generic declarative way, or 
you can just write a query as an instance method and get on with finishing your 
app.

> On Jun 10, 2019, at 5:20 AM, sergio ruiz  wrote:
> 
> I am currently putting together a Seaside website for my radio show. I am 
> trying to figure out how to model the "has and belongs to many" 
> relationships. 
> 
> Each episode can have many tracks, each of these tracks can belong to several 
> episodes.
> I want to be able to present a listing of which episodes each track appears 
> in, and a listing of tracks for each episode.
> 
> The approach I have seen on this is to create an intermediary object and 
> store a set of ids on this, but this seems a little clunky, and it seems like 
> there would be a clean way to do this.
> Am I missing something?
> Thanks!
> 
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com 
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> 

--- End Message ---


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Esteban Maringolo
By reference I mean an instance variable. So it's the same thing.

But it's not that one object has two "parents" (this isn't a tree like
structure).
The object (it is, the Track) has two references to the Episodes where
it appears, such reference happens because aTrack as a instance
variable "holding" (aka "referencing") aCollection, and this
collection "contains" (it is, references) two elements, that are the
Episodes in which a track appears.

For the sake of simplicity, you should define who must perform the
"maintenance" of the collections on only one sides. In my opinion it
should be the Episode.

E.g.
Episode>>addTrackToPlaylist: aTrack
  self playlist add: aTrack.
  aTrack includeInEpisode: self

Episode>>playlist
  playlist ifNil: [playlist := OrderedCollection new].


Track>>includeInEpisode: anEpisode
   self episodes add: anEpisode

Track>>#episodes
   episodes ifNil: [episodes := Set new]


You can see that #includeInEpisode: doesn't add itself to the Episode,
because it is very likely that the interaction is started onto the
Episode and not the Track. Otherwise to avoid a recursion you should
have a condition like:

Episode>>addTrackToPlaylist: aTrack
  (self playlist includes: aTrack) ifFalse: [
self playlist add: aTrack.
aTrack includeInEpisode: self ]

Track>>includeInEpisode: anEpisode
   self episodes add: anEpisode.
   anEpisode addTrackToPlaylist: self




The paper about "Mutual Friends" talks about the pro's and cons of
different approaches.

Esteban A. Maringolo

On Mon, Jun 10, 2019 at 2:40 PM sergio ruiz  wrote:
>
> when you say references, how does this look in pharo? I don’t know that I 
> have used such a relationship.
>
> I was thinking that an object would have an instance variable that was an 
> ordered collection of objects.. So having one object belong to two parent 
> objects could be tricky.
>
>
>
> On Jun 10, 2019, at 1:27 PM, Esteban Maringolo  wrote:
>
> You have anEpisode that references a collection with instances of Track.
> And each Track has a collection of episodes.
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>



Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread sergio ruiz
when you say references, how does this look in pharo? I don’t know that I have 
used such a relationship.

I was thinking that an object would have an instance variable that was an 
ordered collection of objects.. So having one object belong to two parent 
objects could be tricky.



> On Jun 10, 2019, at 1:27 PM, Esteban Maringolo  wrote:
> 
> You have anEpisode that references a collection with instances of Track.
> And each Track has a collection of episodes.


peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread James Foster
Sergio,

When you have a two-way relationship, one option is to keep duplicate 
information and use it to go from one object to the others. The advantage is 
rapid lookup, but the disadvantage is the need to update multiple places to 
maintain consistency (as well as the space it takes). 

Another option is to keep the relationship in only one place and then do a 
search for the secondary relationship on each lookup. So, each episode has a 
collection of tracks and the episode to tracks lookup is direct. If you have a 
track and want to find the episodes, then you query each episode to see if it 
includes that track. The advantage is simplicity of design and maintenance (the 
internal structures are never inconsistent; wrong, maybe, but never 
inconsistent!). 

The disadvantage is extra time doing the lookup. But before you discount this 
approach, ask yourself what performance penalty this will cost. How many 
episodes? How many tracks? Do you have less than 10K of each? How many 
milliseconds does it take to do a “brute-force” search? I strongly recommend:
* Make it work, [and only then]
* Make it right, [and only then, if really needed]
* Make it fast
Do the simplest thing that can possibly work, and that is to have one one set 
of references. Don’t add complexity till you need it. Hide (encapsulate) the 
implementation so you can change it later if needed. 

Another approach is to use a tool that provides automatic references. GemStone 
includes indexes that are managed by the system, so you can just ask the index 
for all episodes that reference a track. You only update one data structure but 
the system manages more.

James

> On Jun 10, 2019, at 5:20 AM, sergio ruiz  wrote:
> 
> I am currently putting together a Seaside website for my radio show. I am 
> trying to figure out how to model the "has and belongs to many" 
> relationships. 
> 
> Each episode can have many tracks, each of these tracks can belong to several 
> episodes.
> I want to be able to present a listing of which episodes each track appears 
> in, and a listing of tracks for each episode.
> 
> The approach I have seen on this is to create an intermediary object and 
> store a set of ids on this, but this seems a little clunky, and it seems like 
> there would be a clean way to do this.
> Am I missing something?
> Thanks!
> 
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com 
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> 



[Pharo-users] Dr. Geo release 19.06a

2019-06-10 Thread Hilaire
I am please to announce the Dr. Geo release 19.06, the GNU interactive
geometry software. It follows the release 19.03 in March 2019.

- New features
- Bugs fix
- Updated French user guide 
- New book "Programmer des math avec Dr. Geo" . WIP - 
Feedback appreciated!

See details in the change log file in the software or read the bugs fix
list .

Download .

Hilaire

-- 
Dr. Geo
http://drgeo.eu





Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Esteban Maringolo
The M:N relationship is pretty straightforward in pure OO design.

You have anEpisode that references a collection with instances of Track.
And each Track has a collection of episodes.

Of course this could be elaborated even further, and have an object
like TrackPlay sitting in between of anEpisode and aTrack.
This TrackPlay object could have extra information, like the timespan
at which it was played, the date (although this could be delegated to
the Episode itself).

It doesn't happen much these days, but a billboard hit was played more
than once, so with a TrackPlay you could log both plays and know when
each one was played.

So
Episode "has many" TrackPlay
TrackPlay "references" Episode and Track

The Track could "has many" Episodes (and ask them for the TrackPlays
of itself) or "has many" references TrackPlay.

And you can make things even more elaborated, but I'd go for the
"TrackPlay" (for the lack of a better name) path.

Regards,

Esteban A. Maringolo

On Mon, Jun 10, 2019 at 9:21 AM sergio ruiz  wrote:
>
> I am currently putting together a Seaside website for my radio show. I am 
> trying to figure out how to model the "has and belongs to many" relationships.
>
> Each episode can have many tracks, each of these tracks can belong to several 
> episodes.
> I want to be able to present a listing of which episodes each track appears 
> in, and a listing of tracks for each episode.
>
> The approach I have seen on this is to create an intermediary object and 
> store a set of ids on this, but this seems a little clunky, and it seems like 
> there would be a clean way to do this.
> Am I missing something?
> Thanks!
>
>
> 
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>



Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread sergio ruiz
Thanks!

I’ll look at this. I’d like to keep it in the OO domain.. There is no existing 
data. Everything would be created for this project.


> On Jun 10, 2019, at 12:53 PM, Ben Coman  wrote:
> 
> If you are keeping your design purely in the object-oriented domain,
> you might try Mutual Friends... 
> https://pdfs.semanticscholar.org/348f/e4ecff3c23f3709bb88e7e60379905a3b930.pdf
>  
> 
> although I've not enough experience with it to know if its the best way.
> 


peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread Ben Coman
On Mon, 10 Jun 2019 at 20:21, sergio ruiz  wrote:

> I am currently putting together a Seaside website for my radio show. I am
> trying to figure out how to model the "has and belongs to many"
> relationships.
>
> Each episode can have many tracks, each of these tracks can belong to
> several episodes.
> I want to be able to present a listing of which episodes each track
> appears in, and a listing of tracks for each episode.
>
> The approach I have seen on this is to create an intermediary object and
> store a set of ids on this, but this seems a little clunky, and it seems
> like there would be a clean way to do this.
>

This is how you'd model many-to-many relationships in relational databases.
https://dzone.com/articles/how-to-handle-a-many-to-many-relationship-in-datab

If that is where your data is stored, you may be forced to this.

If you are keeping your design purely in the object-oriented domain,
you might try Mutual Friends...
https://pdfs.semanticscholar.org/348f/e4ecff3c23f3709bb88e7e60379905a3b930.pdf
although I've not enough experience with it to know if its the best way.

Or you might try relation slots.   Check out SlotExampleMovieAndPersonTest.
Some background reading...
https://rmod.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLayouts.pdf

which I'd guess is still useful even if I read somewhere it was a bit out
of date.

cheers -ben


[Pharo-users] Modeling HABTM

2019-06-10 Thread sergio ruiz
I am currently putting together a Seaside website for my radio show. I am 
trying to figure out how to model the "has and belongs to many" relationships.

Each episode can have many tracks, each of these tracks can belong to several 
episodes.
I want to be able to present a listing of which episodes each track appears in, 
and a listing of tracks for each episode.

The approach I have seen on this is to create an intermediary object and store 
a set of ids on this, but this seems a little clunky, and it seems like there 
would be a clean way to do this.
Am I missing something?
Thanks!



peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101



signature.asc
Description: Message signed with OpenPGP