Re: [Pharo-users] Modeling HABTM

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

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

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

--- End Message ---


[Pharo-users] Could not resolve ConfigurationOfJSON

2019-09-15 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Trying to check out Grafoscopio and I keep running into this error.

Tried with Pharo 5 and 7.

Any suggestions?

--- End Message ---


[Pharo-users] Glorp + P3 + SQLite

2019-10-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I loaded GLORP+P3 without issue.

Trying to load SQLite3 - it also wants to load GLORP which complains of 
conflict.

For P3 I used:

Metacello new
   baseline: 'P3';
   repository: 'github://svenvc/P3';
   load: 'glorp'.


For SQLite:

Metacello new 
repository: 'github://PierceNg/glorp-sqlite3:pharo7';
baseline: 'GlorpSQLite';
load.

but this fails with a conflict.  I suspect the conflict is it wants to load in 
glorp again.

I would also like to have mysql driver at some point.

Any tips for getting these to play nice together would be great.--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I should probably mention that I do not really have a great handle on how 
package configurations work these days.

Coming back to Smalltalk after a long time away.

Pointer to an explanation of how package configurations work would be great.




--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-22 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Nice!  Thanks.

So here is maybe a stupid question (and I'm gonna read the wiki stuff on 
packages next) but it seems to me that the package loader should notice that 
glorp is already loaded and not load it if glorp is specified as a prerequisite 
but instead it fails.

Is the package loader not smart enough to understand what is already loaded and 
skip load attempts?

Puzzling.

> On Oct 19, 2019, at 11:23 PM, Pierce Ng  wrote:
> 
> On Sat, Oct 19, 2019 at 01:26:10AM -0700, Todd Blanchard via Pharo-users 
> wrote:
>> I loaded GLORP+P3 without issue.
>> Trying to load SQLite3 - it also wants to load GLORP which complains of 
>> conflict.
> 
> Todd, to load SQLite3 only:
> 
>  Metacello new
>repository: 'github://astares/Pharo-UDBC/src';
>baseline: 'UDBC';
>load: 'SQLite'
> 
> Pierce


--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-11-21 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Hi Pavel,

I've just gotten around to figuring out BaslineOf and packages.  I see this 
work is in a branch on your own repository.

Do you plan to do a pull request back to the original repository?  I feel like 
we have database code all over the place and no clear "official" versions.

Stll trying to figure out what is current and what is obsolete (Garage?)

> On Oct 19, 2019, at 5:18 AM, Pavel Krivanek  wrote:
> 
> Btw. there exists an updated version of Glorp: 
> github://pavel-krivanek/glorp:8.3.1-23-baseline
> But the compatibility of it with SQLite was never tested
> 
> -- Pavel
> 
> so 19. 10. 2019 v 10:27 odesílatel Todd Blanchard via Pharo-users 
> mailto:pharo-users@lists.pharo.org>> napsal:
> I loaded GLORP+P3 without issue.
> 
> Trying to load SQLite3 - it also wants to load GLORP which complains of 
> conflict.
> 
> For P3 I used:
> 
> Metacello new
>baseline: 'P3';
>repository: 'github://svenvc/P3 <>';
>load: 'glorp'.
> 
> 
> For SQLite:
> 
> Metacello new 
>   repository: 'github://PierceNg/glorp-sqlite3:pharo7 <>';
>   baseline: 'GlorpSQLite';
>   load.
> 
> but this fails with a conflict.  I suspect the conflict is it wants to load 
> in glorp again.
> 
> I would also like to have mysql driver at some point.
> 
> Any tips for getting these to play nice together would be great.

--- End Message ---


Re: [Pharo-users] uFFI: Debugging "External module not found" Error

2019-12-03 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
This is the most annoying thing about UFFI - the library search seems to opaque 
and I don't understand how it works.

So far I am finding best practice is to find the library yourself and then 
provide the exact file path you want.  

That way, you can actually prompt the user to find it if you don't and they get 
a decent experience.

> On Dec 3, 2019, at 11:34 AM, Sean P. DeNigris  wrote:
> 
> Alistair Grant wrote
>> The same message is returned whether the module itself isn't found, or
>> if one of its dependencies can't be found.
> 
> Good to know. I wonder if we can't provide more detailed error messages
> here...
> 
> 
> Alistair Grant wrote
>> On linux you can check dependencies with `ldd file.so`, I don't know
>> what the Mac equivalent is.
> 
> Apparently, it's `otool -L whatever.dylib`, which returns:
>   @rpath/libvlc.dylib (compatibility version 12.0.0, current version 
> 12.0.0)
>   @rpath/libvlccore.dylib (compatibility version 10.0.0, current version
> 10.0.0)
>   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 1252.50.4)
>   /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version
> 7.0.0)
> 
> 
> Still investigating...
> 
> 
> 
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 


--- End Message ---


Re: [Pharo-users] some sort of mentor help ?

2019-12-03 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I looked at the site and I knocked out day 1.  These are little programming 
puzzles you can do in a playground.

Day 1's first puzzles is literally a 1 liner.

The story telling obfuscates the problem and can make the problem seem harder 
than it is.  You have to learn to cut through the noise and see the problem.

You are supposed to find the amount of fuel required to launch a given mass 
into space in a rocket.  This is the key paragraph.

"Fuel required to launch a given module is based on its mass. Specifically, to 
find the fuel required for a module, take its mass, divide by three, round 
down, and subtract 2."

The code for this is:

fuel := (mass / 3) floor - 2.

The floor function rounds downwards.  To round up you use ceiling.

You have a list of modules though.  If you click to get your module mass list, 
its a page with one number per line.  Getting this into a collection is really 
easy.

masses := #(  )

and execute that in your playground.  This is your input data.

To get the fuel for each mass, a collect: seems like a winner.

fuels := masses collect: [:mass | (mass / 3) floor - 2 ].

The final thing he wants is the total amount of fuel required.  You just add up 
the numbers.

total := fuels sum.

I leave the second puzzle of day 1 to you, it is almost the same except you 
have to iteratively calculate the fuel to lift the fuel you add.  
To do this you end up putting a loop into the collect; block and executing it 
over and over until the amount of additional fuel is <= zero.

I hope this gets you going.  You can email me directly at tblanch...@mac.com if 
you get stuck.  

> On Dec 3, 2019, at 2:54 PM, Roelof Wobben via Pharo-users 
>  wrote:
> 
> 
> From: Roelof Wobben 
> Subject: some sort of mentor help ?
> Date: December 3, 2019 at 2:54:19 PM PST
> To: pharo-users@lists.pharo.org
> 
> 
> Hello, 
> 
> do not know if this is the right channel but is there someone or some book 
> which can help me learn how to approach complex problems like the 
> AdventOfCode challenges , I try that but im stuck because most of the time I 
> have the feeling I choose a difficult solution where some easier one exist.
> or I have a very bad plan
> that is a wall I hit many times with my languages and I need a way to get out 
> of it and make a step further with Pharo
> 
> Regards, 
> 
> Roelof 
> 
> 
> 

--- End Message ---


Re: [Pharo-users] [Pharo-dev] [ANN] Grouper

2019-12-09 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
This is cool.  Rails has this kind of capability and I miss it elsewhere.

