[Newbies] Raw sockets (was: New Introductory Tutorial)

2016-08-29 Thread Bert Freudenberg
To look at all traffic you need a "raw socket".
Our SocketAddressInformation class only specifies socketTypeDGram
and socketTypeStream, but not socketTypeRaw.

However, there is a "primitiveSocketCreateRAW" in the VM's SocketPlugin. In
the image, I only see references to "primitiveSocketCreate". So there might
be a way to do it, but the code appears to not be in the image.

- Bert -

On Fri, Aug 26, 2016 at 7:33 AM, Dennis Groves 
wrote:

> I would like to do network traffic analysis with Squeak, however All I can
> find are socket and http objects is there an object for looking at all the
> traffic on a given interface?
>
> Cheers,
>
> Dennis
>
> --
> Dennis Groves , MSc
> dennis.gro...@gmail.com
>
>>
>>
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: Kedama (Re: [Newbies] [ANN] Squeak 5.1 released; www.squeak.org; Trunk open again)

2016-08-29 Thread Bert Freudenberg
On Fri, Aug 26, 2016 at 3:32 PM, H. Hirzel <hannes.hir...@gmail.com> wrote:

> On 8/25/16, Bert Freudenberg <b...@freudenbergs.de> wrote:
> > On Wed, Aug 24, 2016 at 7:19 PM, H. Hirzel <hannes.hir...@gmail.com>
> wrote:
> >
> >> On 8/24/16, Offray Vladimir Luna Cárdenas <off...@riseup.net> wrote:
> >> > Thanks a lot! Seeing Kedama,
> >>
> >> Hello Offray
> >>
> >> The object tool offers a 'Kedama World' in the category 'Kedama'.
> >>
> >> But no other tools / menus to start building simulations.
> >>
> >> It seems that the more code needs to be loaded 
> >>
> >> Do you have any hints how to get started?
> >>
> >
> > It doesn't work right in 5.1 yet. But Tim Felgentreff just (at ESUG in
> > Prague) demonstrated a 5.1-based Etoys image that has pretty much all the
> > Etoys code of the Squeakland image, and Kedama works in there. Running on
> > the Spur VM it's even fast enough without the Kedama plugin (which was
> > needed in the interpreter VM).
> >
> > We intend to release this later this year, but for now I'd recommend the
> > Squeakland version to play with Kedama.
> >
> > - Bert -
>
>
> http://www.squeakland.org/download/
>
> 500 Servlet Exception
>
> java.lang.NullPointerException
> at _jsp._download._index__jsp._jspService(/download/index.jsp:39)
>

Fixed.

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [ANN] Squeak 5.1 released; www.squeak.org; Trunk open again

2016-08-25 Thread Bert Freudenberg
On Wed, Aug 24, 2016 at 7:19 PM, H. Hirzel  wrote:

> On 8/24/16, Offray Vladimir Luna Cárdenas  wrote:
> > Thanks a lot! Seeing Kedama,
>
> Hello Offray
>
> The object tool offers a 'Kedama World' in the category 'Kedama'.
>
> But no other tools / menus to start building simulations.
>
> It seems that the more code needs to be loaded 
>
> Do you have any hints how to get started?
>

It doesn't work right in 5.1 yet. But Tim Felgentreff just (at ESUG in
Prague) demonstrated a 5.1-based Etoys image that has pretty much all the
Etoys code of the Squeakland image, and Kedama works in there. Running on
the Spur VM it's even fast enough without the Kedama plugin (which was
needed in the interpreter VM).

We intend to release this later this year, but for now I'd recommend the
Squeakland version to play with Kedama.

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Project on squeak language

2016-08-20 Thread Bert Freudenberg
Sure. Just ask some specific questions - e.g. what you tried, what worked,
what didn't etc.

- Bert -

On Sat, Aug 20, 2016 at 10:59 AM, roger mpouma  wrote:

> Hello,
> I need help for a drawing project on Squeak. I'd like implement a canvas
> on which we draw with the possibility of drawing with brush changing the
> color and size of the brush. Is it possibile to have help ?
>
> Thank you in advance.
> ___
> Beginners mailing list
> Beginners@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: printf not working on 5.0

2016-08-12 Thread Bert Freudenberg
On Thu, Aug 11, 2016 at 5:16 PM, Joseph Alotta 
wrote:

> Hi Bert,
>
> Thank you for the magic incantation.  It worked.  What will I do when I
> don’t have someone to tell me what the magic words are?
>
> I filed out the code from 4.3 and filed in the same code into 5.0.  Did it
> miss a part?  It is all in one project area or is there parts in other
> places in the image?
>
> How would I debug something like this going forward?
>

No need to debug, you simply need to learn how to use Monticello, our
preferred source code versioning system. Changesets have pretty much fallen
out of style.

Maybe someone else can supply better pointers to tutorials, but here are
some:

http://www.wiresong.ca/monticello/v1/docs/
http://squeakbyexample.org/
https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/
squeak_screencasts
https://www.youtube.com/watch?v=LMlzD5LSBx4

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: printf not working on 5.0

2016-08-11 Thread Bert Freudenberg
On Thu, Aug 11, 2016 at 1:44 AM, Joseph Alotta 
wrote:

> Somehow the code was hooked into ByteString, but I can’t see where or how.
>
> Maybe there is a part that I forgot to copy.  Is it possible that the
> package makes modification to ByteString somewhere?
>

Yes, of course. The package defines various extension methods.

This is probably the easiest way to install it:

Installer ss project: 'Printf'; install: 'Printf'

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: mix ins

2016-08-02 Thread Bert Freudenberg
On Tue, Aug 2, 2016 at 8:55 PM, Joseph Alotta 
wrote:

> 4.3
>
> What is the procedure for upgrading?  Should I file-out the classes,
> download the new version and then file-in?
>

That would be one simple way to do it, yes.

OTOH if you're happy with 4.3 there is no need to upgrade - just add the
methods you need to your image.

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: mix ins

2016-08-02 Thread Bert Freudenberg
On Tue, Aug 2, 2016 at 5:39 PM, Joseph Alotta <joseph.alo...@gmail.com>
wrote:

>
> > On Aug 2, 2016, at 9:38 AM, Bert Freudenberg [via Smalltalk] <[hidden
> email] <http:///user/SendEmail.jtp?type=node=4909179=0>> wrote:
> >
> > Thirdly, to keep these "extension methods" in your own package, put them
> in a method category that starts with an asterisk followed by your package
> name. That is, if your Monticello package is named "Foo-Bar", then put your
> "mix in" Array methods into the category "*foo-bar" which will mark them as
> belonging to your package, not the package the Array class is in. The
> extension methods will be stored and loaded with your package.
>
> Bert,
>
> I am not sure how to do this.  My project is called Books.
>

I meant a method category (a.k.a. protocol). Right-click in Array's method
categories list and add a new category named *books. Then select it and put
your methods there. You can also use drag-and-drop to move a method to the
right category.

[image: Inline image 1]

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: mix ins

2016-08-02 Thread Bert Freudenberg
On Tue, Aug 2, 2016 at 5:48 PM, Joseph Alotta 
wrote:

> Bert,
>
> I don’t have these methods.  I get an error.  See attached:
>


Are you using Squeak 5.0?

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] mix ins

2016-08-02 Thread Bert Freudenberg
On Tue, Aug 2, 2016 at 5:03 PM, Joseph Alotta 
wrote:

> Greetings,
>
> I want to add a method to the Array class.
>
> #(‘abc’ ‘def’) join =>  ‘abcdef’
>
> #(‘abc’ ‘def’) join: $/ => ‘abc/def’
>
> I am afraid that if I add it to Array directly, it will get lost in a new
> update.  I want to keep it in my project area.
>
> In ruby, this is called a “mix in”.
>
> How can I do this?
>

Firstly, these methods exist already.  They are defined in
SequencableCollection, a  superclass of Array, so Array inherits them:

#('abc' 'def') join => 'abcdef'

#('abc' 'def') joinSeparatedBy: '/' => 'abc/def'

Secondly, if you wanted to add these (or other methods), they would not be
lost by updating. That is, unless the update specifically includes a method
of the same name in the same class. Updating only adds and removes methods,
it doesn't "reset" the whole class.

Thirdly, to keep these "extension methods" in your own package, put them in
a method category that starts with an asterisk followed by your package
name. That is, if your Monticello package is named "Foo-Bar", then put your
"mix in" Array methods into the category "*foo-bar" which will mark them as
belonging to your package, not the package the Array class is in. The
extension methods will be stored and loaded with your package.

Have fun!

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] size of character

2016-05-23 Thread Bert Freudenberg
On 23.05.2016, at 17:25, Joseph Alotta  wrote:
> 
> ‘j’ size ==>  1
> 
> $j size ==> error.
> 
> Why shouldn’t the size of a character be 1?

Because it’s not a collection: #size is part of the collection protocol, but it 
doesn’t make sense to send #at: to a character.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] help with morphic

2016-05-20 Thread Bert Freudenberg

> On 20.05.2016, at 10:35, Bert Freudenberg <b...@freudenbergs.de> wrote:
> 
> 
>> On 19.05.2016, at 22:43, Joseph Alotta <joseph.alo...@gmail.com> wrote:
>> 
>> Greetings,
>> 
>> I am having trouble getting started with Morphic.  I tried the tutorial on 
>> squeak.org and found it too hard to follow.  Now I have morphs on my screen 
>> and I don’t know how to close them.
>> 
>> I looked for videos on Morphic and found only a technical comparison of 
>> changes.  Is there a video designed for beginners that someone not an 
>> egghead can follow?
> 
> Lawson English produced a series of tutorial videos. He covers Morphic 
> starting at #18:
> 
> https://www.youtube.com/playlist?list=PL6601A198DF14788D

Btw, this and others are linked from:

http://squeak.org/documentation/

but maybe that’s not visible enough?

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] help with morphic

2016-05-20 Thread Bert Freudenberg

> On 19.05.2016, at 22:43, Joseph Alotta  wrote:
> 
> Greetings,
> 
> I am having trouble getting started with Morphic.  I tried the tutorial on 
> squeak.org and found it too hard to follow.  Now I have morphs on my screen 
> and I don’t know how to close them.
> 
> I looked for videos on Morphic and found only a technical comparison of 
> changes.  Is there a video designed for beginners that someone not an egghead 
> can follow?

Lawson English produced a series of tutorial videos. He covers Morphic starting 
at #18:

https://www.youtube.com/playlist?list=PL6601A198DF14788D

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: next or break in a loop

2016-05-09 Thread Bert Freudenberg

> On 09.05.2016, at 23:00, Joseph Alotta  wrote:
> 
> I don’t think any of the solutions work for my case.
> 
> I want to evaluate several different variable for each step, make 
> calculations and if all of the conditions are met, then skip to the next 
> item, otherwise, do the next step of calculations.
> 
> The project is reading comma deliminated bank or credit card files, taking a 
> column of data, counting various characters, and trying to determine what 
> kind of data it is.  For example, a column of data with two slash characters 
> and eight digits per line is likely to be a date field.  A column of data 
> with more than 3 letter characters and a percentage of digits and a 
> percentage of hash signs is likely to be a payee field.  A column of data 
> with no spaces, no digits, no special characters is likely to be a type of 
> transaction field.  A column of data with one period per item, and only 
> digits or a minus sign is  likely to be a amount field, and a column of data 
> with a high percentage of zero length items and the rest having C or K and a 
> pound sign and four or more digits is likely to be a check number field.
> 
> I am doing a lot of tests for each field and I don’t think the switch is a 
> good fit. 

Sounds like my first suggestion would work then. Create a method 
“processColumn:” that tries to match each pattern and, if successful, reads the 
data and returns.

This should work, but you would have to put a lot of code into one single 
method, which is bad style. Better to have a set of parsing methods (e.g. 
parseAsDate:, parseAsPayee: etc) that would return true if they succeeded, and 
if not, the next one would be tried.

And instead of having a couple of methods you could have a couple of parser 
classes that each would try to parse the item. You would put the parsers in a 
collection and try each of them until one successfully parsed. This would 
probably be the most object-oriented solution.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] next or break in a loop

2016-05-09 Thread Bert Freudenberg
On 09.05.2016, at 20:35, Phil (list)  wrote:
> 
> Smalltalk doesn't have a switch/case statement

True, but Squeak does:

aValue caseOf: {
[firstValue] -> [firstBlock].
[secondValue] -> [secondBlock].
} otherwise: [elseBlock]

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Subclassing PasteUpMorph

2016-05-06 Thread Bert Freudenberg
On 04.05.2016, at 19:48, Michael Rice  wrote:
> 
> I'm experimenting with subclassing PasteUpMorph to get some additional 
> behavior. One thing I want to do is have my subclass open with a CircleMorph 
> at 0@0. I already get that behavior, the CircleMorph in the upper left 
> corner, but want my subclass' origin to be at its center, and the CircleMorph 
> drawn there. My current initialize method,
> 
> initialize
>   ""
> 
>   super initialize.
>   self originAtCenter; addMorph: ((CircleMorph new) color: Color white) 
> centeredNear: 0@0.
> 
> still places it in the upper left corner.
> 
> How do I get the origin, 0@0, at the center?

You could use

circle x: 0 y: 0.

The originAtCenter flag only affects the PasteUpMorph’s cartesianOrigin which 
is used by Etoys (via the x/y methods) and puts the origin at either its 
lowerLeft corner or its center, just as in Math (and unlike Squeak).

That said, Morphic currently does not use a fully transform-based graphics 
engine. You cannot easily transform the coordinate system for submorphs. Etoys 
gets around this by applying the origin offset in its x/y accessors (which also 
flip the y direction from downwards to upwards).

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: debugging by using a global variable?

2016-04-21 Thread Bert Freudenberg
The menu item is behind the blue button in the workspace’s title bar:



- Bert -

