Questions tagged [pharo-5]

1

votes
1

answer
180

Views

How do we implement a curl post in pharo

I have curl post to implement in pharo, but it seems like there is not much in term of explanation on how to do that. I saw few example but they ARE way simpler than what I need to. I would you do that inn pharos? $ curl 'https://url_server' \ -X POST \ -H 'key: MY PASSWORD' \ -H 'Content-Type: ap...
ludo
3

votes
1

answer
100

Views

Is there a specific way to get the Ip of a computer in Pharo smalltalk?

I am trying to run an application Pharo that requires data from the Ip of the host computer in which it's running. In general I have to open the code to set it manually in my Pharo code then launch the application. Is there a better and programmatically way of getting the IP address and returning th...
ludo
4

votes
1

answer
143

Views

How do we deploy a Pharo seaside web application?

I know there is a good explanation in the book Entreprise Pharo for deployment production over a Linux server. I followed the tutorial and was able to deploy the same project. However the project contained only a simple class 'MyFirstWebApp' and did not include Seaside framework. The run script was...
ludo
2

votes
1

answer
148

Views

Pharo Smalltalk test failure because message not understood

I am starting to learn Smalltalk, using Pharo 5. I am now following a tutorial from the squeak guys to get some proper grip on the syntax, etc. I am in the beginning, I have only two classes (a class BlankCell and a BlanCellTestCase class for the unit test). The Blankcell has some messages implement...
rll
2

votes
2

answer
77

Views

openWorldWithSpec making it impossible to return to previous windows

Reading the book 'The Spec UI framework'. Trying to implement the part described in chapter 'Taking over the entire screen'. After executing the code suggested in the book: WindowExample new openWorldWithSpec it seems to be impossible to return to previous state. Tried to delete the new WorldMorph i...
Anton
1

votes
1

answer
91

Views

How can we fill a html text area on pharo

For a login through pharo using the html form there is a method of Znclient which is formAt:add: followed by a post. So I was wondering how to I fill a textArea of html form and make post. Is there a method for such action? jumpingRésultats : Higher scoreConclusion : Best jumper of the school
ludo
1

votes
1

answer
394

Views

How do we write if elseif elseif in pharo?

I have to check 3 conditons using the if elseif elseif. How can I do that in pharo. I did but am not sure since I did not find any such application in pharo. x = 25 ifTrue:[DoSomething] ifFalse:[DoSomething else]. x < 25 ifTrue: [DoSomething] ifFalse:[Domething else]. x > 25 ifTrue: [DoSometh...
ludo
1

votes
1

answer
77

Views

How do we send a canvas image data as an attachment to a server on Pharo?

How do we send or upload a data file to a server on Pharo. I saw some example of sending file from a directory on the machine. It works fine. ZnClient new url: MyUrl; uploadEntityfrom: FileLocator home /Path to the file; put In my case I don't want to send/upload file downloaded on a machine but ins...
ludo
3

votes
1

answer
184

Views

Is it possible to write shell command within Pharo smalltalk?

Like in other programming language, is there a way of running linux shell command in Pharo smalltalk or a simple script ? I would like to have my Pharo image running a script that should be able to automate a tasks and return it to some value. I looked at almost all the documentation around and I co...
ludo
2

votes
1

answer
80

Views

How can I refresh a session for every 60 second and display it on transcript with Pharo?

|a b | a := ZnClient new. a get: 'http://cloud-storage.com/login'. a formAt: 'username' put: 'jom'; formAt: 'password' put: 'mypass'; post; get: 'http://cloud-storage.com/my-file'. 'Here I want to refresh the session for every 60sec and' 'to checking for newer data' b := a maxNumberOfRedirects:60 Tr...
ludo
2

votes
1

answer
93

Views

How can I return a variable contained in a block loop to a method in pharo

Say I have a method which implements a do:[] every:40s block. There is in the block a value data that should be returned at at every delay. How can I retun this to the method in pharo as follow: Class>>updateMethod 'This is a method' | scheduler data | scheduler := TaskScheduler new. scheduler s...
ludo
2

votes
2

answer
106

Views

How do we run a pharo program without instantiating an object in the playground?

I wrote a Pharo program that generates my daily task non-stop. The program itself works fine, however I always need to instantiate my object in the playground to run it. Is there some other way of doing it automatically without having to create an object and send a message to it?
ludo
1

votes
2

answer
600

Views

How do we iterate and select an element of a set in pharo?

My collection is a Set that contains a number of dictionaries. How can iterate over each dictionary in the Set to select a specific key. a Set(a Dictionary('age'->'25' 'code'->2512) a Dictionary('age'->'40' 'code'->'1243') a Dictionary('age'->'35' 'code'->'7854'))
ludo