Douglas Naka | 1 Jul 2010 07:13
Picon
Favicon

Problems during the installation of Magma (squeak 4.1)

Hi everybody,

I'm new to squeak and smalltalk. I was trying to install Magma DB through Monticello, but I got some problems. I tryied two different ways to do it.

First way: I ran the script Intalation code from this tutorial: http://wiki.squeak.org/squeak/2657.
This way I got Magma installed, but when I run the tests almost all get error.

Second way: I access the Magma repository (http://www.squeaksource.com/Magma) from monticello browser and installed MagmaTesterLoader. and when I run the tests almost all get error.

I use:
-squeak 4.1 (exactly the original image from squeak.org)
-windows xp.

Does anyone can help me, please?
Thanks!

   

 
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
C. David Shaffer | 1 Jul 2010 18:30
Picon
Favicon

[ANN] WorkspaceAsMethod package

My last post about this went "thud" :-)  That's OK, I decided I'd just
try it for a while.  After two days I have to say that the idea of
saving workspace contents to class-side methods is working pretty well
so I published WorkspaceAsMethod to squeaksource.

In Squeak 4.1 install with:

Installer ss
    project: 'WorkspaceAsMethod';
    install: 'WorkspaceAsMethod'

>From the Workspaces class documentation:

This class simplifies storing Workspace contents in class-side methods. 
Right now there is no UI support so you have to do things manually. 
Begin by creating a class to house your workspaces.  Make it a subclass
of me.  In this example I'll call it TmpWorkspaces:

Workspaces subclass: #TmpWorkspaces
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'WorkspacesDemo'

Now create a new workspace by evaluating:

TmpWorkspaces openNewWorkspaceSelector: #firstWorkspace label: 'First
Workspace'.

If you browse the TmpWorkspaces class you'll see a class-side method
called firstWorkspace.  This is where your workspace contents will be
saved.  Modify the workspace and 'accept' your changes.  The class-side
method will be updated accordingly.  You can close the Workspace without
fear of losing anything.  To re-open it just:

TmpWorkspaces firstWorkspace

or

TmpWorkspaces open: #firstWorkspace

To open all workspaces just:

TmpWorkspaces openAll.

The #openAll method assumes that your workspaces are all in the method
category 'workspaces' so if you move them they won't be opened by this
selector.

David
kirand | 4 Jul 2010 17:36
Favicon

Translation from old basic program

Hi!

Is anybody remember basic?

I am a beginner and cant understand how to make this program in Smalltalk. I 
found it in old magazine from 80-th years :)
So, this is the program. It makes interest graphics.

10 INPUT "Enter a number"; N
20 DIM X(N), Y(N)
30 R = 120
40 DT = 2 * 3,1416 /N
50 T = 0
60 FOR I = 1 TO N
70 T = T + DT
80 X(I) = 160 + R*COS (T): Y(I) = 125 - R*SIN (T)
90 NEXT I
95 CLSZ
100 FOR I = 1 TO N-1
110 FOR J= I+1 TO N
120 PLOT X(I), Y(I), 3
130 LINE X(J), Y(J)
140 NEXT J
150 NEXT I
160 STOP

Some remarks can help. PLOT+LINE is BitBlt>>drawFrom:to:. DIM X(N), Y(N) is 
PointArray instance.

If anobody make it pls give me a code to see how. 
nicolas cellier | 4 Jul 2010 19:40
Picon
Gravatar

Re: Translation from old basic program

kirand <kirandev <at> ukr.net> writes:

> 
> Hi!
> 
> Is anybody remember basic?
> 
> I am a beginner and cant understand how to make this program in Smalltalk. I 
> found it in old magazine from 80-th years :)
> So, this is the program. It makes interest graphics.
> 
> 10 INPUT "Enter a number"; N
> 20 DIM X(N), Y(N)
> 30 R = 120
> 40 DT = 2 * 3,1416 /N
> 50 T = 0
> 60 FOR I = 1 TO N
> 70 T = T + DT
> 80 X(I) = 160 + R*COS (T): Y(I) = 125 - R*SIN (T)
> 90 NEXT I
> 95 CLSZ
> 100 FOR I = 1 TO N-1
> 110 FOR J= I+1 TO N
> 120 PLOT X(I), Y(I), 3
> 130 LINE X(J), Y(J)
> 140 NEXT J
> 150 NEXT I
> 160 STOP
> 
> Some remarks can help. PLOT+LINE is BitBlt>>drawFrom:to:. DIM X(N), Y(N) is 
> PointArray instance.
> 
> If anobody make it pls give me a code to see how. 
> 