> On Dec 9, 2019, at 6:08 AM, Julien Delplanque  
> wrote:
> 
> Hello,
> 
> I made a small library that reify grouping (that one does via #groupBy: 
> usually): Grouper https://github.com/juliendelplanque/Grouper 
> 
> It is designed in the same spirit as SortFunction, but for grouping.
> 
> Quick example:
> 
> The following code snippet using Grouper:
> 
> (10 to: 50) groupUsing: [ :integer | integer asString first ].
> "an OrderedDictionary(
>   $1->#(10 11 12 13 14 15 16 17 18 19)
>   $2->#(20 21 22 23 24 25 26 27 28 29)
>   $3->#(30 31 32 33 34 35 36 37 38 39)
>   $4->#(40 41 42 43 44 45 46 47 48 49)
>   $5->#(50))"
> is equivalent to the following code snippet using built-in #groupedBy: method:
> 
> (10 to: 50) groupedBy: [ :integer | integer asString first ]
> "an OrderedDictionary(
>   $1->#(10 11 12 13 14 15 16 17 18 19)
>   $2->#(20 21 22 23 24 25 26 27 28 29)
>   $3->#(30 31 32 33 34 35 36 37 38 39)
>   $4->#(40 41 42 43 44 45 46 47 48 49)
>   $5->#(50))"
> The advantage of using it is that it allows one to compose grouper objects.
> 
> Thus, it is easy to describe grouping on 2 or 3 levels.
> 
> Fore example:
> 
> The power of Grouper is that group description are first-class objects. Thus, 
> it is possible to compose group descriptions in order to group a flat 
> collection on multiple levels.
> 
> For example:
> 
> groupComposition := [ :integer | integer asString first ] grouper , [ 
> :integer | integer asString second ].
> (10 to: 50) groupUsing: groupComposition.
> "an OrderedDictionary(
>   $1->an OrderedDictionary(
> $0->#(10) $1->#(11) $2->#(12) $3->#(13) $4->#(14) $5->#(15) $6->#(16) 
> $7->#(17) $8->#(18) $9->#(19))
>   $2->an OrderedDictionary(
> $0->#(20) $1->#(21) $2->#(22) $3->#(23) $4->#(24) $5->#(25) $6->#(26) 
> $7->#(27) $8->#(28) $9->#(29))
>   $3->an OrderedDictionary(
> $0->#(30) $1->#(31) $2->#(32) $3->#(33) $4->#(34) $5->#(35) $6->#(36) 
> $7->#(37) $8->#(38) $9->#(39))
>   $4->an OrderedDictionary(
> $0->#(40) $1->#(41) $2->#(42) $3->#(43) $4->#(44) $5->#(45) $6->#(46) 
> $7->#(47) $8->#(48) $9->#(49))
>   $5->an OrderedDictionary($0->#(50)))"
> On the github, there are more example showing how to build trees with custom 
> objects.
> 
> Any feedback for this library is welcome.
> 
> I would like to propose it to Pharo in the near future because it would 
> simplify a lot of code in DrTests (related to result tree views, the tree on 
> the right of the UI).
> 
> I don't know if it will be possible before next release as we are in feature 
> freeze.
> 
> Cheers,
> 
> Julien
> 

--- End Message ---


Re: [Pharo-users] how can I this refractor this so its more smalltalk

2019-12-17 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Well my main run method looks like this:
run
| op | 
ram := self input.
in := ReadStream on: ram.
[ (op := in next) = 99 ] whileFalse: [ self processOpcode: op ].
^self at: 0.

ram is the array of integers.
in is a ReadStream on them which lets me process them in order.
They are both instance variables.

self input provides a clean copy of the program memory (the integer array).  I 
just used an array literal.  No file IO.

The main dispatch method is

processOpcode: op 

op = 1 ifTrue: [ ^self processAdd ].
op = 2 ifTrue: [ ^self processMultiply ].

and for illustration 

processAdd
| a b c |
a := self at: in next.
b := self at: in next.
self at: in next put: a+b

There are custom versions of at: and at:put: that compensate for zero based vs 
one based array indexing.

at: idx
^ram at: idx + 1

I hope this helps you out.

> On Dec 17, 2019, at 6:59 AM, Roelof Wobben via Pharo-users 
>  wrote:
> 
> 
> From: Roelof Wobben 
> Subject: how can I this refractor this so its more smalltalk
> Date: December 17, 2019 at 6:59:28 AM PST
> To: Any question about pharo is welcome 
> 
> 
> Hello,
> 
> My solution to day2 part1 is right this :
> 
> processData: instructions
> | opcode index firstNumber secondNumber placeToPut firstNumberIndex 
> secondNumberIndex |
> index := 1.
> opcode := instructions at: index.
> [ opcode ~= 99 ]
> whileTrue: [ firstNumberIndex := instructions at: index + 1.
> secondNumberIndex := instructions at: index + 2.
> firstNumber := instructions at: firstNumberIndex + 1.
> secondNumber := instructions at: secondNumberIndex + 1.
> placeToPut := (instructions at: index + 3) + 1.
> opcode == 1
> ifTrue: [ instructions at: placeToPut put: firstNumber + 
> secondNumber ].
> opcode == 2
> ifTrue: [ instructions at: placeToPut put: firstNumber * 
> secondNumber ].
> index := index + 4.
> opcode := instructions at: index ].
> ^ instructions at: 1
> 
> so its ugly code
> 
> is there a way  I can this more the smalltalk way by using streams or 
> something else.
> if so, is there someone who can tell me or can let me see how to make this 
> cleaner code
> 
> Roelof
> 
> 
> 
> 

--- End Message ---


Re: [Pharo-users] [ANN] Phoedown - Markdown to HTML

2020-01-02 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
+1

> On Jan 2, 2020, at 9:24 PM, Pierce Ng  wrote:
> 
> On Thu, Jan 02, 2020 at 12:56:55PM -0600, Sean P. DeNigris wrote:
>> bugs seem to be
>> more severe and difficult to diagnose, so we'll see how it goes as FFI use
>> becomes more and more common...
> 
> There's a saying about (aspects of) building software which source I
> cannot recall:
> 
>  If it hurts, do it more frequently.
> 
> I believe FFI should be pushed as much as possible to work out bugs and
> develop new capabilities. Looking forward to playing with threaded FFI.
> 
> Pierce
> 


--- End Message ---


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-01-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I have some work around building class hierarchies from database schema - 
specifically a Rails style Active Record schema.

It is a bit of a work in progress and is intended to be folded into Glorp but 
you can see where I am at 
https://github.com/pharo-db/glorp/blob/13-Drive-DescriptorSystem-creation-entirely-from-database-schema-and-naming-conventions/Glorp/ActiveRecordDescriptorSystem.class.st#L108
 


Maybe it helps?

> On Jan 18, 2020, at 12:20 AM, Serge Stinckwich  
> wrote:
> 
> Hi there,
> 
> anyone has experience about generating a class hierarchy from a JSON Schema ? 
> Code available somewhere ?
> 
> Thank you.
> 
> -- 
> Serge Stinckwich
> Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO)
> Sorbonne University (SU)
> French National Research Institute for Sustainable Development (IRD)
> University of Yaoundé I, Cameroon
> "Programs must be written for people to read, and only incidentally for 
> machines to execute."
> https://twitter.com/SergeStinckwich 

--- End Message ---


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-01-20 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
The official is https://github.com/pharo-rdbms/glorp (The one I forked at 
pharo-db - a username I need to change as it is causing confusion).

I've been mostly working with P3 and SQLite together.  I've standardized the 
query results format for fetching field definitions so if you want to add 
support for another db, please note the format of the result set and structure 
yours appropriately.

I would very much like all the databases to be hosted under pharo-rdbms and all 
of them to have glorp adaptors and the additional meta structure queries I'm 
adding to the GlorpPlatform classes to enable ActiveRecord.  I feel like 
Pharo's RDBMS story has been lagging and the lack of ready to go database 
support keeps people from building apps on it.  

There are a zillion little business CRUD apps that could be knocked out with 
spec2 or Seaside.

Please, dive in and make improvements.

> On Jan 20, 2020, at 9:15 AM, eftomi  wrote:
> 
> Todd, this is great, I didn't know that you are working on ActiveRecord.
> 
> BTW, I have some minor additions to SQLServerPlatform (support for National
> Language Character Set) and OraclePlatform (Decimal data type) - is there a
> central git repository for Glorp so that I could PR to?
> 
> Thanks and best wishes,
> Tomaz  
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 


--- End Message ---


Re: [Pharo-users] Generate class hierarchy from JSON Schema

2020-01-22 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
That would be amazing!

I'm a Mac/Unix guy so I don't have access to the other platforms (I suppose I 
could fire up an AWS Oracle).  I can do mysql/mariadb, posgresql, and sqlite.

I'm pretty close to pushing my ActiveRecord extensions.  I just need to get 
many to many with link tables done and it is good to go.  I spent a few days 
"porting" the ruby inflector and its tests.

As for database introspection, I am relying on this new method and the result 
set format on DatabasePlatform.

printSqlStatementToListColumnsInTable: aDatabaseTable inSchema: schemaString 
on: aStream
" Format:
   name   |   type| length | nullable | 
default_value | pk 
-+---++--+---+
 id  | character varying |255 |0 | 
''::character varying |  1 

Then I can build a whole class model and descriptor system off the schema.

> On Jan 22, 2020, at 9:55 AM, Tomaž Turk  wrote:
> 
> Thanks, Todd - I'll prepare a PR for https://github.com/pharo-rdbms/glorp 
>  to update SQLServerPlatform and 
> OraclePlatform.
> 
> I already used the standardized query results format in PharoADO which works 
> nicely with Glorp. You can find PharoADO here: 
> https://github.com/eftomi/pharo-ado . 
> Maybe it can be included into the pharo-rdbms collection if you feel that 
> it's mature enough. PharoADO can be used standalone (as interface to ActiveX 
> Data Objects) or with Glorp.
> 
> However, there are some "high level" tests in Glorp package that are still 
> red with Oracle and SQLServer, you can find the list on GitHub under 
> "issues". In particular, I didn't have time yet to implement blobs - PharoADO 
> uses PharoCOM (by Pablo) and firstly we have to settle the Variant SafeArray 
> data type in that package. Now that we have stable Pharo 8.0 64 bit for 
> Windows, PharoCOM should be checked for 64-bits, too. 
> 
> Anyway, I agree with you that the database support is one of the key success 
> factors for a development platform. I'm focusing into this since I hope that 
> one day I could teach the concepts of business solutions development fully in 
> Pharo :-)
> 
> Best wishes,
> Tomaz
> 
> 
> 
>> The official is https://github.com/pharo-rdbms/glorp (The one I forked at 
>> pharo-db - a username I need to change as it is causing confusion).
>>  
>> I've been mostly working with P3 and SQLite together. I've standardized the 
>> query results format for fetching field definitions so if you want to add 
>> support for another db, please note the format of the result set and 
>> structure yours appropriately.
>>  
>> I would very much like all the databases to be hosted under pharo-rdbms and 
>> all of them to have glorp adaptors and the additional meta structure queries 
>> I'm adding to the GlorpPlatform classes to enable ActiveRecord. I feel like 
>> Pharo's RDBMS story has been lagging and the lack of ready to go database 
>> support keeps people from building apps on it.
>>  
>> There are a zillion little business CRUD apps that could be knocked out with 
>> spec2 or Seaside.
>>  
>> Please, dive in and make improvements.

