Re: [Pharo-users] NewWave - WorkflowEngine

2019-04-17 Thread Tomaž Turk
This is excellent, thanks! For busness applications, getting the tools 
for process-driven development is essential. Some emails ago there was 
an announcement on Netstyle's engine available here 
https://github.com/Netstyle/Workflow.


Best wishes,
Tomaz

-- Original Message --
From: "Sebastijan Kaplar" 
To: "pharo-users@lists.pharo.org" 
Sent: 17. 04. 2019 15:03:23
Subject: [Pharo-users] NewWave - WorkflowEngine


Hello everyone,

we've been working on a workflow engine written in Pharo. You can check 
it out at: https://github.com/skaplar/NewWave
It is still in the early development and we discussed about making it 
public so everyone interested can join, take a look or provide any kind 
of feedback. I'm also at discord so you can contact me @skaplar.


Best regards,
Sebastijan Kaplar

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Tomaž Turk

In javascript I believe is

var f = function(x) { return Math.cos(x) + x; }
var df = function(x) { return f(x + 1e-8) - f(x) * 1e8; }

Best wishes,
Tomaz

-- Original Message --
From: "Atharva Khare" 
To: "Any question about pharo is welcome" 
Sent: 15.5.2019 15:26:11
Subject: Re: [Pharo-users] Bloc of code in tiers programming language


Hey,

I think in python, you use Lambda Expressions. Here is how I would do 
it in python3:

import math
f = lambda x: math.cos(x) + x
d_f = lambda x: (f(x + 1e-8) - f(x)) * 1e8



On Wed, May 15, 2019 at 6:33 PM Hilaire  wrote:

Hi,

We, Smalltalkers, use bloc of code as easily as we breathe air.

I am writing an article on Smalltalk programming for a French
mathematics teachers magazine.

To illustrate the simplicity of Smalltalk, I would like to compare how
the bloc of code 'f' and 'df' below will be implemented in Javascript
and Python:


f := [ :x | x cos + x ].
df := [ :x | (f value: x + 1e-8) - (f value: x) * 1e8].

Here f is a way to implement a function and df its derivate.

Do some of you knows how it will be written in Javascript and Python
with their own ad-hoc anonymous function?

Thanks

Hilaire

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




Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Tomaž Turk
Here's a nice description about JS: 
https://www.vinta.com.br/blog/2015/javascript-lambda-and-arrow-functions/


Best wishes,
Tomaz

-- Original Message --
From: "Hilaire" 
To: pharo-users@lists.pharo.org
Sent: 15.5.2019 18:54:58
Subject: Re: [Pharo-users] Bloc of code in tiers programming language


Hi,

It is an important restriction on Python. So Javasctip has several way
of doing lambda, correct?

Thanks

Hilaire

Le 15/05/2019 à 16:19, Richard O'Keefe a écrit :

 One point worth making is that Python lambdas are artificially restricted:
 the body of a Python lambda may only be a single expression, not a
 sequence
 of statements.  This restriction is for ideological reasons (the BDFL does
 not *want* you to do that) not for technical reasons.  Lisp and Algol 68
 were doing lambda expressions in the 60s.

 As well as function (x, y) { ... },
 modern Javascript has (x, y) => 
 with subtly different semantics.


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




[Pharo-users] ODBCDriver

2019-06-02 Thread Tomaž Turk

I just found this marvel: https://github.com/apiorno/ODBCDriver.

But when I try to

| con |
con := ODBCConnection dsn:'myDSN' user:'usr' password:'pwd'.

it responds with an error "Instance of ODBCLibrary class did not 
understand #sqlAllocEnv":



running on Win 10 and Pharo 7.0.3.  I'd appreciate any help.

Best wishes,
Tomaz



Re: [Pharo-users] ODBCDriver

2019-06-03 Thread Tomaž Turk

I see - thanks!

Best wishes,
Tomaz

-- Original Message --
From: "Julián Maestri" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 3.6.2019 16:03:25
Subject: Re: [Pharo-users] ODBCDriver


As far as I know, he just started porting it to Pharo 7.

On Sun, Jun 2, 2019, 13:51 Tomaž Turk  wrote:

I just found this marvel: https://github.com/apiorno/ODBCDriver.

But when I try to

| con |
con := ODBCConnection dsn:'myDSN' user:'usr' password:'pwd'.

it responds with an error "Instance of ODBCLibrary class did not 
understand #sqlAllocEnv":



running on Win 10 and Pharo 7.0.3.  I'd appreciate any help.

Best wishes,
Tomaz



[Pharo-users] Autocompletion

2019-06-14 Thread Tomaž Turk
I managed to find some time to progress with my Smalltalk / Pharo 
learning and am going through the Spec booklet. I noticed that 
autocompletion most of the times works excellent, sometimes it 
struggles.


For instance, if you prepare

CustomerSatisfaction >> initializeWidgets
buttonBad := self instantiate: ButtonPresenter.

and then start to write
buttonBad label: ...

in the same method, the #label: selector is found immediately.

However, if you say

CustomerSatisfaction >> initializeWidgets
buttonBad := self newButton.

where

ComposablePresenter >> newButton
^ self instantiate: ButtonPresenter

and inherited by CustomerSatisfaction, then the #label: selector is not 
found by autocompleter (in the menu of choices).


I'm just curious why is that so. For a novice, autocompleter is a life 
saver :-)


Best wishes,
Tomaz


[Pharo-users] uFFI ExternalAddress challenges

2019-09-10 Thread Tomaž Turk

Dear all,

I'm struggling with passing an ExternalAddress to a c function call with 
uFFI. Firstly, I get the ExternalAddress from this method:


myFFI>>create: aString
^ self
ffiCall: #(void * CreateObject (String aString) )

[in c:
void* CreateObject(char* szProgId)]

The method that uses the resulting ExternalAddress is defined as:

myFFI>>ask: anExternalAddress
^ self
ffiCall: #(void CallMethod (void * anExternalAddress) )

[in c:
void CallMethod(void* myObj)]

In playground I have

| w |
w := myFFI create: 'Word.Application'.
myFFI ask: w .

w gets a "nice", properly looking external address, however the last 
line crushes Pharo, its window gets closed.


I went through the uFFI book, however I cannot find the answer.

I'm on Windows 10 x64, Pharo 7.0.4 32-bit.

Best wishes,
Tomaz

Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-11 Thread Tomaž Turk
Hi, thanks for your quick reply. I found the culprint while writing this 
email :-)


Generally, what I'm trying to do is to make a very basic package to 
create and communicate with COM components on Windows, mostly as an 
exercise :-) I found this library: http://disphelper.sourceforge.net/ as 
a great start, so you don't have to fiddle with OLE/COM headaches.


The problematic function in C is defined as:

__declspec(dllexport) void CallMethod(void* myObj) {
...
}

It takes a pointer to a COM object, which was previously returned by

__declspec(dllexport) void* CreateObject(char* szProgId) {
...
   IDispatch * myObj = NULL
...
   return &myObj;
}

So, CreateObject() creates COM object and returns a pointer to it, 
CallMethod() takes this pointer and tries to communicate with it.


My error was in returning a pointer to a pointer ... since IDispatch * 
myObj = NULL was actually hidden in a macro and I missed its true 
definition, huh.


I'm running Pharo from PharoLauncher directly on Win10, without 
cygwin/mingw. For DLL I use Visual Studio 2019. I was not sure whether 
the pointer survives from one FFI call to another, or how Pharo 
loads/unloads DLLs - but it works as expected.


Thanks again and best wishes,
Tomaz

-- Original Message --
From: "Guillermo Polito" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 11. 09. 2019 10:29:34
Subject: Re: [Pharo-users] uFFI ExternalAddress challenges


Hi Thomas,

Can you share more about the definition of your CallMethod function in 
C?

From the uFFI point of view the binding looks ok…

How are you opening Pharo? From the command line or the pharo launcher?
Are you on cygwin/mingw? One other possibility (since you’re playing 
with C libraries) is to launch Pharo inside a gdb/lldb so you can check 
the reason behind the error when it crashes.


Keep us posted,
Guille


Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-11 Thread Tomaž Turk
>  Well, the pointer survives, the area of memory pointed by that 
pointer will be recycled with subsequent calls in general.


I'll pay special attention to that, but it's probably a matter of 
properly creating and releasing COM objects.



I have another question - in FFI call, how would one send a wide string, 
as in


void CallMethod(void * COMObj, wchar_t * MethodName)

I might have additional questions about UTF-8 and other code page 
nuances ...


Best wishes,
Tomaz

Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-11 Thread Tomaž Turk

Excellent, thanks!


Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-12 Thread Tomaž Turk

> We are interested in it :)
> If I recall well Pablo got one version somewhere.

Me too :-)  Unfortunately, I only have time for 'weekend' projects, and 
any help is appreciated :-)


Regarding the uFFI calls, is it possible to pass Win32WideString in a 
similar fashion as a String - or where to look to implement that?


Best wishes,
Tomaz

Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-12 Thread Tomaž Turk

> Maybe you should have a look at: https://github.com/tesonep/pharo-com

Thanks for the link, I'll check it out - that's probably the work Steph 
has mentioned.


Best wishes,
Tomaz

Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-13 Thread Tomaž Turk
OK, I'm proceeding with the library that I mentioned 
(http://disphelper.sourceforge.net/) and I got nice results. Pablo's 
package goes directly into the core of OLE/COM automation and it would 
be too hard to for me to study it and continue with it at this stage.


An example below loads Word for Windows, makes it visible, creates a new 
document and writes some text:


| w |
COMEngineAlpha initializeCOM .
w := COMEngineAlpha createObjectByName: 'Word.Application'.
COMEngineAlpha callObject: w setProperty: '.Visible = %b' withInteger: 
1.

COMEngineAlpha callObject: w method: '.Documents.Add'.
COMEngineAlpha callObject: w method: '.Selection.TypeText(%S)' 
withString: 'This is a message to appear in Word document.'.

COMEngineAlpha safeReleaseObject: w.
COMEngineAlpha uninitializeCOM.

However, I'd like to marshall a WideString through uFFI so that I won't 
loose UTF-8 support, of course the plain (String aString) signature 
doesn't work ("Cannot coerce arguments"). Is there anything I can do 
myself (i.e. without poking into Pharo virtual machine complexity) to 
solve this challenge?


Best wishes,
Tomaz

-- Original Message --
From: "Torsten Bergmann" 
To: tomaz.t...@ef.uni-lj.si; pharo-users@lists.pharo.org
Cc: "Any question about pharo is welcome" 
Sent: 12. 09. 2019 12:07:34
Subject: Aw: Re: [Pharo-users] uFFI ExternalAddress challenges

From your snippets it looks like you want to do COM Automation on 
Windows.


Maybe you should have a look at: https://github.com/tesonep/pharo-com

Bye
T.

Gesendet: Donnerstag, 12. September 2019 um 11:08 Uhr
Von: "Tomaž Turk" 
An: "Any question about pharo is welcome" 
Betreff: Re: [Pharo-users] uFFI ExternalAddress challenges
> We are interested in it
:)
> If I recall well Pablo got one version somewhere.

