Re: [Newbies] CSV file help

2016-06-17 Thread Chris Cunningham
Hi Joseph,
these methods are now in the package located at:

MCHttpRepository
location: 'http://www.squeaksource.com/CSVData'
user: ''
password: ''

(follow Ron's excellent advice on how to use this).


That said, I would no longer use this package to parse CSV - I've
recently switched over to Avi's parser as well.

(My package still has some interesting uses for the data once you pull
it in.  Of course, it isn't documented.)


I should clean up the page that you found - I had forgotten that it
even existed!


On Fri, Jun 17, 2016 at 1:42 PM, Joseph Alotta 
wrote:

> Greetings,
>
> I am needing conceptual help with parsing these troublesome CSV files.  I
> was breaking the lines using String >> findToken:
> but I found lines where extra deliminators were added.  Notice the three
> following lines, the first and third line have extra commas from Oak Brook,
> IL and the second line does not have the comma.
>
>
> 02/04/2016  Thu,,"COSTCO WHSE #0388 0990388 - OAK BROOK,
> IL",37.00
> 02/05/2016  Fri,,"ELECTRONIC PAYMENT RECEIVED-THANK",-443.52
> 02/06/2016  Sat,,"COSTCO WHSE #1088 0991088 - BOLINGBROOK,
> IL",50.86
>
> I think I need to parse with the double quotes in mind, but I don’t know
> where to break it.
>
> Also, I was reading in the squeak pages that someone had already written
> code for this, but I couldn’t find anything.
>
> http://wiki.squeak.org/squeak/3260 has two methods, CSVSubstrings and
> SequenceableCollection-asCSVLine.st
>
> Does anyone know where these are now?
>
> Sincerely,
>
> Joe.
>
>
>
> ___
> 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: new and initialize

2016-05-11 Thread Chris Cunningham
Hi.

On Tue, May 10, 2016 at 12:37 PM, Joseph Alotta 
wrote:


> More questions:  why isn’t there a command key for debug it?
>

I just learned this today - we do have a command key (well, command key
sequence) for debug it:

Shift+Cmd+D to "Debug it"

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


Re: [Newbies] Re: go to the end of a loop

2016-04-25 Thread Chris Cunningham
Yes, except #whileFalse: only works against blocks. So:
 [f atEnd] whileFalse: [

On Mon, Apr 25, 2016 at 9:59 AM, Joseph Alotta 
wrote:

> Hi Louis,
>
> This is not a school project.  I was looking for a local tutor but could
> find none.  So this is me doing this instead of working crossword puzzles
> or sudukos.
>
> So your advice would be:
>
> (f atEnd) whileFalse: [
> line := f nextLine
>
> (line size < 2) ifFalse:  [ “process line”].
>
> ].
>
>
> Sincerely,
>
> Joe.
>
>
>
>
>
> > On Apr 25, 2016, at 10:06 AM, Louis LaBrunda [via Smalltalk] <[hidden
> email] > wrote:
> >
> > Hi Joe,
> >
> > Better than checking for #nextLine answering nil, I think you can send
> the file stream #atEnd
> > to see if there is any more data.  You would then use a #whileFalse: and
> move the #nextLine
> > call into the second block of the whileFalse:.  Then test for empty
> lines with something like:
> > (line size < 2) ifFalse: [...putting all the code that does the work on
> a line with data in
> > here...].
> >
> > Lou
> >
> > PS.   If this is not a school project, we can be of more help, we just
> don't like doing
> > students projects for them as they learn more with just a few hints and
> not real code.
> >
> > On Mon, 25 Apr 2016 10:16:33 -0500, Joseph Alotta <[hidden email]>
> wrote:
> >
> > >Greetings,
> > >
> > >I have this code:
> > >
> > >**
> > >
> > >read
> > > "read the category file into the dictionary
> > > the first item is the category, the rest of the line are payees
> > >
> > > office expense|home depot|staples|costco
> > > groceries|natures best|jewel|trader joes|fresh thyme
> > > "
> > >
> > >| f line |
> > >f := FileStream oldFileNamed: myfile.
> > >
> > >[(line := f nextLine) notNil] whileTrue: [| array cat payees |
> > >
> > >  array := line  findTokens: $| escapedBy:  Character
> tab .
> > >
> > > cat := array first.
> > > payees := array reject: [ :i | i = cat ].   "rest of the line"
> > >
> > > payees do:  [ :p |   mydict at: (p withBlanksCondensed) put: (cat
> withBlanksCondensed)].
> > >  ].
> > >
> > >
> > >f close.
> > >
> > >*
> > >
> > >I am getting some blank lines in the data file.  Lines with just a
> Character cr.  I was wondering how to handle that.  In other languages,
> there is a break for the loop, to go to the end.  I can do:
> > >
> > >(line size < 2) ifTrue: [ f nextLine.].
> > >
> > >But that would interfere with the notNil idiom at the end of the file.
> So where do I put this.  Is there a common way to jump to the end?
> > >
> > >
> > >Sincerely,
> > >
> > >
> > >Joe.
> > --
> > Louis LaBrunda
> > Keystone Software Corp.
> > SkypeMe callto://PhotonDemon
> >
> > ___
> > 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/go-to-the-end-of-a-loop-tp4891930p4891939.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: go to the end of a loop
> 
> 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-20 Thread Chris Cunningham
On Wed, Apr 20, 2016 at 2:25 PM, Joseph Alotta 
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.
[image: Inline image 1]

>
>
>
>
> > 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
> 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] Help! can't see inside a Bag

2016-04-20 Thread Chris Cunningham
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 
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
> 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] How do I print?

2015-08-23 Thread Chris Cunningham
On Sun, Aug 23, 2015 at 4:43 PM, Kirk Fraser 
wrote:

> Several different things are polymorphically called print.  How do I send
> text to a peripheral printer?  I found the menu item "Send contents to
> printer" and it produced walkback which says
> "MessageNotUnderstood: SmalltalkEditor>sendContentsToPrinter".  Printer
> setup similarly failed yet after the OS supplied the customary sound that
> the printer was hooked up.
>
> This occurred in Squeak 4.5 under Windows 7.  What would solve the problem
> best?  Upgrading Squeak?  Getting a different printer? Going back to
> Digitalk Smalltalk/V and a dot matrix ribbon printer where it did work
> years ago?
>
> Kirk
>

Hi Kirk,
You can fix this by copying the following into the SmalltalkEditor class.

sendContentsToPrinter
| textToPrint printer parentWindow |
textToPrint := paragraph text.
textToPrint size = 0 ifTrue: [^self inform: 'nothing to print.'].
printer := TextPrinter defaultTextPrinter.
parentWindow := self model dependents
detect: [:dep | dep isSystemWindow]
ifNone: [nil].
parentWindow isNil
ifTrue: [printer documentTitle: 'Untitled']
ifFalse: [printer documentTitle: parentWindow label].
printer printText: textToPrint

this will send the contents of an editor pane to the connected (default)
printer.  If you need to change the printer, you can go to the outside top
left icon (mouse), choose VM Preferences->System Preferences->Printer
Configuration.

The above message also shows how to programmatically interface with the
printer.

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


Re: [Newbies] Re: How to round a float?

2015-02-23 Thread Chris Cunningham
On Fri, Feb 13, 2015 at 4:56 PM, nicolas cellier <
nicolas.cellier.aka.n...@gmail.com> wrote:

> ...
>
> If it's for monetary things like computing interests, then the advice is to
> not use Float but ScaledDecimal.
>
> 100 * (1.05s2 raisedTo: 10) roundTo: 0.01s2
> -> 162.89s2
>
> Nicolas
>
> So, for money, I would suggest not using ScaledDecimal, but rather
FixedDecimal.

ScaledDecimal can do funny things that you would not expect in real money
land:

m := 1/3 asScaledDecimal: 2.
m  "==> 0.33s2"
m + m + m "==> 1.00s2"

You shouldn't be allowed to add 33 cents together and get a whole dollar
(usd, at least)!

FixedDecimal actually rounds to the specified length (ScaledDecimal keeps
the entire precision 'behind the curtains').

m := 1/3 asFixedDecimal: 2.
m  "==> 0.33"
m + m + m "==>  0.99"

http://www.squeaksource.com/FixedDecimal.html

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


Re: [Newbies] How to doubble sort a collection

2015-02-04 Thread Chris Cunningham
You have a logic issue with the first one:
sortedNotes
^notes sort:[:a :b | (a date = b date) and:[a temps > b temps]] .
This is saying that the the two dates are different, then false.  For this
you probably want to be something like:
sortedNotes
^notes sort:[:a :b | a date > b date or: [(a date = b date) and:[a temps >
b temps]]] .

-cbc

On Wed, Feb 4, 2015 at 10:22 AM, Raymond Asselin  wrote:

> For now I implemented:
>
> sortedNotes
> ^notes sort:[:a :b | (a date = b date) and:[a temps > b temps]] .
>
> AND
>
> notesSorted
> ^notes sort:[:a :b | a date = b date
> ifTrue:[a temps > b temps]
> ifFalse:[a date > b date]] .
>
> does exactly the same result.
>
> But there is still notes in a same date that do not sort correctly, the
> begining is good and after 5 or so objects
> I get some witch do not seem to be sorted.
>
> BTW don't know the difference between sort:  and sorted:
> it seems as if the last one produce a new collection and the first one
> produce same collection but sorted.
>
> Note: I use 24 hours instead of a.m. / p.m. is this may cause problems?
>
> > Le 2015-02-04 à 12:00, Paul DeBruicker  a écrit :
> >
> > a date = b date
> >   ifTrue:[a temps > b temps]
> >   ifFalse:[a date > b date]
>
> ___
> 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: How to doubble sort a collection

2015-02-04 Thread Chris Cunningham
| and & make sure that each expression between them is executed - so it
will do each of:
   a date  > b date
and
   a date = b date
and
   a date > temps > b date temps

This matters if one of these is significantly slower than the others - it
will run it even it it doesn't need too.  Also if any side-effects are in
one of these expressions, this will make that side effect happen (there
aren't any in these, though).

and: and or: stop executing as soon as one of them is satisfied
sufficiently - so if a date > b date then it will immediately return true
without bothering with the rest of the expressions.
ifTrue:ifFalse: is similar - except you will evaluate the condition
expression AND one of the following expressions.

Often this doesn't matter one way or another - but when it does, it matters
a lot.

-cbc

On Wed, Feb 4, 2015 at 9:00 AM, Paul DeBruicker  wrote:

> Does using the | or & notation have any advantages over and: or or:  or
> ifTrue:ifFalse ?
>
>
> I always write expressions like the one you've written like:
>
> a date = b date
>ifTrue:[a temps > b temps]
>ifFalse:[a date > b date]
>
>
>
>
>
>
>
> Louis LaBrunda wrote
> > Hi Raymond,
> >
> > Try:
> >
> > ^notes sorted:[:a :b | (a date  > b date) | ((a date = b date) & (a date
> > temps > b date temps))].
> >
> > Lou
> >
> > On Wed, 04 Feb 2015 10:34:48 -0500, Raymond Asselin <
>
> > jgr.asselin@
>
> > >
> > wrote:
> >
> >>I have this kind of sorting on anOrderedCollection
> >>
> >>BlocNotes >>sortedNotes
> >>  ^notes sorted:[:a :b | a date  > b date]
> >>
> >>This sort my notes on date but I want them sort by date AND inside a date
> by hours and I don't khow how to do this.
> >>
> >>Some insights?
> >>
> >>aNote = 'med com date temps' instancesVariables what I call hours = temps
> witch is a number like 2123 for 21h23
> >>
> >>Some insights?
> > ---
> > Louis LaBrunda
> > Keystone Software Corp.
> > SkypeMe callto://PhotonDemon
> > mailto:
>
> > Lou@
>
> >  http://www.Keystone-Software.com
> >
> > ___
> > Beginners mailing list
>
> > Beginners@.squeakfoundation
>
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/How-to-doubble-sort-a-collection-tp4803657p4803671.html
> 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] Simple semaphore to synchronize instances of different classes

2012-08-15 Thread Chris Cunningham
On Wed, Aug 15, 2012 at 1:11 PM, Chris Cunnington
 wrote:
> On 12-08-15 3:12 PM, patrick dudjalija wrote:
>>
>> |ts sem|
>>
>> sem:=Semaphore new.
>>
>> [ts:= TestSynchro new.
>> ts semaphore:sem.
>> ts openInWorld.
>> ts start.] fork.
>>
>> sem wait.
>> Transcript cr; show:'Hello world !';cr.
>
> Well, I can observer a few things. The first is that running this code in a
> Workspace the tem vars are unnecessary. (ie. |ts sem|). The second thing is
> that if I execute the code down to "fork" it runs fine. A blue square
> appears in the corner and it counts steps one to nine in the Transcript.
> It's only when you add "sem wait" that it freezes. I had to use Command+. on
> my Mac to unfreeze it. And I'm not convinced this is a bug. Remember, I
> don't think there is a Morph anywhere that uses Semaphore in #step. I have a
> feeling this is not a bug and that it's doing exactly what it's supposed to.
> You have created a Morph and now you've stopped it with #wait. I bet that's
> locking up the entire World, so it appears to freeze. That's my guess.
>
> HTH,
> Chris

So, if you'd still like to do it this way, if you place your entire
script from the workspace into a [] fork, it should then work (since
it will no longer block the UI process).
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] blender 3D