--- End Message ---


Re: [Pharo-users] Migration from Spec to Spec2

2020-01-24 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Thank you for blazing that trail.

> On Jan 24, 2020, at 11:14 AM, Kasper Østerbye  
> wrote:
> 
>  Cheers all,
> 
> There was a mail about Spec2 documentation on this list in the last few days. 
> I had a Spec program, and wanted to see how to migrate it to Spec2. 
> The before and after is the master and the Spec2Migration branches of: 
> https://github.com/kasperosterbye/ovina 
> 
> 
> I decided to write down an account of all my struggles in making this 
> migration. That account is on: 
> https://github.com/kasperosterbye/ovina/blob/Spec2Migration/SpectoSpec2.md 
> 
> 
> Beware - it is LONG.
> 
> In the end, I draw the following conclusions:
> Class comments on which classes to use instead of the depricated ones should 
> be mandatory!
> Spotter is a real help
> Changing terminology is a true pest - in particular since the terminology of 
> a library is used in the applications - in my case Tab became Page.
> The new library has not yet implemented all parts of the old one (but I am 
> sure it has implemented new stuff as well).
> The SpDemo class is not only good, it is a template for others to follow.
> Do not silently delete features. Be brave and include a method oddRowColor 
> with a comment saying it is not going to be implemented in this version, and 
> why.
> Some of them refer to specifics of the code. 
> 
> Overall I can say, that earlier today, Estaban wrote:
>   "Widgets API is more or less compatible, chances are that your 
> components will work out of the box or it will be rewritten by a deprecation 
> rule.
> What is not compatible and there I not auto migration is the layout. You will 
> need to rewrite those.”
> 
> I am afraid to say, that was not my experience :-)
> 
> Best,
> 
> Kasper

--- End Message ---


Re: [Pharo-users] smalltalk conferences

2020-01-27 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
+1

SoCal checking in here.  Would love that as Europe is usually beyond my reach 
for just a tech conf.

> On Jan 27, 2020, at 5:33 PM, tbrunz  wrote:
> 
> We need to start one.  Along with a North American version of ESUG.
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 


--- End Message ---


Re: [Pharo-users] smalltalk conferences

2020-01-27 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
San Diego here.

> On Jan 27, 2020, at 5:37 PM, tbrunz  wrote:
> 
> I'm in Los Angeles.  Plenty of places to hold conferences here!  (San Diego &
> San Francisco, too.)
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 


--- End Message ---


Re: [Pharo-users] sqlite garage

2020-01-30 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Hi Jeff,

If you haven't switched, the current SQLite repository that we would like to 
consider the "official" on is at https://github.com/pharo-rdbms/Pharo-SQLite3 


Garage is being put on a weight loss program.

> On Jan 29, 2020, at 7:04 PM, Jeff Gray  wrote:
> 
> Just thought I'd revisit this as it's been in the back of my mind all this
> time and I finally found out. Of course, the answer was there in front of me
> - I just had to look at the tests!
> 
> If anyone else is interested the connection string has to be in the
> following format:
> 'sqlite3:///c:\sqlite3Databases\testDb.db'
> 
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 

--- End Message ---


Re: [Pharo-users] About "it's not pharo but smalltalk"

2020-02-05 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
FWIW I am one of the mods of /r/smalltalk - happy to have material

Sent from my iPhone

> On Feb 5, 2020, at 13:12, horrido  wrote:
> 
> Reddit is a strange bird. I have found more resistance to Smalltalk there
> than from any other source on the planet. Moreover, those people *really*
> don't appreciate me evangelizing anything. Consequently, I've avoided Reddit
> like the plague.
> 
> I don't know what kind of readership exists at Reddit, but they are openly
> hostile. So you'll forgive me if I don't lend much credence to what
> Redditors say.
> 
> 
> 
> Pavel Krivanek-3 wrote
>> st 5. 2. 2020 v 20:48 odesílatel horrido <
> 
>> horrido.hobbies@
> 
>> > napsal:
>> 
>>> I learned a long time ago that you can't please everybody. I've heard the
>>> critics about my evangelism. I've also heard the praise.
>>> 
>>> So what am I supposed to do? Listen to the critics and ignore the fans?
>>> 
>>> If you're an evangelist, you have to develop a thick skin and follow your
>>> heart. Otherwise, get out of the kitchen...
>>> 
>> 
>> You are a victim of your own strong confirmation bias. I hardly can break
>> it but I just want to point out that in the mentioned discussion, there
>> was
>> no fan of you (and there were more people complaining than the two I
>> mentioned).
>> 
>> Pavel Krivanek-3 wrote
 st 5. 2. 2020 v 19:02 odesílatel horrido <
>>> 
 horrido.hobbies@
>>> 
 > napsal:
 
>> You want to take the Smalltalk heritage as a definition, that’s ok.
>>> We
> don’t, and that’s ok too. Is about what we want to do.
> 
> Who's "we"?
> 
> Last time I checked, nobody owns Pharo. Pharo is not a bunch of core
> developers; it's a community. And I believe there are many Pharoers
>>> who
> share my view.
> 
> Since I'm a Smalltalk evangelist and not a Pharo evangelist, I guess I
> shouldn't ever mention Pharo in my blog. After all, if it's not
> Smalltalk,
> why should I promote it???
> 
 
 Pharo 8.0 release Reddit discussion included some feedback you
 may appreciate:
 
 "Thanks. Does this Pharo release removes feature "Richard Kenneth Eng"?
 That was the only feature in detriment to such an excellent environment
>>> as
 Pharo."
 
 "I really like the idea of pharo's features and smalltalk is quite
 interesting, but I can't help but be put off by the insanely stupid
 marketing culture around it. Most articles about it exaggerate way too
 much
 and seem like they're written by people who were paid to write about
>>> it.
 Or
 maybe I'm reading Medium-cancer too much."
 
 
 
> In fact, this is disastrous for my JRMPC competition since it's based
> entirely on Pharo. I'm promoting Smalltalk but pushing Pharo on all
>>> the
> participating teams??? What the f*ck am I doing?!!
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 
> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>> 
>>> 
> 
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 


--- End Message ---


Re: [Pharo-users] [Pharo-dev] [Ann] Concurrent Programming in Pharo is available

2020-02-10 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I have wanted a clean explanation of semaphores and process scheduling for a 
long time.

Thanks for this.


> On Feb 9, 2020, at 3:58 AM, Stéphane Ducasse  
> wrote:
> 
> On http://books.pharo.org/booklet-ConcurrentProgramming/ 
> 
> 
> 
> S.
> 
> 
> Stéphane Ducasse
> http://stephane.ducasse.free.fr  / 
> http://www.pharo.org  
> 03 59 35 87 52
> Assistant: Julie Jonas 
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley, 
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
> 

--- End Message ---


Re: [Pharo-users] can I divide a string into part of exactly n length

2020-04-27 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
This works

| s1 s2 |
s1 := 'abcdefghijk'.
s2 := String streamContents: [:s || in len | 
   in := ReadStream on: s1.
   len := 0.
   [in atEnd] whileFalse: [ 
  s nextPut: in next.
  len := len + 1.
  (in atEnd not and: [ (len \\ 3) = 0]) ifTrue: [ s space ] ] ]

> On Apr 27, 2020, at 10:07 AM, Roelof Wobben via Pharo-users 
>  wrote:
> 
> 
> From: Roelof Wobben 
> Subject: Re: [Pharo-users] can I divide a string into part of exactly n length
> Date: April 27, 2020 at 10:07:41 AM PDT
> To: Richard Sargent , Any question about 
> pharo is welcome 
> 
> 
> Op 27-4-2020 om 19:05 schreef Richard Sargent:
>> On Mon, Apr 27, 2020 at 9:27 AM Roelof Wobben via Pharo-users 
>> mailto:pharo-users@lists.pharo.org>> wrote:
>> Hello,
>> 
>> I wonder if it is possible in Pharo to divide a string in lets say part 
>> of 3.
>> so this :  'abcdefgh'
>> 
>> would be  'abc def gh`
>> 
>> Do you really want a single string with spaces inserted or do you want a 
>> collection of substrings, each three characters (or less, for the last one)?
>> 
> 
> I need a single string with spaces inserted.
> So maybe I have formulate my question wrong. Very difficult if English is not 
> your mother language and you were bad at school in languages a very very long 
> ago.
> 
> Roelof
> 
> 
> 

--- End Message ---


Re: [Pharo-users] Siren 9.0 Released

2020-05-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
It is interesting to see that Siren uses PortAudio.  I was considering to 
recommend adopting it for Pharo in the other sound thread.

It has been used in a lot of projects, but I am a little concerned it has not 
been recently updated.

http://www.portaudio.com