> On 20.04.2016, at 21:00, Joseph Alotta <joseph.alo...@gmail.com> wrote:
> 
> bert, 
> 
> thanks.  I heard something ding when I dragged it, but nothing happened.  I 
> couldn’t find the item on the menus. 
> 
> Sincerely, 
> 
> Joe. 
> 
> 
> > On Apr 20, 2016, at 10:53 AM, Bert Freudenberg [via Smalltalk] <[hidden 
> > email] > wrote: 
> > 
> > 
> > > On 20.04.2016, at 17:19, Joseph Alotta <[hidden email]> wrote: 
> > > 
> > > Greetings, 
> > > 
> > > My code has some complex parts and I think it would be good to pull parts 
> > > of it out and practice with it in a workspace window. 
> > > 
> > > For example, I have an Array of Transaction objects, that is a instance 
> > > variable.  It is mostly populated from reading a file. 
> > > 
> > > What would be the best method to extract this array? 
> > > 
> > > Assign it to a global variable? 
> > That’s one way to do it. 
> > 
> > You can also drag that instance variable from the inspector to the 
> > workspace, which will create a variable reference. 
> > 
> > In the latest trunk image this should work seamlessly: If you drop an 
> > Array, the workspace variable will be named something like “array12345” and 
> > be bound to that Array. 
> > 
> > In the stable release image, you have to first enable the workspace’s 
> > “accept dropped morphs” flag from its menu button. It will create a 
> > variable named “transfer12345” and put the morph in it. You will have to 
> > refer to the Array as “transfer12345 passenger”. 
> > 
> > - Bert - 
> > 





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Help!! screenshot bounced

2016-04-21 Thread Bert Freudenberg
If you do this more often, you don't have to do it manually.

E.g. when I press my keyboard shortcut for screenshot, it saves the file to a 
Dropbox folder and puts its public URL in the clipboard. Then I paste the URL 
into my mail. So it's press key - select screen region - press another key, 
which for me is even quicker than attaching the file to the email.

- Bert -

> On 20.04.2016, at 21:00, Joseph Alotta <joseph.alo...@gmail.com> wrote:
> 
> okay, i did, but it shouldn’t be this hard. 
> 
> 
> > On Apr 20, 2016, at 10:18 AM, Bert Freudenberg [via Smalltalk] <[hidden 
> > email]> wrote: 
> > 
> > On 20.04.2016, at 17:42, Joseph Alotta <[hidden email]> wrote: 
> > > 
> > > I would like to send the list a screenshot of my problem, but it bounced. 
> > >  What is the appropriate way of sharing a screenshot? 
> > 
> > Upload your screenshot somewhere and send the URL to the list. 
> > 
> > - Bert - 
> > 
> > 
> > 
> > 
> > ___ 
> > Beginners mailing list 
> > [hidden email] 
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
> > 
> >  smime.p7s (5K) Download Attachment 
> > 
> > 
> > If you reply to this email, your message will be added to the discussion 
> > below: 
> > http://forum.world.st/Help-screenshot-bounced-tp4891019p4891022.html
> > To start a new topic under Squeak - Beginners, email [hidden email] 
> > To unsubscribe from Squeak - Beginners, click here. 
> > NAML
> 
> 
> View this message in context: Re: Help!! screenshot bounced
> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
> ___
> Beginners mailing list
> Beginners@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Help! can't see inside a Bag

2016-04-21 Thread Bert Freudenberg
You can include a screenshot, there just is a size limit :)

If you crop the shot to the relevant part, and compress it as PNG, it usually 
fits. It's also polite to shorten the quoted emails to the relevant sections 
(which cuts down on size too).

- Bert -

> On 21.04.2016, at 01:38, Joseph Alotta  wrote:
> 
> How did you put the screen shot in your email?
> 
> Sent from my iPhone 
> 
>> On Apr 20, 2016, at 4:54 PM, cbc [via Smalltalk] <[hidden email]> wrote:
>> 
>> 
>> 
>>> On Wed, Apr 20, 2016 at 2:25 PM, Joseph Alotta <[hidden email]> wrote:
>>> There is a possibility of duplicates.  For example, if I go to Starbucks 
>>> buy a coffee, then buy a second cup.  There would be two transactions same 
>>> amount, same day. 
>>> 
>>> What about OrderedCollection? 
>>> 
>> OrderedCollection would also work, especially if you want to see what order 
>> they happened in. If you just care about counting the times it happened, Bag 
>> might be better.
>>  
>>> How do I send #asSet to the bag, give that the bag is an instance variable 
>>> in my larger object? 
>>> 
>> In the explorer (right where you tried exploring the dictionary value in the 
>> bag), select the bag variable.
>> Then, down int eh bottom pane, type in 
>>self asSet
>> and explore that.
>> 
>>> 
>>> 
>>> 
>>> 
>>> > On Apr 20, 2016, at 2:43 PM, cbc [via Smalltalk] <[hidden email]> wrote: 
>>> > 
>>> > HI Joe, 
>>> > A Bag is a structure to hold multiple, possibly repeating, objects in it. 
>>> >  One of the benefits is to know how many times an object is inside of the 
>>> > bag - how many times it repeats. 
>>> > 
>>> > Bag is implemented with a Dictionary it in - the key is the objects that 
>>> > you put into the bag, and the value is the count of how many times it was 
>>> > put into the bag (hence all of the 1's that you see - they were probably 
>>> > just added once to the bag). 
>>> > 
>>> > The explorer is optimized to make Dictionary navigation fast and 
>>> > convenient for normal Dictionaries - you can see and select the key, and 
>>> > get to see the details of the values in the dictionary. 
>>> > It is not optimized for looking at the dictionary in the Bag, where you 
>>> > care about the key (and mostly not about the value - at least for your 
>>> > use case). 
>>> > 
>>> > To explore the values in the Bag, I would suggest one of two ways of 
>>> > getting at the data: 
>>> > 1> send #asSet to the bag, and explore that 
>>> > 2> send #keys to the dictionary, and explore that 
>>> > Either should work. 
>>> > 
>>> > One more thing to think about - if you aren't going to have multiples of 
>>> > your Transaction objects (or don't care to know that you have multiple of 
>>> > them) in your Bag, you might want to consider using a Set instead. 
>>> > 
>>> > Thanks, 
>>> > cbc 
>>> >
>>> > On Wed, Apr 20, 2016 at 12:31 PM, Joseph Alotta <[hidden email]> wrote:
>>> 
>>> > Help! 
>>> > 
>>> > 
>>> > I have a data structure as the screenshot below shows. 
>>> > 
>>> > There is a Bag with Transaction objects. 
>>> > 
>>> > I can’t see inside the Transaction objects? 
>>> > 
>>> > Why is there a Dictionary? 
>>> > 
>>> > I can see the beginning of the transaction data, but I can’t the the 
>>> > whole line? 
>>> > 
>>> > When I explore, it opens a window on Integer 1.  Where are all the 1s 
>>> > coming from? 
>>> > 
>>> > 
>>> > Sincerely, 
>>> > 
>>> > Joe. 
>>> > 
>>> > 
>>> > here is the link: https://www.flickr.com/photos/jalotta/26480315621/
>>> > 
>>> > 
>>> > 
>>> > ___ 
>>> > Beginners mailing list
>>> > [hidden email]
>>> 
>>> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>> > 
>>> > 
>>> > ___ 
>>> > Beginners mailing list 
>>> > [hidden email] 
>>> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>> > 
>>> > 
>>> > If you reply to this email, your message will be added to the discussion 
>>> > below: 
>>> > http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891054.html
>>> > To start a new topic under Squeak - Beginners, email [hidden email] 
>>> > To unsubscribe from Squeak - Beginners, click here. 
>>> > NAML
>>> View this message in context: Re: Help! can't see inside a Bag
>>> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
>>> 
>>> ___
>>> Beginners mailing list
>>> [hidden email]
>>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>> 
>> 
>> 
>> ___ 
>> Beginners mailing list 
>> [hidden email] 
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>> 
>> 
>> If you reply to this email, your message will be added to the discussion 
>> below:
>> http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891078.html
>> To start a new topic under Squeak - Beginners, email [hidden email] 
>> To unsubscribe from Squeak - Beginners, click 

Re: [Newbies] debugging by using a global variable?

2016-04-20 Thread Bert Freudenberg

> On 20.04.2016, at 17:19, Joseph Alotta  wrote:
> 
> Greetings,
> 
> My code has some complex parts and I think it would be good to pull parts of 
> it out and practice with it in a workspace window.
> 
> For example, I have an Array of Transaction objects, that is a instance 
> variable.  It is mostly populated from reading a file.
> 
> What would be the best method to extract this array?
> 
> Assign it to a global variable?

That’s one way to do it.

You can also drag that instance variable from the inspector to the workspace, 
which will create a variable reference.

In the latest trunk image this should work seamlessly: If you drop an Array, 
the workspace variable will be named something like “array12345” and be bound 
to that Array.

In the stable release image, you have to first enable the workspace’s “accept 
dropped morphs” flag from its menu button. It will create a variable named 
“transfer12345” and put the morph in it. You will have to refer to the Array as 
“transfer12345 passenger”.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Help!! screenshot bounced

2016-04-20 Thread Bert Freudenberg
On 20.04.2016, at 17:42, Joseph Alotta  wrote:
> 
> I would like to send the list a screenshot of my problem, but it bounced.  
> What is the appropriate way of sharing a screenshot?

Upload your screenshot somewhere and send the URL to the list.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Cyrilic fonts in Squeak

2015-05-21 Thread Bert Freudenberg

 On 21.05.2015, at 03:21, David T. Lewis le...@mail.msen.com wrote:
 
 On Thu, May 21, 2015 at 04:06:59AM +0300, Ariel Feinerman wrote:
 Hi all,
 
 does anyone know how to allow cyrillic and other languages in Squeak 4.5?
 
 
 I have no personal knowledge in this area, but I know that cyrillic fonts
 have been supported in various Squeak versions, and I would expect that this
 should be possible in the latest Squeak releases also. Try googling squeak
 cyrillic fonts, follow a few links and see if it helps.

When importing a TTF font we only import the latin glyphs to save space. I’m 
not exactly sure where in the code that is, but by adding the cyrillic code 
points it should just work. All the machinery is there.

Also, Nicolay’s Крестьянство SDK supports cyrillic fonts:

http://st.krestianstvo.org/web/en/download

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Is there a preference setting to block automatic parentheses?

2015-02-21 Thread Bert Freudenberg

 On 20.02.2015, at 17:29, Levente Uzonyi le...@elte.hu wrote:
 
 On Fri, 20 Feb 2015, David T. Lewis wrote:
 
 On Fri, Feb 20, 2015 at 02:02:07PM -0800, Kirk Fraser wrote:
 The automatic supply of the right parenthesis when a left parenthesis is
 typed appears to cost me more time in deleting the extra than it saves in
 the more rare events when I can use the feature.  How can I safely stop it
 for all the p, brackets, and curly braces?  Thanks.
 
 
 Yes, there is a preference. Look in category Morphic and disable the
 Auto Enclose preference.
 
 Some people like this preference a lot. Others think it is horrible.
 
 This implmenentation is not the best. The one in E/OCompletion is better.

I love the feature (in other editors), but hate its current behavior.  If that 
one is better, why don't we use that?

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How to round a float?

2015-02-17 Thread Bert Freudenberg
On 16.02.2015, at 07:29, Louis LaBrunda l...@keystone-software.com wrote:
 
 That's why I thought there was a problem with #roundTo: but maybe #roundTo:
 has some other intent that I'm not aware of?

It's used for snapping values to a grid. E.g. in ScrollBarsetValue:.

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Video4Squeak

2015-02-06 Thread Bert Freudenberg
Video4Squeak is an older camera framework by Diego Gomez Deck. It only works on 
Linux via Video4Linux.

The CameraPlugin comes from Scratch. In the Etoys image you can find a 
CameraMorph that uses it. It should be in the Multimedia category of the Object 
Catalog.

That CameraMorph should also work fine in other images.

- Bert -


 On 06.02.2015, at 10:21, Kirk Fraser overcomer@gmail.com wrote:
 
 How do I get started with Video4Squeak from Physical Etoys?  I have moved the 
 video and audio .dll'[s and code to Squeak 4.5 but I don’t know how to start 
 a camera displaying. 
 
 I want to work with the video to do machine vision like will be done in the 
 DARPA Robotics Challenge. I know the first step after getting the software to 
 work with a camera is to calculate contours. But I cannot find the 
 Video4Squeak author or how to make it work and access the video frames to 
 recognize visual objects.  
 
 I looked at all the Smalltalk code but I don't even understand where the code 
 access the CameraPlugin.dll to be sure it's looking in the correct directory 
 or working at all.  Suggestions?
 
 
 Thank you.
 
 Kirk W. Fraser
 www.JesusGospelChurch.com - Replace the fraud churches with the true church.
 http://freetom.info - Example of False Justice common in America
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners


smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Beginner's List Question

2015-01-25 Thread Bert Freudenberg
On 25.01.2015, at 09:21, Tim Retz human.shield@gmail.com wrote:
 if you use Linux, it's the user's responsibility to know (or figure out) how 
 to get a piece of software working.
 
If we claim that we support Linux, then we should help any user trying to get 
it to run.

Also, Squeak *is* different from most other software. Not necessarily harder to 
run, but different enough to warrant some hand-holding for newbies.

 On Jan 24, 2015 11:00 PM, Kirk Fraser overcomer@gmail.com 
 mailto:overcomer@gmail.com wrote:
 Bert says there are easy to follow instructions to do it.

I actually said that there should be easy to follow instructions and was 
hoping for someone to provide them.

You’re very right that we need these.

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Better Support for Beginners Please!

2015-01-22 Thread Bert Freudenberg
On 22.01.2015, at 07:43, Casey Ransberger casey.obrie...@gmail.com wrote:
 On Jan 21, 2015, at 10:04 PM, Kirk Fraser overcomer@gmail.com wrote:
 
 The Squeak.org main page needs a few changes.

Lots of good suggestions, thank you!

 2) The LINUX instructions at page bottom are not for beginners. Under 
 Beginners there should be a one click solution for installing Squeak in a 
 majority of Linux systems including Kbuntu.  Lacking that, the Beginners 
 heading needs detailed explanation of what all this means and how to 
 accomplish it.
 
 If you're using a Linux based system and you aren't able to administer it 
 yourself, there are a number of third party support providers who can help. 
 That said: if you're using Linux and can't support it, that tends to end up 
 on your shoulders. UNIX, discounting OS X, tends to be a bit like flying and 
 aircraft without a copilot. 
 
 What I really think we need here are folks from the major distros who are 
 willing/able to roll packages based on both the bleeding edge and the recent 
 stable release. Same deal with the various BSDs. 
 
 We haven't found these folks yet.