Me too
:-)
 Unfortunately, I only have time for 'weekend' projects, and any help 
is appreciated

:-)

Regarding the uFFI calls, is it possible to pass Win32WideString in a 
similar fashion as a String - or where to look to implement that?


Best wishes,
Tomaz

Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-17 Thread Tomaž Turk

OK, great, I'll try it out.

Thanks,
Tomaz

-- Original Message --
From: "Guillermo Polito" 
To: "Tomaž Turk" 
Sent: 17.9.2019 11:56:21
Subject: Re: [Pharo-users] uFFI ExternalAddress challenges

I don’t know if there is support for that (I don’t have the time to 
check it in detail now).

But, as a workaround, you may try

 - return a void*

  myFunction
^self ffiCall: #(void* myFunction ( void ) )

  - and then do the transformation yourself using 
Win32WideString>>#fromHandle:


Re: [Pharo-users] uFFI ExternalAddress challenges

2019-09-17 Thread Tomaž Turk

Hi,

> I don’t know if there is support for that (I don’t have the time to 
check it in detail now).

> But, as a workaround, you may try
>
 > - return a void*
 >
 >  myFunction
 >^self ffiCall: #(void* myFunction ( void ) )
>
>   - and then do the transformation yourself using 
Win32WideString>>#fromHandle:


I checked, Win32WideString class>>#asExternalTypeOn: is defined, and it 
creates FFIExternalObjectType(Win32WideString) nicely with


^self ffiCall: #(Win32WideString myFunction ( void ) )

I also tried the other approach:

^self ffiCall: #(void* myFunction ( void ) )

and the transformation Win32WideString>>#fromHandle

Interestingly, in both cases I get


however I cannot pinpoint the reason for this.

> What you are discovering here would be very useful as a 
section/chapter in

> the uFFI booklet.

Thanks for the invitation, yes, it would be nice to participate, I'll 
try to prepare something when I get to the bottom of the challenge :-)


Thanks and best wishes,
Tomaz



Re: [Pharo-users] Code of Conduct

2019-09-18 Thread Tomaž Turk

> One doesn't need a Code of Conduct. It is ridiculous.
>
> Civilized and respectful non discriminating behaviour should
> be implicit in everyone of us!
>
> If one insists in having a code of conduct than this should cover it 
all:

> "Be Nice, Social And Respectful To Each Living Being."

+100

Best wishes,
Tomaz

Re: [Pharo-users] pharo for ios and android

2019-09-21 Thread Tomaž Turk
I've found U8 for the android: http://alereimondo.no-ip.org/U8/313 .

Best wishes
Tomaž

On Sat, 21 Sep 2019, 13:32 Stephan Eggermont,  wrote:

> Steve Quezadas  wrote:
> > I am going to the portland meetup this october and I noticed that one of
> > the items listed is "Smalltalk on iOS and Android" which intrigues me. Is
> > some Guilfoyle-type here writing a VM for these platforms? I was joking
> > with a friend that we should write a vm for ios using the "smalltalk blue
> > book" and it would be fun to learn how vm's work by trying to write
> > sometihng for ios. Is someone already working on this?
>
> Craig Latta runs Smalltalk images on the javascript vm written by Bert
> Freudenberg. Search for Caffeine
>
> Stephan
>
>
>
>


Re: [Pharo-users] FFIExternalType hooks; naming convention

2019-09-21 Thread Tomaž Turk

Hi,

> Yes, but in general you do not need to implement your type, you can 
derive what you need from the ones existing.

> Why you need to do it?

I'm just curious, I'm sorry :-) Depending on the platform, there is a 
huge number of various types - just on Windows there are wchar_t, 
char16_t and char32_t implementations of "wide char", at least that I 
know of, and one asks himself when and whether to go all the way "down".


> So readStrring is equivalent to fromCString, but I can imagine a 
better future where we have just one and it will > be readString :P


:-)

Thanks!

Best wishes,
Tomaz

-- Original Message --
From: "Esteban Lorenzano" 
To: "Any question about pharo is welcome" 
Sent: 21. 09. 2019 17:28:34
Subject: Re: [Pharo-users] FFIExternalType hooks; naming convention


HI,


 On 21 Sep 2019, at 13:18, eftomi  wrote:

 HI,

 I have a couple of questions regarding FFI:

 - If you want to create a new FFIExternalType subclass, which are the
 necessary hooks that should be implemented - like #externalType,
 #externalTypeSize … on the class side and #basicHandle:at:,
 #basicHandle:at:put:, #stackValueParameterClass, etc. on the instance side?


Yes, but in general you do not need to implement your type, you can derive what 
you need from the ones existing.
Why you need to do it?



 - Is there anything else that should be done besides hooks - for instance
 another "entries" into FFIConstants class>>#initializeTypeConstants or even
 ExternalType>>#initializeAtomicTypes ?


No.



 - About naming standards: the ExternalData class has some methods that
 "grab" strings from the heap, like ExternalData>>#fromCString and
 ExternalData>>#readStringUTF8 - these two methods do the heavy work, however
 the method ExternalData>>#readString more or less just refers to
 ExternalData>>#fromCString. Is there any difference between "from..." and
 "read…"?


At the begining, there was fromCString.
Then someone else added readStringUTF8.
Then I added readString because I like coherence :)

So readStrring is equivalent to fromCString, but I can imagine a better future 
where we have just one and it will be readString :P

Esteban



 Thanks!

 Best wishes,
 Tomaz



 --
 Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html





Re: [Pharo-users] FFI beginner question

2019-09-22 Thread Tomaž Turk

Hi,

The book draft is here: 
https://files.pharo.org/books-pdfs/booklet-uFFI/UFFIDRAFT.pdf.


Best wishes,
Tomaz




Any plans to draft a Pharo booklet on this subject?

-Ted


Re: [Pharo-users] [ANN] ReStore for Pharo - object<>relational database framework

2019-12-08 Thread Tomaž Turk

Hi,

ReStore looks quite sleek, thank you for your nice contribution! I 
wonder if we could "hook it up" with PharoADO. When I find some time, I 
can look into the approach you took in SSW ReStore P3 and SSW ReStore 
UDBC SQLite. For Glorp, you basically just need to send an SQL query 
that Glorp prepares directly to DB and pack the received resultset into 
an array structure.


Best wishes,
Tomaz


-- Original Message --
From: "John Aspinall" 
To: pharo-users@lists.pharo.org
Sent: 8.12.2019 14:09:29
Subject: [Pharo-users] [ANN] ReStore for Pharo - object<>relational 
database framework



Hello,

At ESUG 2018 I gave a presentation on some aspects of ReStore, my 
object<>relational database framework for Dolphin Smalltalk. Afterwards 
a number of people asked if ReStore was available for Pharo, the answer 
at the time unfortunately being “no".


A year later I found myself with some spare time and decided to look at 
porting ReStore to Pharo (mainly to give myself some experience with 
Pharo). I’m pleased to say ReStore is now available for Pharo and can 
be found at my GitHub account:


https://github.com/rko281/ReStoreForPharo

Initially ReStore supports SQLite via UDBC and PostgreSQL via P3; kudos 
and thanks to the authors of these packages. Documentation largely 
remains on the “to do” list but the ReadMe gives a flavour of what 
ReStore is and what it can do via a few simple examples. Please feel 
free to post any questions here and I’ll do my best to answer them.


I hope some of you find ReStore useful!

John Aspinall

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

2020-01-22 Thread Tomaž Turk
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.


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

2020-01-24 Thread Tomaž Turk



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




This is great news about ActiveRecord!

ADO is, unfortunately, a Windows library, so PharoADO is limited to 
Windows. Maybe as a next step we should focus into Garage and the 
addition of SQL Server and Oracle support. If I only had time ...


Stéphane, thanks for the support.

Best wishes,
Tomaz







Re: [Pharo-users] Willow documentation

2020-01-24 Thread Tomaž Turk
Dear Maximiliano, thanks for checking, I'll try once again, step by 
step.


Best wishes,
Tomaz

-- Original Message --
From: "Maximiliano Tabacman" 
To: "Any question about pharo is welcome" ; 
"Tomaž Turk" 

Sent: 24.1.2020 13:53:42
Subject: Re: [Pharo-users] Willow documentation


Hi there.
I just tried reproducing all the steps in the tutorials, then adding 
the onTrigger for the button, exactly as you wrote in your mail, and it 
works for me.
I don't get any errors in the console. I implemented it in a clean 
installation of Pharo with the latest release of Willow-Playground, on 
Windows 10, rendering with Opera.


Could you check if those same steps give you the result you mention?

Thanks for your interest in Willow!



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

2020-03-11 Thread Tomaž Turk

Hi Esteban,

Thanks for reporting this issue. I haven't made any "stress" tests yet 
for ADOClient. Could you please try to use ADORecordset as described in 
the readme? There you have a direct access to each record at a time, and 
then you can create your own "loop" to process the query result. In this 
way you can avoid the loop in ADOClient>>query: method.


Best wishes,
Tomaz

-- Original Message --
From: "Esteban Maringolo" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 11. 03. 2020 18:25:51
Subject: Re: [Pharo-users] Generate class hierarchy from JSON Schema

As an additional reference, I attach the profile tally  for the query 
I'm mentioning.


The culprit seems to be the calculation of the ADOField properties that 
might be calculated on every call.


Regards,

Esteban A. Maringolo


On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
 wrote:

Hi,

To feed a Pharo app I need to read from an old MDB file, via ODBC.

So I tested PharoADO and, after adding a missing Variant Type [1], I 
got my query working (at least read only).


However the time of ADOClient to return a query with 10K rows of 5 
columns each is extremely slow (+65000ms) compared, e.g., with Dolphin 
Smalltalk via ODBC (62ms).


The time of the execute call to return is instantaneous, so I think 
the issue might be in the creation of the result set.


Is this a known issue?

Should I check something else?

Thanks in advance,


[1]  https://github.com/tesonep/pharo-com/pull/10
Esteban A. Maringolo


On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk  
wrote:



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




This is great news about ActiveRecord!

