Re: [Pharo-users] how to properly create icons
On 04 Apr 2015, at 09:14, Peter Uhnák i.uh...@gmail.com wrote: Hi, I've been using using ThemeIconscreateIconMethodsFromFile:directory: method to create my own icons, however there are some reported problems https://pharo.fogbugz.com/f/cases/15277/some-icons-from-ThemeIcons-are-broken https://pharo.fogbugz.com/f/cases/15277/some-icons-from-ThemeIcons-are-broken with the code it generates. this is the right way and issue 15277 does not have anything to do with it. My questions are: 1) what exactly is the problem with the generated code? none. 2) what would then be the correct way to generate it? as pointed. Glamorous (Moose) icons seem to use different format (using byte array instead of Base64), but I do not see any code that would generate those methods. their fault, not ours :) and more in deep: there is obviously several ways to do this, and none of them are incorrect. The way provided in ThemeIcons is the way that consumes less space (in sources) I could find… At the end, you have to provide a bitmap, the difference is how to encode them, so is just a different way of encoding the same information. cheers, Esteban Thanks, Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
Tried your install instructions but give me an error[1] about being unable to resolve IconFactory , tries to look inside my package-cache of my image (pharo 4 - 40591 -MACOSX 10). Interesting tool, out of coincidence I am also working with icons but in my cases its SVG icons using Bloc . [1] MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)retryingResolvePackageSpecReferences:gofer: linearLoadPackageSpec: packageSpec gofer: gofer MetacelloPlatform current do: [ | references nearestReference cachedReference externalReference mcVersion loadedVersionInfos | check to see if mcz file is already in cacheRepository cachedReference := self resolvePackageSpec: packageSpec cachedGofer: self loaderPolicy cacheGofer. (cachedReference ~~ nil and: [ packageSpec getFile ~~ nil ]) ifTrue: [ cachedReference name = packageSpec file ifTrue: [ exact match between packageSpec file and cache ^ self scheduleFetchFor: packageSpec cachedReference: cachedReference ] ].look up mcz file references := self retryingResolvePackageSpecReferences: packageSpec gofer: gofer. nearestReference := references last asMetacelloCachingResolvedReference.If the mcz is already in the cacheRepository, no need to copy (cachedReference ~~ nil and: [ cachedReference name = nearestReference name ]) ifTrue: [ latest reference in repository matches cachedReference ... ^ self scheduleFetchFor: packageSpec nearestReference: nearestReference ].If the mcz is already loaded into the image, no need to copy (self ignoreImage not and: [ (loadedVersionInfos := self ancestorsFor: packageSpec) ~~ nil ]) ifTrue: [ loadedVersionInfos do: [ :info | info name = nearestReference name ifTrue: [ ^ self ] ] ]. externalReference := (references select: [ :ref | ref name = nearestReference name ]) first asMetacelloCachingResolvedReference. self repositoryMap at: externalReference name put: externalReference repository. (self resolveDependencies: externalReference nearest: nearestReference into: (OrderedCollection with: nearestReference)) do: [ :reference | | pSpec l | mcVersion := reference version. (l := (GoferVersionReference name: reference name) resolveAllWith: self loaderPolicy cacheGofer) isEmpty ifTrue: [ self cacheRepository storeVersion: mcVersion. reference == nearestReference ifTrue: [ pSpec := packageSpec ] ifFalse: [ pSpec := packageSpec project packageSpec. pSpec name: mcVersion package name ]. self loadData addVersion: mcVersion versionInfo: mcVersion info resolvedReference: reference packageSpec: pSpec ] ]. self scheduleFetchFor: packageSpec externalReference: externalReference ] displaying: 'Fetching ' , packageSpec file in MetacelloFetchingMCSpecLoaderlinearLoadPackageSpec:gofer: in Block: linearLoadPackageSpec: packageSpec gofer: gofer... MetacelloPharo30Platform(MetacelloPlatform)do:displaying: MetacelloFetchingMCSpecLoaderlinearLoadPackageSpec:gofer: MetacelloPackageSpecloadUsing:gofer: [ :pkg | pkg loadUsing: self gofer: gofer ] in MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)linearLoadPackageSpecs:repositories: in Block: [ :pkg | pkg loadUsing: self gofer: gofer ] OrderedCollectiondo: MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)linearLoadPackageSpecs:repositories: [ super linearLoadPackageSpecs: packageSpecs repositories: repositories ] in MetacelloFetchingMCSpecLoaderlinearLoadPackageSpecs:repositories: in Block: [ super linearLoadPackageSpecs: packageSpecs repos...etc... BlockClosureensure: MetacelloLoaderPolicypushLoadDirective:during: MetacelloLoaderPolicypushLinearLoadDirectivesDuring:for: MetacelloFetchingMCSpecLoaderlinearLoadPackageSpecs:repositories: MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)load MetacelloMCVersionSpecLoaderload MetacelloMCVersionexecuteLoadFromArray: [ :dict | ^ self executeLoadFromArray: anArray ] in [ self versionSpec loader: newLoader. MetacelloPlatform current useStackCacheDuring: [ :dict | ^ self executeLoadFromArray: anArray ] defaultDictionary: Dictionary new ] in [ [ self versionSpec loader:
[Pharo-users] videos of 4 min showing a cool pharo XP
I would like that we all brainstorm about videos of 4 min showing a cool pharo XP I think about - haltif implementation - on the fly changing somehting - chipmunks - earth shadder - picasa scripting. …. - rotating cubes I think that doing some teasers in the GT vein is important.
Re: [Pharo-users] how to properly create icons
Thanks Esteban! Peter On Sat, Apr 4, 2015 at 9:29 AM, Esteban Lorenzano esteba...@gmail.com wrote: On 04 Apr 2015, at 09:14, Peter Uhnák i.uh...@gmail.com wrote: Hi, I've been using using ThemeIconscreateIconMethodsFromFile:directory: method to create my own icons, however there are some reported problems https://pharo.fogbugz.com/f/cases/15277/some-icons-from-ThemeIcons-are-broken with the code it generates. this is the right way and issue 15277 does not have anything to do with it. My questions are: 1) what exactly is the problem with the generated code? none. 2) what would then be the correct way to generate it? as pointed. Glamorous (Moose) icons seem to use different format (using byte array instead of Base64), but I do not see any code that would generate those methods. their fault, not ours :) and more in deep: there is obviously several ways to do this, and none of them are incorrect. The way provided in ThemeIcons is the way that consumes less space (in sources) I could find… At the end, you have to provide a bitmap, the difference is how to encode them, so is just a different way of encoding the same information. cheers, Esteban Thanks, Peter
[Pharo-users] how to properly create icons
Hi, I've been using using ThemeIconscreateIconMethodsFromFile:directory: method to create my own icons, however there are some reported problems https://pharo.fogbugz.com/f/cases/15277/some-icons-from-ThemeIcons-are-broken with the code it generates. My questions are: 1) what exactly is the problem with the generated code? 2) what would then be the correct way to generate it? Glamorous (Moose) icons seem to use different format (using byte array instead of Base64), but I do not see any code that would generate those methods. Thanks, Peter
[Pharo-users] IconFactory - utility for creating icons in Pharo
Hi, since I've been making new icons lately for my project I was frustrated with constantly copying code and methods around... so I've made a small utility for it http://smalltalkhub.com/#!/~peteruhnak/IconFactory on top of creating the icons it can add extra stuff like GTInspector support. Any feedback appreciated. Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
That's strange : try this please Gofer new smalltalkhubUser: 'peteruhnak' project: 'IconFactory'; package: 'IconFactory'; load. In the meantime I'll be fixing the configuration... but it should be ok. :/ Peter On Sat, Apr 4, 2015 at 2:00 PM, kilon alios kilon.al...@gmail.com wrote: Tried your install instructions but give me an error[1] about being unable to resolve IconFactory , tries to look inside my package-cache of my image (pharo 4 - 40591 -MACOSX 10). Interesting tool, out of coincidence I am also working with icons but in my cases its SVG icons using Bloc . [1] MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)retryingResolvePackageSpecReferences:gofer: linearLoadPackageSpec: packageSpec gofer: gofer MetacelloPlatform current do: [ | references nearestReference cachedReference externalReference mcVersion loadedVersionInfos | check to see if mcz file is already in cacheRepository cachedReference := self resolvePackageSpec: packageSpec cachedGofer: self loaderPolicy cacheGofer. (cachedReference ~~ nil and: [ packageSpec getFile ~~ nil ]) ifTrue: [ cachedReference name = packageSpec file ifTrue: [ exact match between packageSpec file and cache ^ self scheduleFetchFor: packageSpec cachedReference: cachedReference ] ].look up mcz file references := self retryingResolvePackageSpecReferences: packageSpec gofer: gofer. nearestReference := references last asMetacelloCachingResolvedReference.If the mcz is already in the cacheRepository, no need to copy (cachedReference ~~ nil and: [ cachedReference name = nearestReference name ]) ifTrue: [ latest reference in repository matches cachedReference ... ^ self scheduleFetchFor: packageSpec nearestReference: nearestReference ].If the mcz is already loaded into the image, no need to copy (self ignoreImage not and: [ (loadedVersionInfos := self ancestorsFor: packageSpec) ~~ nil ]) ifTrue: [ loadedVersionInfos do: [ :info | info name = nearestReference name ifTrue: [ ^ self ] ] ]. externalReference := (references select: [ :ref | ref name = nearestReference name ]) first asMetacelloCachingResolvedReference. self repositoryMap at: externalReference name put: externalReference repository. (self resolveDependencies: externalReference nearest: nearestReference into: (OrderedCollection with: nearestReference)) do: [ :reference | | pSpec l | mcVersion := reference version. (l := (GoferVersionReference name: reference name) resolveAllWith: self loaderPolicy cacheGofer) isEmpty ifTrue: [ self cacheRepository storeVersion: mcVersion. reference == nearestReference ifTrue: [ pSpec := packageSpec ] ifFalse: [ pSpec := packageSpec project packageSpec. pSpec name: mcVersion package name ]. self loadData addVersion: mcVersion versionInfo: mcVersion info resolvedReference: reference packageSpec: pSpec ] ]. self scheduleFetchFor: packageSpec externalReference: externalReference ] displaying: 'Fetching ' , packageSpec file in MetacelloFetchingMCSpecLoaderlinearLoadPackageSpec:gofer: in Block: linearLoadPackageSpec: packageSpec gofer: gofer... MetacelloPharo30Platform(MetacelloPlatform)do:displaying: MetacelloFetchingMCSpecLoaderlinearLoadPackageSpec:gofer: MetacelloPackageSpecloadUsing:gofer: [ :pkg | pkg loadUsing: self gofer: gofer ] in MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)linearLoadPackageSpecs:repositories: in Block: [ :pkg | pkg loadUsing: self gofer: gofer ] OrderedCollectiondo: MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)linearLoadPackageSpecs:repositories: [ super linearLoadPackageSpecs: packageSpecs repositories: repositories ] in MetacelloFetchingMCSpecLoaderlinearLoadPackageSpecs:repositories: in Block: [ super linearLoadPackageSpecs: packageSpecs repos...etc... BlockClosureensure: MetacelloLoaderPolicypushLoadDirective:during: MetacelloLoaderPolicypushLinearLoadDirectivesDuring:for: MetacelloFetchingMCSpecLoaderlinearLoadPackageSpecs:repositories:
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
createIconsFromDirectory seems to see only the first png, maybe because its too large how large? createIconFromFile gives me a MNU it accepts a FileReference, not a string; I should put guard there. Peter
Re: [Pharo-users] Devnology presentation slides
Thanks Stephan and Diego, Added to my zotero subcollection on Smalltalk/Pharo: https://www.zotero.org/groups/diseo_y_creacion_phd_msc_universidad_de_caldas/items/collectionKey/IVQ5BUUC/itemKey/272G6IG3/itemPage/7 Cheers, Offray El 03/04/15 a las 16:35, Stephan Eggermont escribió: On 03/04/15 19:30, stepharo wrote: Hi stefan what were the reactions of the audience? We managed to make them think. We had a very small, and very knowledgable group, so we had lots of difficult and interesting questions and discussions. The thing that impressed them the most was the incredibly short feedback loop when doing debugger driven design, and the way you talk to your objects. We pretty much followed the slides with the exercises, having a short sample of each of the complexity reducing things we do in Pharo. Stephan
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
Aha, of course. The program makes assumptions about the file name and since it is naming the method like the file it fails, because you can't have - in method name. I could change it so it removes all non-alphanumeric characters from the name. Peter On Sat, Apr 4, 2015 at 3:52 PM, kilon alios kilon.al...@gmail.com wrote: I found the problem Norse_largeThe '-' prefix works only for literal numbers (use #negated instead) - -cpcIconContents Private - Method generated with the content of the file File @ /Users/kilon/Downloads/Norse_large-cpc.png looks like it does not like that i use - inside the file name. In the folder the name of the file is not Norse_large-cpc.png but Norse-large-cpc.png - has some special meaning here ? On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák i.uh...@gmail.com wrote: create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
yes thats better , install works, first step works too. createIconsFromDirectory seems to see only the first png, maybe because its too large. createIconFromFile gives me a MNU: ByteString base [1]. Why those methods are not on the class side ? [1]ByteString(Object)doesNotUnderstand: #base IconFactorycreateIconFromFile:inClass: UndefinedObjectDoIt OpalCompilerevaluate SmalltalkEditorevaluateSelectionAndDo: SmalltalkEditorevaluateSelection [ textMorph editor evaluateSelection ] in PluggableTextMorphdoIt in Block: [ textMorph editor evaluateSelection ] [ result := editBlock value ] in PluggableTextMorphhandleEdit: in Block: [ result := editBlock value ] TextMorphForEditView(TextMorph)handleEdit: PluggableTextMorphhandleEdit: PluggableTextMorphdoIt Workspace(Object)perform:orSendTo: [ | selArgCount | show cursor in case item opens a new MVC window (selArgCount := selector numArgs) = 0 ifTrue: [ target perform: selector ] ifFalse: [ selArgCount = arguments size ifTrue: [ target perform: selector withArguments: arguments ] ifFalse: [ target perform: selector withArguments: (arguments copyWith: evt) ] ]. self changed ] in ToggleMenuItemMorph(MenuItemMorph)invokeWithEvent: in Block: [ ... BlockClosureensure: CursorWithMask(Cursor)showWhile: ToggleMenuItemMorph(MenuItemMorph)invokeWithEvent: ToggleMenuItemMorph(MenuItemMorph)mouseUp: ToggleMenuItemMorph(MenuItemMorph)handleMouseUp: MouseButtonEventsentTo: ToggleMenuItemMorph(Morph)handleEvent: MorphicEventDispatcherdispatchDefault:with: MorphicEventDispatcherhandleMouseUp: MouseButtonEventsentTo: [ ^ anEvent sentTo: self ] in MorphicEventDispatcherdispatchEvent:with: in Block: [ ^ anEvent sentTo: self ] BlockClosureensure: MorphicEventDispatcherdispatchEvent:with: ToggleMenuItemMorph(Morph)processEvent:using: MorphicEventDispatcherdispatchDefault:with: MorphicEventDispatcherhandleMouseUp: MouseButtonEventsentTo:
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
On Sat, Apr 4, 2015 at 2:46 PM, kilon alios kilon.al...@gmail.com wrote: actually i was wrong its not that large, only 34kbs , I have also attached it if you want to take a look at it. This works just fine for me; does it show any error for you? Or did it just create one file and then gave up? Peter
Re: [Pharo-users] [ANN] New service: The Pharo catalog
read the page. there is an explanation. Le 4/4/15 14:47, Alexandre Bergel a écrit : Hi!! This an excellent idea. How to provide a description for my project? Alexandre Le 1 avr. 2015 à 07:13, Esteban Lorenzano esteba...@gmail.com mailto:esteba...@gmail.com a écrit : Hi, Last week I made a super small project to consolidate all projects published in all metarepos. Is very simple, in the style of smalltalkhub repository list, but it shows all projects with the info their owners provided. Yes, it could be a lot better, but we do not want to lose much time with this because not far in the future (but not right now) we will put online a much better service :) You can see the catalog here: http://catalog.pharo.org and a JSON variant here: http://catalog.pharo.org/catalog/json enjoy, Esteban
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
Because composition/decomposition is good (among others for re-use), because with separate entries you can browse them more easily, because we don't like long methods, ... You get the idea ;-) On 04 Apr 2015, at 16:45, kilon alios kilon.al...@gmail.com wrote: once more I really dont like idea of methods returning single values. This also one of the reasons why Spec annoys me. Why not have Collection / Dictionary that stores all these strings ? Having 100 methods for 100 icons seems really ugly . Instead one collection with 100 entries and a single method would be more than enough. I know its not just you that do this and is how icons work in Pharo .Its basically how many things work like this inside Pharo. But I still dont get it why ? On Sat, Apr 4, 2015 at 5:15 PM, Peter Uhnák i.uh...@gmail.com wrote: Aha, of course. The program makes assumptions about the file name and since it is naming the method like the file it fails, because you can't have - in method name. I could change it so it removes all non-alphanumeric characters from the name. Peter On Sat, Apr 4, 2015 at 3:52 PM, kilon alios kilon.al...@gmail.com wrote: I found the problem Norse_largeThe '-' prefix works only for literal numbers (use #negated instead) - -cpcIconContents Private - Method generated with the content of the file File @ /Users/kilon/Downloads/Norse_large-cpc.png looks like it does not like that i use - inside the file name. In the folder the name of the file is not Norse_large-cpc.png but Norse-large-cpc.png - has some special meaning here ? On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák i.uh...@gmail.com wrote: create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
Or it seems cheap enough to just send #asFileReference to give the user a bit of flexibility Yep, I've changed that. Interesting that google is showing me, that you've replied 8 minutes before I even posted it. :)
Re: [Pharo-users] [ANN] New service: The Pharo catalog
Hi!! This an excellent idea. How to provide a description for my project? Alexandre Le 1 avr. 2015 à 07:13, Esteban Lorenzano esteba...@gmail.com a écrit : Hi, Last week I made a super small project to consolidate all projects published in all metarepos. Is very simple, in the style of smalltalkhub repository list, but it shows all projects with the info their owners provided. Yes, it could be a lot better, but we do not want to lose much time with this because not far in the future (but not right now) we will put online a much better service :) You can see the catalog here: http://catalog.pharo.org and a JSON variant here: http://catalog.pharo.org/catalog/json enjoy, Esteban
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
I found the problem Norse_largeThe '-' prefix works only for literal numbers (use #negated instead) - -cpcIconContents Private - Method generated with the content of the file File @ /Users/kilon/Downloads/Norse_large-cpc.png looks like it does not like that i use - inside the file name. In the folder the name of the file is not Norse_large-cpc.png but Norse-large-cpc.png - has some special meaning here ? On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák i.uh...@gmail.com wrote: create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
once more I really dont like idea of methods returning single values. This also one of the reasons why Spec annoys me. Why not have Collection / Dictionary that stores all these strings ? Having 100 methods for 100 icons seems really ugly . Instead one collection with 100 entries and a single method would be more than enough. I know its not just you that do this and is how icons work in Pharo .Its basically how many things work like this inside Pharo. But I still dont get it why ? On Sat, Apr 4, 2015 at 5:15 PM, Peter Uhnák i.uh...@gmail.com wrote: Aha, of course. The program makes assumptions about the file name and since it is naming the method like the file it fails, because you can't have - in method name. I could change it so it removes all non-alphanumeric characters from the name. Peter On Sat, Apr 4, 2015 at 3:52 PM, kilon alios kilon.al...@gmail.com wrote: I found the problem Norse_largeThe '-' prefix works only for literal numbers (use #negated instead) - -cpcIconContents Private - Method generated with the content of the file File @ /Users/kilon/Downloads/Norse_large-cpc.png looks like it does not like that i use - inside the file name. In the folder the name of the file is not Norse_large-cpc.png but Norse-large-cpc.png - has some special meaning here ? On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák i.uh...@gmail.com wrote: create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] IconFactory - utility for creating icons in Pharo
No really I dont get the idea, composition decomposition is the bread and butter of collection types in any language. Unless pharo has a weakness in this area that I am not aware of, in python I had never such problem. actually its a foremost reason to use them in the first place. Browsing is a limitation of the browser which does not provide a special view for variables but not that hard to amend with inspector. And I find hard to believe you prefer a ton of short methods instead one short one for returning those values. The only reason I can think in this case of icons is that compiling a string as return value of a method to be used statically is easier/ more convenient than defining a huge collection in the initialize method. on the other hand would not make more sense to have all this data that means nothing for the user as separate files and let them load at the startup of the image ? Its not as if anyone would bother editing those huge gibberish strings . Thats the only way I see for avoiding long methods. Or am I missing something here ? On Sat, Apr 4, 2015 at 6:01 PM, Sven Van Caekenberghe s...@stfx.eu wrote: Because composition/decomposition is good (among others for re-use), because with separate entries you can browse them more easily, because we don't like long methods, ... You get the idea ;-) On 04 Apr 2015, at 16:45, kilon alios kilon.al...@gmail.com wrote: once more I really dont like idea of methods returning single values. This also one of the reasons why Spec annoys me. Why not have Collection / Dictionary that stores all these strings ? Having 100 methods for 100 icons seems really ugly . Instead one collection with 100 entries and a single method would be more than enough. I know its not just you that do this and is how icons work in Pharo .Its basically how many things work like this inside Pharo. But I still dont get it why ? On Sat, Apr 4, 2015 at 5:15 PM, Peter Uhnák i.uh...@gmail.com wrote: Aha, of course. The program makes assumptions about the file name and since it is naming the method like the file it fails, because you can't have - in method name. I could change it so it removes all non-alphanumeric characters from the name. Peter On Sat, Apr 4, 2015 at 3:52 PM, kilon alios kilon.al...@gmail.com wrote: I found the problem Norse_largeThe '-' prefix works only for literal numbers (use #negated instead) - -cpcIconContents Private - Method generated with the content of the file File @ /Users/kilon/Downloads/Norse_large-cpc.png looks like it does not like that i use - inside the file name. In the folder the name of the file is not Norse_large-cpc.png but Norse-large-cpc.png - has some special meaning here ? On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák i.uh...@gmail.com wrote: create file ? i thought the class only creates methods yeah, I mean method anyway, the method is created , but it does not proceed to next png. Shouldn create a method for each png it finds in the directory ? yes it should, it operates on a collection, so if dir allFiles select: [ :each | each extension = 'png' ] shows more then one file it should also create a method for each one, not just the first Peter
Re: [Pharo-users] How to silently generate and remove code
Thierry this means that generating ring objects would help you? I guess so. stef Le 30/3/15 16:25, Thierry Goubier a écrit : A use case: the ability to test and debug the code generation part of SmaCC. SmaCC, when compiling a parser, generates dozens of classes and hundreds of methods, some of those very long, as a sequence of refactorings (and optimise them). Then SmaCC apply them all in one step. I'd dream of having a virtual environment where I could test-compile and check all those methods, via a system browser, before they are compiled. Thierry 2015-03-30 9:10 GMT+02:00 Marcus Denker marcus.den...@inria.fr mailto:marcus.den...@inria.fr: On 29 Mar 2015, at 10:32, stepharo steph...@free.fr mailto:steph...@free.fr wrote: Before that I would like that the compiler outputs classes definition in an environment (that can be the default one) but that can be the one I want and specified from the outside of the compiler. For installing, it is the ClassInstaller that does that (and yes, it has an environment). What the compiler does not have is to look up references e.g. to symbols regarding to an environment, but that is because we don’t have that concept right now in the system in general. globals/class vars are requested from the class (which defines its environment). So in general, we first need a use case, else it is not clear what to do… Marcus
Re: [Pharo-users] Glorp with PostgresV2 on Pharo 4
On Fri, Apr 03, 2015 at 07:20:40AM +0200, Sven Van Caekenberghe wrote: Yes, we have to fix that, but you also set it manually, no real need to patch the code: Ok, wasn't sure what the encoding strategy should be. I'll patch GlorpDatabaseLoginResource then. Pierce
Re: [Pharo-users] Tabs in Playground ?
On Sat, Apr 04, 2015 at 09:12:11PM +0200, Cyril Ferlicot wrote: I just wanted to know because with the little Untitle tab it looks lile we can open tabs in it. That was just for information. Up through Pharo 3 I have been using Script Manager. Haven't tried in Pharo 4 so not sure whether any gotchas. Pierce
Re: [Pharo-users] Converting a string containing dots to integer
If it's for the thousand you can use that: (myStringNumber copyWithoutAll: '.') asNumber To find this kind of methods you can use the finder (world - Tools). You select example and you search for things like : '1.234'.'.'.'1234' and that will give you: '1.234' copyWithoutAll: '.' first - '1234' -- Cheers Cyril Ferlicot On 5 April 2015 at 01:43, Benoit St-Jean via Pharo-users pharo-users@lists.pharo.org wrote: -- Forwarded message -- From: Benoit St-Jean bstj...@yahoo.com To: Any question about pharo is welcome pharo-users@lists.pharo.org Cc: Date: Sat, 4 Apr 2015 23:40:01 + (UTC) Subject: Re: [Pharo-users] Converting a string containing dots to integer Do you have more details? Such as, do you have values with more than one dot ? (e.g. 1.436.782) Do you have values with no dot? - Benoit St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean IRC: lamneth Blogue: endormitoire.wordpress.com A standpoint is an intellectual horizon of radius zero. (A. Einstein) -- *From:* Offray Vladimir Luna Cárdenas off...@riseup.net *To:* Any question about pharo is welcome pharo-users@lists.pharo.org *Sent:* Saturday, April 4, 2015 7:17 PM *Subject:* [Pharo-users] Converting a string containing dots to integer Hi all, I'm parsing some text which contains numbers like 8.324 and I would like to convert it to integer. The problem is that asNumber and asInteger don't make the trick because of the dot (.), which is there to indicate thousands, not decimal values. Which is the proper message to send? Cheers, Offray
Re: [Pharo-users] Converting a string containing dots to integer
Thanks a lot it works like a charm! Cheers, Offray El 04/04/15 a las 19:13, Cyril Ferlicot escribió: If it's for the thousand you can use that: (myStringNumber copyWithoutAll: '.') asNumber To find this kind of methods you can use the finder (world - Tools). You select example and you search for things like : '1.234'.'.'.'1234' and that will give you: '1.234' copyWithoutAll: '.' first - '1234' -- Cheers Cyril Ferlicot On 5 April 2015 at 01:43, Benoit St-Jean via Pharo-users pharo-users@lists.pharo.org mailto:pharo-users@lists.pharo.org wrote: -- Forwarded message -- From: Benoit St-Jean bstj...@yahoo.com mailto:bstj...@yahoo.com To: Any question about pharo is welcome pharo-users@lists.pharo.org mailto:pharo-users@lists.pharo.org Cc: Date: Sat, 4 Apr 2015 23:40:01 + (UTC) Subject: Re: [Pharo-users] Converting a string containing dots to integer Do you have more details? Such as, do you have values with more than one dot ? (e.g. 1.436.782) Do you have values with no dot? - Benoit St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean IRC: lamneth Blogue: endormitoire.wordpress.com http://endormitoire.wordpress.com A standpoint is an intellectual horizon of radius zero. (A. Einstein) *From:* Offray Vladimir Luna Cárdenas off...@riseup.net mailto:off...@riseup.net *To:* Any question about pharo is welcome pharo-users@lists.pharo.org mailto:pharo-users@lists.pharo.org *Sent:* Saturday, April 4, 2015 7:17 PM *Subject:* [Pharo-users] Converting a string containing dots to integer Hi all, I'm parsing some text which contains numbers like 8.324 and I would like to convert it to integer. The problem is that asNumber and asInteger don't make the trick because of the dot (.), which is there to indicate thousands, not decimal values. Which is the proper message to send? Cheers, Offray
[Pharo-users] NeoCSV and big files
Dear all, We are currently setup a small ROASSAL team to participate to #Datathon Data for Development: http://simplon.co/datathon-data-for-development-rdv-les-7-et-8-avril-a-montreuil/ We are looking to ways to be able to load big CSV table in a Pharo image. Apparently the size of some CSV files provided will be huge (around 5 Go for one month of data). The format of the data are describe here: http://arxiv.org/abs/1407.4885 Is this possible with NeoCSV, to read only a fraction of the lines regarding some conditions ? If some people want to help online, we can organize a chat to organize us. Regards, -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Re: [Pharo-users] NeoCSV and big files
Am 04.04.2015 um 19:23 schrieb Serge Stinckwich serge.stinckw...@gmail.com: Dear all, We are currently setup a small ROASSAL team to participate to #Datathon Data for Development: http://simplon.co/datathon-data-for-development-rdv-les-7-et-8-avril-a-montreuil/ We are looking to ways to be able to load big CSV table in a Pharo image. Apparently the size of some CSV files provided will be huge (around 5 Go for one month of data). The format of the data are describe here: http://arxiv.org/abs/1407.4885 Is this possible with NeoCSV, to read only a fraction of the lines regarding some conditions ? The NeoCSVReader supports the necessary stream protocol. If you setup the csv reader you can call #next on it and filter by condition. There is also #atEnd so a simple loop should. But I never used to csv reader so Sven might have much better options. Norbert If some people want to help online, we can organize a chat to organize us. Regards, -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Re: [Pharo-users] NeoCSV and big files
Thanks Sven for your support! Alexandre On Apr 4, 2015, at 3:02 PM, Sven Van Caekenberghe s...@stfx.eu wrote: There are also #select: and #select:thenDo: convenience methods. NeoCSV is properly streaming, it should not introduce memory consumption problems itself. But note that you cannot load more than about 1Gb of permanent data in the current VM. One known performance limitation is in handling extremely long lines/records. If you have a question or problem, just ask. Sven On 04 Apr 2015, at 19:54, Norbert Hartl norb...@hartl.name wrote: Am 04.04.2015 um 19:23 schrieb Serge Stinckwich serge.stinckw...@gmail.com: Dear all, We are currently setup a small ROASSAL team to participate to #Datathon Data for Development: http://simplon.co/datathon-data-for-development-rdv-les-7-et-8-avril-a-montreuil/ We are looking to ways to be able to load big CSV table in a Pharo image. Apparently the size of some CSV files provided will be huge (around 5 Go for one month of data). The format of the data are describe here: http://arxiv.org/abs/1407.4885 Is this possible with NeoCSV, to read only a fraction of the lines regarding some conditions ? The NeoCSVReader supports the necessary stream protocol. If you setup the csv reader you can call #next on it and filter by condition. There is also #atEnd so a simple loop should. But I never used to csv reader so Sven might have much better options. Norbert If some people want to help online, we can organize a chat to organize us. Regards, -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/ -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
[Pharo-users] How do I get the list of projects on SmalltalkHub?
Where can we find this information as a newbie? Stef
Re: [Pharo-users] How to silently generate and remove code
Le 30/3/15 09:10, Marcus Denker a écrit : On 29 Mar 2015, at 10:32, stepharo steph...@free.fr wrote: Before that I would like that the compiler outputs classes definition in an environment (that can be the default one) but that can be the one I want and specified from the outside of the compiler. For installing, it is the ClassInstaller that does that (and yes, it has an environment). What the compiler does not have is to look up references e.g. to symbols regarding to an environment, but that is because we don’t have that concept right now in the system in general. globals/class vars are requested from the class (which defines its environment). So in general, we first need a use case, else it is not clear what to do… Sc1: Imagine that Max wants to load code that if the code is incomplete or contains Undefined the code is not loaded at all. To do so we need to be able to compile the code in a separate namespace. Then on success copy/install to another one. sd := SystemDictionary new. OpalCompiler inputEnvironment: Smalltalk globals outputEnvironment: sd. This shows that probably sd should be linked to Smalltalk globals to be able to find new added class (that will not be found in sd). Sc2: We should be able to compile Opal beside Opal in a sister environment, modify it by compiling method there. Sc3: Guillermo's Tornado Infrastructure. Instead of installing, copying manually and hacking, probably that guillermo needs a compiling infrastructure were we can say - look for literals in this special array or environemtn - look for globals in this one - put the returns in the other literalas environment and globals. Stef
Re: [Pharo-users] Tabs in Playground ?
Thank you ! I just wanted to know because with the little Untitle tab it looks lile we can open tabs in it. That was just for information. On 3 April 2015 at 16:51, Alexandre Bergel alexandre.ber...@me.com wrote: Hi Cyril, Maybe it is sufficient for you to work with an inspector. For example, define the method gtInspectorExampleIn: composite gtInspectorPresentationOrder: 30 ^ composite table title: 'Example'; display: [ { #one - 'hello' . #two - 'world'} ]; column: 'Key' evaluated: #key; column: 'Value' evaluated: [ :each | each value printString ]; send: #value in the class SmallInteger and doit: 10 inspect Cheers, Alexandre On Apr 3, 2015, at 9:24 AM, Cyril Ferlicot cyril.ferli...@gmail.com wrote: Hi ! Is it possible to have multiple tabs on the playground ? It seems so but i don't find how to do it simply. -- Cheers Cyril Ferlicot -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. -- Cheers Cyril Ferlicot
Re: [Pharo-users] NeoCSV and big files
There are also #select: and #select:thenDo: convenience methods. NeoCSV is properly streaming, it should not introduce memory consumption problems itself. But note that you cannot load more than about 1Gb of permanent data in the current VM. One known performance limitation is in handling extremely long lines/records. If you have a question or problem, just ask. Sven On 04 Apr 2015, at 19:54, Norbert Hartl norb...@hartl.name wrote: Am 04.04.2015 um 19:23 schrieb Serge Stinckwich serge.stinckw...@gmail.com: Dear all, We are currently setup a small ROASSAL team to participate to #Datathon Data for Development: http://simplon.co/datathon-data-for-development-rdv-les-7-et-8-avril-a-montreuil/ We are looking to ways to be able to load big CSV table in a Pharo image. Apparently the size of some CSV files provided will be huge (around 5 Go for one month of data). The format of the data are describe here: http://arxiv.org/abs/1407.4885 Is this possible with NeoCSV, to read only a fraction of the lines regarding some conditions ? The NeoCSVReader supports the necessary stream protocol. If you setup the csv reader you can call #next on it and filter by condition. There is also #atEnd so a simple loop should. But I never used to csv reader so Sven might have much better options. Norbert If some people want to help online, we can organize a chat to organize us. Regards, -- Serge Stinckwich UCBN UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
[Pharo-users] Converting a string containing dots to integer
Hi all, I'm parsing some text which contains numbers like 8.324 and I would like to convert it to integer. The problem is that asNumber and asInteger don't make the trick because of the dot (.), which is there to indicate thousands, not decimal values. Which is the proper message to send? Cheers, Offray
Re: [Pharo-users] Converting a string containing dots to integer
---BeginMessage--- Do you have more details? Such as, do you have values with more than one dot ? (e.g. 1.436.782)Do you have values with no dot? - Benoit St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean IRC: lamneth Blogue: endormitoire.wordpress.com A standpoint is an intellectual horizon of radius zero. (A. Einstein) From: Offray Vladimir Luna Cárdenas off...@riseup.net To: Any question about pharo is welcome pharo-users@lists.pharo.org Sent: Saturday, April 4, 2015 7:17 PM Subject: [Pharo-users] Converting a string containing dots to integer Hi all, I'm parsing some text which contains numbers like 8.324 and I would like to convert it to integer. The problem is that asNumber and asInteger don't make the trick because of the dot (.), which is there to indicate thousands, not decimal values. Which is the proper message to send? Cheers, Offray ---End Message---
Re: [Pharo-users] Converting a string containing dots to integer
---BeginMessage--- This might do the trick: (Number readFrom: ('8.524.757' copyReplaceAll: '.' with: '')) asIntegeror even nicer (and simpler) ('8.524.757' reject: [:char | char == $.]) asInteger - Benoit St-Jean Yahoo! Messenger: bstjean Twitter: @BenLeChialeux Pinterest: benoitstjean IRC: lamneth Blogue: endormitoire.wordpress.com A standpoint is an intellectual horizon of radius zero. (A. Einstein) From: Offray Vladimir Luna Cárdenas off...@riseup.net To: Any question about pharo is welcome pharo-users@lists.pharo.org Sent: Saturday, April 4, 2015 7:17 PM Subject: [Pharo-users] Converting a string containing dots to integer Hi all, I'm parsing some text which contains numbers like 8.324 and I would like to convert it to integer. The problem is that asNumber and asInteger don't make the trick because of the dot (.), which is there to indicate thousands, not decimal values. Which is the proper message to send? Cheers, Offray ---End Message---