Yes, but this is the beginners list, and Kirk is listing issues a beginner 
might encounter.

 How does one check if one has X Windows installed?
 How does one check if one has 32 bit libraries installed?
 How does one check if one has file permissions addressed?
 
 These are general UNIX questions, and are better directed toward forums 
 devoted to those topics. Remember: Smalltalk is NOT UNIX.

Indeed, we cannot provide a complete unix tutorial. But it would be a good idea 
to make clear in the installation instructions what level of familiarity with 
unix is expected. And even better, include pointers to where to learn it.

 Where does one enter the command line?
 
 Seriously? I think there's a book called Linux for Dummies...
 
 What does a sample command line look like in the top 5 Linux variants?
 
 Go forth, find the truth for yourself, and put it on the wiki? What are the 
 top five Linux variants? Sorry to cockblock here, but I'm a BSD fan, so I 
 don't know or care. 

Language. Also, again, this is the beginners list.

It would be *very* helpful for a beginner to get told the exact command line 
s/he needs to type to install Squeak. And if that command line is different 
between variants of Linux, we should indeed list them for the most popular. 
It's a safe bet that a beginner would use a popular distro, meaning 
Mint/Ubuntu/Debian/Fedora/SUSE.

 Better yet, where is a one click download and install for Linux systems?

Our all-in-one is supposed to work on Linux too. We just must make sure it 
actually does, and provide easy-to-follow instructions.

For discussion on how to make this better we should move over to squeak-dev. 
Here on the beginners list, we try to answer questions, not raise new ones :)

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] What is an Etoys *.xo file?

2014-12-17 Thread Bert Freudenberg
On 17.12.2014, at 15:50, Michael Rice limitc...@gmail.com wrote:
 
 Looking around the web I see some *.xo files. What are they? I thought Etoys 
 saves in *.pr files.

This is a wrapper for Etoys to make it work as an activity under Sugar, the 
operating system of the OLPC XO laptop.

http://activities.sugarlabs.org/

http://sugarlabs.org/

http://www.laptop.org/

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Bounce Example

2014-12-15 Thread Bert Freudenberg

 On 15.12.2014, at 11:40, David Corking li...@dcorking.com wrote:
 
 Bert wrote:
 
 Morphic... assumes you
 will create your own morph class and implement methods to specify
 behavior.
 
 It's certainly possible to do. But you will run into various problems that
 you wouldn't have if you did it properly.
 
 Dan wrote:
 
 By properly do you mean: creating a morph class with methods to specify
 behavior?
 
 At the risk of speaking for Bert, I hear exactly that when he says 'properly'.

Yep :)

- Bert -

 
 The Squeak By Example book and An Introduction to Morphic both
 describe this approach in detail. I, personally, found it much more
 fun than workspace coding.
 
 * http://squeakbyexample.org/
  (see the first 2 chapters, quick tour and first application, then
 chapter 11 'Morphic'
 * http://coweb.cc.gatech.edu:/squeakbook/uploads/morphic.final.pdf
 
 See also http://wiki.squeak.org/squeak/792#Morphic
 
 Have fun! David



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Saving a project...kaput?

2014-12-13 Thread Bert Freudenberg
On 13.12.2014, at 17:51, Michael Rice limitc...@gmail.com wrote:
 
 Haven't Squeaked in a while, refreshing my memory I tried creating a simple 
 example script:
 1) drag a line morph into the playfield
 2) open a view on it
 3) drag a new script from the line view to the playfield
 4) drag a turn script from the line view to the new line script
 5) name the new line script rotate
 6) save the project
 
 I get this error walkback: Scrapbook(Object) doesNotUnderstand: 
 #emptyScrapsBook
 
 I noticed that the save widget file list doesn't include my Squeaklets folder 
 even though it exists in ../Content/Resources
 Also, no sound, no matter whether I select Dummy... or the alternative.
 
 I'm using Fedora Linux 64-bit.
 
 Suggestions? Move to Window 8.1?

For doing Etoys tile scripting you're much better off using the Squeakland 
version:

http://squeakland.org/download/ http://squeakland.org/download/

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Open that fucking thing.

2014-12-11 Thread Bert Freudenberg
On 11.12.2014, at 14:11, Bert Freudenberg b...@freudenbergs.de wrote:
 On 11.12.2014, at 13:54, Hans Schueren werb...@hans-schueren.de wrote:
 stuff
 
 
 Bot or troll, there is no excuse to use profane language on our beginners 
 mailing list.
 
 If you want to avoid being banned, please respond to this email in a 
 sensible manner. 
 
 - Bert -

I did get a response. It was not sensible.

*plonk*

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Feedback: Using Output as the Next Input

2014-12-05 Thread Bert Freudenberg
On 05.12.2014, at 12:15, Dan dnor...@mindspring.com wrote:
 
 On 5 Dec 2014 at 1:13, Bert Freudenberg wrote:
 
 On 05.12.2014, at 00:49, Dan dnor...@mindspring.com wrote:
 
 On 4 Dec 2014 at 23:22, Bert Freudenberg wrote:
 
 Why wouldn't you just keep the output in the image and save
 it?
 When you restart it months later, it will be there.
 
 - Bert -
 
 That surely is simpler than trying to compile a method.
 
 Not that compiling a method is hard.
 
 That is encouraging. Is it something similar to Dynamic Message Calling 
 described in the 
 Terse Guide to Squeak?

Like this:

SomeClass compile: code classified: category.

E.g.
MyClass compile: 'hello ^6*9' classified: 'foo'.
MyClass new hello
== 54

Or 

MyClass class compile: 'helloAgain ^13r42' classified: 'bar'.
MyClass helloAgain
==  54


 I might put something like this in a package.
 
 I'm not sure what you mean by that.
 
 I mean a package on SqueakMap where one can download it and try it out. I see 
 there are 
 over 700 packages out there for the choosing. A great variety. It's 
 unfortunate that not all run 
 on the current release of Squeak but maybe with a little work...  ;)

SqueakMap is just a catalog for finding useful code. You first need to put your 
stuff somewhere else, SqueakMap would be the last step.

 Would users find saving the image as... to be the expected way of
 doing things?
 
 - Dan
 
 Depends on who your users are. If you were the user ... you're
 saving your image all the time, right?
 
 Um, not exactly. But more often than in the past. I feel most comfortable 
 saving with 
 Montecello.

Smalltalk is a personal computing environment, first and foremost. Source code 
is secondary. We basically just resort to source code when we want to share 
stuff with other people. Source code in files has been called quaint.

 Maybe you should be more specific in what data you want to store,
 how you want to distribute it, and who is going to use it.
 
 I have in mind a list of names which are matched randomly in pairs then 
 filtered according to 
 a set of rules. The output is a dictionary and the rules specify that no pair 
 can be the same as 
 previous (up to 3) instances. There are other rules and often hundreds of 
 iterations take 
 place before all pairs obey all the rules.
 
 It might be used, as it is in our family, to draw names for Christmas. The 
 person who runs the 
 program distributes the results to those on the list.

Keeping it in the image is certainly the simplest, especially if you intend to 
use it by just running an expression in a workspace.

If you build it as an app so the user does not have to deal with Smalltalk, 
then it is advisable to treat the deployed image as read-only. In that case you 
would have to store the data in a separate file. 

What makes no sense at all is storing that data in source code.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Feedback: Using Output as the Next Input

2014-12-04 Thread Bert Freudenberg

 On 04.12.2014, at 23:14, Dan dnor...@mindspring.com wrote:
 
 Howdy,
 
 A class is instantiated and produces output in a data structure (array, 
 collection, dictionary, 
 ...). Upon each later (maybe months later) instantiation, the previous output 
 is needed as 
 input. What is the best way to do this for modest (not huge) output? Some 
 possibilities:
Externally - file out and file in
Within the class - compile class methods containing the output; save with 
 Montecello
 
 I'm interested in how to dynamically compile a class method. Can Browser be 
 invoked 
 dynamically? In studying Browser and friends, it looks complicated. Am I 
 missing something 
 or attempting something foolish or ...?

Why wouldn't you just keep the output in the image and save it? When you 
restart it months later, it will be there.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] accept (s)

2014-11-26 Thread Bert Freudenberg
On 26.11.2014, at 02:30, dnor...@mindspring.com dnor...@mindspring.com 
wrote:
 
 An inspector for the menu item accept (s) reveals a selector of 
 #perform:orSendTo: which is implemented in Browser.
 
Is it? In my image, Browser inherits that method from StringHolder. I checked 
using a protocol browser (which shows all messages an object understands, 
including those implemented by superclasses).
 I want to follow the code and I put a halt in #perform:orSendTo: but the 
 debugger never opened. What gives?
 

When I put a halt in StringHolderperform:orSendTo:, the debugger opens fine, 
but only when I use the menu item to accept. The keyboard event uses a 
different code path.

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Bounce Example

2014-11-20 Thread Bert Freudenberg
On 20.11.2014, at 04:14, summae3...@mypacks.net summae3...@mypacks.net 
wrote:

 Hello,
 
  
 I once saw a workspace example which caused a morph to move along an arc in a 
 realistic way - appearing to be affected by gravity. Possibly written by 
 someone from Disney?  Now I search in vain to find it. Please give me a 
 reference.

Morphic is not really set up for workspace-style programming. It assumes you 
will create your own morph class and implement methods to specify behavior.

It's certainly possible to do. But you will run into various problems that you 
wouldn't have if you did it properly.

That said, try the following. Assuming constant mass and gravity, the 
acceleration is constant (since F = ma).

m := Morph new openInWorld.
m position: World center.
speed := 5 @ 0. move horizontally at start
acceleration := 0 @ 1.  accelerate downwards
move := [m owner ifNotNil: [
Acceleration is a 2nd-order (quadratic) function. Physics and Math FTW
speed := speed + acceleration.  accel is 1st 
derivative of speed
m position: m position + speed. speed is 1st derivative of pos
m left  m owner left ifTrue: [speed := speed x abs @ speed y]. 
bounce
m right  m owner right ifTrue: [speed := speed x abs negated @ speed 
y].
m top  m owner top ifTrue: [speed := speed x @ speed y abs].
m bottom  m owner bottom ifTrue: [speed := speed x @ speed y abs 
negated].
(move future: 20) value.repeat every 20ms
]].
move value. first step

For even more fun you could control the morph with a joystick:

j := JoystickMorph new openInWorld.

And insert this inside the move block:

acceleration := (j leftRight @ j upDown negated) * 0.1.

Have fun!

- Bert -




smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Terse Guide to Squeak

2014-10-05 Thread Bert Freudenberg
On 05.10.2014, at 03:36, summae3...@mypacks.net summae3...@mypacks.net 
wrote:

 Thanks, Bert. The hard part was to get etoysinbox added as a repository. The 
 upload took place, AFIK.
 
 - Dan

It did. Except I wrote you should submit to inbox, not etoysinbox, because 
this is for general Squeak, not Etoys. 

But I moved it from the Etoys inbox to the regular inbox now.

- Bert -

 -Original Message-
 From: Bert Freudenberg 
 Sent: Oct 4, 2014 1:09 PM
 To: A friendly place to get answers to even the most basic questions about
  Squeak. 
 Subject: Re: [Newbies] Terse Guide to Squeak
 
 On 04.10.2014, at 18:56, wrote:
 
  When I tried to program a table lookup using the usually very helpful 
  Terse Guide, I noticed a couple of things...
  
  1. The remark for detect: is find position of first element that passes 
  test but it should be return first element that passes test
  
  2. There seems to be no alternative in the guide for finding the first 
  element that passes a test. After some archaeology ;) I found 
  SequenceableCollectionfindFirst: which is useful for table lookups.
  
  I updated TerseGuideHelp class to change the remark for detect: wherever 
  it occurs and added findFirst: to Array, OrderedCollection, 
  SortedCollection, and Interval. How can I contribute this to the 
  All-In-One?
 
 
 You submit the changed package via Monticello.
 
 I made a how-to video a while ago, the relevant part is from 1:20 to 4:00:
 
  https://www.youtube.com/watch?v=2QKmfI4taGo#t=1m20s
 
 This is for Etoys, but the difference is really just the repository names - 
 you submit to inbox. Should only take 3 minutes :)
 
 - Bert -
 
 
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Terse Guide to Squeak

2014-10-04 Thread Bert Freudenberg
On 04.10.2014, at 18:56, summae3...@mypacks.net summae3...@mypacks.net 
wrote:

 When I tried to program a table lookup using the usually very helpful Terse 
 Guide, I noticed a couple of things...
 
 1. The remark for detect: is find position of first element that passes 
 test but it should be return first element that passes test
 
  2. There seems to be no alternative in the guide for finding the first 
 element that passes a test. After some archaeology ;) I found 
 SequenceableCollectionfindFirst: which is useful for table lookups.
 
 I updated TerseGuideHelp class to change the remark for detect: wherever it 
 occurs and added findFirst: to Array, OrderedCollection, SortedCollection, 
 and Interval. How can I contribute this to the All-In-One?


You submit the changed package via Monticello.

I made a how-to video a while ago, the relevant part is from 1:20 to 4:00:

https://www.youtube.com/watch?v=2QKmfI4taGo#t=1m20s

This is for Etoys, but the difference is really just the repository names - you 
submit to inbox. Should only take 3 minutes :)

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Running Squeak on Mac OS X fails due to damaged file.

2014-09-26 Thread Bert Freudenberg
Actually, isn't it only that double-clicking the app does not work? If you 
right-click and select Open it should let you run it.

- Bert -

On 26.09.2014, at 06:11, Henrik Aagaard m...@henrikaagaard.com wrote:

 Thank you! :)
 
 On 25/09/2014, at 22.26, Levente Uzonyi le...@elte.hu wrote:
 
 This is just how security works at Apple. The cause and the fix is 
 explained here: http://www.yourkit.com/download/mountain_lion.html
 
 I think we should add a similar note to the zip file, and the website too.
 
 
 Levente
 
 On Thu, 25 Sep 2014, Henrik Aagaard wrote:
 
 This is my error message:
 http://i57.tinypic.com/68de09.png
 
 On 25 Sep 2014, at 21:39, Tobias Pape das.li...@gmx.de wrote:
 
 
 On 25.09.2014, at 20:50, Henrik Aagaard m...@henrikaagaard.com wrote:
 
 I’ve download the file 3 times, all with this result:
 
 shasum -a 256 Squeak-4.5-All-in-One.zip
 60bfa0c35b33f4e58283dc3a336f95c8177c0c7fbd54b9a171a5a36cd7d13cad
 
 Opening the file and run the .app still results in damaged file from Mac 
 OS X :(
 
 What is the exact error message?
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] squeak : wiki : save password?