> On May 14, 2020, at 1:15 PM, Stéphane Ducasse  
> wrote:
> 
> Thanks Steven this is cool to see that Siren is living and kicking. 
> Last year I was browsing the old site and I was sad because I thought it was 
> dead.  
> Your OSC looks better than the one in Pharo even if we used it successfully 
> to connect interactive tables with a HCI research group. 
> 
> If you need help to migrate from VW let us know because it would be great to 
> have Siren working in Pharo. 
> I did not see any Unit tests and the tests saved us when we migrated Moose. 
> Sometimes we even only kept them because they were
> better than the implementation. It took us around six months and we got free 
> :)
> And we have some contacts that would be interested in London. We could put 
> you in contact.
> 
> Now just some questions and you may know the answer so I ask
>  
>   I was thinking but I may be totally wrong that it was forbidden to give 
> VW images and that the current license 
>   was for personal use only. Long time ago the shrink process was 
> removing the compiler. Now I saw that your image is 42mb. 
> 
>   Personally I do not want to download any VisualWorks distribution and 
> sign their licenses because I want to stay cristal clear 
>   on ANY license and possible issues. I did not look at Visualworks since 
> 2008 and I feel clean and I will stay like that.  
> 
>   So I imagine that I’m not allowed to use your software. I’m not good in 
> music sadly so there is no frustration from my side. 
> 
>   You mention that people can use a non-commercial version of VW but this 
> license does not exist anymore. 
>   
>   Is there a 64 bits version of VW because VW7.5 starts to show its age 
> and on recent mac you only have 64 bits. 
> 
> 
> Some people may think that we are just over the top on open-source but this 
> is not by accident that we took the responsibility to create Pharo. 
> We could not distribute Moose our open-source platform so after 10 years of 
> hard work we had to do something. And we created Pharo. 
> And the problem we got were with the previous version (the non commercial) of 
> the Cincom license and the new one is even more restrictive.
> Some friends of mine told me that some lawyers were starting to get picky and 
> send letters around. 
> So watch out. 
> 
> BTW I did not see the license of Siren on the git repo. If I may suggest one, 
> BSD/MIT are nice, avoid GPL because it means that nobody serious on Smalltalk 
> will ever look at your system and contribute.
> 
> S. 
> 
>> On 14 May 2020, at 01:40, step...@heaveneverywhere.com 
>>  wrote:
>> 
>> 
>> Hello all,
>> 
>> The Siren system is a general-purpose framework for music and sound 
>> composition, processing, performance, and analysis; it is a collection of 
>> about 350 classes written in Smalltalk-80 (40 kLOC or so). Siren 9.0 works 
>> on VisualWorks Smalltalk (though the bulk has been ported to other dialects 
>> as well); Siren supports streaming I/O via OpenSoundControl (OSC), MIDI, and 
>> multi-channel audio ports. The Siren release is available via the web from 
>> the URL http://FASTLabInc.com/Siren . 
>> 
>> Siren is a programming framework and tool kit; the intended audience is 
>> Smalltalk developers, or users willing to learn Smalltalk in order to write 
>> their own applications. The built-in applications are meant as 
>> demonstrations of the use of the libraries, rather than as end-user 
>> applications. Siren is not a MIDI sequencer, nor a score notation editor, 
>> through both of these applications would be easy to implement with the Siren 
>> framework.
>> 
>> There are several elements to Siren:
>> 
>> * the Smoke music representation language (music magnitudes, events, event 
>> lists, generators, functions, and sounds);
>> 
>> * voices, schedulers and I/O drivers (real-time and file-based voices, 
>> sound, score file, OSC, and MIDI I/O);
>> 
>> * user interface components for musical applications (UI framework, tools, 
>> and widgets);
>> 
>> * several built-in applications  (editors and browsers for Smoke objects); 
>> and
>> 
>> * external library interfaces for streaming I/O and DSP math (sound/MIDI 
>> I/O, fast FFT, CSL & Loris sound analysis/resynthesis packages )
>> 
>> The best in-depth doc (book chapter) is in,
>>  http://FASTLabInc.com/Siren/Doc/SirenBookChapter.pdf 
>> 
>> 
>> The read the demo code workbook (this text), go to,
>>  http://FASTLabInc.com/Siren/Siren7.5.Workbook.html 
>> 
>> o

Re: [Pharo-users] GIS support for Pharo

2020-06-04 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Hi Serge,

I would love to participate in getting some GIS features into Pharo.  I think 
it would be a fantastic platform for GIS.

My personal orientation is doing marine navigation (have boat with sensors, 
want boat to be be smarter about navigation).

My main interests is in being able to render S57/S52 formats.  There are a 
number of boat fans that balk at the price of expensive chart plotter computers 
and software.

They have given rise to some DIY stuff.  Some of it just rips code straight out 
of https://gdal.org - I think possibly a FFI integration with gdal might be an 
amazing resource.

I am time constrained for when I can work on this stuff but would like it a lot 
if we at least had some core data types for simple things like lat/lng, regions 
(polygons), and a decent general map renderer.

Anyhow, please include me in any conversations.  Navigation (both air and sea) 
are two things I have an interest in.

> On Jun 3, 2020, at 8:31 PM, Serge Stinckwich  
> wrote:
> 
> Dear all,
> 
> there was already some discussion in the list about GIS support for Pharo 
> previously.
> 
> Working on CORMAS multi-agent simulation platform: 
> https://github.com/cormas/cormas  some 
> developers feel the need to have more GIS support for Pharo.
> 
> I know of existing GIS software:
> - GeoJSON by Zweidenker: https://github.com/zweidenker/GeoJSON 
> 
> - ESRI ascii raster, done by Stephane recently: 
> https://github.com/Ducasse/ESRI-ASCII-Raster 
> 
> - shapefile support by Hernan: http://smalltalkhub.com/#!/~hernan/Shapes 
> 
> (to be moved to github)
> - I found this project also: http://www.squeaksource.com/gekon.html 
> 
> 
> I know that Etienne Delay is also interested by GIS support and propose to 
> implement OpenGIS model support: https://github.com/cormas/cormas/issues/139 
> 
> 
> Can we try to unite and maybe create a pharo-GIS organization on github to 
> federate our efforts? 
> 
> Cheers,
> -- 
> Serge Stinckwich
> https://twitter.com/SergeStinckwich 

--- End Message ---


Re: [Pharo-users] [ANN] What are reasons NOT to use Smalltalk?

2020-06-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Same.  My biggest hesitation is lack of cloud deployment support.  At least for 
web apps.

For desktop apps, I have been holding off building any UI because of the brik 
blok spec spec2 churn.

> On Jun 19, 2020, at 10:02 AM, Richard Sargent 
>  wrote:
> 
> It wouldn't let me vote without choosing an answer, none of which were my 
> answer.
> 
> On Fri, Jun 19, 2020 at 9:32 AM Richard Kenneth Eng 
> mailto:horrido.hobb...@gmail.com>> wrote:
> https://smalltalk.tech.blog/2020/06/19/what-are-reasons-not-to-use-smalltalk/ 
> 
>  
> 
> Thanks for participating in the poll. 

--- End Message ---


Re: [Pharo-users] [ANN] What are reasons NOT to use Smalltalk?

2020-06-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
It isn't plug and play.

For instance, I can pick PHP on an AWS elastic beanstalk menu, set up a couple 
shell scripts, and deploy PHP with 'eb deploy' out of my local git repo.  Easy.

It is possible to deploy the stuff but to build infrastructure and deployment 
scripts for a pharo seaside app, it is a lot more DIY work.

I don't always have time to do that.  I can get a box up,, sure.  Getting a 
fleet up with deployment automation and autoscaling is another can of worms.


> On Jun 19, 2020, at 12:18 PM, Sven Van Caekenberghe  wrote:
> 
> If you are capable of deploying web applications, for any other technology 
> stack, there is really no issue in doing the same for Pharo.

--- End Message ---


Re: [Pharo-users] [ANN] What are reasons NOT to use Smalltalk?

2020-06-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
HTML+CSS+JQuery has been stable for a long time.

That's pretty much what I use (plus the odd jquery widget like date picker).

Not keen on writing code I know will be obsolete next year was my primary point.

> On Jun 19, 2020, at 12:14 PM, Aliaksei Syrel  wrote:
> 
> Imagine trying to build any UI in javascript with their wide family of 
> frameworks ;)

--- End Message ---


[Pharo-users] Re: Pharo-WebView

2021-12-17 Thread Todd Blanchard via Pharo-users
Seems cool but I can't figure out how to build it as a library on MacOS.

> On Dec 16, 2021, at 10:02 AM, Tomaž Turk  wrote:
> 
> Dear all,
> 
> Pharo-WebView package is now available on GitHub at 
> https://github.com/eftomi/Pharo-Webview 
> .
> 
> Pharo-WebView is a package which implements a binding to webview dll library 
> available at https://github.com/webview/webview 
>  in Pharo. Webview allows you to show 
> HTML user interfaces in a native window, inject JavaScript code and HTML 
> content into the window. It renders HTML originating via web requests or as a 
> direct input.
> 
> I tested it on Windows 64 bit in Pharo 64, I plan to do that on Pharo 32 and 
> Linux, however I don't have access to Mac, so if anybody is interested, I'd 
> be grateful :-)
> 
> Best wishes,
> Tomaz



[Pharo-users] Re: Pharo9 GLORP + MySQL

2021-12-23 Thread Todd Blanchard via Pharo-users
Load the glorp target from the MySQL repository.

