Re: [Pharo-users] ifNotEmpty(Do):

2015-10-10 Thread Henrik Nergaard
Look like #ifNotEmpty: is the correct choice. Collection methods select: [ :m | (m selector includesSubstring: 'if' caseSensitive: false) and: [ m selector includesSubstring: 'empty' caseSensitive: false ] ] thenCollect: [ :m

Re: [Pharo-users] About profiling code

2015-11-22 Thread Henrik Nergaard
To profile the creation and drawing, create a canvas and do a #fullDrawOn: onto it. Example: [ | morph canvas | morph := FTTableMorph new extent: 300@300; dataSource: (FTExampleDataSource elements: (Smalltalk allClassesAndTraits

Re: [Pharo-users] The #compile: selector

2016-06-15 Thread Henrik Nergaard
SomeClass compile: 'foo ^ ''foo''' classified: #accessor Best regards, Henrik From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Mark Bratcher Sent: Wednesday, June 15, 2016 8:06 PM To: Any question about pharo is welcome Subject:

Re: [Pharo-users] How can an image know it is running headless?

2016-06-22 Thread Henrik Nergaard
MessageBrowser browse: ( (Symbol selectorTable select: [ :s | s includesSubstring: #headless caseSensitive: false ] ) flatCollect: [ :s | s implementors ] as: OrderedCollection ). Best regards, Henrik -Original Message- From: Pharo-users

Re: [Pharo-users] Better color contrast for class extensions in dark theme

2016-06-24 Thread Henrik Nergaard
Pharo3DarkTheme >>#selectionColor From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Offray Vladimir Luna Cárdenas Sent: Friday, June 24, 2016 7:20 PM To: pharo-users@lists.pharo.org Subject: Re: [Pharo-users] Better color contrast for class extensions in dark theme

Re: [Pharo-users] Fogbuz issues

2016-01-17 Thread Henrik Nergaard
In the top right corner of Fogbugz there is a menu which has an entry called “subscriptions” here you can configure what you want to be automatically subscribed to. See attachment. Best regards, Henrik From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Nicolai Hess

Re: [Pharo-users] Getting whether specific key is currently pressed

2016-02-13 Thread Henrik Nergaard
Quick and dirty: "Sensor shiftPressed" The modification keys (shift/ctrl/alt/cmd?) is available at the MorphicEvent side see the class UserInputEvent (variable buttons + protocol modifier state). Adding a variable to TRAbstractMouseEvent (removing those at TRAbstractMouseClick) which hold this

Re: [Pharo-users] Updating a project and NIL class variables

2016-01-20 Thread Henrik Nergaard
“The warning is: this only happens when the *source* code of the #initialize methods changes. So sometimes, you will have to touch that method to force it.” Perhaps there should be an overload able method that decides whether or not to initialize the class, such that classes relying on

Re: [Pharo-users] 4th Chapter of Updated Pharo by Example ready for review.

2016-01-24 Thread Henrik Nergaard
Hi Stef, In the section "Message structure" some of the code refers to the class Pen which is no longer in the default image (I think it is located in PharoExtras?), perhaps it would be better to change the examples to another class existing in the default image so one can easily try out the

Re: [Pharo-users] Get the code of a method - Artefact

2016-03-10 Thread Henrik Nergaard
( aClass >> #aSelector ) sourceCode. Ex: (Morph>>#drawOn:) sourceCode For class side methods: (Object class >> #taskbarIcon) sourceCode Best regards, Henrik From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Guillaume Ongenae Sent: Thursday, March 10, 2016 11:14 AM

Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Henrik Nergaard
Accessing the Nominatim service: http://wiki.openstreetmap.org/wiki/Nominatim . http://ws.stfx.eu/ATBXE2DN83CW Best regards, Henrik -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of stepharo Sent: Sunday, March 13, 2016 9:52 PM To: Any

Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Henrik Nergaard
aro-users@lists.pharo.org> Subject: Re: [Pharo-users] Ideas of web services that I could script in a couple of lines? Henrik do you use MCFileTreeJsonParser just because this was just the JSON parser you got at hand? Stef Le 13/3/16 22:24, Henrik Nergaard a écrit : > Accessing the Nominati

Re: [Pharo-users] Ideas of web services that I could script in a couple of lines?

2016-03-13 Thread Henrik Nergaard
: Sunday, March 13, 2016 10:53 PM To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Subject: Re: [Pharo-users] Ideas of web services that I could script in a couple of lines? > On 13 Mar 2016, at 22:42, Henrik Nergaard <henrik.nerga...@uia.no> wrote: >

Re: [Pharo-users] View a class with inherited variables/methods

2016-03-08 Thread Henrik Nergaard
s/methods >Hi Henrik, >2016-03-08 16:57 GMT-03:00 Henrik Nergaard <henrik.nerga...@uia.no>: >> #withAllSubclasses >> TextMorphForFieldView withAllSuperclasses reversed collect: [ :cls | cls -> >> {cls instVarNames . cls methods }]. >I was doing something simila

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread Henrik Nergaard
| s1 s2 | s1 := 1234 asString. s2 := 1234 asString. s1 = s2. "true" s1 == s2. "false" s1 asSymbol = s2 asSymbol. "true" s1 asSymbol == s2 asSymbol. "true" (s1 class allInstances select: [:s | s = s1 ]) size. "2" (s1 asSymbol class allInstances select: [:s | s = s1 asSymbol ]) size. "1" [

Re: [Pharo-users] View a class with inherited variables/methods

2016-03-08 Thread Henrik Nergaard
#withAllSubclasses TextMorphForFieldView withAllSuperclasses reversed collect: [ :cls | cls -> {cls instVarNames . cls methods }]. Best regards, Henrik -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Esteban A. Maringolo Sent: Tuesday,

Re: [Pharo-users] STON UUID in the key

2016-04-02 Thread Henrik Nergaard
You need to set “allowComplexMapKeys” in StonReader to true for it to handle objects as keys. | reader | reader := STONReader new. reader allowComplexMapKeys: true. reader on: (STON toStringPretty: (Object new-> Morph new -> nil)) readStream. reader next. Best regards, Henrik From:

Re: [Pharo-users] Playgound inspecting

2016-04-27 Thread Henrik Nergaard
By the way, would someone know how to force the styler to re-style a text? RubShoutStylerDecorator>># refreshStyling So from the textArea something like: (self decoratorNamed: #shoutStyler) ifNotNil: [ :styler | styler refreshStyling ] Best regards, Henrik -Original Message- From:

Re: [Pharo-users] Disabling welcome window

2016-05-17 Thread Henrik Nergaard
World submorphs select: [ :sm | sm isSystemWindow and: [ sm label = PharoWelcomePage title ] ] thenDo: [ :window | window delete ]. Best regards, Henrik From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On

Re: [Pharo-users] Lockup when inspecting Text

2016-05-25 Thread Henrik Nergaard
Could you post the string/text object you have trouble inspecting? Both: "Text new inspect" and " (String loremIpsum: 1234) asText inspect" works fine for me (Image 60035). I can't interrupt the display (Ctrl-.). Try (Alt-.) Best regards, Henrik -Original Message- From:

Re: [Pharo-users] System Browser "Implementors of..." drill down?

2016-07-21 Thread Henrik Nergaard
This can be achieved by selecting the message/class from the text area and either right clicking and using the menu->submenu "Code search..." or you can use the shortcuts: meta+m for implementors, meta+n for senders, and meta+shift+n for references of it. There is also a shortcut (meta+space)

Re: [Pharo-users] SUnit and "data driven" tests

2016-08-12 Thread Henrik Nergaard
One possibility is to move the assertions to another method and have each test method invoke that method with a specific input. For example testPacketA self assertJitterIn: #( 1 2 3 4) equals: 42 Best regards, Henrik -Original Message- From: Pharo-users

Re: [Pharo-users] change which browser opens when browsing senders/implementors

2016-07-19 Thread Henrik Nergaard
SystemNavigation>>#browseMessageList:name:autoSelect:refreshingBlock: Adding: "methods size = 1 ifTrue: [ ^ methods anyOne browse ]." At line 10 should do the trick I think. Best regards, Henrik -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf

Re: [Pharo-users] method names - grey or black

2017-02-03 Thread Henrik Nergaard
MethodWidget>>#methodWrapper: is the method that styles the text entries of the method list in Nautilus. Best regards, Henrik Fra: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] På vegne av sheri...@sheridan-mahoney.com Sendt: 03 February 2017 17:45 Til: pharo-users@lists.pharo.org

Re: [Pharo-users] Tools for easy subtext extraction from text

2017-01-21 Thread Henrik Nergaard
>* I have to manually remove the 0x, even though it is a very common way of >expressing hex numbers Adding a few lines to NumberParser>>#nextNumber enables it to parse 0x... --- ((sourceStream peekFor: $r)) ifTrue: ["r" ... ] ifFalse: [

Re: [Pharo-users] super super

2017-01-15 Thread Henrik Nergaard
#perform:withArugments:inSuperclass: | menu | menu := MenuMorph new. menu isMorph. "true" menu perform: #isMorph withArguments: #() inSuperclass: Morph. "true" menu perform: #isMorph withArguments: #() inSuperclass: Object."false" menu perform: #isMorph withArguments: #() inSuperclass:

Re: [Pharo-users] Create png from pdf

2017-01-16 Thread Henrik Nergaard
See Form protocol (*Graphics-files), #writePNGFileNamed: , and PNGReadWriter. | canvas | canvas := FormCanvas extent: World extent. World fullDrawOn: canvas. canvas form writePNGFileNamed: 'imageOfWorld.png'

Re: [Pharo-users] Tools for easy subtext extraction from text

2017-01-20 Thread Henrik Nergaard
You can use #match and #upTo: on a ReadStream for easy extraction | text digits| text := ' Temperature 0 37C (98F) [0x25] (TMPIN0)' digits:= text readStream match: '[0x' ; upTo: $]. ( '16r' , digits ) asNumber "37"

Re: [Pharo-users] Comparing floats

2016-09-02 Thread Henrik Nergaard
You could implement a custom assert in ConverterTest to do the comparison, something like assert: aNumber withPrecision: precision equals: otherNumber self assert: (aNumber round: precision) equals: otherNumber assert: aNumber closeTo: otherNumber assert:

Re: [Pharo-users] trimRight: problem

2016-09-14 Thread Henrik Nergaard
'This is a string.' trimRight: [ :c | c = $. ] works fine for me. The trimRight method will return a new string object without the punctuation. If you just do the expression without assigning it into a variable/method call, then it will have no effect because strings are immutable so the

Re: [Pharo-users] Little challenges for a friday evening

2016-11-10 Thread Henrik Nergaard
String>>isIsogram 1 to: self size -1 do: [ :ix | (self findString: (self at: ix) asString startingAt: ix +1 caseSensitive: false ) ~~ 0 ifTrue: [ ^ false ] ].

Re: [Pharo-users] Class disappear from Nautilus, in Pharo 4

2016-11-11 Thread Henrik Nergaard
Looks like the class was created without a package? Try something like: CGPhone category: 'PackageName' Best regards, Henrik -Original Message- From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of Hilaire Sent: Friday, November 11, 2016 10:15 AM To:

Re: [Pharo-users] Flashing short duration images in a window

2016-11-28 Thread Henrik Nergaard
| image morph | image := Form fromFileNamed: 'path/(.jpg|.png)'. morph := image asMorph. morph openCenteredInWorld. morph addAlarm: #delete after: 2000 "ms". Ps. Pharo UI runs at 50Hz Best regards, Henrik From: Pharo-users

Re: [Pharo-users] Is it possible to file out a class hierarchy ?

2016-11-17 Thread Henrik Nergaard
| aStream aClass | aStream := '' writeStream. aClass := FTFilter. FTFilter fileOutOn: aStream. FTFilter allSubclassesDo: [ :cls | cls fileOutOn: aStream ]. "(ChunkFileFormatParser for: aStream contents readStream) parseChunks" --- Best regards, Henrik

Re: [Pharo-users] Little challenges for a friday evening

2016-11-11 Thread Henrik Nergaard
isIsogram | i | i := 0. self asLowercase do: [ :char | | val | val := (char asInteger - 96). (val between: 1 and: 26) ifFalse: [ ^ false ].

Re: [Pharo-users] Chip-8

2016-11-20 Thread Henrik Nergaard
http://smalltalkhub.com/#!/~Latsabben/Chip8 From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of olivier auverlot Sent: Wednesday, November 16, 2016 11:22 AM To: Any question about pharo is welcome Subject: [Pharo-users] Chip-8 Hi, I just

Re: [Pharo-users] Chip-8

2016-11-21 Thread Henrik Nergaard
is welcome <pharo-users@lists.pharo.org> Subject: Re: [Pharo-users] Chip-8 I could not resist The keys are not working for me too. Stef Le 21/11/16 à 08:38, olivier auverlot a écrit : Very cool !!! What are the used keys to move the player ? Olivier ;-) 2016-11-21 0:16 GMT+01:00 Henrik Ne

Re: [Pharo-users] About STONS efficiency at storing nested objects { was : (Re: Keeping data with an application)}

2016-11-02 Thread Henrik Nergaard
You could always store the closure as a string and then evaluate it on materialization, at least if it is clean (no thisContext and no return) For blocks without no self usage: -- | blk | blk := [ :a :b | a <= b ]. #_ assert: blk isClean. blk := Compiler evaluate: blk

Re: [Pharo-users] [Stupid Benchmarks] C++ vs Pharo

2016-12-17 Thread Henrik Nergaard
You are comparing two different types here, double vs a 32 bit integer, and program starting time should be excluded. Something like: In playground: Smalltalk garbageCollect. [ 0 to: 16r0FFF do: [ :x | ] ] timeToRun. “ try switch the 0 to 0.0 to have the iterations be on a float, leads to

Re: [Pharo-users] [Stupid Benchmarks] C++ vs Pharo

2016-12-17 Thread Henrik Nergaard
This is not a comparable benchmark as the sum in Smalltalk keeps on growing and ends up doing LargeInteger calculations and thus the speed loss, while the c the int just rolls over. Sum in Smalltalk = 55 Sum in C = -1243309312 Best regards, Henrik -Original Message-

Re: [Pharo-users] making scroll smooth

2017-01-13 Thread Henrik Nergaard
Hi Siemen, This is morph/widget specific so it would depend on what widget you want to change (see implementors of #mouseWheel: ). Best regards, Henrik Fra: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] På vegne av Siemen Baader Sendt: 13 January 2017 11:41 Til: Any question about

Re: [Pharo-users] Mouse events in FastTableModel subclass [Spec]

2017-01-06 Thread Henrik Nergaard
You can get the selection directly in FastTableModel by Setting #handlesDoubleClick: to true and the event handler block using #doubleClickAction: - FastTableModel new icons: [ :e | example iconNamed: #forwardIcon ]; items: (1 to: 10)

Re: [Pharo-users] DNU on materializing a fueled out exception

2016-12-28 Thread Henrik Nergaard
Hi Holger, For slice based fixes: 1) Open case on Fogbugz and set the milestone to Pharo 5.0 2) Create a slice with the proposed fix 3) In Monticello browser: Select the slice package and select Pharo50/main repository and then click on changes to verify that the slice is correct. 3) Upload the

Re: [Pharo-users] Scaled image

2016-12-22 Thread Henrik Nergaard
You can use WarpBlt to scale the form. | input output | input := Smalltalk ui icons iconNamed: #class. output := Form extent: 128 asPoint depth: 32. (WarpBlt toForm: output) sourceForm: input; cellSize: 1;

Re: [Pharo-users] Playground and Dr. Geo

2017-07-16 Thread Henrik Nergaard
Hi, a)Do you wrap the morph inside the morph tab view? , b) Do you use the same code for rendering as in Morph>> #gtInspectorMorphIn: . if a) it is most likely caused by the morph being wrapped within one or more transform morphs, and the offset of these are not taken into account when