2014-09-09 Thread Bert Freudenberg
On 09.09.2014, at 07:08, Mayuresh Kathe mayur...@kathe.in wrote:

 hello,
 
 can i please get the password for saving content on the squeak wiki?

Username: squeak
Password: viewpoints


- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] squeak : wiki : save password?

2014-09-09 Thread Bert Freudenberg
On 09.09.2014, at 09:59, Mayuresh Kathe mayur...@kathe.in wrote:

 On 2014-09-09 12:39, Bert Freudenberg wrote:
 On 09.09.2014, at 07:08, Mayuresh Kathe mayur...@kathe.in wrote:
 hello,
 can i please get the password for saving content on the squeak wiki?
 Username: squeak
 Password: viewpoints
 
 yes, tried that, the save password is supposedly different.

No. Unless someone protected a specific page with its own password. Try editing 
another page?

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] cog support for linux framebuffer!

2014-09-08 Thread Bert Freudenberg
On 06.09.2014, at 12:34, Mayuresh Kathe mayur...@kathe.in wrote:

 hello, would the new 'vm', i.e. cog, support using the linux framebuffer 
 instead of relying on the x windowing system?

It should, yes.

 please take a look at; http://wiki.squeak.org/squeak/3484
 it has clear mention about the squeak on linux fb project.
 
 it would be nice to have squeak run atop the linux kernel directly on 
 resource constrained hardware.

Indeed, and the last time I tried, it worked. Ian's fbdev-driver is in Cog, too:

http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/platforms/unix/vm-display-fbdev/

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How to modify ScrollPane example2 to enable scrolling by scroll wheel?

2014-08-30 Thread Bert Freudenberg
On 30.08.2014, at 04:14, JohnReed Maffeo aldeve...@graffiti.net wrote:

 Hello,
  
 I can not figure out how to get scrolling by scroll wheel to work in 
 ScrollPane example2. I have been poking around using explorer to try and 
 figure out how the scroll wheel works in the Browser but have not 
 discovered/recognized how it is supposed to work.
  
 I have built an application based on ScrollPane example2 and it is working 
 well, but it would be nice to get the scroll wheel to work before I get 
 started on version 2.0. If I can get scrolling to work in the example, I 
 think I can get it to work in my app.

The scroll wheel actually generates keyboard events (ctrl-up/down/left/right). 
You need to make sure the ScrollPane gets these keyboard events. See 
ScrollPanekeyStroke:. Or you could call the ScrollPane's scrollByKeyboard: 
method in your own key stroke handler.

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Help with FFI's

2014-06-29 Thread Bert Freudenberg
On 29.06.2014, at 01:43, Michael Patrick sscsmat...@yahoo.com wrote:

 Hello, 
 
 I would like to use Squeak to develop a MAC application that needs to access 
 the address book and the calendar on a local machine.  I have been able to 
 access these items with Objective C but I was wondering if there was a way 
 that I can do it in Squeak.  I have read the information about FFI but this 
 seems to not be supported in Squeak any more.  Can someone point me to a 
 reference or tell me if this is not a good idea?
 
 Thanks in advance,
 
 Michael

Using the Objective-C Bridge is likely a lot easier than FFI (which is only for 
C bindings):

http://seandenigris.com/blog/?p=807

- Bert -





smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [Q] Creating Form from ByteArray

2014-06-12 Thread Bert Freudenberg
Ah, endianness issue, isn't it fun! BitBlt really operates on 32-bit words, so 
4 pixels of your 8-bit form are stuffed into one word. And they are big-endian 
by default. You can indicate little-endian forms by using a negative depth. So, 
if you use -8 for your form depth it works.

You are (probably) on an x86 processor, which is little-endian, so your byte 
array's first byte ends up in the least significant byte of the first word. 
Interpreting that as a big-endian word gives the pattern you noticed.

I should have mentioned that stuffing a byte array into a form is a hack (there 
is even a method FormhackBits:). It is a useful hack, see for example 
BitmapasByteArray. But by looking at that method you see you need to pay 
attention to your CPU's endianness:

Smalltalk isLittleEndian
== true

Your code could use this:

Smalltalk isLittleEndian ifTrue: [form swapEndianness].

(or initialize its depth to 8 or -8 depending on endianness).

The proper way would be to use a bitPoker, which is independent of 
endianness, but considerably slower:

| w h bytes form poker |
w := 200.
h := 200.
bytes := ((1 to: w*h) collect: [:i | 255 ]) asByteArray.
1 to: w do: [ :x |
1 to: h do: [ :y |
x = y ifTrue: [ bytes at: (w*(y - 1) + x) put: 0 ]
]
].
form := ColorForm extent: w@h depth: 8.
form colors: ((0 to: 255) collect: [:i | Color gray: i / 255]).
poker := BitBlt bitPokerToForm: form.
0 to: w-1 do: [ :x |
0 to: h-1 do: [ :y |
poker pixelAt: x@y put: (bytes at: w * y + x + 1).
]
].
form display

(Btw, don't put parens into 1 to: w do:. It works but defeats an important 
optimization).

- Bert -

On 12.06.2014, at 02:32, Sungjin Chun chu...@castlesoft.co.kr wrote:

 Thanks you for your answer, however there is something I missed here.
 
 I've tried following code
 
 | w h bytes form |
 w := 200.
 h := 200.
 bytes := ((1 to: w*h) collect: [:i | 255 ]) asByteArray.
 (1 to: w) do: [ :x |
 (1 to: h) do: [ :y |
 x = y ifTrue: [ bytes at: (w*(y - 1) + x) put: 0 ]
 ]
 ].
 form := ColorForm extent: w@h depth: 8 bits: bytes.
 form colors: ((0 to: 255) collect: [:i | Color gray: i / 255]).
 form display
 
 What I expected is diagonal line but the result is not. What's wrong with my 
 code?
 
 Thank you in advance.
 
 
 
 On Wed, Jun 11, 2014 at 7:41 PM, Bert Freudenberg b...@freudenbergs.de 
 wrote:
 On 11.06.2014, at 00:36, Sungjin Chun chu...@castlesoft.co.kr wrote:
 
  Hi,
 
  I want to draw gray scale bitmap using byte array which has pixel by pixel 
  gray
  scale value as byte like this;
 
  [0 0 0 0 0 0 0 0
   16 23 255 78 12 12 12 12
  ...
  ...] (8x4 for example)
 
  I can draw this using Pen class pixel by pixel manner but this is very slow 
  and
  I think there should be faster way of creating a Form using above byte 
  array.
 
 If the width is a multiple of 4, you can use the byte array directly as form 
 bits:
 
 | w h bytes form |
 w := 100.
 h := 60.
 bytes := ((1 to: w*h) collect: [:i | 256 atRandom - 1]) asByteArray.
 form := ColorForm extent: w@h depth: 8 bits: bytes.
 form colors: ((0 to: 255) collect: [:i | Color gray: i / 255]).
 form display
 
 This would be the best and fastest way. If the width is not a multiple of 4 
 then perhaps you can add the necessary padding when creating the byte array. 
 Otherwise, a very fast way is to use BitBlt to copy whole lines from the byte 
 array to the form.
 
 But even creating a byte array with the right padding just using at:put: 
 would be a lot faster than using a Pen.
 
 - Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [Q] Creating Form from ByteArray

2014-06-11 Thread Bert Freudenberg
On 11.06.2014, at 00:36, Sungjin Chun chu...@castlesoft.co.kr wrote:

 Hi,
 
 I want to draw gray scale bitmap using byte array which has pixel by pixel 
 gray
 scale value as byte like this;
 
 [0 0 0 0 0 0 0 0
  16 23 255 78 12 12 12 12
 ...
 ...] (8x4 for example)
 
 I can draw this using Pen class pixel by pixel manner but this is very slow 
 and 
 I think there should be faster way of creating a Form using above byte array.

If the width is a multiple of 4, you can use the byte array directly as form 
bits:

| w h bytes form |
w := 100.
h := 60.
bytes := ((1 to: w*h) collect: [:i | 256 atRandom - 1]) asByteArray.
form := ColorForm extent: w@h depth: 8 bits: bytes.
form colors: ((0 to: 255) collect: [:i | Color gray: i / 255]).
form display

This would be the best and fastest way. If the width is not a multiple of 4 
then perhaps you can add the necessary padding when creating the byte array. 
Otherwise, a very fast way is to use BitBlt to copy whole lines from the byte 
array to the form. 

But even creating a byte array with the right padding just using at:put: would 
be a lot faster than using a Pen.

- Bert -




smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How to use Form pixelCompare:with:at:

2014-01-07 Thread Bert Freudenberg
On 07.01.2014, at 15:19, Herbert König herbertkoe...@gmx.net wrote:

 Hi,
 
 FormpixelCompare:with:at: seems to always return 0.
 
 I use it like
 |pict1 pict2|
 pict1 := (Form extent: 100@100 depth: 32) fillBlack.
 pict2 := (Form extent: 100@100 depth: 32) fillWithColor: Color red.
 pict1 pixelCompare: pict1 boundingBox with: pict2 at: 0@0
 
 As I get the same result in a 4.4 and a 3.8 image I guess I don't understand 
 how it's used. No senders in either image.

Try 16 bit forms.

- Bert -



smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How to use Form pixelCompare:with:at:

2014-01-07 Thread Bert Freudenberg

On 07.01.2014, at 16:13, Herbert König herbertkoe...@gmx.net wrote:

 Hi Bert,
 
 Am 07.01.2014 15:57, schrieb Bert Freudenberg:
 Try 16 bit forms. - Bert -
 thanks, that works.
 
 Is this a bug or infeasible with 32 Bit Forms? it's surprisingly fast. (I'm 
 dealing with Photos)

It's using BitBlt so should be fast indeed. Sounds like a bug that it does not 
work in 32 bits, at least according to the comment.

OTOH all the BitBlt tally operations only work up to 16 bit depth. With 32 bit 
forms you could easily overflow a SmallInteger. So you might want to reduce the 
depth of the forms anyway before comparing.

- Bert -




smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] object instance browser?

2014-01-07 Thread Bert Freudenberg
On 04.01.2014, at 20:03, karl ramberg karlramb...@gmail.com wrote:

 Posted to the inbox. I don't have login for trunk
 
 Karl

Thanks! Moved to trunk.

- Bert -




smime.p7s
Description: S/MIME cryptographic signature
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Beginners Digest, Vol 93, Issue 1: object instance browser

2014-01-04 Thread Bert Freudenberg
On 03.01.2014, at 02:36, David T. Lewis le...@mail.msen.com wrote:

 On Thu, Jan 02, 2014 at 05:04:50PM -0800, David Holiday wrote:
 Thank you everyone for your alacritous responses! 
 
 I'm finding one of the challenges in learning Smalltalk is not the syntax of 
 the code, nor the general paradigm by which the code is implemented, but 
 understanding the tools well enough to make things happen. I'm an 
 experienced programmer and I'm finding that I'm having to completely rethink 
 the way I go about my work when diddling around with this language. That's 
 not in and of itself a bad thing - just saying I'm thankful for this mailing 
 list :-) 
 
 
 It does take a bit of getting used to, especially if you are an old
 goat like me. But it is worth the effort.
 
 Youthful and inexperienced people say that there is really not much
 effort involved in learning this stuff, but I'm not personally in a
 position to confirm or deny that claim.

Hah! You should hear students complain ;)

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Problem with roundTo: (Actually with *)

2013-07-03 Thread Bert Freudenberg

On 03.07.2013, at 13:56, summae3...@mypacks.net wrote:

 In Squeak 4.3 I print (7/5) roundTo: 0.01 and get 1.4
 however,
 In Squeak 4.4 I print (7/5) roundTo: 0.01 and get 1.4001
 
 Am I doing something to cause this change? Or, is this the result of 
 inflation :)

No, it's the result of more precise Float printing. Consider this:

((7/5) roundTo: 0.01) = 1.4
== false

((7/5) roundTo: 0.01) = 1.4001
== true


For printing with a reduced precision you should not use roundTo but this:

7/5 printShowingDecimalPlaces: 2
== '1.40'

7/5 printShowingMaxDecimalPlaces: 2
== '1.4'

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Squeak Community Monday - today

2013-03-25 Thread Bert Freudenberg
Two weeks ago we had lots of fun talking about everything from the VM (several 
VM hackers stopped by) over OpenQWAQ / Immersive Terf (3D stuff is always 
fascinating) and tablet UIs (the next big thing is here already) to Metacello 
and git (with Dale, our cross-dialect hero). But mostly we had fun :)

Today we're opening a hangout again for 24 hours so everyone worldwide can get 
their chance:

https://plus.google.com/events/cgrv2ob01fsga5ppbunjdg55fnk

Feel free to drop by and say hello!

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Input and output of morphic text

2013-03-14 Thread Bert Freudenberg
On 2013-03-14, at 03:06, Casey Ransberger casey.obrie...@gmail.com wrote:

 Speaking of Pythagoras, Alan Kay demos a visual proof for the theorem that's 
 super easy for just about anyone to understand right away using Etoys in his 
 TED talk, which is worth a look:
 
 http://www.ted.com/talks/alan_kay_shares_a_powerful_idea_about_ideas.html

I like a slightly different proof even better, because it doesn't need to 
rotate the shapes:

http://www.youtube.com/watch?v=md5UBv3pVBE

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] GSoC (was: Thanks for the fantastic ideas.)

2013-03-13 Thread Bert Freudenberg
Would any of the idea submitters like a student to work on them? There is 
another Google Summer of Code coming up, and we always need project ideas. In a 
previous GSoC, Ricardo Moran from Argentina made some awesome new Etoys tools. 
So please, send your idea to Janko, too!

- Bert -

Am 13.03.2013 um 09:30 schrieb Casey Ransberger casey.obrie...@gmail.com:

 I knew I was going to be overwhelmed and blown away when I asked the 
 community for suggestions. 
 
 I'm at the point where I'm still reading ideas people wrote to share with me, 
 and I have a few favorites that I'm investigating, but I'm gonna have to 
 close the flood gates! Before my brain explodes, SPLAT!
 
 FWIW, some of the best ideas came off list from people who's names I didn't 
 know. I'd like to give extra thanks to these folks; it's been great to meet 
 you and hear your wonderful thoughts. I'd love to see this set post on the 
 list(s) more. 
 
 Also: sorry about spamming the list with the thread. Hopefully I can make it 
 worth whatever bandwidth inconvenience I may have caused. 
 
 Onward and such! (Up.)
 
 
 Casey
 
 
 -- 
 Casey Ransberger
 
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: GSoC (was: Thanks for the fantastic ideas.)