2011-12-14 Thread Chris Cunningham
On Tue, Dec 13, 2011 at 7:00 AM,   wrote:
> Hi great squeakers, is it possible to create in squeak an app like Blender
> 3d or is it better to stay with blenders system. I would like to organize a
> school in Brazil where we will be teaching programing. I want to teach
> around creation of a software app on a large scale that is why I like
> blender 3D. Let me know all your thoughts.
>
> Chuck Smith

Depending where you want to go with this, you can also dig deeper into
the underpinnings.  There is previous work on doing raytracing
directly in smalltalk:
Squeak Port: http://map.squeak.org/package/3993429e-7493-42a3-ab07-40b57d677117
Original VW announcement:
http://www.cincomsmalltalk.com/userblogs/buck/blogView?showComments=true&entry=3243310836

No idea what the license is, but it does show that you can do what you
want in Smalltalk/Squeak.  It just takes time and effort (a lot of it
to rival Blender3d).

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


Re: [Newbies] Database Support - ODBC

2009-09-20 Thread Chris Cunningham
Hi.

There is an ODBC package for Squeak that I have been using
successfully for years, although not in heavy production environments
(http://www.squeaksource.com/ODBC).  There is a new package,
SqueakDBX, that connects to many databases as well, including those
you listed, I believe.  It apparently works well on most platforms,
although I have not used it yet
(http://www.squeaksource.com/SqueakDBX).  In addition, there are
native drivers for Postgres (api v2 -
http://www.squeaksource.com/PostgresV2 with object to relational
mapping Glorp at http://www.squeaksource.com/Glorp), MySQL
(http://www.squeaksource.com/MySQL and various other packages on
Squeaksource).

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


Re: [Newbies] ScaledDecimal implementation (was: Number formatting printf/sprintf for Squeak?)

2009-02-18 Thread Chris Cunningham
On Wed, Feb 18, 2009 at 12:21 PM, Michael van der Gulik
wrote:

>
> Could you give me an example? It isn't immediately intuitive to me what
> incorrect results might occur. Rounding errors maybe?
>
Well, I had to go back and figure out what they were ( I don't have the
exact examples that caused this issue in the first place).  However, if you
have an intermediate calculation that results in a fraction more precise
than what you need, and you make a scaledDecimal out of it, you can get
weird results.  The example:

33.33 + 33.33 + 33.33 + 33.33 = 133.32 "in real math"

x := 33.333s2.   "This prints as 33.33s2, giving the illusion that you have
it exactly as this amount"
x + x + x + x = 133.33s2  "Not accurate, depending on exactly what you are
trying to measure"

y := 33.333 asFixedDecimal: 2.  "This prints as 33.33"
y + y + y + y = 133.32  "that is, the fixed decimal of scale 2 truely
truncated the value, and the result is correct, depending on what you are
measuring"

So, if you need to keep the original precision and you are just want to
present it at a lower precision, ScaledDecimal is exactly what you want.
If, on the other hand, you want the number to be at exactly the precision
that you tell it it should be, then FixedDecimal is what you want.

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


Re: [Newbies] Number formatting printf/sprintf for Squeak?

2009-02-18 Thread Chris Cunningham
I'd be leary of basing Currency off of ScaledDecimal, especially if there is
to be much manipulation of it (such as multiplication or division).  The
reason is that ScaledDecimal keeps the representation of their numbers as
fractions under the covers - which can results in some odd (and incorrect)
results.

There is another package (not part of standard Squeak) that could be more
suitable as a basis for Currency: FixedDecimal, located at
http://www.squeaksource.com/FixedDecimal .  The code isn't very pretty
(sorry about that), but it does work for currency.  That is the reason it
was originally written - when I started noticing the results of simple
mamipulation of my money amounts where wrong.

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


Re: [Newbies] squeak locks up on windows / help me debug it...

2009-01-10 Thread Chris Cunningham
It is worth noting that Pharo is currently under heavy development.  The
Pharo team is busy ripping out parts of Squeak they don't want in the base
image and adding other parts that they do want.  From all reports it is very
nice to work in, but it is not a stable release at this point.  If you want
to keep working with it, be prepared to submit bug reports to that list if
you encounter issue like this one.

Otherwise, pick up the squeak 3.10, 3.9, or 3.8 to try out the tutorials
until Pharo is more stable/released if you don't want to be that involved in
the development (or early beta/alpha? testing) of it.

On Fri, Jan 9, 2009 at 4:39 PM, Cameron Sanders <
csanders.perso...@functional-analyst.com> wrote:

>  I thought the Pharo base image (3.10 with a few fonts & Balloon3d added)
> running on Windows was looking pretty stable (compared to other images).
> But after an hour of editing code on a Vista machine --an hour since the
> last save—Squeak has abandoned me. It is unresponsive. Trying both control
> and alt in combination with '.', 'l' (lower case L), 'c', does nothing
> apparently useful.
>
>
>
> The process stack reported by Vista shows it to be incurring page-faults
> like mad. [OK, that has subsided while I typed this email.] My machine has 4
> GB of RAM, I am running two instances of internet-explorer, and I have
> turned off the Windows search-indexing service. I know Vista has a
> guess-the-next-program pre-loader that could be a little overzealous in
> displacing programs from RAM… but still… it seems like this 101MB program
> shouldn't generate any page faults when the other two leading memory pigs
> are using less than double that much virtual memory. Vista's Resource
> Monitor claims I am using only 43% of physical memory. The page-fault count
> for Squeak.exe doubled while I typed this message.
>
>
>
> When I click the Squeak icon on the window frame of the running copy (upper
> left on Windows), I do see the menu for VM Preferences. It shows me the menu
> and allows me to invoke actions. It will allow me to toggle the "Show output
> console" on and off. The output console shows me changes to memory (as I
> have that option checked). I can use my mouse wheel to scroll this console.
> Control-'.' and Control-c (and lower case L) in this console do not change
> anything.
>
>
>
> After mucking around in the console area, I am now getting "WARNING: event
> buffer overflow" just moving my mouse around in squeak. After turning the
> console off, the pointer is now invisible except when you click. It appears
> that the overall squeak window is repainting itself properly.
>
>
>
> -- Help me debug it
>
>
>
> I have an interest in building a commercial application in Squeak. The FAQs
> says squeak is stable. Given the active community of developers (including
> The Great Ones), I imagine that it is stable, and that I am just doing
> something dumb… repeatedly. However, for Squeak to be adopted more broadly,
> it can't go zombie on users, even when the user does something dumb. That's
> an absolute.
>
>
>
> What is the longest uptime a squeak image has ever endured (while doing
> something useful)? Which version was that and on what platform?
>
>
>
> So I am willing to work to help make squeak more robust, but as a complete
> newbie with it, I need much guidance. So right now, with this hung-up image,
> what should I do? Should I attach to it with gdb? And if so, then what? [If
> the internal process control is working, I won't be able to make heads or
> tales out of it from gdb, right?]  Or can I launch another squeak and send
> it a signal in some way [is it listening?]? What is most useful in this
> case?
>
>
>
> [Is there a way in Windows/Vista to signal an app so as to force a core
> dump?]
>
>
>
> Thanks in advance,
>
> Cam
>
> PS: I want to emphasize that I do not care about the code lost in this
> particular instance (it was tutorial code), instead I am looking for a
> stable free development environment… and I'm willing to help make one.
>
>
>
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 3755 (20090109) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.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] how do I get a change lost from all change sets back into a valid change set?

2008-11-20 Thread Chris Cunningham
On Thu, Nov 20, 2008 at 7:48 AM, Matthew Fulmer <[EMAIL PROTECTED]> wrote:

> Smalltalk condenseChanges
>
Note that this will get rid of ALL intermediate changes in the system,
including the original, including methods that you did not yourself change.
You will be left with just the current version of each method in the system.

On the positive side, it will make you .changes file much smaller.

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


Re: [Newbies] Mail server in Squeak

2008-05-28 Thread Chris Cunningham
On 5/28/08, Aditya Siram <[EMAIL PROTECTED]> wrote:
>
> Is there an SMTP server in Squeak?


Yes, at
http://www.squeaksource.com/smtpserver/

>From the description there:

"The goal behind this is to give Seaside applications the possibility to
accept emails as input. It only works in delivery mode, no relaying, no
gatewaying whatsoever. This means it only accepts mails, you can not use it
to send mails. So this is not a fully featured SMTP server that can replace
sendmail."
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Where are the dialog boxes for input/output?

2008-01-28 Thread Chris Cunningham
On 1/28/08, Herbert König <[EMAIL PROTECTED]> wrote:
>
> Hello LoneHunter01,




reply := FillInTheBlankMorph request: 'What is your real name' initialAnswer
> 'LoneHunter01'


And then responding can be as simple as:

self inform: ('Hello ', reply)
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] tutorial: "doesNotUnderstand" instance variable