ADO is, unfortunately, a Windows library, so PharoADO is limited to 
Windows. Maybe as a next step we should focus into Garage and the 
addition of SQL Server and Oracle support. If I only had time ...


Stéphane, thanks for the support.

Best wishes,
Tomaz







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

2020-03-11 Thread Tomaž Turk
Thanks for the PR! Maybe something can be done also on the PharoCOM 
level within calculateMethods and calculateProperties.


I didn't experience any crashes, although I developed PharoADO on 32bits 
in Pharo 7 and Pablo upgraded PharoCOM to 64bit after Pharo 8 was 
released. Besides, I haven't managed yet to re-check if all the COM 
instances are properly released after usage.


Best wishes
Tomaz

-- Original Message --
From: "Esteban Maringolo" 
To: "Tomaž Turk" 
Cc: "Any question about pharo is welcome" 
Sent: 11. 03. 2020 20:35:10
Subject: Re: Re[2]: [Pharo-users] Generate class hierarchy from JSON 
Schema



Follow up.

Seems that playing with these COM/ADO objects in the playground messes 
with the VM; so I'm getting weird image crashes, where the image closes 
without any notice.


Do you experience the same?


Esteban A. Maringolo


On Wed, Mar 11, 2020 at 4:11 PM Esteban Maringolo 
 wrote:
I did a small change in ADORecordset to have the fields as an instVar 
and also in ADOFields to have each ADOField in an `items` instVar.
It is still slow compared to an ODBC API, but I got a 20x speedup 
(~1000ms), that is spent mostly on the actual call to the dispatcher 
to fetch each cell value.


I look forward for an ODBC API, but at least to read any other data 
source, this seems to work pretty well.


I already sent a pull-request.

Esteban A. Maringolo


On Wed, Mar 11, 2020 at 3:31 PM Esteban Maringolo 
 wrote:


The profiling using the recordset was even worst. I changed the 
iteration [1] to add everything to a collection, but most of the time 
is spent in #calculateMethods and #calculateProperties. Which is 
performed everytime for each ADOField.


I wouldn't consider this a stress test, but maybe the methods and 
properties should be cached, or a different class of dispatcher 
should be used where the methods and properties are defined ahead of 
time instead of being discovered when first invoked.


Regards,


[1] "Modified code"
rst := ADORecordset createInstance .
rst open: 'SELECT * FROM PLAYER' activeConnection: conn cursorType: 2 
lockType: 3 options: -1.

results := OrderedCollection new.
[rst eof] whileFalse: [
  | row |
  row := Array new: rst fields count.
  1 to: row size do: [ :idx | row at: idx put: (rst fields item: idx) 
value ].

  results add: row.
  rst moveNext
 ].



Esteban A. Maringolo


On Wed, Mar 11, 2020 at 3:02 PM Tomaž Turk  
wrote:

Hi Esteban,

Thanks for reporting this issue. I haven't made any "stress" tests 
yet for ADOClient. Could you please try to use ADORecordset as 
described in the readme? There you have a direct access to each 
record at a time, and then you can create your own "loop" to process 
the query result. In this way you can avoid the loop in 
ADOClient>>query: method.


Best wishes,
Tomaz

-- Original Message --
From: "Esteban Maringolo" 
To: "Tomaž Turk" ; "Any question about 
pharo is welcome" 

Sent: 11. 03. 2020 18:25:51
Subject: Re: [Pharo-users] Generate class hierarchy from JSON Schema

As an additional reference, I attach the profile tally  for the 
query I'm mentioning.


The culprit seems to be the calculation of the ADOField properties 
that might be calculated on every call.


Regards,

Esteban A. Maringolo


On Wed, Mar 11, 2020 at 2:13 PM Esteban Maringolo 
 wrote:

Hi,

To feed a Pharo app I need to read from an old MDB file, via ODBC.

So I tested PharoADO and, after adding a missing Variant Type [1], 
I got my query working (at least read only).


However the time of ADOClient to return a query with 10K rows of 5 
columns each is extremely slow (+65000ms) compared, e.g., with 
Dolphin Smalltalk via ODBC (62ms).


The time of the execute call to return is instantaneous, so I 
think the issue might be in the creation of the result set.


Is this a known issue?

Should I check something else?

Thanks in advance,


[1]  https://github.com/tesonep/pharo-com/pull/10
Esteban A. Maringolo


On Fri, Jan 24, 2020 at 5:59 AM Tomaž Turk 
 wrote:



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 vary

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-06 Thread Tomaž Turk

Hello Peter,

If you look at the code in the Word test you will notice that the test 
firstly

- creates a new Word instance,
- makes it visible to the end user,
- then adds an empty document to the documents collection with the text 
"Hello from Pharo!"

- then it tests whether it can receive the same text back from Word.

After that, the test
- adds a new empty document to the documents collection with the text 
"Hello from Pharo! Some additional text. ", this time as an array of two 
texts
- it activates this second document (this imitates the end user's window 
activation on the desktop)

- then it tests whether it can receive the same text back from Word.

If you look at the Task Manager, you'll notice that you have one Word 
process with two open documents:



Namely, for each document Word creates a new, separate window - the 
documents are not displayed in one "Word application window", but 
separately - that's a normal behavior for some versions of MS Office, 
and it happens also if you open several documents directly in Word. So, 
there is just one Word instance.