2013-03-13 Thread Bert Freudenberg
On 2013-03-13, at 11:04, Bert Freudenberg b...@freudenbergs.de wrote:

 Would any of the idea submitters like a student to work on them? There is 
 another Google Summer of Code coming up, and we always need project ideas. In 
 a previous GSoC, Ricardo Moran from Argentina made some awesome new Etoys 
 tools. So please, send your idea to Janko, too!
 
 - Bert -

PS: Here is what Janko wrote last week on how to submit your idea:

Begin forwarded message:

 From: Janko Mivšek janko.miv...@eranova.si
 Subject: Re: [Pharo-users] [squeak-dev] GSoC13: Google Summer of Code 
 started, your ideas please!
 Date: 9. März 2013 14:16:42 MEZ
 To: A friendly place where any question about pharo is welcome 
 pharo-us...@lists.gforge.inria.fr
 Cc: pharo-proj...@lists.gforge.inria.fr Development 
 pharo-proj...@lists.gforge.inria.fr, Squeak 
 squeak-...@lists.squeakfoundation.org
 Reply-To: The general-purpose Squeak developers list 
 squeak-...@lists.squeakfoundation.org
 
 Hi Stef,
 
 Post on the mailing list for each project idea by following this template:
 
  Level: (beginner, intermediate, advanced)
 
  Possible mentor:
 
  Possible second mentor:
 
  Description
 
  Technical Details
 
  Benefits to the Student
 
  Benefits to the Community
 
 Best regards
 Janko

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] PositionableStreamlast

2013-02-18 Thread Bert Freudenberg

On 2013-02-18, at 04:38, liang bing liangbin...@gmail.com wrote:

 Hi all,
 I am reaing Class code,PositionableStreamlast
 
 last
   Return the final element in the receiver
 
   ^ collection at: *position*
 
 
 
 why not collection at: *readLimit*?


That method shouldn't even exist. You're right it's buggy. Very likely 
(hopefully) to be unused too. Thanks for spotting, should be gone soon :)

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: How can I embed an object in another holder

2013-01-28 Thread Bert Freudenberg
On 2013-01-28, at 07:31, Steve Thomas sthom...@gosargon.com wrote:

 Thanks Subbu.
 
 I started looking at what you sent and poking around trying to figure out the 
 code, then realized I could do it the Etoys way and put the morph back into 
 its previous holder (which can vary and I store in a player variable).
 I wound up using a playfield include tile and replacing playfield with the 
 variable used to store the original holder:
 
   self getOrigHolder include: self.
 
 Stephen

Yep, that's the right way to do it in Etoys. In addition to moving the object, 
it also ensures it's in view, the holder's cursor gets updated etc.

If you were doing it in plain Morphic, you would do something like

newContainer addMorph: self

which automatically deletes self from its current container, but does not 
change the position etc.

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Is it just me or is Squeak Universes dead?

2013-01-26 Thread Bert Freudenberg
On 26.01.2013, at 11:31, David Corking li...@dcorking.com wrote:

 I opened the Universe Browser (basic) in my trunk image and hit the
 'update list from network' button.
 
 I got a predebug window for the failure of
 primitiveResolverGetAddressInfo as universe apparently tried to fetch
 
 http://universes.dnsalias.net/%7Euniverses/repositories/development.packages
 
 There doesn't seem to be any DNS record for universes.dnsalias.net
 which is hosted at dyndns.org, so I guess that hosting account has
 expired.
 
 Should I point Universe at a different URL, or ignore it?


A patch to remove the universe stuff from the image would be appreciated. The 
idea was nice, but did never really caught on. SqueakMap is still supported 
(although it could use some more packagers).

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Acquiring lock, releasing in callback

2012-11-02 Thread Bert Freudenberg

On 2012-11-02, at 18:42, Sebastian Nozzi sebno...@gmail.com wrote:

 Hello Dear Squeakers,
 
 threads and co. are giving me headaches :-) I wanted to ask for advice...
 
 What do I use in Squeak to prevent more than one thread entering a region, 
 but releasing the exclusivity in another block/callback? For example, let's 
 suppose there is an hypothetical class Lock that does that.
 
 lock acquire.
 longOperation performWhenFinished: [ callback code ... lock release ].
 ...
 rest of the program
 ...
 
 Is there something like that? Or do I have to simulate it with something 
 else? (Semaphore?)

You could use a Semaphore directly:

semaphore := Semaphore forMutualExclusion.

and then

semaphore wait acquire lock
...
semaphore signal release lock

 I am aware or Monitor/Mutex critical:, but I am not sure I can use it in my 
 case.


Semaphorecritical: simply does a wait and signal like above. But it ensures 
that if something goes wrong the semaphore is still signaled, so it's more easy 
to use.

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: [Scratch] building the scratch image from the source?

2012-09-28 Thread Bert Freudenberg
On 2012-09-28, at 17:00, Matthew Miller mat...@mattdm.org wrote:

 Pardon me for the squeak newbie question. Is it possible to build the
 scratch image from the source files distributed in a scripted way? Do you do
 this internally when working on the project?

No.

 In Fedora, shipping compiled binaries in the source isn't okay. The
 Scratch.image isn't an arch-specific compiled binary, but it *is* squeak vm
 bytecode, right?

It is a snapshot of the complete run-time memory of Squeak. Squeak is a version 
of Smalltalk, the original object-oriented system. It is not text-based. Coding 
in Smalltalk means loading a snapshot from disk, modifying objects in memory, 
and dumping the whole thing to a file between sessions. The image is evolved 
from version to version. It has some objects in it that were created decades 
ago. Literally. The last time the image was bootstrapped was in the 70ies.

This may sound odd, but e.g. the GPL states that sources must be distributed in 
their Preferred Form For Modification. In Smalltalk's case, that preferred 
form is the image. All the code is available and ready to be inspected and 
modified using Smalltalk tools. It's just a bit different from most other 
popular programming systems.

Btw, we have a special list for Squeak newbie questions:

http://lists.squeak.org/mailman/listinfo/beginners

(actually, I'm going to cc this reply to that list)

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: [Scratch] building the scratch image from the source?

2012-09-28 Thread Bert Freudenberg

On 2012-09-28, at 18:27, Matthew Miller mat...@mattdm.org wrote:

 On Fri, Sep 28, 2012 at 06:23:39PM +0200, Bert Freudenberg wrote:
 This may sound odd, but e.g. the GPL states that sources must be
 distributed in their Preferred Form For Modification. In Smalltalk's
 case, that preferred form is the image. All the code is available and
 ready to be inspected and modified using Smalltalk tools. It's just a bit
 different from most other popular programming systems.
 
 No, it sounds reasonable. I can probably get the Fedora packaging committee
 to okay it. (Which is my agenda is asking this question -- I don't
 _actually_ want to make any modifications at this point.)
 
 Is the preferred form _just_ the Scratch.image, or is it the image plus the
 SqueakV2.sources plus the src/Scratch.changes file?


All three. Sources and changes are a database of the source code (referenced 
from the image using absolute file offsets).

Since Fedora accepted Etoys, I see no problem for Scratch.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Marching ants

2012-09-13 Thread Bert Freudenberg
This came up on stack overflow (*), might be interesting to some:

(PolygonMorph
vertices: Rectangle fromUser corners
color: Color transparent
borderWidth: 2
borderColor: Color black)
dashedBorder: {10. 10. Color white. 0. 1};
openInHand

- Bert -

(*) http://stackoverflow.com/questions/12393970/
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Global string search and replace in an image

2012-09-11 Thread Bert Freudenberg

On 2012-09-11, at 01:43, Chris Cunnington smalltalktelevis...@gmail.com wrote:

 On 12-09-10 7:34 PM, Andy Burnett wrote:
 Hello,
 
 Is there a method - or other mechanism - that would let me find all 
 instances of 'foo' and replace them with 'bar' within an image? I imagine 
 there must be, but I can't find it.
 
 Cheers
 Andy
 
 
 ___
 Beginners mailing list
 
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 Try this: 
 
 OrderedCollection allInstances size
 
 Print that. That's the number of instances of OC in the image. Now try 
 
 OrderedCollection allInstances 
 
 or 
 
 OrderedCollection allInstances first
 
 And take a look at the living instances inside the image. That's how you find 
 instances. Replacing them is kind of a different issue. I'd say two things 
 about that. The first is you don't want to just replace instances in the 
 image. You need to be more specific of the context of your instances. Are 
 they in an OrderedCollection or an Array? If so, find that instance and 
 change them inside. 
 
 The second thing is you wouldn't generally replace instances in the image. 
 Just wait and they'll be eaten by the garbage collector. 
 
 So finding instances is not to hard. Use #allInstances. To replace them you 
 need to look not so much at the whole image but the application those 
 instances are in. Inside your app. 
 
 Oh, yea. You can use OrderedCollection allIstances and both explore and 
 inspect. You can see inside the instances that way. (Explore and inspect are 
 one of the main menus.) 
 
 Hope that helps, 
 Chris 

I thought Andy was talking about source code. 

Personally, if I have to rename a method, I search for all senders and fix them 
with copypaste. Same for class renames, inst var renames, etc. There just are 
not that many occurrences, so fixing each one individually is quick, plus I get 
to verify that the change is indeed what I wanted.

There is a tool to automate a lot of this called the Refactoring Browser, which 
many developers like, but I don't even have it in my image.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Is it me, or a problem with FileDirectory?

2012-06-15 Thread Bert Freudenberg

On 2012-06-15, at 12:17, David Lomas wrote:

 I've been trying to debug an application running on Squeak 4.1 randomly 
 crashing on certain setups. It turns out it's where people have their 'My 
 Documents' folder on Windows platforms set to a network share.
 
 As a trivial test case, I can trigger the error like this:
 
 1. Set up a share (can be on the same machine) called 'share'
 2. Check you can browse in Explorer to '\\server\share' - should be empty
 3. Execute the following in a Workspace:
 
 d := FileDirectory on: 'c:\NewDir'. d assureExistence.
 
 That should create a directory called 'NewDir' on the root of the C drive 
 (assuming your machine has a C drive :), just to check everything is working 
 OK.
 
 Now try:
 
 d := FileDirectory on: '\\server\share\NewDir'. d assureExistence.
 
 I get 'PrimitiveFailed: DosFileDirectoryprimCreateDirectory'. From what I 
 can tell, that method doesn't see '\\server\share' as effectively the 'root' 
 of a filesystem and keeps stepping up a level. I don't know if that's the 
 fault of the FilePlugin module, or something else. For info, the versions of 
 the methods in the debug trace are:
 
 DosFileDirectoryprimCreateDirectory: ar 2/2/2001 15:09
 FileDirectorycreateDirectory: yo 2/24/2005 18:33
 FileDirectoryassureExistenceOfPath: jcg 5/10/2010 14:44
 FileDirectoryassureExistence: hg 2/2/2002 16:37
 
 But my guess is that the problem is in FileDirectorydirectoryExists:, as 
 this is where there appears to be handling of special cases for certain file 
 systems. I can't see anything clever in there for UNC paths though.
 
 See also 
 http://lists.squeakfoundation.org/pipermail/squeak-dev/2002-March/037091.html 
 - it's related, but I can't track down the fix that Bert referred to, to see 
 if it helps.

That particular fix is probably unrelated. But the code was fixed last in 2010 
(e.g. the timestamp on assureExistenceOfPath: is now bf 9/9/2010).

You may want to try in a 4.3 image, and if necessary backport the fixes.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Green Screen in Etoys

2012-06-11 Thread Bert Freudenberg

On 2012-06-11, at 05:57, Steve Thomas wrote:

 Folks,
 
 I created a video of a code walk through for my students.  It's an algorithm 
 to create a Green Screen effect in Etoys. 
 As I am definitely a novice when it comes to Squeak, I would appreciate any 
 feedback on how I can correct/improve the explanations.
 
 Here is a link to the video of the code walk through and the introduction 
 video to wet the kids appetitie.


Awesome walkthrough!

Nit picks: 

* pages 8 and 10: when you explain iterating over y, the example code on the 
right should use height, not width ;)

* page 14: 0@0 in Squeak generally denotes the top-left, with increasing y 
values going down. Only Etoys pretends to use a proper Cartesian coordinate 
system with y going up, and the origin in the lower left (or center, depending 
on your playfield's settings). So the image code actually goes through the 
pixels from top to bottom, whereas you show it going from bottom to top.

Also, for others to replicate your coding, you may have to briefly show how to 
make a textual Etoys script. 

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] Re: Differences in OpenGL support on Linux vs. OS X?

2012-06-08 Thread Bert Freudenberg
(moving to beginners list)

