Questions tagged [pharo-5]

Pharo is an Object Orientated prgramming language based on Smalltalk in its current version - 5. Use this tag if you have pharo specific questions. You might also include Smalltalk-Tag

References:

20 questions
5
votes
1 answer

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…
ludo
  • 543
  • 3
  • 14
4
votes
1 answer

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…
ludo
  • 543
  • 3
  • 14
4
votes
1 answer

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…
ludo
  • 543
  • 3
  • 14
2
votes
2 answers

How to do "File in" in Pharo 6.1?

Wanting to migrate my small project from Pharo 5 to Pharo 6.1, and I happily found the File Out option when I right-clicked on my package and its classes. I saw it generates text files for those artifacts in my image directory (I'm running on…
Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
2
votes
2 answers

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…
ludo
  • 543
  • 3
  • 14
2
votes
1 answer

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:…
ludo
  • 543
  • 3
  • 14
2
votes
1 answer

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" |…
ludo
  • 543
  • 3
  • 14
2
votes
1 answer

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…
ludo
  • 543
  • 3
  • 14
2
votes
1 answer

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…
rll
  • 5,509
  • 3
  • 31
  • 46
2
votes
2 answers

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…
Anton
  • 103
  • 4
1
vote
1 answer

List of methods if their implementation has at least two occurences of a word 'assert' in Smalltalk

I wanted to get the list of methods of a class if their implementation has at least two occurrences of a word 'assert' in Smalltalk. Can somebody help me with this? Thanks in advance!
Harika Putta
  • 63
  • 1
  • 8
1
vote
1 answer

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…
ludo
  • 543
  • 3
  • 14
1
vote
1 answer

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…
ludo
  • 543
  • 3
  • 14
1
vote
2 answers

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'…
ludo
  • 543
  • 3
  • 14
1
vote
1 answer

How can we sort dictionaries in an array by a specific key in pharo?

I have an array containing several dictionaries. How can I sorted them using a key that each dictionary have like age? an Array((a Dictionary('age'->'20' 'ID'->1254))(a Dictionary('age'->'35' 'ID'->1350))(a Dictionary('age'->'42' 'ID'->1425)))
ludo
  • 543
  • 3
  • 14
1
2