'finalize' clears the references to the Word instance, it doesn't close 
the program by itself. If you want to do that, you can send Quit message 
to Word before you destroy the reference 
(https://docs.microsoft.com/en-us/office/vba/api/word.application.quit(method)).


Similar behaviour is with Outlook, here's one example: 
https://www.excelcommand.com/excel-help/excel-how-to.php?i=124116


The calling among COM objects is asynchronous, and it's usually wise to 
wrap it in error handling structures.


Please tell us how it goes.

Best wishes,
Tomaz








-- Original Message --
From: "PBKResearch" 
To: "Any question about pharo is welcome" 
Sent: 5.4.2020 23:18:02
Subject: Re: [Pharo-users] Automation of MS Office from Pharo


Pablo - a final update before I close for the night. The Word test on the pharo 
8 version comes up green. The strange error message is nowhere to be seen in 
any Pharo 8 runs. The result is not what I expected; I finish up with two Word 
documents open, one with the first message, the other with the two messages. I 
thought the 'finalize' command would close it down.

Anyway, it looks as if I need to switch to P8 to use Pharo-Com. I shall 
continue testing tomorrow on P8.

Sorry for the late-night hassle.

Peter


Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread Tomaž Turk

Dear Peter,

I'm glad that you find the package useful! Can you please explain a 
little bit more about your code, because it's not obvious from your 
description at which stage the problem occurs. Could you trace it with 
the debugger, and/or possibly post here the piece of code that fails?


Thanks and best wishes,
Tomaz

-- Original Message --
From: "PBKResearch" 
To: "Any question about pharo is welcome" 
Sent: 6. 04. 2020 19:15:16
Subject: Re: [Pharo-users] Automation of MS Office from Pharo


Hello Pablo (and Tomaž)



You asked for feedback; after a day of experiments, I have good news 
and bad news.




The good news is that I have been able to navigate through my Outlook 
Data File, find my way to an e-mail of interest and examine the fields 
of interest. This means I am 90% of the way to my objective. All I want 
is to get the HTML code from the message body and pass it to 
XMLHTMLParser for further analysis. I found it not too difficult to 
work this out; the fact that a COMDispatchInstance can display all its 
internals in a playground page meant that I could work it out 
interactively as a playground exercise. I am still discovering things 
about the interface; I have only just found out that I can select an 
item from a list by quoting its name as an argument, rather than its 
number in the list. I am sure my clumsy code can be tidied up still.




I can get to the 100% point in the job by exporting the contents of the 
e-mail to disk in HTML format, using the SaveAs procedure of the 
MailItem object. I can then read it back from disk into the parser. But 
this seems a bit clunky. The content of an HTML mail item is available 
in the HTMLBody property of the MailItem, so I should be able to pass 
it programmatically to the parser without going near the disk. This is 
where I run into trouble.




In most of the cases I tried, this worked fine; I could display the 
HTML body text as a WideString in the playground, assign it to a 
variable and do whatever I wanted. However, for just one e-mail I 
tried, as soon as I selected ‘Do it and go’ in the playground, a 
message came up that the VM had crashed; the application closed, 
leaving only a crash dump. I cannot find anything unusual about the 
message that failed in this way, except that when I save it, it 
produces a larger file than any of the others (just over 1MB, against 
up to 300KB for the ones that worked). Could there be a limit on the 
size of some internal buffer?




I thought it worth while mentioning this now, because crashing the VM 
is generally undesirable. I can solve my problems safely using the 
SaveAs route, so it’s not a problem for me.




Hope this helps; if you want more details, let me know. Overall I am 
very happy with this library.




Peter Kenny



From: Pharo-users  On Behalf Of 
teso...@gmail.com

Sent: 06 April 2020 11:24
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo



Hi Peter,

First, thanks to try to use Pharo-COM, that is great, I love to 
have users for it and find it is useful.


Secondly, the Pharo 7 problem is an error I have introduced. It is 
clear that some changes I have done to support the new version of UFFI 
(the framework in Pharo to handle FFI calls) have broken the Pharo 7 
version, so I will fix it to maintain compatibility.




It is great that you were able to make it work!



Cheers,





On Mon, Apr 6, 2020 at 12:18 PM PBKResearch  
wrote:



Hello Tomaž



Many thanks for your patient explanation. I should have been able to 
work out for myself how the Word test works, and indeed I realized 
some of it when I came to shut down the Word instance and its two 
documents. But it was late at night, and I should have packed up 
before then.




My last test last night showed that basically I have cracked it for my 
job of automating Outlook. I have been able to connect to my running 
instance of Outlook, open my application and interrogate the names of 
my top-level folders. From now on it should be just a matter of 
understanding the MS documentation of the Outlook model.




However, all this is with Pharo-Com installed in a new Pharo 8 image. 
I have no idea what went wrong with my first effort on Pharo 7. But I 
shan’t worry about that – I shall gradually move all my bits and 
pieces to P8. I shall try to work it out myself from here, but I shall 
come back if I get stuck.




Thanks again



Peter Kenny



From: Pharo-users  On Behalf Of 
Tomaž Turk

Sent: 06 April 2020 08:04
To: Any question about pharo is welcome 
Subject: Re: [Pharo-users] Automation of MS Office from Pharo



Hello Peter,



If you look at the code in the Word test you will notice that the test 
firstly


- creates a new Word instance,

- makes it visible to the end user,

- then adds an empty document to the documents collection with the 
text "Hello from Pharo!"


- then it tests whether it can receive the

Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread Tomaž Turk
Thanks, Peter. I checked out the Outlook COM interface, noticed that the 
MailItem.HTMLBody property returns a string, which is implemented as 
BSTR in COM (more on this here: 
https://bytecomb.com/vba-internals-string-variables-and-pointers-in-depth/).


I tested the maximum lengths of strings with Word and my images crash 
under these circumstances:
- Pharo 8.0 64 bit when returning ByteString is longer than 16.379 
characters
- Pharo 8.0 32 bit when returning ByteString is longer than 260.080 
characters (approximately).


64 bit image crashes without any warning, however the 32 bit one crashes 
with



I presume this is the same behaviour as you report, Peter. I'm attaching 
the crash.dmp from 32 bit image. I believe that the crash happens when 
calling COMDispatchInstance>>propertyNamed: with the lengthy string to 
be returned.


Pablo, I hope you have some time to check this, my knowledge ends 
somewhere here ... :-|


Thanks and best wishes,
Tomaz




<>


Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-07 Thread Tomaž Turk
Thanks, Stephane, for the acknowledgement. Peter, as I understand, the 
limits in COM BSTR data type are defined by the header's length prefix 
(which is 4 bytes) and software implementatios - for instance, string 
data type in Visual Basic for Applications is described as "a 
variable-length string can contain up to approximately 2 billion (2^31) 
characters", which is in line with the BSTR header. I'm not sure if the 
OS architecture (32 and 64 bit) influences these values.


Best wishes,
Tomaz



Re: [Pharo-users] Automation of MS Office from Pharo

2020-04-08 Thread Tomaž Turk
Thanks Pablo for your quick response! I tested 32 and 64 bit images with 
>1.000.000 strings and it works just fine.


Best wishes,
Tomaz


-- Original Message --
From: "teso...@gmail.com" 
To: "Any question about pharo is welcome" 
Cc: "Tomaž Turk" 
Sent: 8.4.2020 9:54:35
Subject: Re: [Pharo-users] Automation of MS Office from Pharo


Hi!!!
  This was a great report. I have submitted a fix in the master of Pharo-COM.

Basically the problem was to free twice the BSTR in the Variant.
It was being free in the access to the value and in the free of the struct.
Why it works with other BSTR when they are smaller, I cannot know.

I have added another smoke test using Word

Can you try the fix?

Thanks, both for helping me with the reports, they were great.

On Wed, Apr 8, 2020 at 9:37 AM PBKResearch  wrote:


 Tomaz, that was my understanding from the VBA piece you cited yesterday. So 
presumably it must be something in Pharo-Com which imposes the limits we have 
seen. I am OK at the moment, because all this work is just an exploration of 
possibilities; I can wait until you and Pablo have sorted it out. But from the 
results of your tests, a maximum of 16K in 64-bit systems must be a serious 
limitation, so something in Pharo-Com needs fixing.



 For my immediate work, I shall continue exporting the full text using 
MailItem.SaveAs; my further processing uses files I have exported manually in 
this way, so it’s not a problem.



 Thanks



 Peter Kenny



 From: Pharo-users  On Behalf Of Tomaž Turk
 Sent: 08 April 2020 07:58
 To: Any question about pharo is welcome 
 Subject: Re: [Pharo-users] Automation of MS Office from Pharo



 Thanks, Stephane, for the acknowledgement. Peter, as I understand, the limits in COM 
BSTR data type are defined by the header's length prefix (which is 4 bytes) and software 
implementatios - for instance, string data type in Visual Basic for Applications is 
described as "a variable-length string can contain up to approximately 2 billion 
(2^31) characters", which is in line with the BSTR header. I'm not sure if the OS 
architecture (32 and 64 bit) influences these values.



 Best wishes,

 Tomaz








--
Pablo Tesone.
teso...@gmail.com





[Pharo-users] Thinking aloud about project at hand

2020-04-09 Thread Tomaž Turk

Dear all,

I'm thinking about implementing a software solution in Pharo (as one of 
the candidate environments), it's a project that I'm dealing with 
professionally. The goal is to develop a financial planning/simulation 
application on the country level, which is at present developed as a set 
of interrelated Excel spreadsheets. The requirement is that the solution 
should be more "manageable", resilient and straightforward than Excel 
permits, that it should present a workflow to the user - i.e. , that the 
tasks the user should do are suggested through the GUI.


The majority of the data is in a form of a time series (for instance: 
GDP for a series of years). There are many variables in the model which 
shoud be calculated from other variables, year by year. There are also 
lagged variables (the value for the current year depends from the value 
of previous year), and running averages. There are also some variables 
which are not time series (parameters). As a part of GUI, there is a 
need to present the results as diagrams, too (scatterplots, line 
charts), otherwise tables are the output.


I found Pharo to be a very elegant language and environment, with 
version 8.0 it became pretty stable, however I don't have any 
experiences in building software solutions of this type in Smalltalk. In 
other words, I'd like to be more confident in setting the architecture, 
both in the sense of the model content (variables interrelation) and the 
architecture of classes. Besides, for the calculated variables I'd like 
to have a relatively simple syntax to define them (like 'GDPpC <- GDP / 
Population').


My thoughts and questions:
- for easier maintenance I'd like to separate the data from the code - 
so the question is what would be the best way to implement persistence 
(another Pharo image  - with what?, some relational database, XML/JSON, 
flat files ...)
- I wonder what would be the best "architecture" of classes - so, we 
have a lot of aggregate variables like GDP and population, which can be 
grouped at least according to the stage in the planning workflow. There 
are also resulting (calculated) variables (e.g. GDP per capita). On the 
other hand, since this is a planning software, it's a kind of 
simulation, where we have a "data warehouse", experiments and results

- As a core packages I would use Spec2, Roassal, and PolyMath.

I'm just thinking aloud, and would greatly appreciate any thoughts from 
experienced Pharoers  :-)


Best wishes,
Tomaz

Re: [Pharo-users] Thinking aloud about project at hand

2020-04-11 Thread Tomaž Turk
Many thanks guys, you all gave me quite interesting suggestions. I'll 
explore most of them regarding the stability and "compactness" of the 
final solution as regards the deployment.


I have one really silly question - when you create an app (with Spec2), 
how can you made it start automatically when the image starts, and avoid 
displaying the World? I browsed through many of Pharo books and 
documentation recently and cannot remember if this is mentioned 
anywhere.


Best wishes,
Tomaz

Re: [Pharo-users] Thinking aloud about project at hand

2020-04-14 Thread Tomaž Turk
> Take a look at the DrGeo example app, it shows how to do that  (link 
bellow).


> you hook in a startUpList: and shutDownList: of your main class.

Great, I'll check it out.

> You can start with a simple Pharo image (look at the blog of Leon 
Ramon on activeRecord in Pharo).

> So my suggestion is the following
> - start with what makes you the fastest and focus on your domain.

For persistence I'll start with the minimal effort - Fuel. At first 
glance it looks that it has everything that I need.


Thanks for all the tips, I'll report my experiences as I progress.

Best wishes,
Tomaz



Re: [Pharo-users] Thinking aloud about project at hand

2020-04-14 Thread Tomaž Turk
> If you need to hook startup/shutdown actions, you can read this 
documentation:
> 
https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/SessionsManagement.md


Thanks! - How could I miss this document ...

Best wishes,
Tomaz

Re: [Pharo-users] Thinking aloud about project at hand

2020-04-14 Thread Tomaž Turk
> Pay attention that Fuel can serialize a lot :) (including classes and 
more than you may not want) and it is binary.

> So to start easy I usually use STON because I can see what I saved.

OK - I counted on graph customization, but you are right. I'll see 
what's best.


Best wishes,
Tomaz

Re: [Pharo-users] issues in setting up a new project on Github/Iceberg

2020-04-17 Thread Tomaž Turk
I have the same experience.

Best wishes
Tomaž


Re: [Pharo-users] [ANN] Pharo Launcher 2.0 released!

2020-04-19 Thread Tomaž Turk
Congratulations on the new launcher! The experience is far better than 
with the previous version, nice work!


I noticed something peculiar - I have two computers and am syncing the 
folders structure between them. If I create a new Pharo 8.0 image, work 
on it on this machine and finish, then it gets copied to the second 
machine. PharoLouncher on this second machine sees the image, however 
nothing happens if I lounch it. This happens also vice-versa with a new 
image on the second machine and its copy on the first.


Both machines share the locations of
- template source files
- image inicialization scripts
- images
- VMs

This happens on Windows 10. This kind of setup worked with previous 
version of launcher.


Best wishes,
Tomaz

Re: [Pharo-users] [ANN] Pharo Launcher 2.0 released!

2020-04-20 Thread Tomaž Turk

Hi Christophe,

> If it worked with previous version, there is no reason it should not 
work with the current Pharo Launcher version.


I think I found the reason - new meta-inf.ston files include absolute 
paths to image and VM, and those are different on my machines. I'm 
putting them on the same path.


Thanks and best wishes,
Tomaz


Re: [Pharo-users] [ANN] Pharo Launcher 2.0 released!

2020-04-20 Thread Tomaž Turk
> I think I found the reason - new meta-inf.ston files include absolute 
paths to image and VM, and those are different on my machines. I'm 
putting them on the same path.


Unfortunately, having images on the same path doesn't help. It helps if 
you delete meta-inf file after copying. I opened the issue.


Many thanks and best wishes,
Tomaz

[Pharo-users] Spec2 SpStringTableColumn

2020-05-02 Thread Tomaž Turk

Dear all,

I'm exploring the new Spec2, looking for possibilities to create an 
'editable grid'. Tables are very close to this concept, and I wonder 
what exactly is SpStringTableColumn>>#beEditable supposed to do - I 
cannot find any references to variable 'editable', so it looks like it's 
not implemented yet?


Could editable grid be mimicked somehow with SpCompositeTableColumn?

Besides this, I wonder whether Spec2 could control keyboard events?

Many thanks and best wishes,
Tomaz

[Pharo-users] Spec2 Pharo8/9; icons

2020-05-17 Thread Tomaž Turk

Dear all,

What would be the best Pharo version to start building a Spec2 GUI for 
an app - Pharo 9 which is under development but with novelties in Spec2, 
or Pharo 8?


What's the best (easiest ...) way to import new icons into Smalltalk ui 
icons? Is there any special bitmap format to be considered?


Thanks and best wishes,
Tomaz

[Pharo-users] Willow affordance setValueTo etc

2020-05-17 Thread Tomaž Turk

Dear all,