First attempt: draw directly on Display

| n xy r dt brush |
n := FillInTheBlank request: 'Enter a number' initialAnswer: ''.
n := Number readFrom: n.  "Transform the String into a Number" 
xy := Array new: n.
dt := Float twoPi / n.
r := 120.
1 to: n do: [:i | 
    "Mind the order or operations here, Smalltalk interprets left to right"
    xy at: i put: ((i*dt) cos * r +160)  <at>  ((i*dt) sin negated * r + 125)].
brush := Form extent: 3  <at>  3.
brush fillBlack.
1 to: n-1 do: [:i | 
i+1 to: n do: [:j | 
	Display
		drawLine: brush
		from: (xy at: i)
		to: (xy at: j)
		clippingBox: Display boundingBox
		rule: Form paint
		fillColor: nil]].

Second attempt: draw on a Form, copy the Form on Display,
restore the Display after 10 seconds.

| n xy r dt form brush |
n := (FillInTheBlank request: 'Enter a number' initialAnswer: '') asNumber.
dt := Float twoPi / n.
r := 120.
xy := (1 to: n) collect: [:i | 
	((i*dt) cos * r +160)  <at>  ((i*dt) sin negated * r + 125)].
form := Form extent: 300 <at> 300.
brush := Form extent: 1  <at>  1.
brush fillBlack.
1 to: n-1 do: [:i | 
i+1 to: n do: [:j | 
	form
		drawLine: brush
		from: (xy at: i)
		to: (xy at: j)
		clippingBox: form boundingBox
		rule: Form paint
		fillColor: nil]].
form displayOn: Display.
[(Delay forSeconds: 10) wait. Display restore] fork

Nicolas
Jerome Peace | 5 Jul 2010 02:02
Picon
Favicon

Re: Re: Translation from old basic program



--- On Sun, 7/4/10, nicolas cellier <nicolas.cellier.aka.nice <at> gmail.com> wrote:

From: nicolas cellier <nicolas.cellier.aka.nice <at> gmail.com>
Subject: [Newbies] Re: Translation from old basic program
To: beginners <at> lists.squeakfoundation.org
Date: Sunday, July 4, 2010, 1:40 PM

kirand <kirandev <at> ukr.net> writes:

>
> Hi!
>
> Is anybody remember basic?
>
> I am a beginner and cant understand how to make this program in Smalltalk. I
> found it in old magazine from 80-th years :)
> So, this is the program. It makes interest graphics.
>
> 10 INPUT "Enter a number"; N
> 20 DIM X(N), Y(N)
> 30 R = 120
> 40 DT = 2 * 3,1416 /N
> 50 T = 0
> 60 FOR I = 1 TO N
> 70 T = T + DT
> 80 X(I) = 160 + R*COS (T): Y(I) = 125 - R*SIN (T)
> 90 NEXT I
> 95 CLSZ
> 100 FOR I = 1 TO N-1
> 110 FOR J= I+1 TO N
> 120 PLOT X(I), Y(I), 3
> 130 LINE X(J), Y(J)
> 140 NEXT J
> 150 NEXT I
> 160 STOP
>
> Some remarks can help. PLOT+LINE is BitBlt>>drawFrom:to:. DIM X(N), Y(N) is
> PointArray instance.
>
> If anobody make it pls give me a code to see how.
>

First attempt: draw directly on Display

| n xy r dt brush |
n := FillInTheBlank request: 'Enter a number' initialAnswer: ''.
n := Number readFrom: n.  "Transform the String into a Number"
xy := Array new: n.
dt := Float twoPi / n.
r := 120.
1 to: n do: [:i |
    "Mind the order or operations here, Smalltalk interprets left to right"
    xy at: i put: ((i*dt) cos * r +160) <at> ((i*dt) sin negated * r + 125)].
brush := Form extent: 3 <at> 3.
brush fillBlack.
1 to: n-1 do: [:i |
i+1 to: n do: [:j |
    Display
        drawLine: brush
        from: (xy at: i)
        to: (xy at: j)
        clippingBox: Display boundingBox
        rule: Form paint
        fillColor: nil]].

Second attempt: draw on a Form, copy the Form on Display,
restore the Display after 10 seconds.

| n xy r dt form brush |
n := (FillInTheBlank request: 'Enter a number' initialAnswer: '') asNumber.
dt := Float twoPi / n.
r := 120.
xy := (1 to: n) collect: [:i |
    ((i*dt) cos * r +160) <at> ((i*dt) sin negated * r + 125)].