On 07.06.2012, at 22:18, Phil (list) wrote:

 
 Bert,
 
 On Jun 7, 2012, at 6:25 AM, Bert Freudenberg wrote:
 
 
 This is probably unrelated, but you are apparently not using the latest 
 OpenGL package, and you messed it up severely. Why is it using 
 B3DAcceleratorPlugin instead of libGL?! I had to revert 
 openGLLibraryName to make it work at all.
 
 
 The short answer is that my work with OpenGL predated a lot of the 
 discussion/documentation that's now available for Squeak and involved a lot 
 of trial and error, so yes I'm considerably out of date and probably doing 
 some screwy/wrong things and plan to correct that.
 
 I *think* you identified my issue re: B3DAcceleratorPlugin.  When I initially 
 tried to get the code running on Linux I was getting module not found errors 
 and so I incorrectly did a search and replace to replace the module names 
 (and accidentally went a little beyond that) which resulted in the appearance 
 of OpenGL working on Ubuntu 12.04... and it sort of works (i.e. it's drawing 
 but very poorly via B3D and I think I was/am getting confused re: internal 
 vs. external plugins and how B3D fit into the mix with OpenGL.  I vaguely 
 recall going down this path several years ago when I was attempting to 
 initially get it running on OS X.)
 
 Based on some further research on squeak-dev, the real issue appears to be my 
 machines configuration (libGL isn't where the VM expects it)... and you're 
 right, that's not a vm-dev issue but I do thank you for helping to point me 
 in what appears to be the right direction to resolve this.
 
 Now if none of what I've said makes sense, then I'm still lost but I'll take 
 further discussion off of vm-dev.
 
 Thanks,
 Phil

It does make sense. The way the OpenGL bindings work isn't entirely obvious, 
that's true.

What's happening is that in the moment you create an OpenGL object, the FFI 
methods are rewritten. The module you see in the source code is not the one 
that gets used. You can verify this by switching to see decompiled code.

The openGLLibraryName method tells the system which library to use (e.g. 
opengl32.dll on Windows, OpenGL.framework on OS X). On Unix, the default is 
GL, which the VM expands to libGL.so.

Now, while this works for Unix in general, it does not work for Linux, unless 
you install development libraries. E.g. on my Ubuntu system, where I did 
install mesa-libGL-devel, I do have that symlink:

$ ll /usr/lib/i386-linux-gnu/mesa/
-rw-r--r--  1 root root 29 May 15 03:14 ld.so.conf
lrwxrwxrwx  1 root root 10 May 15 03:14 libGL.so - libGL.so.1
lrwxrwxrwx  1 root root 12 May 15 03:14 libGL.so.1 - libGL.so.1.2
-rw-r--r--  1 root root 358232 May 15 03:15 libGL.so.1.2

However, if you only install mesa-libGL and not the -devel package, you 
only have this:

$ ll /usr/lib/i386-linux-gnu/mesa/
-rw-r--r--  1 root root 29 May 15 03:14 ld.so.conf
lrwxrwxrwx  1 root root 12 May 15 03:14 libGL.so.1 - libGL.so.1.2
-rw-r--r--  1 root root 358232 May 15 03:15 libGL.so.1.2

Therefore, to make it work on a user's Linux install, you have to make 
openGLLibraryName return libGL.so.1.

Actually, I'm going to commit this right away ;)

Btw, B3DAcceleratorPlugin is just used for setting up an OpenGL context to 
render into. Since this is platform-dependent (in contrast to OpenGL itself) 
and needs VM integration, this part is a plugin and not done via FFI.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Help with pen stuff

2012-06-05 Thread Bert Freudenberg
On 05.06.2012, at 11:46, OrgmiGeek wrote:

 In my spare time I decided to rite a simple paint program! I have encountered
 some problems:
 #1 does paint stuff work in the BorderedMorph category?

With a Pen you paint on a Form (which is an picture object holding pixels). To 
display a Form in Morphic you can use an ImageMorph.

 #2 how would you make the program draw where your mouse pointer is? I think
 you do it like:
 myPen goto: 200@200.  but more like: myPen goto: mouseX@mouseY

Your morph can receive mouse events. You need to implement the 
handlesMouseDown: method to return true.

This will send mouse event messages to your morph. It will receive a mouseDown: 
message when the mouse button is pressed, and a mouseMove: message when the 
mouse is moved subsequently, and finally a mouseUp: message.

The argument to these messages is a MouseEvent. It has a position, but that is 
in world coordinates. You need to subtract the morph's topLeft coordinate from 
the event's position.

It's really just a handful of lines, but see the attached example for a working 
version.

- Bert -



BertsPaintMorph.st
Description: Binary data
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Where is the setter for self?

2012-06-01 Thread Bert Freudenberg
On 01.06.2012, at 22:26, Chris Cunnington smalltalktelevis...@gmail.com wrote:

 It's clearer to me to have:
 
 self
 printString new Control.Slider(null,null)
 all inst vars
 decoration a SUCreate
 canvas nil
 options nil
 handleId nil
 trackId nil
 
 But that makes no design sense to a person arranging information on a screen. 
 Now that I get it, it looks fine. :)

Also: what you are seeing next to all the inst vars is their printString.

 ObjectMemory, the Interpreter are clear objects on the learning landscape.

Except they're not Smalltalk objects at all.

 ParagraphEditor with its printIt and doIt (which I've heard people talk about 
 for years) comes to me as a revelation.

Yes, although I find it a bit limiting that our basic tools still rely so much 
on a textual representation. As you noted elsewhere, Self did a better job 
UI-wise to make objects tangible.

- Bert -
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] perform withArguments

2012-04-24 Thread Bert Freudenberg
On 24.04.2012, at 10:59, Dawson wrote:

 .. I had thought there might be a way of building up the cellObject
 cellLock: aBoolean ... judging from the replies, it seems that it is
 either a) crazy, b) it can't be done, c) no one knows how to do it.


It's a) crazy.

Of course there's a way to do it. It depends on where your variables actually 
are. For temporary variables, you would use thisContext.

| cell1 cell2 cell3 |
cell1 := 'this'.
cell2 := 'is'.
cell3 := 'crazy'.
ctx := thisContext.
(1 to: 3) inject: '' into: [:s :i | s, (ctx at: i), ' ']

For instance variables, you would use instVarNamed:

cell1 := 'this'.
cell2 := 'is'.
cell3 := 'crazy'.
(1 to: 3) inject: '' into: [:s :i | s, (self instVarNamed: 'cell', i asString), 
' ']

Both of these are equally crazy. An array is much less crazy:

cell1 := 'not'.
cell2 := 'so'.
cell3 := 'crazy'.
array := {cell1. cell2. cell3}.
array inject: '' into: [:s :cell | s, cell, ' ']

But as others pointed out, in real code you would not even put cells into 
individual variables in the first place, but create them as an array (not 
OrderedCollection, since you do not need the number of cells to change).

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: perform withArguments

2012-04-24 Thread Bert Freudenberg
On 24.04.2012, at 11:34, Louis LaBrunda wrote:

 
 .. I had thought there might be a way of building up the cellObject
 cellLock: aBoolean ... judging from the replies, it seems that it is
 either a) crazy, b) it can't be done, c) no one knows how to do it.
 
 I don't know if I would say it is crazy but some might.  Mostly I use VA
 Smalltalk, it is designed more for business use that Squeak is (that's not
 a knock on Squeak, it's just the way it is).  In VA Smalltalk the compiler
 is not included with the packaged images.  In Squeak, you always live in
 the image with the compiler.  I expect there is a way to build up a string
 that might look like this: cell1 cellLock: true and then send it to the
 compiler and then execute the compiled code returned by the compiler.  I
 bet Bert and many other in the group know how to do this.  But once you
 play with collections, you will see it is not needed.


Hah! Using the compiler is even more crazy than the meta programming facilities 
(thisContext, instVarNamed:). But yes, it's possible:

Compiler new evaluate: 'cell1 cellLock: true' in: thisContext to: self

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Squeak on a BeagleBone

2012-04-23 Thread Bert Freudenberg

On 21.04.2012, at 13:25, David Graham wrote:

 On 4/21/12 2:16 PM, Bert Freudenberg wrote:
 On 20.04.2012, at 22:14, David Graham wrote:
 
 It took me almost 20 years, but I finally thought of something interesting 
 to put on the Internet. ;)
 
 I've been experimenting with a BeagleBone (embedded ARM V7 platform) and 
 was able to get Squeak 4.2 running without a problem.  I put together a 
 simple demo with a blog post and video, and thought the Squeak list may be 
 interested (also, please let me know if I have any technical errors in my 
 smalltalk code explanation).
 
 http://blog.unthinkable.org/
 
 -David
 Very nice!
 
 There is one flaw in your code. You should never run Morphic code outside 
 the UI process. But your appendValue: message does that. The correct way 
 would be to write
 
  WorldState addDeferredUIMessage: [graph1 appendValue: lightValue]
 
 That will cause the block to be evaluated at the next display cycle.
 
 Of course, the proper way to make an updating Morph is to write a new Morph 
 class. Then you could use Morphic's stepping mechanism to read the data and 
 display it.
 
 Thanks Bert!  I just started playing with Morphic and didn't know this. ( 
 also, I just started learning smalltalk last year and mostly working with 
 Zinc on Pharo).  I was targeting my post at non-smalltalk arduino / 
 BeagleBone devs and wanted to keep the syntax as simple as possible, but 
 should I update the post?

Well, people learn from examples, and it's better if the examples do not teach 
bad style.

Here is a way to use Morphic's stepping properly from a workspace. This uses 
the Etoys mechanism of adding methods to an object directly (without having to 
make a new class in the browser):

graph1 := GraphMorph new.
graph1 assureUniClass.
graph1 class compile: 'step
self appendValue: 50 atRandom.
super step'.
graph1 class compile: 'stepTime
^50'.
graph1 openInWorld.
graph1 extent: 700@500.
graph1 clear.

This avoids having to create a background process, but I'm not sure if that 
makes it more clear to your audience.

- Bert -

 But for a 10 line hack your code is not bad :)
 I hear this a lot. ;)
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners



___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] perform withArguments

2012-04-23 Thread Bert Freudenberg
Ah that's curious - your reply did not have a Re: and was not threaded with the 
original message. Would have saved me to write a message very similar to yours 
;)

- Bert -

On 23.04.2012, at 10:44, Louis LaBrunda wrote:

 Hi,
 
 For your example:
 
   cellObject cellLock: aBoolean
 
 where cellObject is to look like: cell1, cell2, cell3 ..., or cell9
 
 I don't think you want or need to use #perform:.  You use #perform: when
 you want to construct the message name and sent the constructed message
 name to an object.
 
 In your case you know the message you want to send, it is #cellLock:.  What
 you don't know (or have easily available) is the object you want to send
 the message to.
 
 What I think you need to do is save your cell objects in an array or
 collection (I will let you look up collections, but ask again if you need
 help).  With something like:
 
 cellObjects := OrderedCollection new.
 cellObjects add: YourCellClass new.
 
 Once you have a collection of your cells, you can access one or more of
 them and sent the #cellLock: message to it like so:
 
 (cellObjects at: cellNumber) cellLock: aBoolean
 
 Good luck and keep posting if you need help.
 
 Lou
 
 On Mon, 23 Apr 2012 07:58:47 -0700 (PDT), OrgmiGeek
 cool.origam...@gmail.com wrote:
 
 Hi,
 I've read the sparse documentation on 'dynamic message' calls and I've
 experimented a lot and still cannot figure out how to do something that
 should be simple:
 
 I want to build a message like this:
 
  cellObject cellLock: aBoolean
 
 where cellObject is to look like: cell1, cell2, cell3 ..., or cell9
 
 I can build up cellObject like this:
 
   self perform: ('cell', cellNumber asString) asSymbol
 
 but I can't figure out how to build the full message with the key selector
 cellLock:, and the value 'aBoolean'.
 I've tried everything I can think of based on the terse documentation, and
 anything I can find on the internet, which isn't much (including this
 forum).
 
 Any help would be appreciated.
 
 Thanks
 
 -
 ---
 Under the age of 15 so don't want to post my name :D
 ---
 Louis LaBrunda
 Keystone Software Corp.
 SkypeMe callto://PhotonDemon
 mailto:l...@keystone-software.com http://www.Keystone-Software.com
 



___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Using a squeak VM

2012-03-21 Thread Bert Freudenberg

On 21.03.2012, at 12:20, Brian Lockwood wrote:

 Hi, I am trying to run a squeak VM. It is scratch 1.4
 
 I have the VM etc downloaded from the site at MIT. source page
 
 I managed to run it by overwriting the default folder with the scratch one 
 and renaming the scratch.image as squeak.image.
 
 Seems to me that this was not what I should have to do. 
 
 If someone has given me a squeak vm and source code, how do I just get 
 MySqueak to load and run it?
 
 Or is this the wrong question? (Or rather, was that the wrong question?  
 35F.gif)
 
 System Tosh dual core Intel, Fedora 16
  3.2.10-3.fc16.x86_64

squeak /path/to/my.image


- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Searching senders of a method

2012-03-03 Thread Bert Freudenberg

On 03.03.2012, at 13:44, deejay220989 wrote:

 Hi,
 
 May I know the difference between:
 
 SystemNavigation default allCallsOn: #subclassResponsibility
 and
 ProtoObject allCallsOn: #subclassResponsibility
 
 It seems that ProtoObject allCallsOn: #subclassResponsibility returns 3
 results lesser than SystemNavigation default allCallsOn:
 #subclassResponsibility
 
 Shouldn't they return the same result since ProtoObject is the superclass of
 all classes?


In my image, this returns an empty collection:

ProtoObject allCallsOn: #subclassResponsibility

Which is unsurprising, since ProtoObject has no methods that send 
#subclassResponsibility.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Searching senders of a method

2012-03-03 Thread Bert Freudenberg

On 03.03.2012, at 14:00, deejay220989 wrote:

 I see..I thought it will search for the method in the subclasses of
 ProtoObject too. As for me, it returns a SortedCollection (349 entries).
 
 Which version of Squeak are you using?


The latest (4.4 alpha trunk). How about you?

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Searching senders of a method

2012-03-03 Thread Bert Freudenberg
On 03.03.2012, at 14:07, deejay220989 wrote:

 I'm using 4.2..now downloading 4.3 and will try to download 4.4 alpha..will
 let you know later.


It looks like the behavior was changed in 4.3. It now excludes subclasses. Not 
sure why. Levente?

To get the old behavior you now would need to do

SystemNavigation default allCallsOn: #subclassResponsibility localTo: 
ProtoObject

The size difference comes from duplicates - if you convert the result of this 
to a Set and compare sizes, they do match.

(SystemNavigation default allCallsOn: #subclassResponsibility localTo: 
ProtoObject) size
== 391

(SystemNavigation default allCallsOn: #subclassResponsibility localTo: 
ProtoObject) asSet size
== 358

This may be considered a bug, I guess.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Siblings

2012-02-29 Thread Bert Freudenberg
On 29.02.2012, at 14:25, sholom.eisenstat wrote:

 In creating a simulation of balloons rubbing, I want to have ‘electrons’ 
 created.
 What tiles can I use to generate siblings or copies of a ‘dot’ that would 
 then move around?
 I’m not sure if I want siblings or copies..
 This would be similar to having to create a stream of projectiles from a 
 cannon or hose, for example.

You would use the electron's copy tile to duplicate it and the world's 
include tile to place it in the world, like so:

world include electron's copy