> On Dec 22, 2021, at 1:33 PM, laszlo.szoln...@gmail.com wrote:
> 
> Hi, I’m new to the Pharo users mailing list and to Pharo in general, too.
> 
> My goal is to make a CRUD web application using Seaside, Magritte, GLORP and 
> MariaDB (MySQL-like RDBMS).
> 
> I already test-drove GLORP with PostgreSQL-P3, with success.
> 
> But I need MariaDB because it implements SQL:2011 (which Postgres lacks 
> currently) thus enabling the use of system-versioned and bi-temporal tables.
> 
> Currently I don’t need GLORP to handle any of the SQL:2011 features as the 
> versioning would be invisible to the web app, it is needed only for auditing 
> purposes.
> 
> I tried to make the system work be installing the MySQL driver into a fresh 
> Pharo9 image:
> 
> Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 
> 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it 
> manually from github. (Sorry but I'm noob to work with baselines, Iceberg, 
> Monticello and such.) Then loaded GLORP: Metacello new repository: 
> 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do 
> everything in a similar manner to how I did it with P3: login := Login new 
> database: MySQLPlatform new; username: 'root'; password: ''; host: ' host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor 
> forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very 
> nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. 
> *GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the 
> demo from pharobooks with an example on how to use GLORP with P3. It contains 
> the demo class models, descriptors and table definitions. And finally: 
> session login. >>> Instance of MySQLDriver did not understand #queryEncoding 
> :(  Any hints appreciated.
> 
> 



Re: [Pharo-users] My Keynote at the Salta Conference

2018-11-20 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
OK, I'll bite.

What does "code the competition" mean exactly?

I last used Smalltalk "in anger" pre-pharo with squeak.  I live ST and am 
looking for a way back "in" but
TBH the changes from Squeak are vast and I have too many ideas to work on and 
keep hitting walls.

I'm intrigued but need more direction.  Whatcha need - ELI5.



> On Nov 20, 2018, at 5:13 PM, horrido  wrote:
> 
> No, the money isn't lost. I was merely suggesting that without some help, the
> marketing opportunity for this competition would be lost.
> 
> I'm not sure you understand how much work is involved in this project. I
> will be doing a great deal of the heavy lifting. I have to setup the
> competition website server. I have to advertise or reach out to high schools
> across the country. I have to get local media interested in covering the
> competition. I have to look into producing the T-shirt swag, and shipping
> the T-shirts to all contest participants, and at an affordable rate to fit
> the budget. Those are only a few things off the top of my head.
> 
> Coding the actual contest problems according to David Buck's prescription
> shouldn't be open-ended and shouldn't be a huge commitment. I imagine it
> would be a couple of months of work during spare time.
> 
> 
> 
> jgfoster wrote
>> Hi Richard,
>> 
>> So the  that we gave you is now “lost"? Perhaps people didn’t
>> understand what you expected from us other than money. What else is needed
>> to make your project a success? We are supposed to “code the competition”
>> as well? Anything else?
>> 
>> Is this practice of insulting people (“Doesn’t anyone care about promoting
>> Pharo?”) supposed to be motivating? Is it a demonstration of you expertise
>> at marketing? Does it build confidence about how the Smalltalk community
>> will be perceived by the new arrivals?
>> 
>> I’ve appreciated your blog posts and your passion, but I’m put off by this
>> approach.
>> 
>> James
>> 
>> P.S. I realize that I’m probably doing what I’m criticizing in
>> you—throwing out negative comments from behind a keyboard to score points
>> when I might not be so harsh in person. 
>> 
>>> On Nov 20, 2018, at 2:36 PM, Richard Kenneth Eng <
> 
>> horrido.hobbies@
> 
>> > wrote:
>>> 
>>> Not even a single nibble? Doesn't anyone care about promoting Pharo?
>>> 
>>> What a colossal lost opportunity!
>>> 
>>> 
>>> On Sun, 18 Nov 2018 at 09:29, Richard Kenneth Eng <
> 
>> horrido.hobbies@
> 
>>  
>> horrido.hobbies@
> 
>> >> wrote:
>>> Some of you may already be aware of my presentation at Smalltalks 2018,
>>> the outcome of which was full funding for my Smalltalk programming
>>> competition. See My Keynote at the Salta Conference
>>> 
>>>  
>>> >;.
>>> 
>>> Three years ago, David Buck provided an outline for the competition. See
>>> attached.
>>> 
>>> I would like to use that as a starting point, though I am open to
>>> alternative suggestions.
>>> 
>>> The reason for this post is the following...
>>> 
>>> I need volunteers to code the competition. I am nowhere near qualified to
>>> do so, as my knowledge of Pharo is limited.
>>> 
>>> Without help from Pharoers (or, at least, Smalltalkers), the competition
>>> is in jeopardy. This is a great opportunity to promote Pharo. (The
>>> original competition three years ago was going to use VisualWorks, but
>>> since Cincom did not see fit to support my competition this year, I
>>> decided to go with Pharo.)
>>> 
>>> Please contact me if anyone is interested. It would be a terrible shame
>>> to waste this opportunity.
>>> 
>>> Regards,
>>> Richard
> 
> 
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html 
> 
--- End Message ---


Re: [Pharo-users] My Keynote at the Salta Conference

2018-11-21 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
OK, sorry.  I missed that.

Now I've read it. And it requires a customized VM that can count bytecodes 
executed against a budget and terminate execution if the budget is exceeded.

For the developer it requires an awareness of the relationship between 
bytecodes and source code.  I, personally, have virtually no idea what that 
relationship is.  I used Smalltalk as a high level language and try not to 
worry about how expensive things are until it actually matters.  I think that 
is most developers.

So I'm not really a fan of this contest approach.  The implementation is 
certainly beyond my skills.  I have been dabbling with Squeak since its release 
and only recently trying to get into Pharo "in anger" because I have a couple 
projects I personally want to realize.  I'm finding the entire thing to be 
really fast moving and hard to get my head around and the VM is pretty much 
still impenetrable to me after a couple months trying to build one.

So I'm definitely not your guy and the number of people who are on top of the 
VM enough to pull this off is likely on the order of ten.

Maybe a different kind of coding contest?  I'd try adapting problems from some 
existing competition questions.

> On Nov 20, 2018, at 6:32 PM, horrido  wrote:
> 
> Basically, implementing what was outlined in David Buck's document (attached
> to the original post). It may involve hacking the VM to count byte codes.
> 
> SmalltalkContestIdeas.docx
>  >  
> 
> 
> Pharo Smalltalk Users mailing list wrote
>> OK, I'll bite.
>> 
>> What does "code the competition" mean exactly?
>> 
>> I last used Smalltalk "in anger" pre-pharo with squeak.  I live ST and am
>> looking for a way back "in" but
>> TBH the changes from Squeak are vast and I have too many ideas to work on
>> and keep hitting walls.
>> 
>> I'm intrigued but need more direction.  Whatcha need - ELI5.
>> 
>> 
>> 
>>> On Nov 20, 2018, at 5:13 PM, horrido <
> 
>> horrido.hobbies@
> 
>> > wrote:
>>> 
>>> No, the money isn't lost. I was merely suggesting that without some help,
>>> the
>>> marketing opportunity for this competition would be lost.
>>> 
>>> I'm not sure you understand how much work is involved in this project. I
>>> will be doing a great deal of the heavy lifting. I have to setup the
>>> competition website server. I have to advertise or reach out to high
>>> schools
>>> across the country. I have to get local media interested in covering the
>>> competition. I have to look into producing the T-shirt swag, and shipping
>>> the T-shirts to all contest participants, and at an affordable rate to
>>> fit
>>> the budget. Those are only a few things off the top of my head.
>>> 
>>> Coding the actual contest problems according to David Buck's prescription
>>> shouldn't be open-ended and shouldn't be a huge commitment. I imagine it
>>> would be a couple of months of work during spare time.
>>> 
>>> 
>>> 
>>> jgfoster wrote
 Hi Richard,
 
 So the  that we gave you is now “lost"? Perhaps people didn’t
 understand what you expected from us other than money. What else is
 needed
 to make your project a success? We are supposed to “code the
 competition”
 as well? Anything else?
 
 Is this practice of insulting people (“Doesn’t anyone care about
 promoting
 Pharo?”) supposed to be motivating? Is it a demonstration of you
 expertise
 at marketing? Does it build confidence about how the Smalltalk community
 will be perceived by the new arrivals?
 
 I’ve appreciated your blog posts and your passion, but I’m put off by
 this
 approach.
 
 James
 
 P.S. I realize that I’m probably doing what I’m criticizing in
 you—throwing out negative comments from behind a keyboard to score
 points
 when I might not be so harsh in person. 
 
> On Nov 20, 2018, at 2:36 PM, Richard Kenneth Eng <
>>> 
 horrido.hobbies@
>>> 
 > wrote:
> 
> Not even a single nibble? Doesn't anyone care about promoting Pharo?
> 
> What a colossal lost opportunity!
> 
> 
> On Sun, 18 Nov 2018 at 09:29, Richard Kenneth Eng <
>>> 
 horrido.hobbies@
>>> 
 >> 
 horrido.hobbies@
>>> 
 >> wrote:
> Some of you may already be aware of my presentation at Smalltalks 2018,
> the outcome of which was full funding for my Smalltalk programming
> competition. See My Keynote at the Salta Conference
> 
>  
> >
> 
>  
> >;;.
> 
> Three years ago, David Buck provided an outline for 