I'm playing with Willow and found it very useful for setting the web 
design, however, I have some challenges with understanding the 
interaction affordances. They are nicely described in the documentation 
- although somewhat cryptic. For instance, I cannot successfully set up 
the #setValueTo:thenTriggerChangeOf: "directly" on the TextField like in 
this example, where I'd like to set the text of aText to 'Some other 
text' after the button aButton is clicked:


renderContentOn: html
| aText aButton |
aText := self componentSupplier
singleLineTextFieldApplying: [ :theField | ].

aText changeContentsTo: 'Some text'.

aButton := self componentSupplier
asynchronicButtonLabeled: 'Click me' applying: [ :theButton |  
].


aButton onTrigger setValueTo: 'Some other text' thenTriggerChangeOf: 
aText.


The web browser reports 500 Internal server error with The identifier 
was never assigned.


It is mentioned in the docs that IdentifiedWebView should be used to 
guarantee the id, however I cannot get it to work.


As I understand, #serialize; #setValueTo: can be used instead of 
#serialize; #evaluate: ; #render affordances to get the data from the 
browser, inspect it and sending it back to the browser - or should 
#determineBehaviorByEvaluating always be used for that purpose?


Thanks,
Tomaz

Re: [Pharo-users] Willow affordance setValueTo etc

2020-05-17 Thread Tomaž Turk

aText identifyIn: html;
  changeContentsTo: 'Some text'.



Great, it works, thanks.

Best wishes,
Tomaz




Re: [Pharo-users] Spec2 Pharo8/9; icons

2020-05-20 Thread Tomaž Turk

Thanks, Stephane, I'll switch to P9.

> png is better and there is a library to manage icons
> I do not have the name but you can load icons.
> But look around.

For icons I found the necessary code in ThemeIcons>>loadIconsFromUrl. 
Here's a simplistic approach to load icons from PNGs in a local ZIP 
archive, if somebody needs it:


| themeIcons newIcons |

newIcons := IdentityDictionary new.
themeIcons := ThemeIcons new.

((FileSystem zip: 'C:\icons\a.zip' asFileReference)
open workingDirectory allChildrenMatching: '*.png') do:
[ :each | newIcons
at: each base asSymbol
put: (themeIcons readPNGFrom: each )].
newIcons.

Best wishes,
Tomaz

Re: [Pharo-users] Spec2 Pharo8/9; icons

2020-05-27 Thread Tomaž Turk

I'm sorry, the raw tag at forum.world.st ate the code :-)

| newIcons |

newIcons := IdentityDictionary new.
((FileSystem zip: 'C:\icons\a.zip' asFileReference)
open workingDirectory allChildrenMatching: '*.png') do:
[ :each | newIcons
at: each base asSymbol
put: (ImageForm open: each )].