(this actually produces a sibling, but it wouldn't matter either way)

Btw, since this is an Etoys-specific question, you may find this to be a better 
place to ask this kind of questions:

http://squeakland.org/discuss/

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: Problem with cmd-c

2012-02-01 Thread Bert Freudenberg

On 31.01.2012, at 13:10, Ylem wrote:

 Hello everyone, I have a problem with Squeak, my iBook G4, does not allow me
 to copy and paste, just run cmd-c, Squeak crashes immediately. I apologize
 but I do not speak English well, thank you all for your work.


Which Squeak VM are you using?

One idea would be to delete the ClipboardExtendedPlugin.bundle from your VM app.

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Testing = and == in workspace

2012-01-08 Thread Bert Freudenberg
On 08.01.2012, at 00:48, Ben Coman wrote:

 For some naive reason I thought that the SmallIntegers would stop at 64k. 


No, SmallIntegers currently use the full 31 bit range:

{SmallInteger maxVal hex. SmallInteger minVal hex}
== #('16r3FFF' '-16r4000')

  Is it platform dependent on whether the CPU is 16/32/64 bit ?

Squeak is independent of the CPU word size. All images in general use are 32 
bits. That means an object pointer (aka oop) is a 32 bit word. Squeak's 
ancestor, Smalltalk-80, used 16 bit oops. For Squeak there is an experimental 
64 bit image format, where each object pointer uses 64 bits. (1)

Normally an oop references a chunk of memory, which has one to three header 
words, and zero or more words for the contents of the object. 

Only SmallIntegers are special: their oops do not reference memory, but the 
value is taken from the bits of the oop itself. Each oop has one tag bit 
which determines if it is a normal oop (a reference) or an immediate object. 
The other 31 bits determine the value of the SmallInteger. (2)

That's why two SmallIntegers with the same value are always identical. == 
simply compares oops.

- Bert -

(1) 64 bit VM means a VM compiled for a 64 bit processor, 64 bit image 
means an image that use 64 bit oops. These are independent concepts, a 64 bit 
VM may run a 32 bit image. See http://squeakvm.org/squeak64/faq.html

(2) There have been proposals to use more tag bits, which would reduce the 
range of SmallIntegers, but add more immediate classes. There have been 
experiments but nothing has been officially adopted yet. But in particular with 
64 bit oops there are so many bits that we may see more immediate classes.

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] class method #initializeClass vs. #initialize

2012-01-08 Thread Bert Freudenberg

On 08.01.2012, at 06:21, Ben Coman wrote:

 I have come across a class method initializeClass with a comment Do not 
 rename to #initialize.
 Is that a generic concern ?

It is pretty unusual.

 This particular case is from BaseUnit  initializeClass from 
 http://www.squeaksource.com/Units.html


Generally you would name this method initialize. This ensures it is 
automatically evaluated when loading the class.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Testing = and == in workspace

2012-01-07 Thread Bert Freudenberg

Am 07.01.2012 um 07:04 schrieb Ben Coman b...@openinworld.com:
 I had thought that the two assignments of 'xxx' to (x) and (y) would result 
 in different objects, but they turn out to be identical.  It is like the 
 compiler has noticed that they are equal and chosen to make them identical.  

That is indeed what's happening. 

You can verify this by executing each line separately. 

- Bert -___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Is there an easy way to implement an animation loop?

2012-01-06 Thread Bert Freudenberg
On 05.01.2012, at 22:27, karl ramberg wrote:

 Ugh, that is right.
 Stepping starts right away for a new morph.

Only if #wantsSteps answers true.

 Since you want stepping only at certain times you should use 
 startSteppingSelector:  and stopSteppingSelector: (and not call that 
 selector/method #step.)

Or make #wantsSteps answer false and send #startStepping later.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Changing the extent of an ImageMorph

2012-01-05 Thread Bert Freudenberg

On 04.01.2012, at 16:44, Jan Teske wrote:

 Hey,
 
 I'm currently developing a small game with Squeak. Part of it is a bunch of 
 menus which should have background images. Therefore I have realized them as 
 ImageMorphs with the respective images.
 Now, there are menus which sizes are determined dynamically during the 
 runtime of the game. That means I have to change the size of the menus. Since 
 I cannot do this by manipulating 'menu extent: ...' directly, the only way I 
 found until now is to manipulate the image form 'menu image: menu image 
 scaledToSize: ...'. That works pretty well except for one thing: I cannot 
 change the aspect ration of the original image with scaledToSize:. Since I do 
 not know the extends of my menus before the game starts, I cannot say 
 anything about the needed image ratio. Since my menus should be as applicable 
 as possible I need to be able to resize also in a way which destroys the 
 original scales.
 
 Is there any easy workaround for my problem or a recommended way for creating 
 resizable Morphs with background images?


Wouldn't it be simplest to just use a regular MenuMorph and give it a 
BitmapFillStyle?

MenuMorph example
fillStyle: (BitmapFillStyle fromForm: ScriptingSystem 
squeakyMouseForm);
openCenteredInWorld 

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Iterating backwards through a Matrix

2011-12-22 Thread Bert Freudenberg

On 22.12.2011, at 09:50, Jan Teske wrote:

 I'm currently trying to develop a game with squeak. The game field is based 
 on a Matrix in which all the game objects are placed.
 To simulate gravity I need the possibility to iterate over the Matrix in a 
 reversed order. For example if my Matrix looks like that:
 
1 x x 2
x 3 x x
4 x x 5
 
 I need to bring that into a Collection like {5. 4. 3. 2. 1} which allows me 
 to perform iterations (select) over this reversed order. It would also be 
 okay if the order was like {4. 5. 3. 1. 2} since I only need the elements in 
 the lower rows to come before the elements in the upper rows.
 I already tried 'myMatrix toArray reverse' but the toArray seems to mess up 
 the whole order so that is not working.

I don't see toArray anywhere, but asArray should work fine, it preserves 
the order.

 Maybe I could iterate through the Matrix on my own and build an Array out of 
 that. But since I feel I might have overlookes something I wanted to ask for 
 a better way first. Is there any?

You did not overlook anything. The Matrix class simply isn't set up for that 
kind of usage. You will have to iterate over it yourself. 

Possibly you would want to make your own GameField class, which could have the 
matrix as an instance variable. It can have all the methods you need, like 
reverse. Then in the rest of your game you would only use that game field, 
not matrix directly. In a later implementation stage you could change its 
internal implementation easily (e.g., to make it more efficient).

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] blender 3D

2011-12-14 Thread Bert Freudenberg
On 14.12.2011, at 09:57, dimitris chloupis wrote:Are you ready to code a 1 million lines of code application ? Because that is how big blender is. Sure maybe you can squeeze that because smalltalk is much less verbose than cto 250.000 lines. Are you still ready to do that ? And fight all the buginess along the way ?Wouldn't you rather debug in Smalltalk than any other system? It's not as if any other language would make that simpler.Also if your goal is to teach programming then you will probably need to choose a more popular programming language as that will be the choice that your students will favor.It's true that people favor popular languages. That's what the term "popular" means. It's also true, however, that people with Smalltalk experience usually have a much better grip on OO design than those who only know the more popular languages.[...]In the end its completely up to what you want to do, in any case one thing I advice is never , never , never understimate how difficult simple things can be ;)Never underestimate the power of a dedicated professor and a bunch of good PhD students. They can create amazing things, certainly enough to learn with.That's how I got hooked into Smalltalk back in my university days. We built a largish 3D rendering system, in VisualWorks Smalltalk. You may have encountered this picture, which I created in that system:So yes, it's perfectly possible. You have to have at least one technically very proficient member in your group though. He/she will have to initially mentor all the others who are new to this. Over time the number of capable people will grow.Good luck!- Bert -___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


[Newbies] What makes Smalltalk different

2011-11-22 Thread Bert Freudenberg
(This is from an answer to a question on StackOverflow 
http://stackoverflow.com/questions/8222489 It might be helpful to some newbies 
on this list so I'm re-posting)

===
Q: (paraphrased) I want to learn Smalltalk but without the baggage of an IDE. 
Just let me use my favorite text editor, that's much easier.

A: It is not helpful to learn Smalltalk as just another language. You would be 
missing the point entirely.

Smalltalk's graphical environment is not just an IDE. The core of the system is 
simply objects. The interface provides various ways to create objects and 
interact with them. The language is just a convenient way to create messages to 
the objects. It is secondary to the objects themselves.

In other OO languages, you write your program, then you run it, which creates 
objects in memory. Not so in Smalltalk. You create objects in memory (e.g. 
class objects) and then send messages to e.g. add methods. But a class object 
is only created once, not every time you run your program.

There is no such thing as your program, in fact. There is no main. It's 
just a world of objects, some longer-lived, some temporary. In fact, in the 
system there are objects that were created 30 years ago. Literally. The objects 
are just frozen to disk as a memory dump (a file which we call image) and 
unfrozen later (possibly on a different machine).

That image, the world of objects, is the primary artifact in Smalltalk. There 
is a sources file, yes, but that's just a database of text snippets to not take 
up so much RAM. You cannot edit this file by hand (objects in the image use 
absolute file offsets into the sources file). You cannot re-create the system 
from the sources file - the system was bootstrapped a long time ago and from 
then on only modified.

It's true that superficially the Smalltalk GUI looks just like another IDE. No 
coincidence - Eclipse was originally written by Smalltalkers in Smalltalk. But 
there is the crucial difference that in regular IDEs you just manipulate text 
files. A text editor is a valid alternative for that. In Smalltalk, the GUI 
manipulates objects in memory. A text editor can not do that.

And as for what Smalltalk to use, I would recommend Squeak. Very friendly 
community, very nice environment, and subscribing to the original Smalltalk 
vision of creating a great personal computing environment for everyone.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] What makes Smalltalk different

2011-11-22 Thread Bert Freudenberg

On 22.11.2011, at 18:48, Yoshiki Ohshima wrote:

 At Tue, 22 Nov 2011 12:35:28 +0100,
 Bert Freudenberg wrote:
 
 It's true that superficially the Smalltalk GUI looks just like another IDE. 
 No coincidence - Eclipse was originally written by Smalltalkers in 
 Smalltalk. But there is the crucial difference that in regular IDEs you just 
 manipulate text files. A text editor is a valid alternative for that. In 
 Smalltalk, the GUI manipulates objects in memory. A text editor can not do 
 that.
 
  Could this be Visual Age for Java rather than Eclipse? (Eclipse superceded 
 VA for Java so transitively it could be true.)

Precisely. A couple of the IBM Smalltalk people went on to create Eclipse. The 
product name for IBM's Smalltalk was Visual Age. That Smalltalk originally 
came from OTI.

- Bert -

  Back when I knew about Java but not Smalltalk, the files Visual Age
 for Java installed on to my computer were very strange looking.
 Later, I learned that these were Smalltalk files.^^;
 
 -- Yoshiki
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners



___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] What makes Smalltalk different

2011-11-22 Thread Bert Freudenberg
On 22.11.2011, at 19:45, H. Hirzel wrote:

 Yes, a good concise summary.
 
 A candidate for a module an www.cnx.org. I'd like to put it there.
 
 Bert, may I ask you to allow me to do that. The license for that web
 site with e-learning modules is
 http://creativecommons.org/licenses/by/3.0/
 
 --Hannes

Yes, of course.