Re: [Pharo-users] Lambda World 2018 - What FP can learn from Smalltalk by Aditya Siram

2018-11-23 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I saw it.  I learned a lot about some things I didn't know about in Pharo.  I 
had no idea how PetitParser worked.  Now I'm intrigued.

It was an interesting perspective because, while he wasn't pushing Smalltalk, 
he was pushing for other languages to pursue better environments and tools 
built in their own languages.  Basically using Pharo as an inspirational "bar 
raiser" by saying "they did this - we should be able to do it too".

Although I think a lot of why Smalltalk makes that stuff doable is the 
integrated graphical environment - something most other languages simply don't 
have.  

Not sure what to make of the knocks on Pharo's GC. I had thought the goal was a 
very aggressive collector to support multimedia

> On Nov 23, 2018, at 11:37 AM, Jimmie Houchin  wrote:
> 
> Hello,
> 
> Interesting video using Pharo for presenting its points.
> 
> https://www.youtube.com/watch?v=baxtyeFVn3w
> 
> Wondering if anybody else has seen this video. What can be learned from this 
> outside perspective.
> 
> He is mostly positive about Pharo and is using it as an example of things he 
> would like to see in his world.
> 
> He does say that Pharo's GC is not good.
> 
> Thoughts.
> 
> Jimmie
> 
> 
> 
> 
> 


--- End Message ---


Re: [Pharo-users] GPS / Longitude / Latitude library

2018-12-04 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I have long wanted to do a FFI interface to GDAL.  I think Pharo would make a 
great GIS workbench.

Possibly when 64bit UFFI stabilizes.

> On Dec 4, 2018, at 1:21 AM, Alistair Grant  wrote:
> 
> Hi,
> 
> Does anyone know of a library for processing GPS coordinates?
> 
> What I'm looking for are things like:
> 
> - Parsing from and printing to various string formats (HMS, NESW, decimal)
> - Distance between two points
> - etc.
> 
> Thanks,
> Alistair
> 


--- End Message ---


[Pharo-users] OpenGL resources?

2018-12-07 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Hi,

I need to learn OpenGL for my job and was wondering if any of the OpenGL 
experts could comment on Pharo's OpenGL integration and its suitability for a 
learning environment.

Are there any particular packages I should look at that are heavily OpenGL 
oriented that would make a good base for learning?

Thanks
--- End Message ---


Re: [Pharo-users] OpenGL resources?

2018-12-07 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I will look at that.  Thanks!

> On Dec 7, 2018, at 7:23 AM, Esteban Lorenzano  wrote:
> 
> Hi,
> 
> well… there is an (or several) OpenGL packages. 
> I would say is a perfect environment because you do not have the compile 
> cycle, but you already know that :)
> 
> I’d recommend starting here: 
> 
> https://github.com/ronsaldo/uffi-opengl 
> <https://github.com/ronsaldo/uffi-opengl>
> 
> And in general, anything Ronie does is “graphic-heavy”. I would take one of 
> his projects/demos to learn how to use it.
> 
> Esteban
> 
> Ps: no, I have no idea about OpenGL :P
> 
> 
>> On 7 Dec 2018, at 15:45, Todd Blanchard via Pharo-users 
>> mailto:pharo-users@lists.pharo.org>> wrote:
>> 
>> 
>> From: Todd Blanchard mailto:tblanch...@mac.com>>
>> Subject: OpenGL resources?
>> Date: 7 December 2018 at 15:45:10 CET
>> To: Any question about pharo is welcome > <mailto:pharo-users@lists.pharo.org>>
>> 
>> 
>> Hi,
>> 
>> I need to learn OpenGL for my job and was wondering if any of the OpenGL 
>> experts could comment on Pharo's OpenGL integration and its suitability for 
>> a learning environment.
>> 
>> Are there any particular packages I should look at that are heavily OpenGL 
>> oriented that would make a good base for learning?
>> 
>> Thanks
>> 
>> 
> 

--- End Message ---


[Pharo-users] GlorpSQLite not finding sqlite library on Mac

2018-12-16 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I loaded up Glorp SQLite using

Metacello new 
repository: 'github://pharo-rdbms/glorp-sqlite3';
baseline: 'GlorpSQLite';
load.


This seems to be the only way to get SQLite support?  There is no standalone 
UFFI library?  Not that I have a problem with it, I know and like GLORP.

Then I ran the basic UDBCSQLite tests and they all fail with 'External module 
not found'.

I'm on MacOS Mojave.

I presume this means that the sqlite library was not found but the best I can 
find is a method #library that returns #sqlite

I want to use a homebrew installed version sqlite (technically, I want to use 
spatialite which is an extended version with GIS extensions).  

Reading the well written 
https://files.pharo.org/books-pdfs/booklet-uFFI/UFFIDRAFT.pdf I gather that I 
should subclass FFILibrary to make a SQLiteLibrary and have UDBCSQLite class 
that implements  
#macModuleName to return 
'/usr/local/Cellar/libspatialite/4.3.0a_6/libspatialite.dylib'?



--- End Message ---


[Pharo-users] Managing Code - Creating a Library/Package from scratch?

2019-01-05 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
The bit I always struggle with on various Smalltalk environments is the right 
way to manage code.  It keeps changing.  Which is fine. But I've been away for 
a bit and I'm lost now.

I want to create a new package that can be loadable and lives in a git repo.  I 
guess Metacello is part of that.  And Iceberg. And...what else?  I want to 
build a library but am no longer clear on what a library (or package I guess) 
definition is built from.

Thanks.
--- End Message ---


Re: [Pharo-users] Website is down

2019-01-23 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Is it a static website or does it have code behind it?

Could we use S3 at AWS?

> On Jan 22, 2019, at 9:37 AM, Esteban Maringolo  wrote:
> 
> El mar., 22 ene. 2019 a las 14:03, Esteban Lorenzano
> () escribió:
>> 
>> There is a problem with INRIA servers :(
>> They does not seems to support high traffic
>> 
> 
> They don't support high traffic nor high volume either. The download
> speed was awful then, and it's even worst now.
> But hey, those who pass all these obstacles to get to know and try
> Pharo are more likely to continue using it. :)
> 
> 
>> (supposing public from reddit and yc is high traffic?)
> 
> Well... with at least a 100:1 ratio of visits:upvotes the hits must be
> at least two order of magnitude higher than on a regular day.
> Which makes me wonder... do we have any stats of that?
> 
> These problems are "good" problems, and are the easiest to solve.
> 
> 
> Esteban A. Maringolo
> 


--- End Message ---


Re: [Pharo-users] Slots doc

2019-02-03 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Seems like an opportunity...I have no idea what the addition of slots does but 
I would like to learn.

> On Feb 3, 2019, at 1:33 AM, ducasse  wrote:
> 
>> Hello,
>> 
>> Where I can find documentation for slots?
>> 
>> I am trying to access the pharo books site but it is unreachable from my
>> network right now, I got a connection time out (It works from my 3G though
>> (??) ), but if I remember correctly the is no slot description in any book.
>> 
>> Regards,
>> Vitor
> 
> Hello victor 
> 
> There is no documentation about slots that I know. I’m sorry. 
> Marcus may want to write one in the future.
> 
> Stef
> 

--- End Message ---


[Pharo-users] Re: Null Object Pattern

2022-03-15 Thread Todd Blanchard via Pharo-users
Why do you not just do something like

[ “complicated code that might fail somewhere in here” ] 
on: Error 
do: [:error | nil]

Use the on:do: exception handling to stay safe.

Result := [anObject long chain of messages that might return a nilValue ]
on: Error do: [:e | nil].

> On Mar 15, 2022, at 11:16 AM, s...@clipperadams.com wrote:
> 
> I had some chaining that was getting too complex due to many nil checks, so I 
> started to refactor using a Null Object.
> 
> However, I’m struggling a bit with the refactor due to inlining. Since 
> #ifNil: variants might be inlined, it seems that something like:
> 
> anObject with a long chain of messages ifNotNil: [ :result | “…” ]
> 
> must be changed into something like:
> 
> anObject with a long chain of messages isNil ifFalse: [ anObject with a long 
> chain of messages “…” ].
> 
> Obviously, I can use a temp to have:
> 
> result := anObject with a long chain of messages.
> 
> result isNil ifFalse: [ result “…” ].
> 
> But both seem ugly and make me question using this pattern.
> 
> What am I missing?
> 
> After 40+ years of Moore’s Law, can we turn off these inlines by default?
> 



[Pharo-users] Re: Null Object Pattern

2022-03-18 Thread Todd Blanchard via Pharo-users
I feel like you’ve latched onto something that is genuinely a non problem and 
if you get your way we all suffer reduced performance and a guarantee that a 
nil test is universally the same thing.

If you want an overridable nil test, write your own nil test like isNilish and 
make it mean what you like without disrupting the rest of the system. Problem 
solved and you’re not violating the open closed principle.

Sent from my iPhone