Re: [Pharo-users] Is it possible to change the Pharo application title bar?

2017-07-23 Thread Henrik Nergaard
DisplayScreen hostWindowTitle: 'NewTitle' Best regards, Henrik Fra: Pharo-users på vegne av Tim Mackinnon Sendt: 22. juli 2017 18:44:46 Til: Pharo Users Newsgroup Emne: [Pharo-users] Is it possible to

Re: [Pharo-users] Playground doesn't respect LF endings

2017-08-19 Thread Henrik Nergaard
>> Right now I have to execute `Clipboard clipboardText withSqueakLineEndings >> asString` and then copy the result. Why not fix the issue instead? * Browse senders of #cr * Filter "rub" * Find the method that navigates the cursor to line end * change #indexOf::: to use

Re: [Pharo-users] Windows equivalent of kill -s SIGUSR1?

2017-05-14 Thread Henrik Nergaard
Windows do not have Unix-style signals such as SIGUSR1. To kill a process you can use Windows PowerShell: $ Stop-Process -Name Pharo Or by pid: $ Get-Process -Name Pharo $ Stop-Process -Id 42 Best regards, Henrik Sent from Mail for Windows 10

[Pharo-users] XPath has unresolved dependencies

2017-06-05 Thread Henrik Nergaard
Hi, Loading XPath from the catalog browser into the latest image raises a warning that there are unresolved references, and that the package depends on the following classes: XMLHighlighter, XMLHighlighterDefaults, GLMXMLHighlighterTextStylerDecorator. The regular XPath works fine ignoring