2007-11-14 Thread Chris Cunningham
On 11/14/07, Andrew n marshall <[EMAIL PROTECTED]> wrote:
>
>
> Does a subclass have the same access privilege, or must I
> use accessors when reference superclass instance variables?


Subclasses can also directly reference instance variables defined in
superclasses as well.

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


Re: [Newbies] assorted beginner questions

2007-10-03 Thread Chris Cunningham
Hi.

On 10/2/07, Mark Smithfield <[EMAIL PROTECTED]> wrote:
>
> As I read code in Squeak, I discover method names that
> I do not
> know. How do you find these methods if you don't know
> the type of
> the receiver?


If you are asking how to find out what a method does from the code, the
easiest way is to place the cursor over the method (just a part of it) and
press alt+m (on windows, or maybe ctl+m, or on a Mac, cmd+m).  This should
bring up the implementors of the method, and you can browse through all of
the implementors and look at the code.  If that still doesn't make sense,
you can ask about the method here and others will nicely explain it to you
(like Ron did).

>> In the floor method from Number,
>>
>> truncation _ self truncated.
>>
>> What does the underscore mean?
>
>:=
>In some images it shows up as a left-pointing arrow.
>I'm not sure if that's coming back in later iterations or not.

The underscore is an assignment.  If you have picked the right font, you
won't see underscores in the code, but rather a left-pointing arrow.  I
believe these fonts are still in the current versions of Squeak - but they
just arent the default in some (most?) of the distributions.  So, if you
change the font (or modify the font yourself - I haven't done that, but it
is doable), then you can currently get back the left-pointing arrow.

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