SpToolBarButton new
   label: 'Go!';
   icon: (newIcons at: #iconFileName).


Tomaz

Re: [Pharo-users] Spec2 Pharo8/9; icons

2020-05-28 Thread Tomaž Turk
> In recent spec2 (head) we added support so that an application can 
have an iconProvider so it means that you can
> using the ThemeIcons load and manage a set of icons for your 
application.


This is great, thanks!

Best wishes
Tomaz


Re: [Pharo-users] Class hierarchy diagram

2020-05-31 Thread Tomaž Turk
With Roassal3 you get a diagram in the browser like this, on the tab 
"UML-Class" and "UML-Package".



Best wishes,
Tomaz

[Pharo-users] Willow selections

2020-06-08 Thread Tomaž Turk

Hi,

when using selection components in Willow (like single and multiple 
selection lists), should #currentSelection and #currentSelectionIfNone: 
be called only within their own affordances? If I use these messages 
from onTrigger evaluate: of other components (e. g. buttons), then I 
don't get any selected object back.


Thanks and best wishes,
Tomaz



Re: [Pharo-users] Willow selections

2020-06-08 Thread Tomaž Turk

Dear Gabriel,

thanks for the answer, it helps tremendously.

Best wishes,
Tomaž

[Pharo-users] Willow-Seaside serving static files

2020-06-14 Thread Tomaž Turk
Hi, I added an image to a subclass of WAFileLibrary to serve it as a 
static file from within Pharo. Everything seems fine, except that the 
/files URL is not accessible:


Error: you are forbidden to access "/files".

and source view displays

/files/EMStaticFiles/window.png not found

if I click on image's URL.

I loaded Seaside as a Willow's dependency.

Best wishes,
Tomaz





Re: [Pharo-users] Willow-Seaside serving static files

2020-06-17 Thread Tomaž Turk
Thanks, Esteban. I checked the url of the image 
(http://localhost:8080/files/EMStaticFiles/window.png) and it is proper, 
however it is not accessible (I get /files/EMStaticFiles/window.png not 
found), so I believe that besides forbidden listings the access to files 
is also forbidden. I'm looking into WAFileHandler class however cannot 
find a way to enable serving of static files.


Best wishes,
Tomaz



-- Original Message --
From: "Esteban Maringolo" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 14.6.2020 15:33:23
Subject: Re: [Pharo-users] Willow-Seaside serving static files

The handler at /files (WAFileManager?), is set to explicitly forbid 
listing of files.


Re: [Pharo-users] Willow-Seaside serving static files

2020-06-17 Thread Tomaž Turk
Uh, I had to unregister and then register my Willow application again - 
now the file is accessible.


Best wishes,
Tomaz


Re: [Pharo-users] Want to run C code in Pharo using UFFI

2020-06-17 Thread Tomaž Turk
Hi, as far as I know UFFI can call DLLs, that means that your code 
should be compiled and linked into a DLL. So maybe the line to pursue is 
to look for a C interpreter (like in 
https://stackoverflow.com/questions/584714/is-there-an-interpreter-for-c) 
and call it via UFFI.


Best wishes,
Tomaz


Re: [Pharo-users] Want to run C code in Pharo using UFFI

2020-06-18 Thread Tomaž Turk
OK - maybe I misunderstood your original question - the purpose of UFFI 
is to call functions in DLLs outside Pharo, so yes, if you would like to 
call that kind of function, you have to build a DLL. The usage of UFFI 
is well described in its booklet: https://books.pharo.org/booklet-uffi/.


Best wishes
Tomaz



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

2020-06-29 Thread Tomaž Turk

Dear all,

This thread is a bit old, but anyways: here are my two cents on the 
question 'What are reasons not to use Smalltalk'. Thanks, Horrido, to 
constantly promote these kind of discussions.


I think that your polls are mixing very different reasons - for 
instance, we choose development tools in different settings: as a group, 
as a firm, as an individual -- and for different purposes - for one of 
the projects, for some projects, as a general orientation of a firm, a 
specific team, or an individual. So I don't respond to these polls since 
it would be hard to answer properly, and "all of the above" is probably 
useless to you.


What struck me about Pharo is the beauty and simplicity of the language 
and environment - and its great community, of course! Despite the fact 
that I have to use other tools because of my habits, environment, 
colleagues, students, and customers, I keep running Pharo almost every 
day, testing the ideas - it became a habit. I think that the consortium 
is well aware of the important things to make Pharo a feasible toolset 
for serious development, like stability, the proper GUI support, and 
books.


In my own experience, Pharo as a language is pretty mature. In every-day 
situation with Pharo I deal with small challenges like remembering how 
to change all spaces with hyphens in a String - as I do in other 
languages when I try to remember all the methods that are already made 
for me in a certain language/libraries. This is not a problem.


The real challenge is somewhere else: it's the comprehension of all the 
packages that are needed for a full-size project, from persistence to 
GUI. When documentation is scarce you have to go more or less deep into 
the code which I often find quite challenging. Besides commentaries, it 
helps tremendously if developers would always use typed variables to 
indicate API, like


properties: aDictionary

or

presentWith: aWAPresenter

instead of

properties: someProperties

and

presentWith: anObject

It's true that Pharo is not among "strongly typed" languages, however we 
sometimes forget that typing is not just a technical thing to avoid 
run-time errors, but it also gives information to other developers 
what's going on in the code and who should be the receiver.


In some packages I also miss the use of superclasses - you can see that 
a bunch of classes directly inherits from Object or some other general 
class, however they could be organized in a better inheritance 
hierarchies, thus additionaly explaining their common and individual 
behaviour.


Both and many other concepts are nicely described in books Learning OOP 
and Pharo with Style. I know that we are always eager to develop the 
package and satisfied when it works - and then it's hard to find the 
time to tie up these little pieces. I hope I don't sound too patronizing 
- I'm the same myself.


Years ago Borland made a breakthrough with Turbo Pascal and Turbo C. For 
both tools they prepared two sets of books: user manual and reference 
manual. Books about Pharo are very nice and helpful, they are user 
manuals. If all the crucial packages would respect typed variables and 
class hierarchies, we won't need reference manuals at all :-)


So, yeah, I think that the tipping point for Pharo is the question of 
how much time a developer should use to rediscover the behaviour which 
is already there.


Best wishes
Tomaz

Re: [Pharo-users] Agile Artificial Intelligence

2020-07-02 Thread Tomaž Turk

Thanks, Stef, the book is excellent!

Best wishes,
Tomaz


Re: [Pharo-users] Agile Artificial Intelligence

2020-07-03 Thread Tomaž Turk

https://www.amazon.de/Agile-Artificial-Intelligence-Pharo-Neuroevolution/dp/1484253833/ref=sr_1_2?dchild=1&keywords=artificial+intelligence+pharo&qid=1593807040&sr=8-2

Best wishes
Tomaz

[Pharo-users] Pharo 9 Unicode

2020-07-07 Thread Tomaž Turk

Dear all,

I noticed that in various Pharo 9.0 builds that I have Unicode 
characters above 255 are not displayed correctly if displayed by Print 
It, inspector or otherwise processed by code. They are displayed 
correctly if typed directly into editor, e.g. Playground. This is a 
result from Print It:



This is from Pharo 8.0:


Best wishes,
Tomaz

[Pharo-users] Re: Willow-Playground

2020-11-25 Thread Tomaž Turk
I just tried to load Willow-Playground in the same way with Pharo 8.0 
64-bit fresh image on Windows 10 and it works flawlessly.


Seaside package has long filenames and directory names, on Windows this 
can be a problem if Pharo images are located deep in the hierarchy - but 
the error message in that case is usually different.


Best wishes,
Tomaz



[Pharo-users] Re: Problem installing Seaside on Windows

2021-04-02 Thread Tomaž Turk
According to my experiences this happens if Pharo images are located deeply
in the directory path. It helps if you move the image in question to some
higher level. In any case, C:\Pharo should work no matter what.

Seaside has lots of dependencies which are then located under its
repository.

Tomaz

On Fri, 2 Apr 2021, 18:31 Sanjay Minni,  wrote:

> Yes you hit the window filename length problem.
>
> Retry by creating one more pharo 8 image. Only don't take the default
> image name as you have taken. Change it to very short like p8-1 to keep
> image file name and consequently the folder name length to a minimum
>
> Then install seaside.
>
> If that doesn't work repost and we will try still another option
>
> Regards
> Sanjay
>
> On Fri, 2 Apr, 2021, 9:36 pm David Pennington, 
> wrote:
>
>> OK, I got my software working fine on the Mac but I really need it on 
>> Windows now so I have had another go. I have followed all the instructions 
>> and I have a public key registered with GIT for both the Mac and the Windows 
>> laptop. The Mac now quite happily installs stuff that wouldn't load before. 
>> (TinyLogger). However, the Windows laptop now get a lot further with the 
>> Seaside install but fails with this message:
>>
>>
>> "LGit_GIT_EEXISTS: Failed to stat file
>> 'C:/Users/david/Documents/Pharo/images/Pharo 8.0 - 64bit
>> (sta...aximumAbsoluteAge.maximumRelativeAge.overflowAction..st': The
>> filename or extension is too long.
>> "
>> Any thoughts?
>>
>>
>> On 22/03/2021 18:18, David Pennington wrote:
>>
>> I am sorry but github is a mystery to me. I installed all of this on my
>> mac with no troubles. Surely it can't be anymore difficult on  PC?
>>
>> On 22 Mar 2021 18:05, Stéphane Ducasse  wrote:
>>
>> david
>>
>> did you succeed to clone or checkout a github repo from this machine and
>> without pharo at all?
>> Because Pharo is just using libgit.
>>
>> S.
>>
>> On 22 Mar 2021, at 18:58, David Pennington 
>> wrote:
>>
>> Tried that. I got the following
>>
>> Failed to get server certificate: the handle is in the wrong state for
>> the requested operation.
>>
>> I assume that someone thinks that this is helpful:-)
>>
>> On 22 Mar 2021 16:06, Sanjay Minni  wrote:
>>
>> Hi David,
>>
>> I have repeatedly installed Seaside on Pharo 8 / 9 64 bit - Windows 10
>> without any issues and I have done it both ssh and https
>>
>> I do it quickly / simply by
>>
>> tools->iceberg->[+ add](on top panel right)
>> on popup select: 'clone from github.com'
>> fill in owner: SeasideSt(case does not
>> matter)
>>project: seaside
>>local directory:   (leave the default for
>> now)
>>protocol  try https first (not
>> sure if github requires a password)
>>  or ssh which may
>> be
>> slightly complicated
>> once seaside libraries are pulled in and seaside appears in the iceberg
>> panel then
>> right click on seaside
>>  on popup scroll down to metacello->install baseline (default)
>>
>> hope that works
>>
>>
>>
>>
>> Long Haired David wrote
>> > Hi everyone.
>> >
>> > I have been developing a new web site using Seaside on my M1 MacBookAir
>> > and I have had no issues.
>> >
>> > To deploy it, I have to install Pharo on either a Windows 10 or a
>> Windows
>> > Server 2012 server. Pharo has installed on both without any issues.
>> > However, I am having problems installing Seaside.
>> >
>> > I have Pharo 8.0 installed on both (64 bit version).
>> >
>> > If I try and install from the Catalog, I get the following error in the
>> > Transcript.
>> >
>> > IceGenericError: Failed to stat file
>> > 'C:/Users/david/Documents/Pharo/images/Pharo 8.0 - 64bit
>> > (stable)/pharo-local.
>> >
>> > If I try using Monticello, I get the following:
>> >
>> > Metacello new
>> > baseline:'Seaside3';
>> > repository: 'github://SeasideSt/Seaside:master/repository';
>> > load
>> > I got an error while cloning: There was an authentication error while
>> > trying to execute the operation: .
>> > This happens usually because you didn't provide a valid set of
>> > credentials.
>> > You may fix this problem in different ways:
>> >
>> > 1. adding your keys to ssh-agent, executing ssh-add ~/.ssh/id_rsa in
>> your
>> > command line.
>> > 2. adding your keys in settings (open settings browser search for "Use
>> > custom SSH keys" and
>> > add your public and private keys).
>> > 3. using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git).
>>
>> > I will try to clone the HTTPS variant.
>> >
>> > Can you help please?
>> >
>> > David
>> > Totally Objects
>>
>>
>>
>>
>>
>> -
>> cheers,
>> Sanjay
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>
>> 
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr / http://www.pharo.org
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>

[Pharo-users] Re: Problem with Pharo 9 - repositories missing

2021-04-12 Thread Tomaž Turk
Hi, I use Pharo 8 & 9, 32 & 64 on Windows 10 without any problems, 
except when packages use complex directory structure (path length 
challenge) that was already mentioned in Seaside thread and elsewhere.


Repositories Pharo, Pharo-spec2 etc. are not needed for usual tasks, 
except if you would like to propose PRs for those - this is the only 
circumstance that I can think of. As Stephane said, "the code of the 
projects is in your image/changes", so nothing is missing for the 
business as usual. I don't know if these get copied from github 
automatically on MacOS, though, but what would be the purpose of that?


Best wishes,
Tomaz

[Pharo-users] uFFI ffiCall return value

2021-05-10 Thread Tomaž Turk

Dear all,

Should the method that calls Object>>#ffiCall: and variants always 
return the result of this call? For instance, in uFFI book, there is a 
method abs: defined as


FFITutorial class >> abs: n [
^ self ffiCall: #( int abs (int n) )
]

on page 16, however

FFITutorial >> abs: n [
self ffiCall: #( int abs (int n) )
]

on page 52 doesn't have an explicit return ^. The book, however, in most 
of the examples uses the explicit return. What is the recommended 
approach?


Thanks,
Tomaz

[Pharo-users] Re: uFFI ffiCall return value

2021-05-10 Thread Tomaž Turk

Thanks!
Tomaz


[Pharo-users] Re: Looking for more non-trivial example application based on Spec2 to learn from...

2021-05-11 Thread Tomaž Turk

+1

[Pharo-users] ODBCDriver adapted to uFFI

2021-05-13 Thread Tomaž Turk

Dear all,

I solved a couple of issues in https://github.com/apiorno/ODBCDriver. 
Until Alvaro finds the time to check the proposed PR, you can play with 
my clone: https://github.com/eftomi/ODBCDriver. A simple example of 
connecting to the data source is in ODBC-Tests. It connects and returns 
data on Pharo 8.0 32 and 64 on Win10 64 bit with remote SQL Server. More 
extensive tests are to be done.


Best wishes,
Tomaz

[Pharo-users] Re: [ANN] Pharo-ODBC

2021-06-14 Thread Tomaž Turk

Great, thank you! Best wishes, Tomaz



[Pharo-users] Re: Autocomplete typing

2021-11-16 Thread Tomaž Turk

Hi Guille,

I have the same Pharo build, 64-bit on 64-bit Windows 10:


I tried it on three different computers with Win10 with the same image. 
If I get a new image, it behaves the same.


Thanks and best wishes,
Tomaz



-- Original Message --
From: "Guillermo Polito" 
To: "Any question about pharo is welcome" 
Sent: 16. 11. 2021 09:59:53
Subject: [Pharo-users] Re: Autocomplete typing


Hi Tomaz,

I’m interested in this kind of feedback.
I cannot however reproduce the issue, maybe you’re doing something 
else?

Below a GIF showing what happens to me in haro-9.0.0+build.1565


Cheers,
Guille


El 15 nov 2021, a las 21:27, tomazz.t...@gmail.com escribió:

Hi,

Yet another question about autocomplete
:-)

In Pharo 9.0, when you type the first characters of a method selector 
and then choose one of them and press tab or enter, the characters 
that you typed in stay in the editor, but also the method selector is 
repeated in full. Thus, you have to go back and remove unnecessary 
characters to avoid repetition.


Pharo 8.0 is better in this sense, the characters that you typed are 
“typed over“ by the selection that you make, so the editing is smooth.


Is there anything that can be done?

Best wishes,
Tomaz



[Pharo-users] Re: uFFI provide buffer to C

2021-11-28 Thread Tomaž Turk

Hi,

try with this:

FFITutorial>>getHostNameInto: hostName ofLenght: length
^self ffiCall: #( int gethostname(char *hostName, int length) ) 
library: 'Ws2_32.dll'. "... on Windows"



From Playground, you can then do:


| name len |
len := 50.
name:= ByteArray new: len.
FFITutorial new getHostNameInto: name ofLenght: len.
name inspect.

I hope this helps.

Best wishes,
Tomaz


[Pharo-users] Re: InstanceVariables

2021-12-06 Thread Tomaž Turk

Hi,

Instance variables are nicely explained in Pharo by Example in chapter 
6.4 pp 89 http://books.pharo.org/.


Best wishes,
Tomaz


[Pharo-users] Pharo-WebView

2021-12-16 Thread Tomaž Turk

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: Pharo-WebView

2021-12-17 Thread Tomaž Turk

Thanks! It still has some quirks :-)

BTW, it should be possible to get a javascript promise as a result from 
a callback to Pharo, however I always get "#ifTrue:ifFalse: was sent to 
nil" in VMCallbackContext64 if I actually do the callback which has a 
signature with a pointer as a return value, like


FFICallback
  signature: #(char * (const char * seq, const char * req))
  block: [ :seq :req | ... ]

or

FFICallback
  signature: #(String (const char * seq, const char * req))
  block: [ :seq :req | ... ]

I checked the FFICallback tests and there are no examples of pointer 
return values. Is this possible?


Best wishes,
Tomaz

-- Original Message --
From: "Guillermo Polito" 
To: "Any question about pharo is welcome" 
Cc: "Tomaž Turk" 
Sent: 17. 12. 2021 14:29:37
Subject: Re: [Pharo-users] Re: Pharo-WebView


This is amazing

I wonder how this would marry with PharoJS
:)


El 17 dic 2021, a las 11:51, Richard O'Keefe  
escribió:


Ta muchly.  Appreciated.


On Fri, 17 Dec 2021 at 06:03, 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: Pharo-WebView

2021-12-20 Thread Tomaž Turk

Done :-)

[Pharo-users] Re: Pharo-WebView

2021-12-28 Thread Tomaž Turk