> On Mar 18, 2022, at 8:39 AM, s...@clipperadams.com wrote:
> 
> 
> What you can do is turning it off globally in the setting (all compiler 
> option are listed there)
> 
> But take care: we can not recompile the image without optimzations as this 
> adds intererrupt possibilities to code that was not interruptable before, 
> which breaks the code in for process switching itself, I think.
> 
> So it sounds like my daydream that inlining be turned off by default is a 
> heavier lift than just flipping a switch, correct?
> 
> In principle (ignoring the amount of work involved) what are your thoughts RE 
> my musing: “After 40+ years of Moore’s Law, can we turn off these inlines by 
> default?” and my hypothesis that this is an optimization that made sense at 
> the time but now adds complexity for questionable payoff?


[Pharo-users] Re: Null Object Pattern

2022-03-18 Thread Todd Blanchard via Pharo-users
What, exactly, is inconsistent about a key message isNil being allowed to be 
overridden?

There is a VERY simple solution to your problem that does not involve 
disrupting the platform.  

But you'd rather change the platform.

Part of the reason Smalltalk has not been the greatest platform to build 
software on is its extreme malleability.  It is a double edged sword for sure.  
It is great for research.  Not so hot for actual systems development.  

"The key in making great and growable systems is much more to design how its 
modules communicate rather than what their internal properties and behaviors 
should be. Think of the internet – to live, it (a) has to allow many different 
kinds of ideas and realizations that are beyond any single standard and (b) to 
allow varying degrees of safe interoperability between these ideas." -Alan Kay

The inlined methods implement key operations that I believe *should* be 
immutable.  Because the system is implemented in terms of itself, it is not 
very hard to completely destroy an image and render it unusable by overriding 
the wrong message in the wrong class (try overriding #environment at the class 
level and let me know how long before your image completely packs up under a 
torrent of walkbacks).

If anything, I would like to see more immutable structure in the core classes.  
Add methods?  Always.   Casually override anything?  There be dragons there.

> On Mar 18, 2022, at 11:06 AM, s...@clipperadams.com wrote:
> 
> I feel like you’ve latched onto something that is genuinely a non problem…
> 
> I wouldn’t call complexity and lack of consistency a “non problem”, but it 
> sounds like for you the practical implications outweigh my 
> seemingly-somewhat-ideological/niche concerns. Is that a fair summary? In any 
> case, I appreciate your perspective.
> 



[Pharo-users] Re: Null Object Pattern

2022-03-18 Thread Todd Blanchard via Pharo-users



> On Mar 18, 2022, at 11:39 AM, Esteban Maringolo  wrote:
> 
> You say that Smalltalk is not so hot for system developments because
> it's extremely malleable? What are you measuring it against?

Lots of things but to keep things simple lets go with Objective C since it is 
quite similar in concept and style but the library classes are closed to 
modification without extraordinary effort (you can replace a method but you're 
gonna have to work to do it because you don't have the source code for the core 
classes).

> 
> It is still easy to break almost anything, without having to resort to
> compiler pragmas. :-)

Yeah, that's kind of my point.  I have junked a lot of images in my wake.

>> If anything, I would like to see more immutable structure in the core 
>> classes.  Add methods?  Always.   Casually override anything?  There be 
>> dragons there.
> 
> Something like  "final" classes and "const" globals or not being able
> to extend classes such as [Proto]Object?


IDK exactly.  Yeah, maybe a pragma that was part of the core library that would 
prevent an override of a key method that say, the browser, depends on.

Smalltalk is great for building things, but unlike when I build, say, a car, I 
don't have to drag around the entire factory I used to build the car behind it 
everywhere.

Toying with the idea of using one image to host remote developer tools that we 
do not change and using it to operate on a second image that has minimal dev 
tools but will be the production version of my app.  That would provide the 
separation that would keep me from destroying toolkit by accident while trying 
to tweak the app.

Just musing here.  I've become kind of dissatisfied with Pharo development of 
late.  Hard to build anything that lasts very long.


> 
> 
> 
>> 
>> On Mar 18, 2022, at 11:06 AM, s...@clipperadams.com wrote:
>> 
>> I feel like you’ve latched onto something that is genuinely a non problem…
>> 
>> I wouldn’t call complexity and lack of consistency a “non problem”, but it 
>> sounds like for you the practical implications outweigh my 
>> seemingly-somewhat-ideological/niche concerns. Is that a fair summary? In 
>> any case, I appreciate your perspective.
>> 
>> 


[Pharo-users] Re: Wow - Chat GPT understands Smalltalk

2023-03-15 Thread Todd Blanchard via Pharo-users
ChatGPT has been trained on some outdated “freely available” books.

I tried it with the first half of the first question of the Advent of Code 2022 
and asked it to write Pharo Smalltalk.

It produced some outdated stuff using messages that are no longer there.

FWIW, isOdd was present in Pharo around 2011.

> On Mar 15, 2023, at 2:57 AM, Joachim Tuchel  wrote:
> 
> interesting
> 
> #isOdd is not Smalltalk, neither Pharo 10 nor VAST 12  understands this 
> message ;-)
> 
> If I evaluate your snippet -replacing #isOdd for #odd, I get an empty 
> Collection. The divisible by 4 things is somewhat interesting, because (1 to: 
> 100 by: 4) is amn interval 1,5,9 etc ;-)
> 
> So chatGPT is probably a newbie in Smalltalk. Interesting is how logical the 
> explanation sounds, you're tempted to believe it...
> 
> 
> 
> Joachim 
> 
> 
> 
> 
> 
> Am 15.03.23 um 10:45 schrieb giorgio ferraris:
>> it's interesting to see how the answer changes with only a small change on 
>> the question:
>> 
>> (1 to: 100 by: 4) reject: [:i | i isOdd]
>> 
>> gives:
>> The code creates a collection of numbers from 1 to 100, incrementing by 4 at 
>> each step using the to:by: message. It then applies the reject: message to 
>> this collection, which returns a new collection containing all elements for 
>> which the given block evaluates to false.
>> 
>> In this case, the block is [i | i isOdd], which checks whether a given 
>> number i is odd using the isOdd method. So the result of the entire 
>> expression is a collection of all even numbers between 1 and 100 that are 
>> divisible by 4.
>> 
>> 
>> ciao
>> 
>> giorgio
>> 
>> 
>> On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon  
>>  wrote:
>>> Of course everyone is talking about ChatGPT, and I saw a post to 
>>> ExplainCode and didn’t expect it to understand Smalltalk, so was impressed 
>>> that it does! Presumably the Tonel Smalltalk code on GitHub has helped 
>>> along with numerous articles?
>>> 
>>> Try it out: https://whatdoesthiscodedo.com/
>>> 
>>> I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
>>> 
>>> And got this (neat eh):
>>> 
>>> The code above is written in the programming language Smalltalk.
>>> 
>>> It creates a collection of numbers from 1 to 100, incrementing by 3 at each 
>>> step. This is done using the "to:by:" construct where the starting value is 
>>> 1, the ending value is 100, and the increment is 3.
>>> 
>>> The resulting collection is then filtered using the "reject:" method, which 
>>> takes a block of code as an argument. In this case, the block checks 
>>> whether each element (denoted by the variable i) is odd by using the 
>>> "isOdd" method. If an element is odd, it will be rejected from the 
>>> collection.
>>> 
>>> So, the final result is a collection of all even numbers from 1 to 100, 
>>> incrementing by 3 at each step.
>>> 
>>> Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e 
>>> -- 
> 
> --- 
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de 
> Fliederweg 1 http://www.objektfabrik.de 
> 
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com 
> 
> Telefon: +49 7141 56 10 86 0Fax: +49 7141 56 10 86 1
> 



[Pharo-users] Re: Porting from VW to Pharo

2023-04-11 Thread Todd Blanchard via Pharo-users
You mean we can't just ask ChatGPT to do it?

/s