Re: [Newbies] Chaining versus cascading

2007-09-20 Thread Chris Cunningham
On 9/20/07, Chris Cunnington <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a question about the difference between chaining and cascading.
> What
> would happen if you wrote this:
>
> Html table id: 'label' with: [foo foo foo]
>
> You see, I've left out the semicolon that the sushi store demo puts
> between
> 'label' and with. It usually looks like this:
>
> Html table id: 'label'; with: [foo foo foo]


Well, the first example is sending the method *#id:with:* to *Html table.  *The
second example is the equavalent of:
*Html table id: 'label'.*
*Html table with: [foo foo foo].*

The cascading operator (the semicolon ;) causes the next message (#with:) to
be sent to the previous messages (#id:) receiver (in this case, Html table).
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] printing graphics in squeak

2007-09-18 Thread Chris Cunningham
If you want to print directly out of Squeak, at least on Windows platforms,
I've found the class TextPrinter to be very useful.  It is obvoiusly
designed to print text reports, but all of the plumbing is there to print
out a page of whatever content you want too.  However, there will be digging
involved.

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


Re: [Newbies] Is it possible to manipulate excel spreadsheet by squeak

2007-09-07 Thread Chris Cunningham
Hi.

Here is a link for it (the home page, really):

http://wiki.squeak.org/squeak/3624

It looks like the importer is mainly for documents - word related stuff.
Although it is probably worth trying the calc import (OpenOffice.org's
version of Excel).  And if it doesn't support that, it might be relatively
easy to add support for it (at least the enough for what you need).

-Chris

On 9/6/07, Offray Vladimir Luna Cardenas <[EMAIL PROTECTED]>
wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi,
>
> Diego Gómez-Deck wrote a OpenOffice importer for Squeak some time ago (I
> don't have the link, but you can search about it). So a possible way
> could be OpenOffice importing of the excel files and then use the Diego
> code to open it in Squeak.
>
> Cheers,
>
> Offray
>
>
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Re: [Newbies] Scratch questions

2007-08-29 Thread Chris Cunningham
On 8/29/07, Benjamin Schroeder <[EMAIL PROTECTED]> wrote:
>
> My experience on Windows is that if you launch Squeak.exe by double-
> clicking, it can take a while to bring up the dialog where you can
> choose an image. However, if you drag an image file onto Squeak.exe,
> or use a batch file to pass it as a parameter, the image starts up
> much faster.
>

I believe that if you search for and use the latest windows executable (
3.9.2 is the version I'm using, although there appear to be 3.10.x versions
for windows available as well), then it will start very quickly by just
double clicking squeak.exe, and that the reason is very similar to what you
have written.  It was just fixed in either 3.9.1 or 3.9.2 (after being
'broken' for a very long time).

These are available at: http://www.squeakvm.org/win32/ .

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


Re: [Newbies] Loading package plus dependencies via monticello

2007-08-02 Thread Chris Cunningham
>
> Ok, nice tool. In principal exact what I was looking for.
> Unfortunately it doesn't support directory repositories
> and it that way.


Hi Norbert,

Attached is a simple change set that will allow it to mostly support
directories (I've been using it personally for a while now - there are
undoubtedly places where there are holes).  Basically, it removes the
protections that were put in to not use Directories.  If you think about it,
using directory repositories for configurations is a really bad idea - if
you share the config with someone else, they can't get to your
repositories.  Heck, if the directory is local on your machine and you
switch to another machine, they configuration isn't even useful for
yourself.

That said, this will allow you to do it if you still want too.

-Chris
'From Squeak3.8.1 of ''28 Aug 2006'' [latest update: #6747] on 2 August 2007 at 
2:43:24 pm'!

!MCConfigurationBrowser methodsFor: 'repositories' stamp: 'CBC 8/2/2007 14:42'!
addRepository
(self pickRepositorySatisfying: [:ea | (self repositories includes: ea) 
not])
ifNotNilDo: [:repo |
"   (repo isKindOf: MCHttpRepository)
ifFalse: [^self inform: 'Only HTTP repositories 
are supported']."
self repositories add: repo.
self changed: #repositoryList.
]! !

!MCConfigurationBrowser methodsFor: 'repositories' stamp: 'CBC 8/2/2007 14:42'!
checkRepositories
"   | bad |
bad := self repositories reject: [:repo | repo isKindOf: 
MCHttpRepository].
^bad isEmpty or: [
self selectRepository: bad first.
self inform: (String streamContents: [:strm |
strm nextPutAll: 'Please remove these repositories:'; 
cr.
bad do: [:r | strm nextPutAll: r description; cr].
strm nextPutAll: '(only HTTP repositories are 
supported)']).
false]."
^true! !


!MCDirectoryRepository methodsFor: 'as yet unclassified' stamp: 'CBC 8/2/2007 
14:43'!
asCreationTemplate
^'MCDirectory on: ', directory printString! !

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