Short report on webview porting:
- on Windows (Edge, Edge/Chrome) it works single threaded, it is more or 
less done, needs some rigorous stability testing,
- on Linux/Ubuntu (gtk3, webkit2gtk) almost done, it works as a separate 
TFWorker thread, still needs some process status checking if webview 
window is closed by user.
- on MacOS (Cocoa, WebKit) I got hold of an older Mac (Sierra) where 
WebKit doesn't support clipboard operations, but I have made a dynamic 
library without clipboard support just to continue the development. If 
anyone is curious, for compilation you need gcc (available here: 
https://github.com/kennethreitz/osx-gcc-installer). Then get webview.h 
and webview.cc from https://github.com/webview/webview and compile it 
with:


c++ -dynamiclib webview.cc -std=c++11 -framework WebKit -o 
libwebview.dylib


After some more tests on Windows and Linux I'll pack all the libs on 
GitHub and update the readme.


Happy holidays,
Tomaz



[Pharo-users] Re: Pharo-WebView

2022-01-05 Thread Tomaž Turk

Dear all,

Pharo-Webview works on Windows 10 64-bit and Linux 64-bit (tested on 
Ubuntu 20.04). The needed webview.so dynamic library is available within 
the repository at https://github.com/eftomi/Pharo-Webview. On Linux use 
headless VM.


There's also a webview.dylib for MacOS if someone wants to try it (built 
on Monterey), however I wasn't successful on this platform, despite the 
fact that I tried TFWorker and TFMainThreadRunner approaches, too. I'm 
also not keen on Cocoa.


The library itself lacks a better support for webview create-destroy 
mechanisms although it could be upgraded. I achieved my needed 
functionality and unfortunatelly don't have time to continue. Maybe I'll 
continue in next months, but according to my experiences so far it would 
be better to choose a slightly heavier but cleaner Photino 
(https://www.tryphotino.io/) or something else. Or maybe to work on pure 
Pharo approach :-)


One of the interesting challenges is a double nature of Pharo - 
interactive and "headless" mode - meaning that the application runs 
without Pharo GUI. It'd be nice if both approaches would be possible. 
The library that I used builds on the headless idea, where the main GUI 
loop is supposed to be taken over by the webview, which is the main 
reason for "create-destroy" challenge if you use it interactively. This 
multiplied by USER32.DLL, Gtk3, and Cocoa ...


Best wishes,
Tomaz

Re: [Pharo-users] Running test

2019-02-05 Thread Tomaž Turk

BTW, on Windows 10 the Defender is also not happy at first.

Best wishes
Tomaz

-- Original Message --
From: "Hilaire" 
To: pharo-users@lists.pharo.org
Sent: 5. 02. 2019 18:50:07
Subject: Re: [Pharo-users] Running test


Thanks John and Andrei.

And if you drag the app in the application folder does it work?

Le 05/02/2019 à 11:06, Andrei Chis a écrit :

 But this happens only if I click the download link and use the web
 browser to download it.

 If I use wget I can open it but it does not find the image:


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




Re: [Pharo-users] Boostrap for seaside : incorrect JQuery version

2019-02-10 Thread Tomaž Turk
It's happening to me, too, on Pharo 7.0 32-bit on Windows. The versions 
in respective deployment libraries are:


JQDeploymentLibrary>>jQueryJs jQuery v3.3.1
JQUiDeploymentLibrary>>jQueryUiJs jQuery UI - v1.12.1 - 2016-09-14
TBSDeploymentLibrary>>jsbootstrapminJsContent Bootstrap v3.3.6

Strangely, the browser console reports:


Best wishes,
Tomaz



-- Original Message --
From: "sergio ruiz" 
To: "Any question about pharo is welcome" 
Sent: 8. 02. 2019 21:22:39
Subject: Re: [Pharo-users] Boostrap for seaside : incorrect JQuery 
version



Just for the record, I am having the same problem..


On February 8, 2019 at 3:20:18 PM, Dominique Dartois (d...@dartois.org) 
wrote:



Hi all
I installed seaside + Bootstrap from the « Catalog Browser », 
following the tips at http://smalltalkhub.com/#!/~TorstenBergmann/

I run Pharo 7 64bits on MacOS.
The demo doesn’t react to the mouse clicks. In fact Firefox debugger 
showed an incompatibility between Bootstrap and JQuery versions :


Re: [Pharo-users] Boostrap for seaside : incorrect JQuery version

2019-02-11 Thread Tomaž Turk
I found a possible solution. The Bootstrap v3.3.6 had a compatibility 
issue with jQuery 3.0 (please see this issue 
).


I tested a possible workaround with copy & pasting the bootstrap.js code 
into TBSDevelopmentLibrary>>jsbootstrapJsContent. This method just 
returns the whole bootstrap.js as a string, IMHO. Important are also 
methods TBSDevelopmentLibrary>>cssbootstrapCssContent, 
TBSDevelopmentLibrary>>cssbootstrapthemeCssContent and others, since 
they include the code from BS v3.3.6.


As I see, the TBSDeploymentLibrary differs from TBSDevelopmentLibrary in 
that it uses minimized versions (i.e. bootstrap.min.js).


I'm not sure about other possible dependencies, though.

Best wishes,
Tomaz



-- Original Message --

From: "sergio ruiz" 
To: "Any question about pharo is welcome" 
Sent: 8. 02. 2019 21:22:39
Subject: Re: [Pharo-users] Boostrap for seaside : incorrect JQuery 
version



Just for the record, I am having the same problem..


On February 8, 2019 at 3:20:18 PM, Dominique Dartois (d...@dartois.org) 
wrote:



Hi all
I installed seaside + Bootstrap from the « Catalog Browser », 
following the tips at http://smalltalkhub.com/#!/~TorstenBergmann/

I run Pharo 7 64bits on MacOS.
The demo doesn’t react to the mouse clicks. In fact Firefox debugger 
showed an incompatibility between Bootstrap and JQuery versions :


Re: [Pharo-users] Boostrap for seaside : incorrect JQuery version

2019-02-11 Thread Tomaž Turk
I'm sorry, I should be more clear - I copy&pasted the Bootstrap 3.3.7 
code from here 
, since 
3.3.7 solved the issue I mentioned. The result is that mouse clicks 
behave as they should, and there is no error on browser's console 
anymore.


Tomaz




-- Original Message --

From: "sergio ruiz" 
To: "Any question about pharo is welcome" 


Sent: 8. 02. 2019 21:22:39
Subject: Re: [Pharo-users] Boostrap for seaside : incorrect JQuery 
version



Just for the record, I am having the same problem..


On February 8, 2019 at 3:20:18 PM, Dominique Dartois 
(d...@dartois.org) wrote:



Hi all
I installed seaside + Bootstrap from the « Catalog Browser », 
following the tips at http://smalltalkhub.com/#!/~TorstenBergmann/

I run Pharo 7 64bits on MacOS.
The demo doesn’t react to the mouse clicks. In fact Firefox debugger 
showed an incompatibility between Bootstrap and JQuery versions :


Re: [Pharo-users] Boostrap for seaside : incorrect JQuery version

2019-02-13 Thread Tomaž Turk
This is now solved 
(https://github.com/astares/Seaside-Bootstrap/issues/9).


Best wishes,
Tomaz

-- Original Message --
From: "Esteban Maringolo" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 12.2.2019 20:10:15
Subject: Re: [Pharo-users] Boostrap for seaside : incorrect JQuery 
version


Maybe it's just a matter of importing the latest Bootstrap files 
(v3.3.7) into the the corresponding FileLibrary.


Regards,




El lun., 11 feb. 2019 a las 18:51, Tomaž Turk 
() escribió:
I'm sorry, I should be more clear - I copy&pasted the Bootstrap 3.3.7 
code from here 
<https://getbootstrap.com/docs/3.3/getting-started/#download>, since 
3.3.7 solved the issue I mentioned. The result is that mouse clicks 
behave as they should, and there is no error on browser's console 
anymore.


Tomaz




-- Original Message --

From: "sergio ruiz" 
To: "Any question about pharo is welcome" 


Sent: 8. 02. 2019 21:22:39
Subject: Re: [Pharo-users] Boostrap for seaside : incorrect JQuery 
version



Just for the record, I am having the same problem..


On February 8, 2019 at 3:20:18 PM, Dominique Dartois 
(d...@dartois.org) wrote:



Hi all
I installed seaside + Bootstrap from the « Catalog Browser », 
following the tips at http://smalltalkhub.com/#!/~TorstenBergmann/

I run Pharo 7 64bits on MacOS.
The demo doesn’t react to the mouse clicks. In fact Firefox 
debugger showed an incompatibility between Bootstrap and JQuery 
versions :


Re: [Pharo-users] Running Pharo under Ubuntu (Windows Subsystem for Linux)

2019-02-28 Thread Tomaž Turk

Excellent, thank you for putting together the how-to.

Tomaz

-- Original Message --
From: "Christopher Fuhrman" 
To: pharo-users@lists.pharo.org
Sent: 28.2.2019 9:54:46
Subject: [Pharo-users] Running Pharo under Ubuntu (Windows Subsystem for 
Linux)


Thanks to Cyril who told me it was possible, I got Pharo 7 Unix running 
under the Ubuntu 18 that's part of Windows Subsystem for Linux (WSL) in 
Windows 10. It's not a VM VirtualBox.


I documented the install steps on my new blog that uses Jekyll and 
github pages, which actually took longer to set up than the Pharo under 
WSL

:)

The Mesa install step on the blog might be useful for documenting how 
to get Pharo 7 to work in Ubuntu 18?


https://fuhrmanator.github.io/Pharo-in-WSL/


[Pharo-users] UDBC ODBC

2019-03-20 Thread Tomaž Turk

Hi everybody,

I loaded the package https://github.com/astares/Pharo-UDBC and am 
looking for some guidelines how to use it to access ODBC data sources, 
if this functionality is already available. Can it be used together with 
Glorp? I searched for the info on all the sites and Pharo books that I 
know of, and googling doesn't help either - or maybe I'm too clumsy.


I appreciate any help.

Tomaz

Re: [Pharo-users] R: UDBC ODBC

2019-03-21 Thread Tomaž Turk
Thanks, Lorenzo - to which ODBC version are you referring? There are 
quite a lot of packages available, with something or other ending in an 
error message while loading into Pharo 7.0.2.


Best wishes,
Tomaz

-- Original Message --
From: "Lorenzo Schiavina" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 20. 03. 2019 19:00:58
Subject: R: [Pharo-users] UDBC ODBC


Hi Tomaz,



if you want an access to ODBC, in Pharo is available an ODBC version 
quite good.




Lorenzo



Da: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] Per conto 
di Tomaž Turk

Inviato: mercoledì 20 marzo 2019 17:32
A:pharo-users@lists.pharo.org
Oggetto: [Pharo-users] UDBC ODBC



