Questions tagged [pharo]

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
1

votes
0

answer
40

Views

Pharo ZnServer printOn: Transcript

Did this: ZnServer printOn: Transcript. No longer need this on transcript and would like to stop the server from printing on it now. How can I do this?
rbschris
1

votes
0

answer
24

Views

Pharo ZnClient possible to host more than one server instance?

My question is about hosting multiple ZnServers in Pharo: I put together an app that is mapped to default delegate. I also want to be able to generate and serve files for download so I thought I would also host a file serve with ZnStaticFileServerDelegate class. I tried as so: | a b | a := ZnServer...
rbschris
1

votes
1

answer
52

Views

Pharo doesn't save temporary variable names

Hello Pharo community, I am following instructions based on PharoByExample. In chapter 3.6 when I paste the code of initialize method in the browser and Accept it, I see that temporary variables are renamed as tmp1 tmp2 tmp3 tmp4: initialize | tmp1 tmp2 tmp3 tmp4 | super initialize. tmp4 := self ce...
mrd abd
1

votes
1

answer
48

Views

Is there a limit to the number of nested #call:'s in Seaside?

I'm developing a Seaside Application and I suspect I've reached a point in which I can no longer #call: another component. It's not an issue of my WAComponents, since I tried other messages that end up in #call:, like #confirm:. I have 4 nested #call:'s in my app (I know, I know... but I'm not look...
juliang
1

votes
3

answer
282

Views

Serving pharo seaside 3.0 with lighttpd

I am trying to serve my app with lighttpd. With seaside 2.8 the following worked in my lighttpd.conf: proxy.server = ( '/pharo' => ( ( 'host' => '127.0.0.1', 'port' => 8080, 'check-local' => 'disable')) ) but with seaside 3.0 it rewrites the url to say http://localhost/pharo when accessing it over a...
Jay Erasmus
1

votes
2

answer
219

Views

How to identify binary and text files using Smalltalk