- Bert -

 
 On 11/22/11, Gary Dunn garydun...@gmail.com wrote:
 Well put! Please can someone with permissions capture this on our swiki?
 
 Gary Dunn
 Open Slate Project
 http://openslate.org
 
 On Nov 22, 2011 1:35 AM, Bert Freudenberg b...@freudenbergs.de wrote:
 
 (This is from an answer to a question on StackOverflow
 http://stackoverflow.com/questions/8222489 It might be helpful to some
 newbies on this list so I'm re-posting)
 
 ===
 Q: (paraphrased) I want to learn Smalltalk but without the baggage of an
 IDE. Just let me use my favorite text editor, that's much easier.
 
 A: It is not helpful to learn Smalltalk as just another language. You would
 be missing the point entirely.
 
 Smalltalk's graphical environment is not just an IDE. The core of the
 system is simply objects. The interface provides various ways to create
 objects and interact with them. The language is just a convenient way to
 create messages to the objects. It is secondary to the objects themselves.
 
 In other OO languages, you write your program, then you run it, which
 creates objects in memory. Not so in Smalltalk. You create objects in
 memory (e.g. class objects) and then send messages to e.g. add methods. But
 a class object is only created once, not every time you run your program.
 
 There is no such thing as your program, in fact. There is no main. It's
 just a world of objects, some longer-lived, some temporary. In fact, in the
 system there are objects that were created 30 years ago. Literally. The
 objects are just frozen to disk as a memory dump (a file which we call
 image) and unfrozen later (possibly on a different machine).
 
 That image, the world of objects, is the primary artifact in Smalltalk.
 There is a sources file, yes, but that's just a database of text snippets
 to not take up so much RAM. You cannot edit this file by hand (objects in
 the image use absolute file offsets into the sources file). You cannot
 re-create the system from the sources file - the system was bootstrapped a
 long time ago and from then on only modified.
 
 It's true that superficially the Smalltalk GUI looks just like another IDE.
 No coincidence - Eclipse was originally written by Smalltalkers in
 Smalltalk. But there is the crucial difference that in regular IDEs you
 just manipulate text files. A text editor is a valid alternative for that.
 In Smalltalk, the GUI manipulates objects in memory. A text editor can not
 do that.
 
 And as for what Smalltalk to use, I would recommend Squeak. Very friendly
 community, very nice environment, and subscribing to the original Smalltalk
 vision of creating a great personal computing environment for everyone.
 
 - Bert -
 
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 



___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Drawing with Morphic Transforms

2011-10-18 Thread Bert Freudenberg
On 18.10.2011, at 06:09, Jeff G wrote:

 Hi Everyone,
 
 My question concerns how to correctly use transforms when drawing in Morphic. 
  I have created a morph and overridden its drawOn: method so that I can 
 convert the canvas passed in to a BalloonCanvas so I can get anti-aliasing 
 when I draw, and subsequently to a clipping canvas so that I can draw figures 
 outside the bounds of the morph without actually drawing past the morph and 
 onto the Display.  
 
 One of the things that I would like to do is allow for shapes I am drawing to 
 be given an arbitrary scale, translation, and rotation.  Each shape would 
 have an associated transform so that when they are asked to draw they would 
 set their transform on the canvas and draw as though they are situated at the 
 origin and the transform will take care of having the actual rendering occur 
 in the correct location.  Ie if a rectangle has size of 20@20 and the morph 
 has its bounds starting from 500@400 (topLeft) then ultimately the rectangle 
 will start drawing from 500@400 to 520@420, and thus will display correctly 
 in the morph.
 
 My problem is that I cannot seem to get the canvas to actually take into 
 account the transform that I am setting during drawing.  I can call 
 transformBy: or transformBy:clipTo:during: passing in either a 
 MatrixTransform2x3 or a MorphicTransform, with both being given an offset of 
 the Morph's topLeft.  I then draw a rectangle at 0@0 with a extent of 
 100@100.  My experience with other vector drawing toolkits would lead me to 
 believe that this should cause the rectangle to draw in the top left corner 
 of the morph no matter where it is onscreen, but alas the rectangle only 
 appears when I move the morph to the top left of the display, meaning that 
 the transform isn't causing an offset to take place during the drawing.
 
 Any pointers that could be offered to allow me to get my drawing up and fully 
 transformed would be greatly appreciated as I would like to work on a simple 
 asteroids game after this, and I will be using transforms of basic shapes 
 extensively as they travel around the screen.

It does work, but read below for things that may trip you up:

c := Display getCanvas asBalloonCanvas.
c aaLevel: 4.
c transformBy: (MatrixTransform2x3 withOffset: 100@100).
c transformBy: (MatrixTransform2x3 withAngle: 20).
c drawRectangle: (0@0 extent: 100@50) color: Color red borderWidth: 1 
borderColor: Color black.

Note that the transform is taken into account only for Balloon drawing. 
BalloonCanvas inherits from FormCanvas. It overrides most FormCanvas drawing 
methods, but you may find some that are not overridden.

For most efficiency, use the drawBezier* methods. Balloon can be quite 
efficient. It was developed to play back Flash animations, though the Flash 
file support has been removed in recent Squeak releases. 

Morphic generally uses FormCanvas, which does not allow arbitrary transforms. 
For rotation and scaling it falls back to warping bitmaps. That's because it's 
older than Balloon, and never was converted to use properly nested transformed 
drawing.

Another source of confusion might be that (in contrast to most other 
scene-graph APIs) Morphic uses absolute coordinates. When you move a Morph, it 
actually adjusts all the bounds of its submorphs. You will have to override 
that mechanism in your own Shape hierarchy.  Again, look at the Flash player if 
you need an example how to do this.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Re: [] whileTrue: [] implementation

2011-10-05 Thread Bert Freudenberg
On 05.10.2011, at 00:24, nicolas cellier wrote:

 Bert Freudenberg bert at freudenbergs.de writes:
 On 04.10.2011, at 19:16, Erlis Vidal wrote:
 
 Thanks Bert!
 
 The byte code has the answer, I thought that the byte code will map the
 source code but I see that's not the
 case, probably to ensure some optimizations.. or to do that jump I don't
 know how to do that in smalltalk
 
 For ifTrue: it is purely an optimization, yes. It would work fine by actually
 sending that message. It would
 just be slower.
 
 In the case of whileTrue:, however, it's not just an optimization. The only
 way to do loops otherwise would
 be by recursion. But the Squeak VM does not do tail-call elimination, so it
 would run out of space pretty
 soon. Generating the loop as a byte code back jump is essential for the 
 system
 to work.
 
 - Bert -
 
 
 
 Oh no, we could as well reduce stack depth to (numberOfIteration log: 2) with
 silly recursive code like this:
 
 
 BlocktryTwiceThen: aBlock
   self value ifFalse: [^aBlock value].
   self value ifFalse: [^aBlock value].
   ^
   [self value ifFalse: [^aBlock value].
   self value ifFalse: [^aBlock value].
   true]
   tryTwiceThen: [^aBlock value]
 
 Blocklog2WhileTrue
^self tryTwiceThen: [^nil]
 
 | i maxDepth sender |
 i := maxDepth := 0.
 [i := i+1.
   depth := 0.
   sender := thisContext.
   [(sender := sender sender) isNil] whileFalse: [depth := depth+1].
   maxDepth := maxDepth max: depth.
 i1] log2WhileTrue.
 ^maxDepth

Yes, but log(n) is still not good enough for loops that run forever. Like the 
Morphic main loop. Or the idle process.

I don't think it's possible to emulate whileTrue without reaching for the meta 
hammer. Interesting discussion though. Maybe a bit over the head of the average 
newbie ;)

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [] whileTrue: [] implementation

2011-10-04 Thread Bert Freudenberg

On 04.10.2011, at 17:58, Erlis Vidal wrote:

 Hi all, 
 
 I was looking at the implementation of some of the flow control methods and I 
 have a question with the method whileTrue. 
 
 First of all, I can see two identical implementation in the classes 
 BlockClosure and BlockContext the implementation is this 
 
 whileTrue: aBlock 
 Ordinarily compiled in-line, and therefore not overridable.
 This is in case the message is sent to other than a literal block.
 Evaluate the argument, aBlock, as long as the value of the receiver is 
 true.
 
 ^ [self value] whileTrue: [aBlock value]
 
 I'm assuming here that there's another class Block I'm missing (something 
 like the literal block mentioned in the comment) which is the one that 
 contains the logic I was looking for. But I'm not able to find any other 
 whileTrue method in my image.

Block is just short for either BlockClosure or BlockContext. Literal blocks 
are those written directly with square brackets. If you store a block in a 
variable and pass that variable, the block would not be literal.

 What's the difference between BlockClosure and BlockContext? 


BlockClosures are BlockContexts Done Right.

If you wrote square brackets in older Squeak versions (3.x) you would get a 
BlockContext. In a current Squeak you get a BlockClosure.

So since now we only have closures, the difference is only of historic 
interest. You can do some things with closures that you couldn't do with block 
contexts, e.g. recursive blocks:

| fac |
fac := nil.
fac := [:n | n  1 ifTrue: [n * (fac value: n - 1)] ifFalse: [1]].
fac value: 10

This would not have worked with contexts.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] [] whileTrue: [] implementation

2011-10-04 Thread Bert Freudenberg
On 04.10.2011, at 18:41, Erlis Vidal wrote:

 Can I add methods to literal blocks?

Yes.

 Where do I implement those methods?

In class BlockClosure.

 In case your answer is in BlockClosures, why I don't see any ifTrue: in the 
 while implementation? 

Because the compiler generates a jump byte code for whileTrue: directly. In a 
browser on the whileTrue: method, click the source button to switch to 
showing byte codes.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Move an object into another project

2011-09-28 Thread Bert Freudenberg
On 28.09.2011, at 05:24, Jonathan Wright wrote:

 Subbu and Gary,
 
 Cool. Thanks you.  If I move the object into the Squeak tab I then can
 move it out of there from any project.  However, if I move the object
 into the Tools tab, when I drag the object out it automatically makes a
 copy of it instead.  This could be very helpful.

You also could make your own flap (see the flaps menu). If you enable its 
parts bin behavior then it will hand you a copy, otherwise it just grabs the 
object itself.

Btw we call the contents drawer a flap and the small handle its tab. 

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Instability

2011-09-13 Thread Bert Freudenberg

On 13.09.2011, at 10:47, Overcomer Man wrote:

  Anyway, if you pull the halo on the debugger, you should be able to click 
  the wrench, which will give you an inspector that you can use to drill down 
  into the actual stack trace.
 
 Too bad the drill down process wasn't explained.  Now what does one do to get 
 the stack copied?

The stack is automatically logged to a file named SqueakDebug.log in the 
default directory. Just attach that. Watch out though, it gets overwritten on 
the next error.

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] OMeta

2011-08-25 Thread Bert Freudenberg
On 25.08.2011, at 15:57, Sean P. DeNigris wrote:

 I tried to load OMeta2 into Squeak 4.2 and ended up with
 AnObsoleteOMeta2Base subclass: #OMeta2
 
 From squeaksource.com/OMeta, I loaded:
 1. OMeta2-Preload
 2. OMeta2-Postload
 
 It seems like the post-load is removing the base class of OMeta2.
 
 How do I load it successfully?

There is a bug in 4.2 preventing OMeta's special PackageInfo class from being 
loaded. This has been fixed in the trunk version.

It works fine in Squeak4.3alpha-11314 (and presumably later versions).

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] OMeta

2011-08-25 Thread Bert Freudenberg

On 25.08.2011, at 16:11, Bert Freudenberg wrote:

 On 25.08.2011, at 15:57, Sean P. DeNigris wrote:
 
 I tried to load OMeta2 into Squeak 4.2 and ended up with
 AnObsoleteOMeta2Base subclass: #OMeta2
 
 From squeaksource.com/OMeta, I loaded:
 1. OMeta2-Preload
 2. OMeta2-Postload
 
 It seems like the post-load is removing the base class of OMeta2.
 
 How do I load it successfully?
 
 There is a bug in 4.2 preventing OMeta's special PackageInfo class from being 
 loaded. This has been fixed in the trunk version.
 
 It works fine in Squeak4.3alpha-11314 (and presumably later versions).

Actually the version I tried was 11460 (I did update from 11314).

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Keyboard input - programming course

2011-07-05 Thread Bert Freudenberg
On 05.07.2011, at 01:44, Stephen Woolerton wrote:

 Then, make a Morph and send it messages. Evaluate each line individually to 
 see its effect.
 
  joe := Morph new.
  joe openInWorld.
  joe position: 100@100.
  joe color: Color red.
 
 I'm running Pharo 1.2.1 and hope you can help in this list. Am running Mac OS 
 X 10.6.7.
 
 I can't see how to get halos so that I can remove morphic objects I've 
 created. Also, if I click Ctrl-Click on an object, I get a context menu, 
 however choosing delete doesn't delete the Morph. I can inspect the object 
 via Morph/ImageMorph/PasteUpMorph.
 
 Also System/Settings/Appearance/Morphic/Halo doesn't have anything that helps 
 either.
 
 Should I be running Squeak if I want to use Morphic?

Yes.

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] selectors for an array of classes

2011-07-04 Thread Bert Freudenberg

On 03.07.2011, at 19:48, Jonathan Wright wrote:

 On Sun, 3 Jul 2011 18:47:09 +0200
 Bert Freudenberg b...@freudenbergs.de wrote:
 
 On 03.07.2011, at 18:35, Jonathan Wright wrote:
 
 
 Hello,
 
 I am trying to read the methods of several classes.  I am getting a
 messagenotunderstood for the following code:
 
 TempObject := #(OrderedCollection Integer).
 TempObject do: [ :iClass |
 iClass selectorsDo: [ :item |
 item.]].
 
 I can run a iClass name successfully.
 
 Try iClass class, that should be enlightening ;)
 
 But it doesn't seem to recognize iClass selectors.
 
 The name message works on any (see Objectname). iClass is not
 actually a class in your example.
 
 Hint 1: #() creates a literal array.
 
 Hint 2: Classes are not literals.
 
 Hint 3: {} creates a non-literal array.
 
 Nitpick: temps should have lowercase-names.
 
 - Bert -
 
 ___
 Beginners mailing list
 Beginners@lists.squeakfoundation.org
 http://lists.squeakfoundation.org/mailman/listinfo/beginners
 
 
 Awesome, thanks for the hints!  It works now!
 
 In finding information about non-literal arrays, it seems you put
 periods in between the array contents.
 
 I'm not sure I understand iClass class.  It just seems to add class at
 the end.  I suppose I would now have extra methods to work with in
 doing that?

No, I meant if you had tried that in your original example it would have 
answered Symbol. Because that's what literal arrays store for unembellished 
identifiers (except for nil, true, and false).

 Regarding TempObject, yeah I've been using it as a global variable for a
 while now, so it should be capitalized in my case.  :-)  I read all
 about the capitalization guidelines for smalltalk and it all makes
 sense to me.

In that case, it's all right. I guess the appropriate longevity of temp vars 
is in the eye of the beholder ;)

- Bert -



___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Keyboard input - programming course

2011-07-04 Thread Bert Freudenberg

On 04.07.2011, at 09:45, Stephen Woolerton wrote:

 Hi all,
 
 We wish to use Squeak/Smalltalk for a beginner programming course and require 
 the simplest way to get keyboard input.
 
 First of all:-
 - is there a way in Squeak to get console input (analogous to system.in, in 
 Java)? Line input would be ideal, rather than character by character.

There is a way, but it is complicated, platform-dependent, and very rarely 
used. Squeak provides its own user interface, the command line interface is 
only used for e.g. server apps.

 - how would one display a text label and a text field and obtain input from 
 the text field (am thinking of Morphic)

name := UIManager default request: 'Enter your name'.
Transcript show: name; cr.

However, IMHO this is *not* the best way to introduce Squeak programming to 
beginners. It mimics procedural programming in a console.

Instead, just open a Workspace and begin evaluating expressions. There doesn't 
have to be a program. In fact, there is no main. Just send messages to 
objects. 

3 + 4
1234 / 56
100 factorial
'foo bar' asUppercase 

Then, make a Morph and send it messages. Evaluate each line individually to see 
its effect.

joe := Morph new.
joe openInWorld.
joe position: 100@100.
joe color: Color red.

From there I'd continue with inspectors and explorers. Squeak by Example is an 
excellent source for further exploration:

http://squeakbyexample.org/

- Bert -


___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] selectors for an array of classes

2011-07-03 Thread Bert Freudenberg
On 03.07.2011, at 18:35, Jonathan Wright wrote:

 
 Hello,
 
 I am trying to read the methods of several classes.  I am getting a
 messagenotunderstood for the following code:
 
 TempObject := #(OrderedCollection Integer).
   TempObject do: [ :iClass |
   iClass selectorsDo: [ :item |
   item.]].
 
 I can run a iClass name successfully.

Try iClass class, that should be enlightening ;)

  But it doesn't seem to recognize iClass selectors.

The name message works on any (see Objectname). iClass is not actually a 
class in your example.

Hint 1: #() creates a literal array.

Hint 2: Classes are not literals.

Hint 3: {} creates a non-literal array.

Nitpick: temps should have lowercase-names.

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] How do I install squeak in a iPad?

2011-07-01 Thread Bert Freudenberg
Am 01.07.2011 um 05:21 schrieb Lester Zimmer lvzim...@gmail.com:

 Hi!
 
 How do I install squeak in a iPad?
 
 Lester

Since you are asking this on the newbies list I guess you want the easiest way?

Simplest is to become a Squeak/Etoys beta tester:

http://etoys.squeak.org/experimental/ipad/

This does not require jailbreaking. 

- Bert -

___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


  1   2   3   4   5   6   >