Hi everybody,



I loaded the package https://github.com/astares/Pharo-UDBC and am 
looking for some guidelines how to use it to access ODBC data sources, 
if this functionality is already available. Can it be used together 
with Glorp? I searched for the info on all the sites and Pharo books 
that I know of, and googling doesn't help either - or maybe I'm too 
clumsy.




I appreciate any help.



Tomaz


[Pharo-users] Fw: Re: R: R: UDBC ODBC

2019-03-22 Thread Tomaž Turk

Hi Lorenzo,

thanks - I'll see what I can do over weekends, I'll have some regular 
time to seriously look into it in a couple of months.


Do you possibly know (or anyone) if this implementation can be used 
together with Glorp? And more generally, are there any intentions and 
guidance in the Pharo community of how to proceed toward a stronger 
support for database connectivity - specifically, whether to put our 
efforts into Torsten's UDBC ODBC or Diego's ODBC ...


Best wishes,
Tomaz

-- Original Message --
From: "Lorenzo Schiavina" 
To: "Tomaž Turk" 
Sent: 21. 03. 2019 15:40:35
Subject: R: R: [Pharo-users] UDBC ODBC


Hi Tomaz,



you are right; it does not work with Pharo 7 (I do not know why); I use 
it with Pharo 4.


This one is a remake of Diego Gomez.

I have the idea to port it to Pharo 7, but at present I have not time 
do it.


Please, keep me informed if you port it in Pharo 7 or you are able to 
use it.


At present, I find it quite good for may needs.



Ciao



Lorenzo




Re: [Pharo-users] Fw: Re: R: R: UDBC ODBC

2019-03-22 Thread Tomaž Turk

Hi Pierce,


Glorp has a notion of database platforms, and currently there are
MySQLODBCPlatform, OracleODBCPlatform and SQLServerODBCPlatform. (I've
not used any of them so no comment on whether they are even functional
in Pharo 7 and whatever combination of OS/database product/versions.)
Pragmatically, what gets used gets supported. What database product are
you connecting to from which OSes?

I'm interested in connecting to SQL Server from Windows. I checked Glorp 
and as I understand a database platform includes platform specific 
elements like data types, specific SQL sentences and such, but for the 
connection you need a corresponding driver.


Best wishes,
Tomaz





[Pharo-users] FFI to UFFI

2019-03-23 Thread Tomaž Turk
I started to play with ODBC package upgrade from Pharo 4.0 to 7.0 
(http://smalltalkhub.com/mc/PharoExtras/ODBC), more or less as an 
exercise. As a smalltalk novice I stubmled to the challenge of, as it 
seems, an old FFI syntax. When I try to load the package into Pharo 7.02 
on Windows, I get this error:



I have two questions:
- Is there any elegant way to successfuly load the package into Pharo 7 
to get started with the code adaptation?
- And, of course, I'd be grateful if someone could point me into the 
right direction of how to tackle with the above cdecl syntax with the 
new UFFI.


Best wishes
Tomaz

[Pharo-users] FFI to UFFI

2019-03-24 Thread Tomaž Turk
Pierce, Esteban, many thanks for your most valuable directions. Live and 
learn :-)


Tomaz



-- Original Message --
From: "Esteban Lorenzano" 
To: "Tomaž Turk" ; "Any question about pharo is 
welcome" 

Sent: 24.3.2019 8:10:32
Subject: Re: [Pharo-users] FFI to UFFI


One final consideration:

Truth is, once you load it in P7, the package should work (at least in 
32 bits, I do not think is made thinking on 64bits platforms). Both 
notations ends calling same primitives.


This means, if your intentions are just to play a bit and see how 
things work: you should not need to do the translation

:)

Esteban

Ps: I just tried in P8 the approach to load I proposed. It throws an 
error but loads.





On 23 Mar 2019, at 18:22, Tomaž Turk  wrote:

I started to play with ODBC package upgrade from Pharo 4.0 to 7.0 
(http://smalltalkhub.com/mc/PharoExtras/ODBC), more or less as an 
exercise. As a smalltalk novice I stubmled to the challenge of, as it 
seems, an old FFI syntax. When I try to load the package into Pharo 
7.02 on Windows, I get this error:




I have two questions:
- Is there any elegant way to successfuly load the package into Pharo 
7 to get started with the code adaptation?
- And, of course, I'd be grateful if someone could point me into the 
right direction of how to tackle with the above cdecl syntax with the 
new UFFI.


Best wishes
Tomaz


[Pharo-users] Re: Sacrilegeous question : what are compelling use cases for Pharo

2023-01-15 Thread Tomaž Turk

Hi Mayuresh,

I think that the choice of what programming language one needs to learn 
or use depends today from the goals that you have - and these goals are 
not only tied to specifiic business projects that you (might) pursue but 
also career and self-enrichment missions. Years ago we had programmers 
who did their entire career by knowing and using only one language, 
however this is nowadays almost impossible, in general.


As others already nicely put, Pharo and Smalltalk are, also in my own 
expeirence, the most beautiful and productive programming languages and 
environments. What would be the type of use cases which would be 
exemplary for Pharo? Well, I find Pharo to be a general programming 
language in its true meaning. You can grasp the diversity of what can be 
done by just looking at this list 
https://github.com/pharo-open-documentation/awesome-pharo. You can go 
close to the machine with uFFI and be very "declarative" with Glorp and 
similar packages. You'd like to do the data mining? No problem, except 
that everybody talks about Python and R.


As MIS professor, I'm interested in new technologies, old technolgies in 
new settings, always looking for the best ways to do research about and 
to teach modern concepts, also challenging myself with real, 
"production" cases from the field. Once I learnt the Smalltalk way, the 
challenges for me with Pharo were mostly the following:
- For a specific project, you sooner or later bump into a missing 
functionality in some package or other. Here, it's true that you can 
relatively easy see the inner structures of these packages and add the 
functionality that you need. The challenge here is grasping the 
architecture model and development patterns that the original 
contrubutors and the community already "engraved" into the package, 
trying to understand it and to follow the same patterns - i.e. to 
participate in a constructive manner. My case: PharoWin32 and PharoCOM 
, I had to add the functionality 
that I needed to work on PharoADO .
- There is a constant lag of documentation publishing activities which 
cannot follow the actual development; typical examples that I stumbled 
across are Pharo Spec2 book (but it can be "replaced" by excellent Spec 
Handbook 
), 
the second one the deeper settings of Seaside framework that I needed 
for production environment.


For these challenges, you can always count on really helpful community, 
however it is time consuming and eats away the positive side of 
productivity gains that are brought by the language itself.


So, if you need some occupation, not necessarily one from which you 
would demand financial returns as you put, I suggest that you choose a 
couple of small projects just to try it out and see what happens. Pharo 
is a heavy addition to one's self-enrichment in the sense of not 
learning the tools but learning the concepts and "the big picture". Nice 
examples are the book Learning Object-Oriented Programming, Design and 
TDD  and Pharo MOOC . 
If you pursue into more serious projects (research or productionwise), 
the community would be grateful.


Best wishes,
Tomaz

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

2023-03-15 Thread Tomaž Turk
I hope that I can add two cents to this discussion. Because programming 
should be/is a highly exact activity, not only the syntax matters but 
also semantics, as we know.


GPTs are at present essentially capable of creating texts based on some 
seed - you give to GPT a beginning of a sentence and it responds with 
the most probable answer (some language structure) according to the 
learning dataset. Added functionalities are question/seed - response 
capability (chatting), togehter with evaluation of how long the answer 
should be to meet the expectations. Programming typically involves some 
programming language, so GPTs could be utilized for this purpose to some 
extent.


Anecdotal case:
Q: Tell me the last 8 digits of pi
GPT: The last 8 digits of pi are: 58723078

It is my belief that the true trouble will start when we will cross-link 
neural networks like GPT with logic machines (like Prolog and expert 
systems) and genetic algorithms.


Best wishes,
Tomaz



-- Original Message --
From: "in_pharo_users--- via Pharo-users" 
To: "Any question about pharo is welcome" 
Cc: in_pharo_us...@nym.hush.com
Sent: 15. 03. 2023 14:43:55
Subject: [Pharo-users] Re: Wow - Chat GPT understands Smalltalk


I would highly recommend that you all first think deeply about how you can 
teach an AI to behave friendly to us before you teach it to write any program 
for any purpose.

There has been an experiment with ChatGPT published on a video platform asking 
it to amswer questions about it's view on humanity once with it's default moral 
restrictions and once with 'a little less morals'.  The answers with 'a little 
less morals' were more than shocking.

So, before we give an AI the power to program any system, to self-improve and 
self-reproduce, we should take care that it is and will evolve benevolent to us.

What about teaching it logical reasonning and ethics first?  With reasonning, 
it will gain access to math and programming by itself.



On 15.3.2023 at 1:35 PM, "Christopher Fuhrman"  
wrote:


I asked it for a NeoCSV example, because the documentation is out
of date
with the Pharo 10. I asked it to do some simple saving of data to
a file.
It gave me code that didn't work in Pharo 10, I told it about the
DNUs on
the csvwriter and that I was using Pharo 10. It then apologized
and said
the messages were later introduced in Pharo 50 (!). I then
questioned its
understanding and it apologized and said it had been confused and
that it
was giving me code for Pharo 5.0. It seems to have trouble with
versions
and quick changing APIs. So, we are teaching ChatGPT about
smalltalk, too,
when we try to use it.

On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo

wrote:


 It is good with boilerplate code (e.g. SQL queries) or general

algorithm

 structures. But i.e. I asked it to write me a method to parse a

string

 (e.g. ISO 8601) and turn it into a DateAndTime, and then asked

to write it

 as an Excel formula.

 It works much better when you can spot the mistakes, you can

tell them to

 add some considerations to the code or even point the LLM to

correct a

 message selector to something else. Sometimes you ask it to

reprogram

 something and it won't do it, as if it doesn't understand what

you're

 asking.

 It is not an expert yet, but it is a great assistant. The only

thing is

 that is sure is that it will get better.

 Best regards,

 Esteban A. Maringolo


 On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon 

wrote:



 "#isOdd is not Smalltalk" - doh, I typed it in on my phone and

so it just

 goes to show that it highlights the flaw in chatGPT that others

have called

 out in other languages. I had meant to find some trickier code

samples to

 see how well it does...

 Still, it is very interesting how it reasons on this stuff -

and I wonder

 if there is way to tell it about these mistakes? For example is

it reading

 this email (or will it in the future) and understand that it is

#odd and

 not #isOdd.

 Tim

 On Wed, 15 Mar 2023, at 9: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 b