> On Apr 11, 2023, at 8:52 AM, Steffen Märcker  wrote:
> 
> Dear Christian and Richard,
> 
> thanks for your answers. I'll try to go through the process step by step and 
> come back with questions to the list if that's okay.
> 
> First, after loading the "Pharo Fileout PDFTalk", VW (8.3, 64 Bit) shows two 
> unloadable definitions:
> - PostscriptInterpreterTests>>_ph_testOperatorNotFound
> - ColorValueTest>>_ph_testBridgedNamedColors
> Both classes are not loaded
> 
> Second, it appears that some of the selectors mentioned on 
> https://wiki.pdftalk.de/doku.php?id=smalltalktransformdocumentation 
>  have 
> been renamed, e.g., PackageChanges>>unusedClasses
> 
> More general, regarding project structure. What is the best approach to port 
> a project that consists of multiple loosely coupled packages (not in a 
> bundle) some of which being optional? Like
> - Package Project Core
> - Package Project Core Tests (requires Core)
> - Package Project Extension A (requires Core)
> - Package Project Extension A Tests (requires Extension A)
> - Package Project Examples (requires Core and Extension A)
> 
> And how should I structure this on the Pharo site and in an iceberg 
> repository? One Git repository per package or all in the same? Is there a 
> guide to this or a specific Mooc lesson?
> 
> Kind regards,
> Steffen
> 
> 
> 
> Christian Haider schrieb am Donnerstag, 6. April 2023 18:16:00 (+02:00):
> 
> Yes, PDFtalk is the only example, because it was created to port that 
> library. Any other uses are welcome.
>  
> The project has been dormant for a year now because of other obligations, but 
> I hope to resume soon.
>  
> The documentation is, as Richard notes, in a suboptimal state. I think that 
> the information is still accurate.
> Any help with this would be welcome, for example by asking questions or by 
> criticizing concrete issues.
>  
> Christian
>  
> Von: Richard Sargent  
> Gesendet: Donnerstag, 6. April 2023 17:55
> An: Any question about pharo is welcome 
> Betreff: [Pharo-users] Re: Porting from VW to Pharo
>  
> The best(?) place to start is perhaps 
> https://wiki.pdftalk.de/doku.php?id=smalltalktransform 
> .
> The only examples are various ports of PDFtalk (from VisualWorks) to Pharo, 
> Squeak, GemStone, and VAST.
>  
> PDFtalk is quite complex and the porting rules are correspondingly complex. 
> The Transform documentation does leave something to be desired.
>  
> On Thu, Apr 6, 2023 at 8:22 AM Steffen Märcker  > wrote:
> Hi!
> 
> this topic pops up from time to time on the mailing list. I want to port a
> number of packages to Pharo. I remember "Shaping" asking this for porting
> PDFtalk.
> 
> 1. Is the workflow still up to date or is there a new way of doing things?
> 2. From what I understand so far, I just need the following package from
> Store:
> - Smalltalk Transform Project
> 3.  Is there a page that documents the process process in general?
> https://wiki.pdftalk.de/doku.php?id=setupvisualworks 
>  seems to be specific
> for PDFtalk like the thread on this list.
> 
> Kind regards,
> Steffen
> 
> -- 
> Gesendet mit Vivaldi Mail. Laden Sie Vivaldi kostenlos von vivaldi.com 
>  herunter.



[Pharo-users] Re: Troubleshooting ByteArray

2024-01-17 Thread Todd Blanchard via Pharo-users
Try this:

(PDFDocument new compression: false)add: (PDFPage new add: (PDFTextElement new 
text: 'Hello'; from: 10mm@10mm)); exportTo: 'test.pdf' asFileReference 
writeStream.

Compression causes your string to be gzip’d which is a ByteArray and not a 
String of any kind.

Unfortunately, the write stream is a ZnCharacterWriteStream which is expecting 
some kind of String.

This is going to take some untangling so just turn off compression (which is on 
by default) and it seems to work.  

> On Jan 17, 2024, at 4:43 PM, Richard O'Keefe  wrote:
> 
> So the method is expecting some kind of string, but it received a
> ByteArray, which is NOT any kind of string.
> What's in the ByteArray?  Where did it come from?  Why isn't it a string?
> 
> On Thu, 18 Jan 2024 at 04:34, sergio ruiz  wrote:
>> 
>> Hi, all.
>> 
>> I am working on creating a PDF with Artefact 
>> (https://github.com/pharo-contributions/Artefact) and am having an issue 
>> running the first example.
>> 
>> the Example looks like:
>> 
>> PDFDocument new add: (PDFPage new add: (PDFTextElement new text: 'Hello'; 
>> from: 10mm@10mm)); exportTo: 'test.pdf' asFileReference writeStream.
>> 
>> 
>> When running this, I get the error:
>> 
>> Instance of ByteArray did not understand #isByteString
>> 
>> indeed, ByteArray does not have a method called isByteString.
>> 
>> I have tried creating a method that returns either true or false (I tried 
>> them both), but I have not successfully built the PDF.
>> 
>> The method calling isByteString looks like:
>> 
>> 
>> ZnUTF8Encoder
>> 
>> next: count putAll: string startingAt: offset toStream: stream
>> "Write count characters from string starting at offset to stream."
>> "Overwritten for performance reasons - create a fast path for byte strings"
>> 
>> string isByteString
>> ifTrue: [ self next: count putAllByteString: string startingAt: offset 
>> toStream: stream ]
>> ifFalse: [ super next: count putAll: string startingAt: offset toStream: 
>> stream ]
>> 
>> I TOTALLY get this. This is a whole bunch of very specific questions. But my 
>> ultimate goal is to take a deep dive into stream processing to figure this 
>> out.
>> 
>> Thanks!
>> 
>> 
>> peace,
>> sergio
>> photographer, journalist, visionary
>> 
>> Public Key: 
>> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
>> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
>> @sergio_101@mastodon.social
>> https://sergio101.com
>> http://www.codeandmusic.com
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101
>> 


[Pharo-users] Re: Troubleshooting ByteArray

2024-01-17 Thread Todd Blanchard via Pharo-users
I guess I’ll point you to the issue too.

PDFStreamPrinter>printPDFDataStream: aPDFDataStream 
……
Line 13: (self compression) ifTrue: [ streamData := (self compressWithGZip: 
streamData) asByteArray  ].

> On Jan 17, 2024, at 5:13 PM, Todd Blanchard via Pharo-users 
>  wrote:
> 
> Try this:
> 
> (PDFDocument new compression: false)add: (PDFPage new add: (PDFTextElement 
> new text: 'Hello'; from: 10mm@10mm)); exportTo: 'test.pdf' asFileReference 
> writeStream.
> 
> Compression causes your string to be gzip’d which is a ByteArray and not a 
> String of any kind.
> 
> Unfortunately, the write stream is a ZnCharacterWriteStream which is 
> expecting some kind of String.
> 
> This is going to take some untangling so just turn off compression (which is 
> on by default) and it seems to work.  
> 
>> On Jan 17, 2024, at 4:43 PM, Richard O'Keefe  wrote:
>> 
>> So the method is expecting some kind of string, but it received a
>> ByteArray, which is NOT any kind of string.
>> What's in the ByteArray?  Where did it come from?  Why isn't it a string?
>> 
>> On Thu, 18 Jan 2024 at 04:34, sergio ruiz  wrote:
>>> 
>>> Hi, all.
>>> 
>>> I am working on creating a PDF with Artefact 
>>> (https://github.com/pharo-contributions/Artefact) and am having an issue 
>>> running the first example.
>>> 
>>> the Example looks like:
>>> 
>>> PDFDocument new add: (PDFPage new add: (PDFTextElement new text: 'Hello'; 
>>> from: 10mm@10mm)); exportTo: 'test.pdf' asFileReference writeStream.
>>> 
>>> 
>>> When running this, I get the error:
>>> 
>>> Instance of ByteArray did not understand #isByteString
>>> 
>>> indeed, ByteArray does not have a method called isByteString.
>>> 
>>> I have tried creating a method that returns either true or false (I tried 
>>> them both), but I have not successfully built the PDF.
>>> 
>>> The method calling isByteString looks like:
>>> 
>>> 
>>> ZnUTF8Encoder
>>> 
>>> next: count putAll: string startingAt: offset toStream: stream
>>> "Write count characters from string starting at offset to stream."
>>> "Overwritten for performance reasons - create a fast path for byte strings"
>>> 
>>> string isByteString
>>> ifTrue: [ self next: count putAllByteString: string startingAt: offset 
>>> toStream: stream ]
>>> ifFalse: [ super next: count putAll: string startingAt: offset toStream: 
>>> stream ]
>>> 
>>> I TOTALLY get this. This is a whole bunch of very specific questions. But 
>>> my ultimate goal is to take a deep dive into stream processing to figure 
>>> this out.
>>> 
>>> Thanks!
>>> 
>>> 
>>> peace,
>>> sergio
>>> photographer, journalist, visionary
>>> 
>>> Public Key: 
>>> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
>>> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
>>> @sergio_101@mastodon.social
>>> https://sergio101.com
>>> http://www.codeandmusic.com
>>> http://www.twitter.com/sergio_101
>>> http://www.facebook.com/sergio101
>>> 



[Pharo-users] Re: Backing up data

2024-01-18 Thread Todd Blanchard via Pharo-users
You want to look at Fuel, a serialization library.

Sent from my iPhone

> On Jan 17, 2024, at 9:49 PM, sergio ruiz  wrote:
> 
> I have been in the relational database world for decades. One of the things 
> that is super simple is backing up and restoring data.
> 
> Sometimes, it makes it makes sense to pull the production data into 
> development. In the case of a catastrophe, it’s super simple to restore data 
> from a backup.
> 
> I am thinking of backup strategies for my data once again, and am wondering 
> if things have changed since I was last using smalltalk.
> 
> I am thinking of the following:
> 
> STON
> I could dump all of my data into STON, but there is one slight twist. In this 
> project, it’s just making a list of movie listings. There are three basic 
> classes: Theater, Movie, Event. Each of these classes stores an 
> OrderedCollection of items of that type on a class variable, as I’ll need to 
> access each on their own.. so, if an event has a theater, I’ll need to access 
> Theaters on their own, and Movies on their own.
> 
> So, I would have to rebuild the list of Theaters from the Theaters in each 
> event. Otherwise, I would lose the link between the Theaters on the Theater 
> class variable and the Theater in the Event instance.
> 
> Am I thinking about this incorrectly?
> 
> Gemstones
> I am totally into the idea of using gemstones. Is there a backup and restore 
> for objects here? do the relationships remain?
> 
> Voyage
> This seems like a good solution, but I would rather stay in the smalltalk 
> object store.
> 
> Ideas?
> 
> Thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: 
> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> @sergio_101@mastodon.social
> https://sergio101.com
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>