I want to verify that a given file in a path is of type text file, i.e. not binary, i.e. readable by a human. I guess reading first characters and check each character with : isAlphaNumeric isSpecial isSeparator isOctetCharacter ??? but joining all those testing methods with and: [ ... and: [ ......
user869097
1

votes
1

answer
142

Views

Pharo: #subclass:instanceVariables… message personalized

I am fighting against the Object message #subclass:instanceVariableNames:classVariableNames:poolDictionaries:category, in order to manipulate subclasses of an specific class. I have RareClass with a class method #subclass:coposes...etc and want to do: RareClass subclass: #RareSubclass composes: #Som...
Illiax
1

votes
1

answer
53

Views

Why won't my action's shortcut be executed?

In Moose 4.6, here's my code: finder := GLMFinder new. finder show: [:a | a dynamic display: (GLMTextPresentation new forSmalltalk); act: [self halt] on: $k entitled: 'Implementors (k)' ]. finder openOn: 'Waaaaaaa' If I click the little menu item, a debugger comes up. But, if I press apple-k, it d...
nes1983
1

votes
1

answer
233

Views

Pharo and Squeak Smalltalk: Listing unimplemented methods in a package?

How do I list all unimplemented methods in a package? Given that the method should be implemented in that package and not in other (for example in a superclass outside the package or in Object). Edit: Yes, I'd like to know 'messages sent that are not implemented' but to limit the analysis to one spe...
user1000565
1

votes
1

answer
96

Views

How can all the Workspace windows be enumerated in a Pharo workspace?

I want to list all the Workspaces windows in a in a Pharo window. When I shift click a Workspace window the item selected is usually a PluggableTextMorph or a TextMorphForEditView. When it is a PluggableTextMorph it owns a TextMorphforEditView which was not picked by the click. Inspecting or explori...
vfclists
1

votes
1

answer
49

Views

NBFFICallback with Win32 types raising type unresolved

I am currently exploring NativeBoost. Thought i will start with a simple event hook. For defining the callback i subclassed NBFFICallback and added my fnSpec with a return type of LRESULT. fnSpec ^ 'LRESULT ( INT nCode, LPARAM lParam , WPARAM wParam)' after i instantiated it using mycallback := MyC...
Thushar G R
1

votes
1

answer
88

Views

How to persist graphs presenting circular references in Voyage?

I'm having an issue I don't recall having had about half a year ago when trying out Voyage. In my schema, a User has an instVar referencing all the Centers he belongs to, and a Center has an instVar referencing all of its Users, so when the Voyage serializer tries to serialize a user (or a center),...
Bernat Romagosa
1

votes
1

answer
78

Views

Monticello repository not committing methods(resources) of WAFileLibrary subclass

I find that WAFileLibrary subclasses resource methods cannot be committed to Monticello repository. Is this normal? These resources have been added by the WAFileLibrary->addFilesIn: method. But when i try to create another method and then commit, i find that the new method gets committed and that i...
Thushar G R
1

votes
2

answer
191

Views

Loading images (graphics) with VisualWorks very slow

I am trying to load image files like jpeg into vw as part of an application. This seems to take very long and sometimes even crashes vw. The image has roughly 3.5MB and is a simple jpeg picture. This is what causes the problem: ImageReader fromFile:'pic.jpg'. This operation takes about 5-10 seconds...
Henrik Guschov
1

votes
1

answer
333

Views

Pharo 2.0 Smalltalk and PostgresV2

Trying to return results from a table in a DB. This code works: | connection results | PGConnection defaultConnectionArgs hostname: '*****.awebservice.com'; portno: 1234; databaseName: '*****'; userName: '********'; password: '**************'. connection := PGConnection new. connection startup. resu...
Carl Wilson
1

votes
2

answer
532

Views

Smalltalk, TDD, and immutable objects

Like many people, I've wanted to really learn smalltalk and TDD. For fun, I've been going through the excellent Tetris TDD tutorial at: https://github.com/orfjackal/tdd-tetris-tutorial/blob/tutorial/README.md and converting the code to Smalltalk. I've gotten to the third set of tests (https://github...
matt eisenberg
1

votes
2

answer
72

Views

Is Runtime method

Is there a way to tell in Pharo Smalltalk if the current image is a runtime image or a development image? I'm wanting create a way to signal a shutdown of a runtime image but not a development image.
Brad Selfridge
1

votes
1

answer
145

Views

serving using zinc and pharo

After working on zincs tutorial I want to serve an entire repo filled with .js, .html and .css files I created a firstpathsegment so that I upload all files to the sam place but then how to create a place to serve and store the files ? and how to upload them ?
amroto
1

votes
2

answer
195

Views

How do I change the default cmd key for keyboard shortcuts in Pharo 3.0?

I'm trying to bind the cmd key in Pharo 3.0 to another key because my system (linux+xmonad) already uses the alt key for other things. I am trying to bind cmd key, currently mapped to alt, to the win/super/meta key. I changed method defaultModifier in UnixPlatform class, from: defaultModifier ^KMMod...
ericvm
1

votes
1

answer
87

Views

How do I build a UI for input/output mapping?

Reading a csv files header or something similar I would like to create an OrderedDictionary with mapped colnames for output. Something like: { 'email' -> 'email address'. 'postal code' -> 'zip code' } What widget could I use as a starting point?
pauel
1

votes
1

answer
297

Views

Pharo custom class is not indexable (smalltalk)

I have the following code to create a collection as a member of a class: CustomClass new members:Set new; yourself. next I ask for the size custom members size. which results in obviously 0, but when I insert a custom element in the set and I ask for the size it results in an error telling me my cus...
user2321611
1

votes
1

answer
132

Views

How do the various smalltalk VMs provide cross-platform graphics for morphic?

For example, Pharo and Squeak are different implementations of Smalltalk. Are there specific bindings in the smalltalk VM for each platform?
dave paola
1

votes
2

answer
130

Views

Using lightbox: in Seaside's WAComponent appears in Halos but the browser doesn't show it?

Just wanted to show the editor in a lightbox in the Ajax chapter here StLoggedInComponent>>initializeMenuComponent self menuComponent: (StMenuComponent new addEntry: 'All' withAction: [ self showAllTasks ]; addEntry: 'Completed' withAction: [ self showCompletedTasks ]; addEntry: 'Pending' withAction...
unom
1

votes
1

answer
258

Views

Is it possible to scale pharo user interface on hidpi display?

I'm trying to use pharo 4.0 on 4k laptop. Is it possible to scale gui interface (not just fonts)?
lompy
1

votes
1

answer
34

Views

Determining loaded group from postLoadDoIt:

Is it possible to determine what group was used to load a particular baseline from postLoadDoIt: in Metacello? For example: BaselineOfProject>>baseline: spec ... spec group: 'default' with: #(...). spec group: 'complete' with: #(...). spec postLoadDoIt: #postLoad:spec:. BaselineOfProject>>postLoad:...
Peter Uhnak
1

votes
1

answer
43

Views

How to query all Monticello packages from a Metacello Configuration?

I have a Metacello configuration like ConfigurationOfAthens and I want to know which packages provides, the result would be : Athens-Cairo Athens-CairoPools Athens-Core etc. I tried (GoferConfigurationReference name: 'ConfigurationOfAthens') packages. but it is not understood by the system. It this...
user869097
1

votes
1

answer
87

Views

XMLParser in Pharo Claims U+00A0 is “Invalid UTF-8”

Given the input: Where the character after the '.' in the body attribute of the sms tag is U+00A0; I get the error: XMLEncodingException: Invalid UTF-8 character encoding (line 2) (column 13) IIUC, the UTF-8 representation of that character is 0xC2 0xA0 per Wikipedia. Sure enough, bytes 72 and 73 of...
Sean DeNigris
1

votes
1

answer
81

Views

Conditionally skip a method with MetaLinks

Imagine we have some method MyClass>>#method: arg Transcript crShow: 'executed' So when you do MyClass new method: 1 the transcript is filled with 'executed' lines. Now I want to skip this method if arg is 0. I've tried to install an instead metalink with a condition: link := MetaLink new condition:...
Uko
1

votes
1

answer
51

Views

How to make multiple descriptions in a method on Magritte

In Magritte I can define a description method that returns one description: MyEntity>>nameDescription ^ MAStringDescription new accessor: #street; label: 'Street'; priority: 100; yourself But can I return more than one description, in an array, for example? I thought maybe magritteContainer pragma m...
VitorCruz
1

votes
1

answer
155

Views

How to use Unified FFI in Pharo for integer buffer

There is very little documentation on how to use Unified FFI in Pharo. I would like to know how to deal with the following situation... Let's say you have a shared C library (called testlib.so) with the following function signature: void func1(int *buf); How would you use uFFI to call this function?...
Robert McCall
1

votes
1

answer
76

Views

How do I create an array or an OrderedCollection of dates between two days in Pharo?

I have two dates and I would like to create an array or and OrderedCollection between them. I would also like to be able to compare this array/OrderedCollection with another one in a condition. I have this code which gives me the span between the two date. However Timespan uses aDateAndTime as inpu...
Damon Moazami
1

votes
1

answer
0

Views

Squeak - How do I move a circle?

In the Squeak Smalltalk environment, I am trying to learn Morphic. There are many, many Morphic classes and I cannot determine the most appropriate one(s) to use for my current application, and I prefer not to invent anything that already exists at this point. Links to relevant code/info would be ap...
RAL
1

votes
2

answer
0

Views

How to find the current stack?

in Pharo, how can I find the currently evaluating stack?
nes1983
1

votes
5

answer
0

Views

How to get the bytes that makeup an integer?

In Smalltalk (or at least Squeak and Pharo), is there a portable way to get the bytes that make up an integer, starting with the most significant byte followed by the next-most, and so on, regardless of byte-ordering differences across platforms?
Reynald
1

votes
2

answer
0

Views

Is there a smalltalk implementation of the textile “humane text” format?

I like the textile 'Humane web text generator' and I'd like to use it in tools like Pier, but I've not yet come across a Smalltalk implementation. Does such a thing exist?
Piers Cawley
1

votes
2

answer
0

Views

serving static files with comanche

I used to use this code to serve static files from Comanche web server from within Pharo 1.2 image: createService | contentPath dirPath svc ma | contentPath := 'htdocs'. dirPath := FileDirectory default fullNameFor: contentPath. svc := (HttpService on: self port) name: 'seaside-' , self port grease...
milan
1

votes
1

answer
0

Views

In Moose, how can I be notified of a special key press?

In Moose, I want my browser to be notified whenever a user presses Command-M in any text pane. I'm listening to the inner port, waiting for any kind of event. While there is a text event that comes in when Command-m is pressed, it doesn't contain the fact that command-m was pressed. To verify, in Mo...
nes1983
1

votes
2

answer
102

Views

Default JQuery UI Tabs

I am using Pharo smalltalk image with latest seaside loaded. I had loaded the JQBaseTheme in my project. What should i do to bypass the colourful,large view of the UITab and show a simple UITab as shown in http://jqueryui.com/demos/tabs/default.html
VARUN ISAC
1

votes
1

answer
121

Views

WAFileLibrary alternative

1)I had a set of '.js' files in a particular Directory structure. 2)I NEED to store them locally with my smalltalk image and need not want to host them seperately. 3) I DONT need to keep them inside the smalltalk image, with the WAFileLibrary. Please let me know how the following code needs to be...
VARUN ISAC

View additional questions