form := Form extent: 300 <at> 300.
brush := Form extent: 1 <at> 1.
brush fillBlack.
1 to: n-1 do: [:i |
i+1 to: n do: [:j |
    form
        drawLine: brush
        from: (xy at: i)
        to: (xy at: j)
        clippingBox: form boundingBox
        rule: Form paint
        fillColor: nil]].
form displayOn: Display.
[(Delay forSeconds: 10) wait. Display restore] fork

Nicolas

Hi kirand, Hi Nicolas

Thought I'd give it a quick try. Here we just make a polygon and allow it to open. Heavily used the underlying goal of the problem to guide what is being done. I had fun seeing how easily I could do this in squeak. I have no idea if it meets the original purpose of the request.

If I really was feeling lazy I would have invented a Number fromUser method to simplify the input. I half expected someone to already have done so.

Lazy mans method:

n := (FillInTheBlank request: 'Enter a number' initialAnswer: '') asNumber.
(plottingPoints :=
(0 to: 360 by:  360 /n) collect: [ :each | (Point r: 120 degrees: each) + (160 <at> 125)  ] ) .

(LineMorph initializedInstance setVertices: plottingPoints )
openInWorld .


Yours in curiosity and service, --Jerome Peace


_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Bert Freudenberg | 5 Jul 2010 14:34
Picon
Gravatar

Re: Translation from old basic program

On 04.07.2010, at 11:36, kirand wrote:

> Hi!
> 
> Is anybody remember basic?
> 
> I am a beginner and cant understand how to make this program in Smalltalk. I found it in old magazine from
80-th years :)
> So, this is the program. It makes interest graphics.
> 
> 10 INPUT "Enter a number"; N
> 20 DIM X(N), Y(N)
> 30 R = 120
> 40 DT = 2 * 3,1416 /N
> 50 T = 0
> 60 FOR I = 1 TO N
> 70 T = T + DT
> 80 X(I) = 160 + R*COS (T): Y(I) = 125 - R*SIN (T)
> 90 NEXT I
> 95 CLSZ
> 100 FOR I = 1 TO N-1
> 110 FOR J= I+1 TO N
> 120 PLOT X(I), Y(I), 3
> 130 LINE X(J), Y(J)
> 140 NEXT J
> 150 NEXT I
> 160 STOP
> 
> Some remarks can help. PLOT+LINE is BitBlt>>drawFrom:to:. DIM X(N), Y(N) is PointArray instance.
> 
> If anobody make it pls give me a code to see how. 

Display restoreAfter: [Pen new mandala: (FillInTheBlank request: 'Enter a Number') asInteger]

- Bert -
@@@ | 5 Jul 2010 19:11
Favicon

Re: Translation from old basic program


"nicolas cellier" <nicolas.cellier.aka.nice <at> gmail.com> сообщил/сообщила в 
новостях следующее: news:loom.20100704T192902-992 <at> post.gmane.org...

> First attempt: draw directly on Display

Maybe I choose wrong method (drawFrom:to:) or there is a mistake in a BASIC 
program, but a picture looks different. See here:

http://s1.bild.me/bilder/210510/4182103pattern.JPG 
nicolas cellier | 5 Jul 2010 21:09
Picon
Gravatar

Re: Translation from old basic program

kirand <kirandev <at> ukr.net> writes:

> 
> 
> "nicolas cellier" <nicolas.cellier.aka.nice <at> gmail.com> сообщил/сообщила в 
> новостях следующее: news:loom.20100704T192902-992 <at> post.gmane.org...
> 
> > First attempt: draw directly on Display
> 
> Maybe I choose wrong method (drawFrom:to:) or there is a mistake in a BASIC 
> program, but a picture looks different. See here:
> 
> http://s1.bild.me/bilder/210510/4182103pattern.JPG 
> 

Oh, then I would say try to draw from: (xy at: i) to: (xy at: i) + (xy at: j).

Nicolas
Markus Schlager | 12 Jul 2010 18:12
Picon
Picon

Connectors and Squeak 4

Are Ned Konz's Connectors still available with Squeak 4?

Markus
David T. Lewis | 14 Jul 2010 01:07
Picon
Favicon

Re: Connectors and Squeak 4

On Mon, Jul 12, 2010 at 06:12:59PM +0200, Markus Schlager wrote:
> Are Ned Konz's Connectors still available with Squeak 4?

As far as I know, Connectors should still work with Squeak 4 (but
I have not checked). Did you try loading Connectors, or are you asking
about how to do this?

If there are any problems, I am sure that they will be addressed soon
because Connectors is a part of the EToys images and there is work
under way to move the latest EToys onto the Squeak 4 images.

Dave

Gmane