Re: [Pharo-users] [Pillar] How do I include a picture which I get from aMorph imageFrom?

2017-08-31 Thread Henrik Nergaard
"There is no need to open the morph in the world and delete it. #imageForm uses its own form and renders the morph onto it." | image | image := AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap; color: Color gray; addMorph: (EllipseMorph new color: Color red);

Re: [Pharo-users] Fuel serialize of 70MB takes forever on Linux vs. Mac

2017-12-18 Thread Henrik-Nergaard
Hi Andreas, It looks like you may have problems with hash collisions FLLargeIdentityDictionary. What are the tally sizes of the FLLargeIdentityDicitonary used when you serialize? (If these have a tally larger than ~ 75% of the available size (4096 items), then there may well be some performance

Re: [Pharo-users] Object configuration idioms

2018-02-11 Thread Henrik-Nergaard
Hi Peter, I would just fill in the configuration and have it give me the correct client which uses the configuration instance. = | client | client := TwitterConfiguration new username: 'stuff'; password: 'password1'; port: '1234'; useHttps; client.

Re: [Pharo-users] Morph reacting to Window being closed

2018-07-29 Thread Henrik-Nergaard
Hi Peter, There are two methods which can be used for this purpose. #outOfWorld: #announceDeleted Both are called recursively down the morph tree from the window. If you need to stop the window or provide a dialog then you should create a subclass of Model and use that to keep references to

Re: [Pharo-users] NeoJSON sorting instance variables/properties

2018-07-25 Thread Henrik-Nergaard
Hi Peter, This functionallity is already available in STON where it preserves the order when you use an OrderedDictionary. And was implemented for the usecase of dealing with fileout and versioning. Perhaps the same could be added to NeoJson so that instead of some magic flag you provide an