Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
i'm on ubuntu right now, so i could help with trying & testing things and/or diagnosing problems. Just tell me what to do -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 27 September 2017 at 22:54, Stephane Ducasse wrote: > Igor I will share the dropbox for you. > What would be great is to port the code of clement to Pharo 6.1 or > even 70 to check SDL20 > Esteban was integrating some of the code of ronie. > > Downloading.. Would be nice, if someone could give me short directions how to test it , what to run and what to expect. Because i am clearly was out of context for too long. > Stef > > > On Wed, Sep 27, 2017 at 1:05 PM, Igor Stasenko wrote: > > i'm on ubuntu right now, so i could help with trying & testing things > and/or > > diagnosing problems. Just tell me what to do > > > > > > -- > > Best regards, > > Igor Stasenko. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
okay, first, i have to change the path to SDL2 library, because on my machine it's in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 but there's another trouble: browsing is incredibly slooow... First, i used finder to look for 'libSDL2-2.0.so.0' in sources. it took like 2 minutes to go through first few classes with starting A letter in their name. Then i lost temper, interrupted it and decided to browse into SDL bindings manually - clicked on OSWindow-SDL2 package... and its still 100% CPU and didn't opened while i typing this whole message. What is going on? Are .sources file corrupted or what? On 28 September 2017 at 01:27, Igor Stasenko wrote: > > > On 27 September 2017 at 22:54, Stephane Ducasse > wrote: > >> Igor I will share the dropbox for you. >> What would be great is to port the code of clement to Pharo 6.1 or >> even 70 to check SDL20 >> Esteban was integrating some of the code of ronie. >> >> Downloading.. > Would be nice, if someone could give me short directions how to test it , > what to run and what to expect. Because i am clearly was out of context for > too long. > > >> Stef >> >> >> On Wed, Sep 27, 2017 at 1:05 PM, Igor Stasenko >> wrote: >> > i'm on ubuntu right now, so i could help with trying & testing things >> and/or >> > diagnosing problems. Just tell me what to do >> > >> > >> > -- >> > Best regards, >> > Igor Stasenko. >> >> > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
apparently the SDL2 library is not in LD search path ldd libSDL2DisplayPlugin.so linux-gate.so.1 => (0xf77e9000) libSDL2-2.0.so.0 => not found libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75dd000) /lib/ld-linux.so.2 (0x56573000) so it simply doesn't starts, so i installed sudo apt-get install libsdl2-2.0-0:i386 but then i found that i need to install 32-bit version of cairo as well.. but alas.. here is where i stuck: sudo apt-get install libcairo2:i386 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libtheora0 : Depends: libcairo2 (>= 1.2.4) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. something in my installation are in conflict with 32-bit version of cairo.. that's weird.. but unmet dependencies/dependency conflict resolution of linux .deb packages is not my strong side. So, it would be nice if someone could help how to proceed with that. On 28 September 2017 at 01:41, Igor Stasenko wrote: > okay, first, i have to change the path to SDL2 library, because on my > machine it's in > /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 > but there's another trouble: > browsing is incredibly slooow... > First, i used finder to look for 'libSDL2-2.0.so.0' in sources. it took > like 2 minutes to go through first few classes with starting A letter in > their name. > Then i lost temper, interrupted it and decided to browse into SDL bindings > manually - clicked on OSWindow-SDL2 package... and its still 100% CPU and > didn't opened > while i typing this whole message. > > What is going on? Are .sources file corrupted or what? > > > > On 28 September 2017 at 01:27, Igor Stasenko wrote: > >> >> >> On 27 September 2017 at 22:54, Stephane Ducasse >> wrote: >> >>> Igor I will share the dropbox for you. >>> What would be great is to port the code of clement to Pharo 6.1 or >>> even 70 to check SDL20 >>> Esteban was integrating some of the code of ronie. >>> >>> Downloading.. >> Would be nice, if someone could give me short directions how to test it , >> what to run and what to expect. Because i am clearly was out of context for >> too long. >> >> >>> Stef >>> >>> >>> On Wed, Sep 27, 2017 at 1:05 PM, Igor Stasenko >>> wrote: >>> > i'm on ubuntu right now, so i could help with trying & testing things >>> and/or >>> > diagnosing problems. Just tell me what to do >>> > >>> > >>> > -- >>> > Best regards, >>> > Igor Stasenko. >>> >>> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
imo, best what could be done is to forget about 32-bit version and use 64-bit VM & libs, to avoid problems like above. but for that, i need a 64-bit VM/image pair for a start, because one that you gave me is 32-bit.. and hence drags all the trouble with all this .so dependency zoo.. -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 28 September 2017 at 12:43, Hilaire wrote: > Hi Igor, > > I got libsdl and libcairo 32bits installed fine on 64bits Ubuntu 17.04. > > weird.. > What is your ubuntu system? > > cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.04 DISTRIB_CODENAME=zesty DISTRIB_DESCRIPTION="Ubuntu 17.04" > Hilaire > > > > Le 28/09/2017 à 01:22, Igor Stasenko a écrit : > >> something in my installation are in conflict with 32-bit version of >> cairo.. that's weird.. >> but unmet dependencies/dependency conflict resolution of linux .deb >> packages is not my strong side. >> So, it would be nice if someone could help how to proceed with that. >> > > -- > Dr. Geo > http://drgeo.eu > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Demo] Creating Bloc Widgets with Pharo
Stephan , you said you cannot replace the last one in the video. I think you can have an easy solution: you should treat a pane that you are currently over - the one you are going to replace, so if you drag over something which is not placeholder, then it should automatically be shifted and replaced by placeholder. Cheers :) On 29 September 2017 at 00:56, stephan wrote: > On 28-09-17 21:07, Stephane Ducasse wrote: > >> For example why a BlElement cannot get >> invisible and visible in addition to visibility: BlVisibility visible. >> > > It can, and if we do that systematically we end up with a BlElement with a > thousand methods. There are so many aspects that an element might need to > handle. Handling children, layout, styling, drawing, fonts, events, > visibility. Where should the border be? > > One thing I noted is that in Bloc we don't have a way to decide where to > add a dropped element in a parent that has a specified layout. In Morphic > that is also a responsibility of the layout. > > Stephan > > > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 29 September 2017 at 11:23, Hilaire wrote: > Beside the official ones, are you using alternate repositories? It can > become a hell. > > In your posting, a Thoera dependency appeared... > > it looks like there's an error in dependency spec. because i have 64-bit cairo installed, and uninstalling theora drags half of the desktop stuff after itself.. oh.. looks like i found why: sudo dpkg -i libcairo2_1.14.8-1_i386.deb Selecting previously unselected package libcairo2:i386. (Reading database ... 541684 files and directories currently installed.) Preparing to unpack libcairo2_1.14.8-1_i386.deb ... De-configuring libcairo2:amd64 (1.15.2-0intel1) ... Unpacking libcairo2:i386 (1.14.8-1) ... dpkg: error processing package libcairo2:i386 (--install): package libcairo2:i386 1.14.8-1 cannot be configured because libcairo2:amd64 is at a different version (1.15.2-0intel1) dpkg: error processing package libcairo2:amd64 (--install): package libcairo2:amd64 1.15.2-0intel1 cannot be configured because libcairo2:i386 is at a different version (1.14.8-1) Processing triggers for libc-bin (2.24-9ubuntu2.2) ... Errors were encountered while processing: now where the heck i can find binary of appropriate version libcairo2:i386 1.15.2 (googling doesn't helps) > Hilaire > > Le 28/09/2017 à 19:51, Igor Stasenko a écrit : > >> >> I got libsdl and libcairo 32bits installed fine on 64bits Ubuntu >> 17.04. >> >> weird.. >> > > -- > Dr. Geo > http://drgeo.eu > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 29 September 2017 at 22:05, Hilaire wrote: > libcairo2:amd64 1.15.2-0intel1 is clearly not from the official repository. > > See on my ubuntu17.04: > > hilaire@PCHome:~$ dpkg -l | grep libcairo2 > ii libcairo2:amd64 1.14.8-1 amd64Cairo 2D vector graphics library > ii libcairo2:i386 1.14.8-1 i386 Cairo 2D vector graphics library > ii libcairo2-dev 1.14.8-1 amd64Development files for the Cairo 2D > graphics library > > > If you can wipe it out, you may sort out. > > most probably it is due to my attempts to make my hybrid graphics setup work.. i bought this laptop year ago and then figured out, that there are issues with X11 and kernel drivers that prevents using both video cards on board.. and installing latest & finest didn't changed much. -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 30 September 2017 at 17:51, J.F. Rick wrote: > Hi Igor et al., > > thanks for taking a look at this. I appreciate it a lot. I've been swamped > with work et al. but I'm back. If I understand it correctly, Igor is still > fighting with drivers to make it work on his system. Let me know when you > want me to try something. > > Sure. But i didn't done much, so there's nothing to appriciate yet :) But i want to help, if it won't require reinstalling OS, because i need my machine in working condition almost 24/7.. so i cannot take too much risk with it :( Cheers, > > Jeff > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems
On 1 October 2017 at 10:26, Hilaire wrote: > All these difficulties are good argument to get the appropriate > libcairo/libpng shipped with the Linux VM, as done with Windows and MacOSX > VM > > Nah, in my case, there's nothing that can be lableled as "Pharo fault". It is definitely a linux/ubuntu ecosystem fault. - by not providing parallel updates for 32 & 64 bit variant of same library. > Hilaire > > > Le 30/09/2017 à 21:58, Igor Stasenko a écrit : > >> Sure. But i didn't done much, so there's nothing to appriciate yet :) >> But i want to help, if it won't require reinstalling OS, because i need >> my machine in working condition almost 24/7.. so i cannot take too much >> risk with it :( >> > > -- > Dr. Geo > http://drgeo.eu > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Athens error
i think it will help more if you reveal the full stack trace with actual exception.. IIRC you can do it by clicking on errorneous morph and in its menu pick the stack trace. On 16 December 2017 at 23:29, Hilaire wrote: > Hi, > > With DrGeo built on image Pharo7.0-64bit-e41f921 Athens error shows up on > the canvas (screenshot). > > The drgeo dev. environment based on the older Pharo7.0-64bit-f82fc36 image > does not have this error with the same VM. > > The DrGeo build removes some pharo package but it is unlikely to produce > such error, or so? > > -- > Dr. Geo > http://drgeo.eu > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] 'function unavailable' when calling OpenDBXDriver for MySQL
On 16 November 2014 23:46, bsselfri...@gmail.com wrote: > I've used the instructions defined on the "http://dbxtalk.smallworks.eu/"; > website to setup the OpenDBXDriver for a MySQL database. When I try to > make > a connection to the database, I'm getting the "function unavailable". > > I have this working on a Ubuntu 14.04 32bit OS. I'm wondering if my > problem > is my 64bit Ubuntu or do I have other problems. > > > My setup: > > Ubuntu 14.04 64bit. > Pharo 3.0 > libopendbx.so.1.2.0 i386 version > > could be that libopendbx links with other 32-bit drivers, which is missing in your system. try ldd libopendbx.so.1.2.0 and see if all required libs are present. (32-bit , of course) > Brad Selfridge > > > > - > Brad Selfridge > -- > View this message in context: > http://forum.world.st/function-unavailable-when-calling-OpenDBXDriver-for-MySQL-tp4790564.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] running out of memory while processing a 220MB csv file with NeoCSVReader - tips?
Never ending memory consumption problem. Hopefully with 64-bit version of VM we'll have a way more space to waste and it could take more effort to put system on its knees. -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost pointer and "+"
As i understand, in general, the problem that you described is in following: - you want to pass an address of your buffer contents, but started not from very first element of your buffer, but somewhere inside a buffer. In smalltalk you cannot reference an element of array, only the object (array in that case) as a whole. The reason why it like so, because VM moves objects around, and you cannot control directly when that happens, and also VM responsible for updating all pointers (references) to moved object(s) for all interested parties (which could be other objects, stack etc) , making sure all references remain consistent upon such move. So, with such constraints, the only way to validly point to an element inside array would be to store two values separately: - a reference to an object, that represent your buffer (which VM would update at will) - an index (or offset) in that object, pointing to element in your buffer Unfortunately, this is the only way how we could implement such, lets say 'ElementPointer' safely. Which then can be used to pass to C function(s), converting object reference + offset into simple address just before invoking a function (and sure thing, knowing that there's no chance triggering GC, else it will turn into pointer to wrong place, but that's general problem of passing pointers on object memory heap, not just exclusively for 'element pointer' and such). For buffers allocated externally, e.g. outside heap governed by VM, there's nothing prevents you from having an address that pointing inside some buffer (or even outside it :) For NBExternalAddress: addr := self allocate: somespace. newAddr := NBExternalAddress value: addr value + someoffset. or newAddr := addr copy value: addr value + someoffset sure, it is up to you then, how to calculate offsets and buffer size(s) as well as allocating/deallocating memory for buffers you using. On 8 June 2015 at 16:41, Matthieu Lacaton wrote: > Hello everyone, > > I have a small question about NativeBoost : How does the "+" operator when > applied to a pointer translates into NativeBoost code ? > > To give a bit of context, what I want to do is to reallocate some > non-contiguous bytes in memory to a buffer. Basically, I have an array of > integers in a buffer and I want to copy some chunks of it in another > buffer. The chunks are always the same size and the offset between each > chunk is always the same too. > > Because a bit of actual code is easier to understand here is what I'd like > to do in Pharo : > > ... > > int i, j; > int *data = malloc(1000*sizeof(int)); > int *newData = malloc(50*sizeof(int)); > > // Allocate initial data > for (i = 0 ; i < 1000, i++) { > data[i] = i; > } > > //Copy desired chunks into new buffer > for (i = 0; i < 5; i++ ) { > memcpy( newData + j*10, data + 200 + j*30, 10*sizeof(int)); > j++; > } > > free(data); > > ... > > Here basically I'll get in my buffer chunks of 10 integers starting at 200 > with an offset of 30 between chunks, and this 5 times. (200 201 202 ... 208 > 209 230 231 ... 238 239 260 ... 328 329). > > I am okay with the malloc, memcpy and free but I don't know how to handle > the "+" operator in my memcpy function. > > Thank you, > > Matthieu > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost pointer and "+"
On 9 June 2015 at 20:05, Matthieu Lacaton wrote: > *@ Igor* > > >> As i understand, in general, the problem that you described is in >> following: >> - you want to pass an address of your buffer contents, but started not >> from >> very first element of your buffer, but somewhere inside a buffer. > > > Yes ! Exactly that. I'm bad at explaining things :( > > me too, sometimes. :) > > Unfortunately, this is the only way how we could implement such, lets say >> 'ElementPointer' safely. Which then can be used to pass to C function(s), >> converting object reference + offset into simple address just before >> invoking a function (and sure thing, knowing that there's no chance >> triggering GC, else it will turn into pointer to wrong place, but that's >> general problem of passing pointers on object memory heap, not just >> exclusively for 'element pointer' and such). >> > > Alright, thank you very much for your explanations ! By the way, is there > a way to disable the GC for a short period of time and then re-enable it ? > > Well, some aspects of GC behavior can be controlled, but they serve rather for fine tuning or picking the strategy ahead of time, knowing, what application is going to run. So, at application level, you can use them.. but not at the level of library/framework (like in case of NB), because there's no way to determine what/where will be used, and so, fiddling with GC is worst possible way to solve the problem :) Also, in general, it would be a bad practice to rely on subtle and fuzzy details of GC triggering logic, because it is one of the most sophisticated parts of VM and subject of future changes. So, instead relying on implementation details, a new contract between VM and language side is introduced and it called 'object pinning'. So, that pinned objects are no longer a subject of relocation in memory. It means that you will be able to control, that chosen object(s) will be not relocated in memory, regardless how often VM triggers GC and what is involved. And that comes with Spur. > > *@ Henrik* > > I am not sure I understand every bit of your code right now but I will > definitely study it because it looks awesome. > Moreover, performance is quite important for me so your solution is very > attractive and I'll try to use it. Thanks a lot ! > > I find it both fun and amazing what you can do with Pharo. I never thought > I would do assembly inside Pharo ! > > > Again, a big thanks to both of you, > > Cheers, > Matthieu > > > > > 2015-06-09 17:43 GMT+02:00 Igor Stasenko : > >> As i understand, in general, the problem that you described is in >> following: >> - you want to pass an address of your buffer contents, but started not >> from >> very first element of your buffer, but somewhere inside a buffer. >> >> In smalltalk you cannot reference an element of array, >> only the object (array in that case) as a whole. >> >> The reason why it like so, because VM moves objects around, and you >> cannot control directly when that happens, >> and also VM responsible for updating all pointers (references) to moved >> object(s) >> for all interested parties (which could be other objects, stack etc) , >> making sure all references remain consistent upon such move. >> So, with such constraints, the only way to validly point to an element >> inside array >> would be to store two values separately: >> - a reference to an object, that represent your buffer (which VM would >> update at will) >> - an index (or offset) in that object, pointing to element in your buffer >> >> Unfortunately, this is the only way how we could implement such, lets say >> 'ElementPointer' safely. Which then can be used to pass to C function(s), >> converting object reference + offset into simple address just before >> invoking a function (and sure thing, knowing that there's no chance >> triggering GC, else it will turn into pointer to wrong place, but that's >> general problem of passing pointers on object memory heap, not just >> exclusively for 'element pointer' and such). >> >> For buffers allocated externally, e.g. outside heap governed by VM, >> there's nothing prevents you from having an address that pointing inside >> some buffer (or even outside it :) >> >> For NBExternalAddress: >> >> addr := self allocate: somespace. >> >> newAddr := NBExternalAddress value: addr value + someoffset. >> >> or >> >> newAddr := addr copy value: addr value + someoffset >> >> sure, it is up to yo
Re: [Pharo-users] InputEventSensor and polling
On 16 May 2013 10:32, Henrik Johansen wrote: > > On May 15, 2013, at 10:34 PM, Eric Clack wrote: > >> Hi Stephane and Jannik, >> Well I don't hate the code (yet ;-) So perhaps I'll have a play with it a >> bit more and see if I can get something that works well, and fits with plans >> for Pharo3.0. >> >> Cheers, >> -Eric. > > Would it be possible to translate it to something like > alias spaceHandler > When space pressed [ > set t1 true] > > When flag clicked [ > set t1 false > install spaceHandler >Loop forever [ > move 5 steps > turn 5 degrees > if t1 [ > Stamp the sprite on the screen > set t1 false > ] >] > uninstall spaceHandler > ] > > In general, it should be possible to rewrite polling code to event-driven > with some use of temporaries. > +1 you can simply turn polling into non-polling by recording the events (as they come i.e. key-down , then key-up) in some "keyboard map" then your test "if space down" is actually asking keyboard map whether space key is held down or not, and you don't need polling event sensor. For "key pressed" events the story is a bit more complicated, because there's a lot of mess how to translate "key-down /up" pair of physical events (separated by time) into one or series of synthesized "key pressed" events. Operating systems handling them differently, VM (hardcoded) code tries to unify this but IMO is only makes things worse, because it introducing common "worst" denominator. >From VM side, i would really leave only raw event handling (e.g. physical key down/up events) and let image side decide how to synthesize "key pressed" events. However, with devices like touchpads things even worse, because they actually generating only key press events (while actually user still touching screen and then releases after some time, so it is still key down/up physically). (maybe implementing own virtual keyboard in image would be a good solution to that problem) > Cheers, > Henry -- Best regards, Igor Stasenko.
Re: [Pharo-users] [ANN] ZnReadEvalPrintDelegate
On 16 May 2013 15:05, Sven Van Caekenberghe wrote: > > On 16 May 2013, at 14:41, Camillo Bruni wrote: > >> cool :) > > Thx, it is actually very simple, just a little hack. > > I wanted to make it work like your zero-conf scripts > > $ curl localhost:1701/repl | bash > > But that does not seem possible (after a day of fruitless bash hacking ;-): > bash already reads its script from stdin, hence the script itself cannot read > his own input from stdin (or so it seems). > > If you would happen to know how to do it … > you know you can always add one more pipe, do you? | | :) >> On 2013-05-16, at 14:36, Sven Van Caekenberghe wrote: >> >>> Hi, >>> >>> Here is a little tool that might be useful to some you. For others it might >>> be a nice example. >>> >>> So you have your shiny Pharo server application running in the cloud. When >>> something goes wrong, most of the time you will just restart, manually or >>> automatically. But sometimes you wish you could interact with a running >>> headless server image. Problem is, you can't out of the box. >>> >>> ZnReadEvalPrintDelegate is a simple tool that exports a REPL Web Service. >>> Much like the emergency evaluator. Primitive but better than nothing. >>> Install it on a port of your choice, running in a independent Zn HTTP >>> server, bound to localhost only. >>> >>> ZnReadEvalPrintDelegate startInServerOn: 1701. >>> >>> There is only one API method: POST a plain/text Smalltalk expression to >>> evaluate, get the result back. >>> >>> ZnClient new >>> url: 'http://localhost:1701/repl'; >>> contents: '42 factorial'; >>> post. >>> >>> Here is an example terminal session (logged in to the server, not remote): >>> >>> A GET on the service /repl gives some help text >>> >>> $ curl http://localhost:1701/repl >>> # Pharo Smalltalk REPL. POST expressions to evaluate >>> # Here is one way (type ctrl-d to end input) >>> curl -X POST -H'Content-Type:text/plain' --data-binary @- >>> http://localhost:1701/repl >>> >>> A POST with -d is good for short expressions >>> >>> $ curl -X POST -H'Content-Type:text/plain' -d '42 factorial' >>> http://localhost:1701/repl >>> 14050061177528798985431426062445115699363840 >>> >>> For longer or multi line expressions you can read input from stdin and end >>> with ctrl-d (copy the expression returned by the GET). Or you could send >>> text files. >>> >>> $ curl -X POST -H'Content-Type:text/plain' --data-binary @- >>> http://localhost:1701/repl >>> { (1 to: 10) sum. (1 to: 10) average } >>> {55. (11/2)} >>> >>> There is error handling as well: >>> >>> $ curl -X POST -H'Content-Type:text/plain' --data-binary @- >>> http://localhost:1701/repl >>> 1 plus: 2 >>> MessageNotUnderstood: SmallInteger>>plus: >>> SmallInteger(Object)>>doesNotUnderstand: #plus: >>> Receiver: 1 >>> Arguments and temporary variables: >>> aMessage: plus: 2 >>> exception: MessageNotUnderstood: SmallInteger>>plus: >>> resumeValue:nil >>> Receiver's instance variables: >>> 1 >>> UndefinedObject>>DoIt >>> Compiler>>evaluate:in:to:notifying:ifFail:logged: >>> Compiler>>evaluate:in:to:notifying:ifFail: >>> Compiler>>evaluate:in:to: >>> ZnReadEvalPrintDelegate>>evaluate: in Block: [| result |... >>> BlockClosure>>on:do: >>> ZnReadEvalPrintDelegate>>evaluate: in Block: [:out | [| result |... >>> String class(SequenceableCollection class)>>new:streamContents: >>> >>> WARNING: never open this service beyond your local network ! This service >>> gives you absolute control over and access to everything in your image. For >>> example, the following will kill your image: >>> >>> $ curl -X POST -H'Content-Type:text/plain' -d 'Smalltalk quitPrimitive' >>> http://localhost:1701/repl >>> >>> All this in one class and a handful of methods. >>> >>> Enjoy, >>> >>> Sven >>> >>> PS1: Part of Zinc HTTP Components, in the bleedingEdge version. >>> >>> PS2: Of course, basic authentication or HTTPS can be added through simple >>> Zn configuration. >>> >>> -- >>> Sven Van Caekenberghe >>> Proudly supporting Pharo >>> http://pharo.org >>> http://association.pharo.org >>> http://consortium.pharo.org >>> >>> >>> >>> >>> >> >> > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Fwd: widget to show progress
Here is a simple "widget" for you: Cursor wait showWhile: [ ... do something which may end, but you cannot predict when... ] :) On 19 May 2013 13:12, Benjamin wrote: > Me too :) > > I think I will implement one soon :) > Ben > > On May 19, 2013, at 1:08 PM, Usman Bhatti wrote: > > Hello all, > > I am looking for a widget/control in Pharo that shows the progress of a > process that takes undeterministic time. > > > usman > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Fwd: widget to show progress
On 19 May 2013 22:09, Denis Kudriashov wrote: > Hi > > 2013/5/19 Igor Stasenko >> >> Here is a simple "widget" for you: >> >> Cursor wait showWhile: [ >> ... do something which may end, but you cannot predict when... >> ] > > > There is nice post about why it is bad > http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&printTitle=Cursor_consider_showWhile:_%20[Harmful]&entry=3432339015 > Completely agree with that. Even without reading that post i can say why: - you changing the global state, and if your UI system complex enough (and it tends to grow more and more complex in time), eventually you may end up with having two pieces of functionality, both trying to set cursor (unique global resource) to something they prefer right now, without being aware that other party also wants to change it.. The result of it, you can see in many today's desktop applications (not pharo) - cursor flickering changing from one shape into another, while application processing something .. which is very annoying. However pharo image right now having like 90 senders of this message and getting rid all of them is going to be tedious. I just recommended something which is available now.. if people can't wait for better solution, which obviously should replace existing one. :) -- Best regards, Igor Stasenko.
Re: [Pharo-users] String replacement
On 27 May 2013 18:42, Thomas Worthington wrote: > I've got a string which is the header section of an email. I have a regex > which will split a header field name from its data (ie, "From: > j...@null.com" becomes "From" and "j...@null.com") but some header lines are > long and have been continued by inserting a newline and one or more > spaces. Before splitting the fields I need to undo these continuations by > deleting these combinations of a newline followed by some whitespace. > > This would certainly be trivial in Perl or any of the normal Linux regex > engines but I've spent hours on this today, equipped with the PBE2 > chapter, and got nowhere. > > How do I do this in Pharo? trimBlock := [:string | | lines | lines := string lines. lines collect: #trimmed ]. trimBlock value: 'Header1: fooo Header2: barrr Header3: zork' => #('Header1: fooo' 'Header2: barrr' 'Header3: zork') > > Thanks, > > Thomas > -- Best regards, Igor Stasenko.
Re: [Pharo-users] inspect returns iOf SystemWindow and not receiver
On 8 June 2013 20:29, Sabine Knöfel wrote: > Hi, > > while developing my app with seaside, I sometimes use inspect within any > statement. > I am used from Pharo 1.4 and from other smalltalk dialects, that >>inspect > returns the receiver itself. > But in Pharo 2.0 it returns an instance of SystemWindow. > I dont see any sense in that. It that with intent? > I was not behind the change, but i think answering window is more useful than just receiver. Since you sending 'inspect' message to object you already having access to it, and getting same object back is less useful, than inspector window, which you can give extra instructions (like placement etc). > Sabine > > > > -- > View this message in context: > http://forum.world.st/inspect-returns-iOf-SystemWindow-and-not-receiver-tp4692399.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] inspect returns iOf SystemWindow and not receiver
On 9 June 2013 08:03, Sabine Knöfel wrote: > I should give an example why this is not useful for me. > > While developing, I use >>inspect to see, what is in any object AND I want > the app to proceed. > E.g. while creating a report, I want to see the table columns in an > inspector. > I don't want to halt and debug, I only want to see an inspector. > > self currentPageadd: > (PDFDataTableWithColumnsCaptionElement new > captions: self costReportDaysTableColumns inspect; > data: ...; > > Now, I have to write it like that > > self costReportDaysTableColumns inspect. > self currentPage add: > (PDFDataTableWithColumnsCaptionElement new > captions: self costReportDaysTableColumns ; > data: ...; > > Yes, this is possible but it is not so easigoing as simply put an inspect > somewhere. > you still can use it: self currentPageadd: (PDFDataTableWithColumnsCaptionElement new captions: (self costReportDaysTableColumns inspect; yourself); data: ...; > Remarks: > 1) I develop a seaside app. I am not interested in the System Window;-) > 2) I cant find a selector >>onWindowClosed: > 3) >>inspect is a selector which exists in every smalltalk dialect. In every > smalltalk dialect I worked with, inspect returned the receiver. It is kind > of standard IMHO. > > > > > -- > View this message in context: > http://forum.world.st/inspect-returns-iOf-SystemWindow-and-not-receiver-tp4692399p4692430.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] inspect returns iOf SystemWindow and not receiver
On 10 June 2013 10:52, Sabine Knöfel wrote: > Hi Igor, > > thanks! > > Don't you agree with me that in this point, Pharo should have the same > behaviour as the other smalltalk dialects (VisualAge/IBM Smalltalk, > VisualWorks, Gemstone)? > i don't have strong opinion on that. for me, this is not a big deal. > Greetings > Sabine > > On Sun, Jun 9, 2013 at 6:37 PM, Igor Stasenko [via Smalltalk] > <[hidden email]> wrote: > >> On 9 June 2013 08:03, Sabine Knöfel <[hidden email]> wrote: >> >>> I should give an example why this is not useful for me. >>> >>> While developing, I use >>inspect to see, what is in any object AND I >>> want >>> the app to proceed. >>> E.g. while creating a report, I want to see the table columns in an >>> inspector. >>> I don't want to halt and debug, I only want to see an inspector. >>> >>> self currentPageadd: >>> (PDFDataTableWithColumnsCaptionElement new >>> captions: self costReportDaysTableColumns >>> inspect; >>> data: ...; >>> >>> Now, I have to write it like that >>> >>> self costReportDaysTableColumns inspect. >>> self currentPage add: >>> (PDFDataTableWithColumnsCaptionElement new >>> captions: self costReportDaysTableColumns ; >>> data: ...; >>> >>> Yes, this is possible but it is not so easigoing as simply put an inspect >>> somewhere. >>> >> you still can use it: >> >> self currentPageadd: >> (PDFDataTableWithColumnsCaptionElement new >> captions: (self costReportDaysTableColumns >> inspect; yourself); >> data: ...; >> >>> Remarks: >>> 1) I develop a seaside app. I am not interested in the System Window;-) >>> 2) I cant find a selector >>onWindowClosed: >>> 3) >>inspect is a selector which exists in every smalltalk dialect. In >>> every >>> smalltalk dialect I worked with, inspect returned the receiver. It is >>> kind >>> of standard IMHO. >>> >>> >>> >>> >>> -- >>> View this message in context: >>> >>> http://forum.world.st/inspect-returns-iOf-SystemWindow-and-not-receiver-tp4692399p4692430.html >> >>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. >>> >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> >> >> >> >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://forum.world.st/inspect-returns-iOf-SystemWindow-and-not-receiver-tp4692399p4692470.html > >> To unsubscribe from inspect returns iOf SystemWindow and not receiver, >> click >> here. >> NAML > > > View this message in context: Re: inspect returns iOf SystemWindow and not > receiver > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. -- Best regards, Igor Stasenko.
Re: [Pharo-users] ui slowness on newly installed ubuntu 13.04 64bit
On 13 June 2013 22:05, Guillermo Polito wrote: > Hmm, unless there is a difference in compilation, then it is maybe the check > we added with Igor to handle correctly objects as methods. I'll put this in > my todo for the weekend :/. > 10 times slowdown because of a single flag check? > > On Thu, Jun 13, 2013 at 9:57 PM, Sven Van Caekenberghe wrote: >> >> I am sorry, some 10x slowdown with vmLatest. >> >> $ ./pharo-ui --version >> 3.9-7 #1 Fri May 31 13:43:31 CEST 2013 gcc 4.6.3 >> NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: >> acc98e51-2fba-4841-a965-2975997bba66 May 31 2013 >> NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: >> acc98e51-2fba-4841-a965-2975997bba66 May 31 2013 >> >> git://gitorious.org/cogvm/blessed.git Commit: >> 0f562e0afe14e533470278943b5d65d42ea133c2 Date: 2013-05-30 16:38:08 +0200 By: >> Igor Stasenko Jenkins build #14595 >> Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 >> UTC 2012 i686 i686 i386 GNU/Linux >> >> plugin path: /home/sven/Pharo/pharo-vm/ [default: >> /home/sven/Pharo/pharo-vm/] >> >> >> >> On Mon, Jun 10, 2013 at 9:55 AM, Camillo Bruni >> wrote: >>> >>> thanks for the insight. I opened an issue: >>> https://pharo.fogbugz.com/default.asp?10879 >>> >>> >>> can you try get.pharo.org/30+vmLatest to try out the "unstable" VM? >>> >>> On 2013-06-09, at 19:04, Sven Van Caekenberghe wrote: >>> >>> > I think that we do have a problem, and I think it is VM related. >>> > >>> > This is what I see on my Ubuntu 13.04 64-bit machine (AMD Athlon(tm) II >>> > X4 >>> > 640, 4GB, AMD Radeon HD 7750) using a Pharo 3.0 #30189 image. >>> > >>> > Using the vm from get.pharo.org/30+vm >>> > >>> > [ SystemNavigation new allCallsOn: #ifTrue: ] timeToRun. 99 101 >>> > >>> > [ SystemNavigation new browseAllCallsOn: #ifTrue: ] timeToRun. 1455 >>> > 1420 >>> > >>> > Using the vm from ppa:pharo/stable >>> > >>> > [ SystemNavigation new allCallsOn: #ifTrue: ] timeToRun. 1495 1518 >>> > >>> > [ SystemNavigation new browseAllCallsOn: #ifTrue: ] timeToRun. 11535 >>> > 11156 >>> > >>> > That is a 10x slowdown ! >>> > >>> > Here are the VM details: >>> > >>> > $ ./pharo-ui -version >>> > 3.9-7 #1 Wed Mar 13 18:22:44 CET 2013 gcc 4.4.3 >>> > NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.18 uuid: >>> > a53445f9-c0c0-4015-97a3-be7db8d9ed6b Mar 13 2013 >>> > NBCogit NativeBoost-CogPlugin-EstebanLorenzano.18 uuid: >>> > a53445f9-c0c0-4015-97a3-be7db8d9ed6b Mar 13 2013 >>> > git://gitorious.org/cogvm/blessed.git Commit: >>> > 412abef33cbed05cf1d75329e451d71c0c6aa5a7 Date: 2013-03-13 17:48:50 >>> > +0100 >>> > By: Esteban Lorenzano Jenkins build #14535 >>> > Linux linux-ubuntu-10 2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 >>> > 11:26:59 >>> > UTC 2012 x86_64 GNU/Linux >>> > plugin path: /home/sven/Pharo/pharo-vm/ [default: >>> > /home/sven/Pharo/pharo-vm/] >>> > >>> > $ pharo-vm-x --version >>> > 3.9-7 #1 Thu Jun 6 11:05:55 UTC 2013 gcc 4.7.3 >>> > NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: >>> > acc98e51-2fba-4841-a965-2975997bba66 Jun 6 2013 >>> > NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: >>> > acc98e51-2fba-4841-a965-2975997bba66 Jun 6 2013 >>> > git://gitorious.org/cogvm/blessed.git Commit: >>> > 0f562e0afe14e533470278943b5d65d42ea133c2 Date: 2013-05-30 16:38:08 >>> > +0200 >>> > By: Igor Stasenko Jenkins build #14595 >>> > Linux samarium 2.6.24-32-xen #1 SMP Thu Jul 12 14:30:40 UTC 2012 i686 >>> > athlon i686 GNU/Linux >>> > plugin path: /usr/lib/pharo-vm/ [default: /usr/lib/pharo-vm/] >>> > >>> > One version seems older, but I don't know what changed inbetween them >>> > >>> > Sven >>> > >>> > On Fri, Jun 7, 2013 at 6:49 PM, Paul DeBruicker >>> > wrote: >>> > >>> >> And the pharo2 linux all-in-one runs in 116ms on my hardware on Ubuntu >>> >> 13.04 64bit. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> On 06/07/2013 09:35 AM, Markus Fritsche wrote: >>> >>> On 07.06.2013 17:55, Paul DeBruicker wrote: >>> >>>> From the below it seems to be something with running on linux 64bits >>> >>>> with a UI slows it down by a factor of 10x. >>> >>>> >>> >>>> >>> >>>> Command line per Camillo below on ubuntu 13.04 64bit on the hardware >>> >>>> was: 134ms >>> >>>> >>> >>>> Using Pharo-2 windows all in one on a windows xp virtualbox VM was: >>> >> 163ms >>> >>>> >>> >>>> Using Pharo-2 linux all in one on a ubuntu 12,04 64bit virtualbox VM >>> >>>> was: 1918ms >>> >>>> >>> >>>> >>> >>>> Using Pharo-2 linux all in one on a debian 6 32bit virtualbox VM >>> >>>> was: >>> >> 152 ms >>> >>> Further research: >>> >>> Pharo PPA VM, Ubuntu 13.04 64Bit: >>> >>> [SystemNavigation new allCallsOn: #ifTrue: ] timeToRun 2230 >>> >>> CogVM from Eliot directly ( >>> >>> http://www.mirandabanda.org/files/Cog/VM/VM.r2732/): >>> >>> [SystemNavigation new allCallsOn: #ifTrue: ] timeToRun 164 >>> >>> >>> >>> Kind regards, >>> >>> Markus >>> >> >>> >> >>> >> >>> >>> >> > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Tabular Data Viewer
On 17 June 2013 19:29, plantec wrote: > Hi Sven, > This kind of widget is missing. > Have a try with: > SimpleGridExample new open > It is implemented with MorphTreeMorph. > It is far from the best solution since MorphTreeMorph a Tree/List > widget but it should be ok if you have not too many data. > Maybe the Glamour solution is based on it, I don't remember. Speaking about MorphTreeMorph: i find it really strange that it supports grid layouts. When one entity has so many responsibilities/functionality, it is easy to get lost there. As a consequence: if there's a bug, it is really hard to fix it. > Cheers > Alain > > > On 17 juin 2013, at 16:17, Sven Van Caekenberghe wrote: > >> Hi, >> >> Is there an easy way to view tabular data in Pharo, much like a spreadsheet ? >> >> Ideally, something along the following lines >> >> MagicTableView new >> headings: #( name age sex score ); >> data: ; >> open. >> >> Can spec be used for this ? >> >> Pointing me to some relevant example in the image is OK too ;-) >> >> Thx, >> >> Sven >> >> >> -- >> Sven Van Caekenberghe >> http://stfx.eu >> Smalltalk is the Red Pill >> >> > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] How do can we set up a crowdsourcing for pharo
On 27 June 2013 14:16, Stéphane Ducasse wrote: > Hi > > we got this discussion about the VM on 64 bits so do we try to take the > opportunity > to get a crowdsource donate button for it? > > Esteban/igor what is your estimate for such task? > depends what you put into it: - interpreter + plugins - new object/image format (64bit) - 64-bit jit > Stef -- Best regards, Igor Stasenko.
Re: [Pharo-users] How do can we set up a crowdsourcing for pharo
On 27 June 2013 14:48, Esteban Lorenzano wrote: > honestly, depends a lot on who will do it. > > basically, I see 3 parts: > > 1) The Stack VM 64bits > 2) The Pharo image 64bits. > 3) NB-FFI 64 (No point on having a VM who cannot talk with the outside world) > > a future task could be create a JIT, but I complete ignorant on how > difficult/possible is that :) > > To compile the stack vm in 64 bits is not difficult, but there is a lot of > small tweaks to make... so I think 1 man-month should be enough . > To produce a 64bits pharo image we need an objecttracer and Guille says > with ObjectSpaces is a lot easier... but again, it has to be done... I think > another month should be enough. > > ... and with NB-FFI 64, no idea, but AFAIK is almost there (Camillo knows > more there) > also, 1 and 2 are vital, and we can tune 3 with the VM+Image working. > > That's my (very general) opinion. > ah.. yes.. FFI too. That shouldn't be very difficult but cannot start work on it unless other two is ready. (it needs to know about object format and other stuff to generate proper code) > Esteban > > On Jun 27, 2013, at 2:16 PM, Stéphane Ducasse > wrote: > >> Hi >> >> we got this discussion about the VM on 64 bits so do we try to take the >> opportunity >> to get a crowdsource donate button for it? >> >> Esteban/igor what is your estimate for such task? >> >> Stef > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Pharo-dev] How do can we set up a crowdsourcing for pharo
On 27 June 2013 18:32, Esteban Lorenzano wrote: > I told you: 2 man/month > (not taking NB-FFI into account) > That is a bit optimistic :) But reasonable. > On Jun 27, 2013, at 6:26 PM, Stéphane Ducasse > wrote: > >> so much? >> how many men/months? >> >> Stef >> >> On Jun 27, 2013, at 3:02 PM, Igor Stasenko wrote: >> >>> On 27 June 2013 14:16, Stéphane Ducasse wrote: >>>> Hi >>>> >>>> we got this discussion about the VM on 64 bits so do we try to take the >>>> opportunity >>>> to get a crowdsource donate button for it? >>>> >>>> Esteban/igor what is your estimate for such task? >>>> >>> >>> depends what you put into it: >>> - interpreter + plugins >>> - new object/image format (64bit) >>> - 64-bit jit >>> >>>> Stef >>> >>> >>> -- >>> Best regards, >>> Igor Stasenko. >>> >> >> > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] implementing #release in a domain object
On 27 June 2013 14:54, Paul DeBruicker wrote: > On 06/27/2013 12:48 AM, Camillo Bruni wrote: >> >> On 2013-06-27, at 01:08, Paul DeBruicker wrote: >> >>> Sven & Camillo, >>> >>> Ok thanks. And using the PointerFinder is there a way to know which of >>> the pointers points to the SystemDictionary or Object someObject or >>> whereever the GC begins so one would not have to check every pointer for >>> every stubborn object. >>> >>> E.g. Lets say I've nil'ed the reference between the Navy and the ship so >>> its ready to go but a few of the soldiers on the ship have references to >>> other ships because their transfer papers weren't processed properly. >>> Running #pointersTo on those soldiers gives a large collection of >>> pointers. >>> >>> >>> How can I use the computer to filter that list to just those references >>> back to the root object? >> >> What do you mean by root object? >> > > I'm sure my understanding is not completely accurate but by 'root > object' I mean whichever object (memory space? pointer?) the VM always > considers as part of the object-space-to-keep when it begins a full GC. > So every object which is kept implicitly points to that object through a > long chain (web?) of pointers. > yes, but in opposite direction. consider yourself a painter which start painting nodes , starting from root ones, then paint ones which they pointing to, then paint ones which those was pointing to (unless they already painted) and so on.. continue until you have nothing to paint left. Then the nodes which remain unpainted is garbage. If your objects connected via tree pattern, then everything goes well: - high command gives an order to admiral to disassemble his fleet, sink ships with all crew on board - admiral gives commands to captains, they give orders to officers and officers to rest of crew - when lower chain of command completes the order, the higher ones can commit suicide and finally captains press the button to open kingstones and die with ship. - finally admiral will do a harakiri (so, that will be perfect japanese version :) but in russian version (a graph), an admiral's dauther is married on one of the fleet's captains, and admiral, by knowing that gives order only to all but the ship where captain is in command. But that captain is friend with captain of another ship, and he asks admiral to find a way to keep that guy too and that guy can also has friends on other ships.. and so on.. so at the end, only those who has no friends will be fired.. but those who having them, will stay :) > > > >> In any case, if I'm not mistaken, this isn't that easy. Usually you have >> to manually track down and follow the objects in the PointerExplorer >> >> => Inspect an Object, right click, Explore Strong Pointers >> >> >> > > OK. I can imagine a Roassal visualization of a rats nest of objects as > nodes connected with edges made with #pointsTo: with just a few edges > connecting the main blob (e.g. the navy) to objects (soldiers) in a > smaller blob (the ship I want to GC). Kind of like the visualization > Craig Latta uses as the header for his blog and describes here: > https://thiscontext.wordpress.com/2012/10/22/a-detailed-description-of-spoons-object-memory-visualization-tools/ > -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Pharo-dev] How do can we set up a crowdsourcing for pharo
On 27 June 2013 20:51, Sven Van Caekenberghe wrote: > > On 27 Jun 2013, at 20:41, Igor Stasenko wrote: > >> On 27 June 2013 18:32, Esteban Lorenzano wrote: >>> I told you: 2 man/month >>> (not taking NB-FFI into account) >>> >> That is a bit optimistic :) >> But reasonable. > > Just to be clear: the goal is to make the current Cog & Stack VMs decent > 64-bit apps that can operate on a 64-bit OS without needing special/extra > 32-bit libs, while keeping intact the current 32-bit internal memory/pointer > model, right ? > > And that on all 3 platforms ? > > Make that at least 3 months ;-) > Be careful with using 'decent'. Because to my opinion, i cannot call even our today's 32-bit VMs decent. They are OK as to me. But i want more/better etc before i can call them decent. :) -- Best regards, Igor Stasenko.
Re: [Pharo-users] unstable build
On 29 June 2013 17:48, Camillo Bruni wrote: > I am not very happy with the current build it seems to be quite random when it > comes to test results. I ran the tests multiple times and I get different > outcomes > each time. > > That said, I need somebody to pair program with me on the monkey since there > is > currently a non-deterministic bug present that prevents the tool from running > properly. > > anyone in? me -- Best regards, Igor Stasenko.
Re: [Pharo-users] trait question
On 29 June 2013 20:12, Camillo Bruni wrote: > Working on the new class builder I have a hard time figuring out the full > trait > semantics. > > If I use a trait on instance side, does that imply that its classTrait on the > metaclass? yes. Trait resembles same dual property as class (it has instance side and class side methods). But i also not really like it. IMO single trait should be applied separately only to selected behavior not two at once (class and its metaclass), and you should be able to choose which one. -- Best regards, Igor Stasenko.
Re: [Pharo-users] trait question
On 29 June 2013 21:21, Stéphane Ducasse wrote: > > On Jun 29, 2013, at 8:19 PM, Igor Stasenko wrote: > >> On 29 June 2013 20:12, Camillo Bruni wrote: >>> Working on the new class builder I have a hard time figuring out the full >>> trait >>> semantics. >>> >>> If I use a trait on instance side, does that imply that its classTrait on >>> the >>> metaclass? > > No. I do not think so (I will have to think). > Normally Trait and ClassTrait are two different classes. NOw I do not > remember if a trait is composed > of a classTrait too. > Trait has 'classTrait' > Sytef > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] trait question
yes, i don't know if it good or bad, but i'd rather prefer that traits applied to Behavior, but not to Class (which has two entangled behaviors). But maybe for human comprehension it is better.. but not for implementing, because it certainly makes model more complex. On 29 June 2013 22:52, Camillo Bruni wrote: > > On 2013-06-29, at 22:32, Igor Stasenko wrote: > >> On 29 June 2013 21:21, Stéphane Ducasse wrote: >>> >>> On Jun 29, 2013, at 8:19 PM, Igor Stasenko wrote: >>> >>>> On 29 June 2013 20:12, Camillo Bruni wrote: >>>>> Working on the new class builder I have a hard time figuring out the full >>>>> trait >>>>> semantics. >>>>> >>>>> If I use a trait on instance side, does that imply that its classTrait on >>>>> the >>>>> metaclass? >>> >>> No. I do not think so (I will have to think). >>> Normally Trait and ClassTrait are two different classes. NOw I do not >>> remember if a trait is composed >>> of a classTrait too. >>> >> Trait has 'classTrait' > > yes, but the strange part is, that if you use a Trait on the instance-side it > will automatically install the class trait as well. > > ClassDescription subclass: #Class > uses: TClass > ... > > and the users > > TClass users => an IdentitySet(Class) > TClass classTrait users => an IdentitySet(Class class) > > so in this case it implies that when you use a Trait on the instance side it > will > apply also it's classTrait to the class side. So is it ok then to enforce > that in > the new class builder? > > Currently you can do the following in the new class builder: > > PharoClassInstaller make: [:builder| > builder > superclass: Object; > name: 'Foo'; > traitComposition: TClass ] > > which will explicitely NOT install `TClass classTrait` in `Foo class`. > Does this behavior make sense? -- Best regards, Igor Stasenko.
Re: [Pharo-users] trait question
On 30 June 2013 15:48, Damien Cassou wrote: > On Sun, Jun 30, 2013 at 2:54 PM, Camillo Bruni wrote: >> But you know that you can do this right now? > > > I think these examples only show that some verifications are missing. > I don't know any source code using that. To me it's more a bug than a > feature. I would keep things simple: applying a trait to a class > applies the classTrait to the metaclass. > but that's far less simpler than: - applying trait to behavior (object), applies it only to that object and nothing else (no meta-mess). > -- > Damien Cassou > http://damiencassou.seasidehosting.st > > "Success is the ability to go from one failure to another without > losing enthusiasm." > Winston Churchill > -- Best regards, Igor Stasenko.
Re: [Pharo-users] trait question
On 1 July 2013 14:01, Camille Teruel wrote: > > On 1 juil. 2013, at 12:19, Igor Stasenko wrote: > >> On 30 June 2013 15:48, Damien Cassou wrote: >>> On Sun, Jun 30, 2013 at 2:54 PM, Camillo Bruni >>> wrote: >>>> But you know that you can do this right now? >>> >>> >>> I think these examples only show that some verifications are missing. >>> I don't know any source code using that. To me it's more a bug than a >>> feature. I would keep things simple: applying a trait to a class >>> applies the classTrait to the metaclass. >>> >> but that's far less simpler than: >> - applying trait to behavior (object), applies it only to that object >> and nothing else (no meta-mess). > > Yet the current trait model is based on trait and class trait, and that's > consistent with the class model. > If you want trait to be applied only on one side: > - we have to refactor a lot of stuff, because a lot of our current code rely > on this model. > - you have to provide a new way for managing instance/class-side dependancies: > For example, if one the class side you have: "self class blah" how can you > ensure that the class side has the implementation you expect? it is not responsibility of trait to reason whether "self class" gives right/wrong object to work with. #class is just a message sent to receiver.. you may think it is special, but there's nothing special in it comparing to any other message you sending to object(s). in any case, when developer applies trait on class side, he knows what he doing, isn't? > > On the other hand if you want a trait to be applied only on the instance > side: provide only instance-side methods. > And if you want a trait to be applied only on the class-side: provides only > class-side methods. > So everything's fine with this regard IMO. Don't change it, just ensure the > missing verification in the class builder. > Fine? Ok, how to apply trait which has single method, to make this method appear on both class and instance sides? (Copy/pasting same method twice is not an answer). I am not asking for changing things. But i think that implementation would be simpler, if Trait do not have to support class/metaclass duality. -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Pharo-dev] Tudor Girba joins Pharo Board
On 3 July 2013 09:59, Tudor Girba wrote: > Hi everyone, > > Thanks for the wishes. > > Just a note: I do not see getting in the board as a prize, but as a work to > do. And there is some work left :) > Indeed. That's why i abstain from things like that. I have enough things to do :) > One of the points that I will stress everyone with is the marketing of > Pharo. Marketing, like any other meaningful thing, requires design. Design > requires feedback. And feedback requires time. That is why we have to start > with this endeavor sooner rather than later. > > The other thing about marketing is that it can actually be meaningful, but > this happens only when we live what we sell. Pharo does offer a fantastic > opportunity because when people talk about it, their eyes blink. This > reveals both value and values that are packaged deep in Pharo. > > We just have to capitalize on that, and I want to start by making explicit > what makes Pharo unique and valuable. Everyone thinks of various things, but > we do not yet have a concerted message. This message, and I will aim at one > single message, has to transpire in everything we do: from the way we design > the code, to the concepts we adopt in the language, to the frameworks we > build on top, and to the developer and user experience. > > This is exciting, but it requires team effort. This is where you come in. We > want your energy outside of pure coding. More concrete proposals will come > in the near future, but until then, feel free to chip in your ideas. > > Cheers, > Doru > > > > > On Wed, Jul 3, 2013 at 4:16 AM, Mariano Martinez Peck > wrote: >> >> Congrats! Doru, It's well deserved. >> Best, >> >> >> On Tue, Jul 2, 2013 at 7:51 PM, Alexandre Bergel >> wrote: >>> >>> Cool! >>> >>> Alexandre >>> >>> >>> On Jul 2, 2013, at 10:12 AM, Sven Van Caekenberghe wrote: >>> >>> > Hi, >>> > >>> > The Pharo Board is pleased to announce that Tudor Girba has recently >>> > joined the Pharo Board. Among others, he will try to contribute on long >>> > term >>> > issues like the positioning of Pharo. >>> > >>> > Stéphane, Marcus & Sven >>> > >>> > http://www.pharo-project.org/about/board >>> > >>> > -- >>> > http://pharo.org >>> > http://association.pharo.org >>> > http://consortium.pharo.org >>> > >>> > >>> > >>> > >>> > >>> >>> -- >>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: >>> Alexandre Bergel http://www.bergel.eu >>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. >>> >>> >>> >>> >> >> >> >> -- >> Mariano >> http://marianopeck.wordpress.com > > > > > -- > www.tudorgirba.com > > "Every thing has its own flow" -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
Same question again. And same answer (i have no other yet). Why just don't use disk memory? I know it is extra effort, but that's what all software does, when it has to deal with big amounts of data. Why in smalltalk it should be different? Of course, on your place, i would also prefer that there is some magic fairy waves its magic wand and problem solved, but it is not going to be solved. If today you need >512Mb for your data, tomorrow you will need twice as much, and after tomorrow it will double again. So, let us be realistic: the solution to your problem lies not in VM, but in a way how to manage the data. -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 8 July 2013 22:43, Tudor Girba wrote: > Hi, > > Igor, please get this point of view out of your system :). > > First, not all programming languages are like this: You can easily run other > VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I can run > Pharo with 1Gb on Mac without problems. According to your reasoning we might > end up downgrading the Mac VM. Some data does not fit in memory, but if I can > get all my data in my image, I will choose to do it. > > I am not saying that we should compare with Java, or that it is the end of > the world that the Windows VM is highly restricted. I am simply saying that > we should not dismiss this as a problem just because we do not know how, or > do not have the resources to solve it right now. > > After all, we are here to change the world :). > Yes, but this topic was raised multiple times already. Maybe we should stop wasting time on it? All you need to do, to change the limit, go to platforms/win32/vm/sqWin32Alloc.h And change this: #ifndef MAX_VIRTUAL_MEMORY #define MAX_VIRTUAL_MEMORY 512*1024*1024 #endif So, if you want more, build VM with any limit you see fit. But there's a reason why in official VM its 512. > Cheers, > Doru -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 8 July 2013 22:52, Mariano Martinez Peck wrote: > I am with Doru here. > Today, 500MB is NOTHINGG. > NOTHING. > NOTHING. > A LATOP comes with 8GB. 16x more than the max the VM can allocate. > For one of my clients, I have just set up a server with 32GB. It has 64x > than the max a Pharo VM can allocate. Really? > Going to disk is not always a possibility for many many reasons. > And even if it were possibleif I have to spent XXX hours to workaround > Pharo because it cannot use more than 500MB, then people will simply move to > another language. > And finally, wasn't a language like Smalltalk prepare for you and let you > only focus in your app blah blah blah.. ? having to go to disk doesn't > sound like that... > > So, Igor, I cannot stand that point of view. I can stand many others, like > explaining why it's not Pharo fault, the problem window has, the money/time > it would take for an engineer to fix it, etc etc etc. But not your position. > My point is that people should stop raising this topic again and again and do something about it. Either rewrite memory management in VM, to dynamically allocate address space, or rewrite own application to use disk memory. And i know that 512mb is nothing, especially for application which deals with big amounts of data. But from that perspective, 8GB is nothing as well. Be realistic: if you need to generate/process lots of data, you should not rely on just operative memory, it is pretty limited resource, comparing to disk memory. It was like that from the very beginning, and i think it will stay like that for a while. > Cheers, > -- > Mariano > http://marianopeck.wordpress.com -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 09:13, Esteban Lorenzano wrote: > > On Jul 9, 2013, at 9:10 AM, Igor Stasenko wrote: > >> On 8 July 2013 22:43, Tudor Girba wrote: >>> Hi, >>> >>> Igor, please get this point of view out of your system :). >>> >>> First, not all programming languages are like this: You can easily run >>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I >>> can run Pharo with 1Gb on Mac without problems. According to your reasoning >>> we might end up downgrading the Mac VM. Some data does not fit in memory, >>> but if I can get all my data in my image, I will choose to do it. >>> >>> I am not saying that we should compare with Java, or that it is the end of >>> the world that the Windows VM is highly restricted. I am simply saying that >>> we should not dismiss this as a problem just because we do not know how, or >>> do not have the resources to solve it right now. >>> >>> After all, we are here to change the world :). >>> >> >> Yes, but this topic was raised multiple times already. Maybe we should >> stop wasting time on it? >> >> All you need to do, to change the limit, go to >> platforms/win32/vm/sqWin32Alloc.h >> >> And change this: >> >> #ifndef MAX_VIRTUAL_MEMORY >> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >> #endif >> >> So, if you want more, build VM with any limit you see fit. >> But there's a reason why in official VM its 512. > > Which reason? (It is a real question, I do not remember why it is so low) > If you reserve most of memory for objects, think how you could use things like freetype, opengl, cairo & any other library which allocates memory on conventional heap. also, think that DLLs and kernel needs breathing space as well. > Esteban -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 09:13, Stéphane Ducasse wrote: >>> First, not all programming languages are like this: You can easily run >>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I >>> can run Pharo with 1Gb on Mac without problems. According to your reasoning >>> we might end up downgrading the Mac VM. Some data does not fit in memory, >>> but if I can get all my data in my image, I will choose to do it. >>> >>> I am not saying that we should compare with Java, or that it is the end of >>> the world that the Windows VM is highly restricted. I am simply saying that >>> we should not dismiss this as a problem just because we do not know how, or >>> do not have the resources to solve it right now. >>> >>> After all, we are here to change the world :). >>> >> >> Yes, but this topic was raised multiple times already. Maybe we should >> stop wasting time on it? >> >> All you need to do, to change the limit, go to >> platforms/win32/vm/sqWin32Alloc.h >> >> And change this: >> >> #ifndef MAX_VIRTUAL_MEMORY >> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >> #endif >> >> So, if you want more, build VM with any limit you see fit. >> But there's a reason why in official VM its 512. > > Igor this is a real issue and we are all fighting to get more members in the > consortium > so that one day we can hire a guy like you to address it. > https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 > Stef -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 09:50, Esteban Lorenzano wrote: > > On Jul 9, 2013, at 9:22 AM, Igor Stasenko wrote: > >> On 9 July 2013 09:13, Esteban Lorenzano wrote: >>> >>> On Jul 9, 2013, at 9:10 AM, Igor Stasenko wrote: >>> >>>> On 8 July 2013 22:43, Tudor Girba wrote: >>>>> Hi, >>>>> >>>>> Igor, please get this point of view out of your system :). >>>>> >>>>> First, not all programming languages are like this: You can easily run >>>>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: >>>>> I can run Pharo with 1Gb on Mac without problems. According to your >>>>> reasoning we might end up downgrading the Mac VM. Some data does not fit >>>>> in memory, but if I can get all my data in my image, I will choose to do >>>>> it. >>>>> >>>>> I am not saying that we should compare with Java, or that it is the end >>>>> of the world that the Windows VM is highly restricted. I am simply saying >>>>> that we should not dismiss this as a problem just because we do not know >>>>> how, or do not have the resources to solve it right now. >>>>> >>>>> After all, we are here to change the world :). >>>>> >>>> >>>> Yes, but this topic was raised multiple times already. Maybe we should >>>> stop wasting time on it? >>>> >>>> All you need to do, to change the limit, go to >>>> platforms/win32/vm/sqWin32Alloc.h >>>> >>>> And change this: >>>> >>>> #ifndef MAX_VIRTUAL_MEMORY >>>> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >>>> #endif >>>> >>>> So, if you want more, build VM with any limit you see fit. >>>> But there's a reason why in official VM its 512. >>> >>> Which reason? (It is a real question, I do not remember why it is so low) >>> >> >> If you reserve most of memory for objects, think how you could use things >> like >> freetype, opengl, cairo & any other library which allocates memory on >> conventional heap. >> also, think that DLLs and kernel needs breathing space as well. > > yep, but still could be doubled and have enough reserved memory for > externals, I think. > In any case, we need a solution, 512m is obviously too small (no matter if 1G > is still not enough, it would be a lot better). > > Not to extend memory because "is still not enough" is like not healing a guy > because "he will be dead old anyway" :) > https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 please check >> >> >>> Esteban >> >> -- >> Best regards, >> Igor Stasenko. >> > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 10:01, Benjamin wrote: > > On Jul 9, 2013, at 9:16 AM, Igor Stasenko wrote: > > On 8 July 2013 22:52, Mariano Martinez Peck wrote: > > I am with Doru here. > Today, 500MB is NOTHINGG. > NOTHING. > NOTHING. > A LATOP comes with 8GB. 16x more than the max the VM can allocate. > For one of my clients, I have just set up a server with 32GB. It has 64x > than the max a Pharo VM can allocate. Really? > Going to disk is not always a possibility for many many reasons. > And even if it were possibleif I have to spent XXX hours to workaround > Pharo because it cannot use more than 500MB, then people will simply move to > another language. > And finally, wasn't a language like Smalltalk prepare for you and let you > only focus in your app blah blah blah.. ? having to go to disk doesn't > sound like that... > > So, Igor, I cannot stand that point of view. I can stand many others, like > explaining why it's not Pharo fault, the problem window has, the money/time > it would take for an engineer to fix it, etc etc etc. But not your position. > > My point is that people should stop raising this topic again and again > and do something about it. > Either rewrite memory management in VM, to dynamically allocate address > space, > or rewrite own application to use disk memory. > > And i know that 512mb is nothing, especially for application which > deals with big amounts of data. > But from that perspective, 8GB is nothing as well. Be realistic: if > you need to generate/process lots of data, > you should not rely on just operative memory, it is pretty limited > resource, comparing to disk memory. > It was like that from the very beginning, and i think it will stay > like that for a while. > > > "640K ought to be enough for anybody." > -- Bill Gates > Ben, you wanted to add something constructive to discussion? > > > Cheers, > -- > Mariano > http://marianopeck.wordpress.com > > > > > -- > Best regards, > Igor Stasenko. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 10:08, Sven Van Caekenberghe wrote: > > On 09 Jul 2013, at 10:03, Igor Stasenko wrote: > >> On 9 July 2013 09:13, Stéphane Ducasse wrote: >>>>> First, not all programming languages are like this: You can easily run >>>>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: >>>>> I can run Pharo with 1Gb on Mac without problems. According to your >>>>> reasoning we might end up downgrading the Mac VM. Some data does not fit >>>>> in memory, but if I can get all my data in my image, I will choose to do >>>>> it. >>>>> >>>>> I am not saying that we should compare with Java, or that it is the end >>>>> of the world that the Windows VM is highly restricted. I am simply saying >>>>> that we should not dismiss this as a problem just because we do not know >>>>> how, or do not have the resources to solve it right now. >>>>> >>>>> After all, we are here to change the world :). >>>>> >>>> >>>> Yes, but this topic was raised multiple times already. Maybe we should >>>> stop wasting time on it? >>>> >>>> All you need to do, to change the limit, go to >>>> platforms/win32/vm/sqWin32Alloc.h >>>> >>>> And change this: >>>> >>>> #ifndef MAX_VIRTUAL_MEMORY >>>> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >>>> #endif >>>> >>>> So, if you want more, build VM with any limit you see fit. >>>> But there's a reason why in official VM its 512. >>> >>> Igor this is a real issue and we are all fighting to get more members in >>> the consortium >>> so that one day we can hire a guy like you to address it. >>> >> >> https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 > > Yeah ! Now users can set the limit themselves. > > And then they will come back complaining that certain things don't work when > they raise the limit too high ;-) > > One day we will have a proper 64-bit VM. > Yes, i wish we can be there today. (And one day people will learn a difference between actual memory used and reserved address space :) >>> Stef >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 10:21, Igor Stasenko wrote: > On 9 July 2013 10:08, Sven Van Caekenberghe wrote: >> >> On 09 Jul 2013, at 10:03, Igor Stasenko wrote: >> >>> On 9 July 2013 09:13, Stéphane Ducasse wrote: >>>>>> First, not all programming languages are like this: You can easily run >>>>>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go >>>>>> there: I can run Pharo with 1Gb on Mac without problems. According to >>>>>> your reasoning we might end up downgrading the Mac VM. Some data does >>>>>> not fit in memory, but if I can get all my data in my image, I will >>>>>> choose to do it. >>>>>> >>>>>> I am not saying that we should compare with Java, or that it is the end >>>>>> of the world that the Windows VM is highly restricted. I am simply >>>>>> saying that we should not dismiss this as a problem just because we do >>>>>> not know how, or do not have the resources to solve it right now. >>>>>> >>>>>> After all, we are here to change the world :). >>>>>> >>>>> >>>>> Yes, but this topic was raised multiple times already. Maybe we should >>>>> stop wasting time on it? >>>>> >>>>> All you need to do, to change the limit, go to >>>>> platforms/win32/vm/sqWin32Alloc.h >>>>> >>>>> And change this: >>>>> >>>>> #ifndef MAX_VIRTUAL_MEMORY >>>>> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >>>>> #endif >>>>> >>>>> So, if you want more, build VM with any limit you see fit. >>>>> But there's a reason why in official VM its 512. >>>> >>>> Igor this is a real issue and we are all fighting to get more members in >>>> the consortium >>>> so that one day we can hire a guy like you to address it. >>>> >>> >>> https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 >> >> Yeah ! Now users can set the limit themselves. >> >> And then they will come back complaining that certain things don't work when >> they raise the limit too high ;-) >> >> One day we will have a proper 64-bit VM. >> > Yes, i wish we can be there today. > (And one day people will learn a difference between actual memory used > and reserved address space :) > .. because reserving 512Mb for image which barely eats 30Mb is a huge waste. >>>> Stef >>> >>> >>> >>> -- >>> Best regards, >>> Igor Stasenko. >>> >> >> > > > > -- > Best regards, > Igor Stasenko. -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 12:12, Norbert Hartl wrote: > > Am 09.07.2013 um 10:21 schrieb Igor Stasenko : > >> On 9 July 2013 10:08, Sven Van Caekenberghe wrote: >>> >>> On 09 Jul 2013, at 10:03, Igor Stasenko wrote: >>> >>>> On 9 July 2013 09:13, Stéphane Ducasse wrote: >>>>>>> First, not all programming languages are like this: You can easily run >>>>>>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go >>>>>>> there: I can run Pharo with 1Gb on Mac without problems. According to >>>>>>> your reasoning we might end up downgrading the Mac VM. Some data does >>>>>>> not fit in memory, but if I can get all my data in my image, I will >>>>>>> choose to do it. >>>>>>> >>>>>>> I am not saying that we should compare with Java, or that it is the end >>>>>>> of the world that the Windows VM is highly restricted. I am simply >>>>>>> saying that we should not dismiss this as a problem just because we do >>>>>>> not know how, or do not have the resources to solve it right now. >>>>>>> >>>>>>> After all, we are here to change the world :). >>>>>>> >>>>>> >>>>>> Yes, but this topic was raised multiple times already. Maybe we should >>>>>> stop wasting time on it? >>>>>> >>>>>> All you need to do, to change the limit, go to >>>>>> platforms/win32/vm/sqWin32Alloc.h >>>>>> >>>>>> And change this: >>>>>> >>>>>> #ifndef MAX_VIRTUAL_MEMORY >>>>>> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >>>>>> #endif >>>>>> >>>>>> So, if you want more, build VM with any limit you see fit. >>>>>> But there's a reason why in official VM its 512. >>>>> >>>>> Igor this is a real issue and we are all fighting to get more members in >>>>> the consortium >>>>> so that one day we can hire a guy like you to address it. >>>>> >>>> >>>> https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 >>> >>> Yeah ! Now users can set the limit themselves. >>> >>> And then they will come back complaining that certain things don't work >>> when they raise the limit too high ;-) >>> >>> One day we will have a proper 64-bit VM. >>> >> Yes, i wish we can be there today. >> (And one day people will learn a difference between actual memory used >> and reserved address space :) >> > Igor, > > I don't understand your point here. In an environment where you can neither > use nor reserve memory upon a certain limit I find the distinction useless. > Usually you tend to tell that you don't want to think about the "far future > right things" but the things that solve actual problems. Where has this > attitude gone? :) > Strange, that you had such impression. :) Usually i tend a lot about future things, and that's why i really hate temporary solutions, which work today but break tomorrow. I am idealist, and that's why i trying to fix what not broken time to time. > Norbert > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 9 July 2013 12:14, Norbert Hartl wrote: > > Am 09.07.2013 um 11:01 schrieb Igor Stasenko : > >> On 9 July 2013 10:21, Igor Stasenko wrote: >>> On 9 July 2013 10:08, Sven Van Caekenberghe wrote: >>>> >>>> On 09 Jul 2013, at 10:03, Igor Stasenko wrote: >>>> >>>>> On 9 July 2013 09:13, Stéphane Ducasse wrote: >>>>>>>> First, not all programming languages are like this: You can easily run >>>>>>>> other VMs (e.g., Java) with more than 3 GB. But, let's not even go >>>>>>>> there: I can run Pharo with 1Gb on Mac without problems. According to >>>>>>>> your reasoning we might end up downgrading the Mac VM. Some data does >>>>>>>> not fit in memory, but if I can get all my data in my image, I will >>>>>>>> choose to do it. >>>>>>>> >>>>>>>> I am not saying that we should compare with Java, or that it is the >>>>>>>> end of the world that the Windows VM is highly restricted. I am simply >>>>>>>> saying that we should not dismiss this as a problem just because we do >>>>>>>> not know how, or do not have the resources to solve it right now. >>>>>>>> >>>>>>>> After all, we are here to change the world :). >>>>>>>> >>>>>>> >>>>>>> Yes, but this topic was raised multiple times already. Maybe we should >>>>>>> stop wasting time on it? >>>>>>> >>>>>>> All you need to do, to change the limit, go to >>>>>>> platforms/win32/vm/sqWin32Alloc.h >>>>>>> >>>>>>> And change this: >>>>>>> >>>>>>> #ifndef MAX_VIRTUAL_MEMORY >>>>>>> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >>>>>>> #endif >>>>>>> >>>>>>> So, if you want more, build VM with any limit you see fit. >>>>>>> But there's a reason why in official VM its 512. >>>>>> >>>>>> Igor this is a real issue and we are all fighting to get more members in >>>>>> the consortium >>>>>> so that one day we can hire a guy like you to address it. >>>>>> >>>>> >>>>> https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 >>>> >>>> Yeah ! Now users can set the limit themselves. >>>> >>>> And then they will come back complaining that certain things don't work >>>> when they raise the limit too high ;-) >>>> >>>> One day we will have a proper 64-bit VM. >>>> >>> Yes, i wish we can be there today. >>> (And one day people will learn a difference between actual memory used >>> and reserved address space :) >>> >> .. because reserving 512Mb for image which barely eats 30Mb is a huge waste. > > Yes, use cases are different. Therefor there should be a vm switch where you > can choose the maximum memory to reserve, to heap size at start, the maximum > heap size, etc. > and so i added it. But i hate doing that. Because such switch should not exist and VM should be able to adapt to application's memory requirements automatically, without requiring user's input. Because then you have to write manual, explaining what is address space, and why users should be educated about it in order to use VM properly. And every other switch like this one you add, it makes manual bigger and bigger, up to the point, that it turns into complete mess of inter-depending, conflicting switches, some of them obsolete, some of them tricky and nobody knows how to use them properly (and that happens for sure). > Norbert -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 10 July 2013 00:07, Usman Bhatti wrote: > Tx igor. > Now I am waiting to get hold of the new VM (with this parameter) to test on > Windows. > yes, i am building it right now on my machine to test if it works, and jenkins refuses to build it (but for other reasons, which we need to fix asap) > > > > On Tue, Jul 9, 2013 at 8:44 PM, Stéphane Ducasse > wrote: >> >> For the people that did not click on the link :) >> >> Tree SHA1: 26bf913 >> Parent SHA1: 14cc218 (- fixed save for 2.0) >> raw diff | raw patch >> >> Added option in windows .ini file >> to set the virtual memory address space limit. >> >> AddressSpaceLimit = >> The default is 512Mb >> >> Thanks igor. >> >> Stef >> >> >> >> >> On Jul 9, 2013, at 10:03 AM, Igor Stasenko wrote: >> >> On 9 July 2013 09:13, Stéphane Ducasse wrote: >> >> First, not all programming languages are like this: You can easily run >> other VMs (e.g., Java) with more than 3 GB. But, let's not even go there: I >> can run Pharo with 1Gb on Mac without problems. According to your reasoning >> we might end up downgrading the Mac VM. Some data does not fit in memory, >> but if I can get all my data in my image, I will choose to do it. >> >> I am not saying that we should compare with Java, or that it is the end of >> the world that the Windows VM is highly restricted. I am simply saying that >> we should not dismiss this as a problem just because we do not know how, or >> do not have the resources to solve it right now. >> >> After all, we are here to change the world :). >> >> >> Yes, but this topic was raised multiple times already. Maybe we should >> stop wasting time on it? >> >> All you need to do, to change the limit, go to >> platforms/win32/vm/sqWin32Alloc.h >> >> And change this: >> >> #ifndef MAX_VIRTUAL_MEMORY >> #define MAX_VIRTUAL_MEMORY 512*1024*1024 >> #endif >> >> So, if you want more, build VM with any limit you see fit. >> But there's a reason why in official VM its 512. >> >> >> Igor this is a real issue and we are all fighting to get more members in >> the consortium >> so that one day we can hire a guy like you to address it. >> >> >> >> https://gitorious.org/cogvm/blessed/commit/341e6c2e150bcde80dfea6c890bab7745b2a6d44 >> >> Stef >> >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> >> > -- Best regards, Igor Stasenko.
Re: [Pharo-users] More than 500MB for windows
On 10 July 2013 13:41, Tudor Girba wrote: > Wow! > > This is really exciting. > > Thanks a lot, Igor. I value this help even more knowing how you feel about > the modification. Or maybe you changed your mind in the meantime? :) > No. It just a pain, knowing that it can do better, but to do it you have to change how VM manages the memory, which is much more work than what i did. I am not looking from position of "making customer happy", but "making myself happy", because apparently i am also using same VM and i want it to shine not just from outside, but inside as well. That's why i am grumbling :) So, okay.. i ran following: | objectQuantity objectSize objects fs | objectQuantity := 1024. objectSize := 1024*1024. objects := Array new: objectQuantity. fs := 'allocation.log' asFileReference ensureDeleted writeStream. 1 to: objectQuantity do: [ :index | objects at: index put: (ByteArray new: objectSize). fs nextPutAll: index asString; cr. fs flush ]. and run it on windows, and it actually behaved quite well, at 472 Mb allocated , i got a low-space warning popup. And no ugly crash. (note it cannot be strictly 512Mb, because some space already taken by image + jit + etc.. ) now, i set AddressSpaceLimit=1024 in .ini file and run the same again, and it stopped at 984 (megs allocated), again showing low-space warning (but it took a whiile to show it.. and image responding quite slow.. maybe because i run on virtual box and it is more memory than i gave to boxed windows, so it forced to do a lot of disk swapping. so, it works. -- Best regards, Igor Stasenko.
[Pharo-users] New win32 VM available (was: More than 500MB for windows)
So, after spending unproportionally huge time (2days) dealing with jenkins config idiosyncrasies, it finally managed to build it. http://files.pharo.org/vm/pharo/win/latest.zip This VM should react properly on AddressSpaceLimit= setting in .ini file. The ini file is located in same directory as VM executable. If it doesn't exists, you can run VM once and it will create it automatically. Thanks for patience. -- Best regards, Igor Stasenko.
Re: [Pharo-users] New win32 VM available (was: More than 500MB for windows)
On 15 July 2013 15:34, Damien Cassou wrote: > On Mon, Jul 15, 2013 at 3:27 PM, Tudor Girba wrote: >> Ok, I admit. I should read emails thoroughly :). Please ignore the second >> issue. Still, why is it called PharoS? > > > may it be because this is a StackVM and not Cog? yeah, it looks like Esteban by making configs for PharoS VM made a mistake and these VMs uploaded into same location as Cog ones.. (we fixed it already, building new VM, which will copy stuff properly) alternatively , you can download VM from build server: https://ci.inria.fr/pharo/view/VM/job/PharoVM/182/Architecture=32,Slave=vm-builder-win/ (to make sure we're talking about same VM) > > -- > Damien Cassou > http://damiencassou.seasidehosting.st > > "Success is the ability to go from one failure to another without > losing enthusiasm." > Winston Churchill > -- Best regards, Igor Stasenko.
Re: [Pharo-users] New win32 VM available (was: More than 500MB for windows)
On 15 July 2013 16:59, Tudor Girba wrote: > Aha :). > > Ok. I tested PharoS with 1GB and I got a 800MB image running well. > > Is there really no chance of getting Cog with this feature? :) > please ,read more carefully.. :) it was error in config, which copied PharoS files over Pharo ones. And answering your question: you should have the same feature in both VMs since they sharing same C codebase. > Doru > > > > > On Mon, Jul 15, 2013 at 4:23 PM, Igor Stasenko wrote: >> >> On 15 July 2013 15:34, Damien Cassou wrote: >> > On Mon, Jul 15, 2013 at 3:27 PM, Tudor Girba >> > wrote: >> >> Ok, I admit. I should read emails thoroughly :). Please ignore the >> >> second >> >> issue. Still, why is it called PharoS? >> > >> > >> > may it be because this is a StackVM and not Cog? >> >> yeah, it looks like Esteban by making configs for PharoS VM >> made a mistake and these VMs uploaded into same location as Cog ones.. >> (we fixed it already, building new VM, which will copy stuff properly) >> >> alternatively , you can download VM from build server: >> >> >> https://ci.inria.fr/pharo/view/VM/job/PharoVM/182/Architecture=32,Slave=vm-builder-win/ >> >> (to make sure we're talking about same VM) >> >> > >> > -- >> > Damien Cassou >> > http://damiencassou.seasidehosting.st >> > >> > "Success is the ability to go from one failure to another without >> > losing enthusiasm." >> > Winston Churchill >> > >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > > > -- > www.tudorgirba.com > > "Every thing has its own flow" -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Pharo-dev] [DOC] Building and deploying your first web app with Pharo
since you gave listing at the end of page, i wonder, how much PHP (yes! :) code it would take to implement same app? :) of course , PHP is not really fair comparison, since it doesn't implements full HTTP stack, nor it deals with HTTP requests directly as Zinc does, and runs on top of web server which does that for it. On 15 July 2013 13:12, Sven Van Caekenberghe wrote: > Hi, > > I wrote a new tutorial, "Building and deploying your first web app with Pharo > - Understanding HTTP fundamentals through Zinc HTTP Components". > > By chronologically following the development process, you will see a small > web app growing from something trivial to the final result. Finally, we will > save our source code in a repository and deploy for real in the cloud. > > http://zn.stfx.eu/zn/build-and-deploy-1st-webapp > > Pharo 2.0/3.0 features such as Nautilus, SmalltalkHub, Metacello > Configurations, Zeroconf Scripts and of course Zinc HTTP Components are used > while highlighting traditional strengths such as incremental, live & > interactive development in a rich environment. > > Enjoy, > > Sven > > PS: Feedback is welcome, the source document lives here > https://github.com/svenvc/zinc/blob/master/build-and-deploy-1st-webapp/build-deploy-1st-webapp.md > - pull requests appreciated. > > -- > Sven Van Caekenberghe > Proudly supporting Pharo > http://pharo.org > http://association.pharo.org > http://consortium.pharo.org > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Your vm is too old….
On 24 July 2013 17:13, Norbert Hartl wrote: > As I cannot work with the pharo VM right now I'm back to use Eliots Cog. But > If I open a more recent image it complains about my vm being to old. What > does it really check in order to complain? Some just version string/number > parsing? Is it always sever? > IIRC, it checking a VM build date. > Norbert -- Best regards, Igor Stasenko.
Re: [Pharo-users] Your vm is too old….
On 24 July 2013 22:46, Tudor Girba wrote: > Use the latest stable VM. It should solve the problem. > Nope. Problem will be solved if we will know exactly what causing it, write test with can reproduce it with 100% guarantee. Using latest VM is not recipe from disease. Unfortunately, we still don't have reproducible case and that blocks us from fixing it. > Doru > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Your vm is too old….
On 25 July 2013 12:05, Tudor Girba wrote: > The workaround at the image level was needed only until we got the VM > working. The details about the workaround are here: > https://pharo.fogbugz.com/f/cases/10395/ > > I was sure that in the meantime, the problem was solved in the VM as well, > but I cannot trace that information. Perhaps it is not. Esteban? > Last time i discussed with Esteban about it, he said that he don't knows where the problem in VM, neither me. > Cheers, > Doru > > > On Thu, Jul 25, 2013 at 9:13 AM, Stéphane Ducasse > wrote: >> >> >> On Jul 25, 2013, at 9:08 AM, Tudor Girba wrote: >> >> This was a problem that we also had (when working in Moose), and Esteban >> fixed it (first the workaround in the image, and then in the VM). We are >> using this VM since some months now and the problem did not resurface. >> >> That is why I know it is fixed in the latest stable PharoVM. >> >> >> Ok what igor is probably meaning is that we would prefer to get the system >> running without having to have a workaround at the image level. >> >> >> Cheers, >> Doru >> >> >> On Thu, Jul 25, 2013 at 9:03 AM, Norbert Hartl wrote: >>> >>> Doru, >>> >>> I'm sorry but I was mistaken somehow. I tried always to use the newest >>> VM. I just downloaded a new vm a few minutes ago and now I cannot reproduce >>> the problem anymore. That doesn't mean it won't appear anymore but I'll work >>> with the pharo vm and see if it comes back. >>> >>> thanks, >>> >>> Norbert >>> >>> Am 24.07.2013 um 22:46 schrieb Tudor Girba : >>> >>> > Use the latest stable VM. It should solve the problem. >>> > >>> > Doru >>> > >>> > >>> > On Jul 24, 2013, at 10:34 PM, Norbert Hartl wrote: >>> > >>> >> >>> >> >>> >> Am 24.07.2013 um 18:21 schrieb Stéphane Ducasse >>> >> : >>> >> >>> >>> >>> >>> On Jul 24, 2013, at 5:13 PM, Norbert Hartl >>> >>> wrote: >>> >>> >>> >>>> As I cannot work with the pharo VM right now >>> >>> >>> >>> what is the problem? >>> >> >>> >> I get the DNU SmallInteger>>add: all the time especially when using >>> >> metacello (Using Versionner I get it nearly every attempt to validate the >>> >> configuration). This occurred already a few times on the list. >>> >> >>> >> >>> >>> >>> >>>> I'm back to use Eliots Cog. But If I open a more recent image it >>> >>>> complains about my vm being to old. What does it really check in order >>> >>>> to >>> >>>> complain? Some just version string/number parsing? Is it always sever? >>> >>>> >>> >>>> Norbert >>> >>> >>> >>> >>> >> >>> > >>> > -- >>> > www.tudorgirba.com >>> > >>> > "Quality cannot be an afterthought." >>> > >>> > >>> >>> >> >> >> >> -- >> www.tudorgirba.com >> >> "Every thing has its own flow" >> >> > > > > -- > www.tudorgirba.com > > "Every thing has its own flow" -- Best regards, Igor Stasenko.
Re: [Pharo-users] Unix Domain Sockets
On 28 July 2013 03:46, Pierce Ng wrote: > Hello, > > I want to share that I wrote a blog post on using Unix domain sockets in > Pharo. > > http://samadhiweb.com/blog/2013.07.27.unixdomainsockets.html > > The NetNameResolver bits can be made more Smalltalk-ish. Also, I'll be > looking into the minor changes needed to support SocketStream as well. > > Maybe this is the wrong list to ask, but how do I contribute this to Pharo? > Well, pharo-dev list is more appropriate place for discussing contributions. Because users list is mostly about 'how can i ... ' stuff, e.g. to help newcomers with pharo, or clarify things etc (at least this is how i using it). As for the rest, you can read details at this page (and link from it): http://www.pharo-project.org/community/how-to-contribute About unix sockets: i see the changes is not really big and easy to integrate. My only question regarding this, how do you think, maybe it make sense to have a separate class for it, so users can tell: UnixSocket new instead of Socket newIPC i also think that if socket creation failed, the code should throw an error rather than return nil. > > Cheers. > > -- > Pierce Ng > http://samadhiweb.com/blog/ > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Pharo 2.0 with Seaside + DBXTalk + GlorpDBX + Magritte 3 + TWBS is getting slower and slower
On 30 July 2013 10:51, Marcus Denker wrote: > > On Jul 29, 2013, at 7:31 PM, p...@highoctane.be wrote: > > The image and the changes file are here: (uploading... will take a while - > 30 min or so) > > https://www.dropbox.com/sh/wfxep3jm5v27szt/5keLUTFvGz > > Ok, I downloaded them. > > Marcus > it appears that .changes file is corrupt, for instance , browse: WAWelcomeBrowse>>renderContentOn: and it shows: ontentOn: html html heading level1.. (and i guess all code which loaded after certain point is corrupt) i also found 2 UI processes hanging around as well as some others which i cannot terminate.. something went wrong during installing the code. -- Best regards, Igor Stasenko.
Re: [Pharo-users] Pharo performance
On 30 July 2013 10:42, Sven Van Caekenberghe wrote: > Hi Yanni, > > On 30 Jul 2013, at 05:17, Yanni Chiu wrote: > >> On 29/07/13 7:08 PM, Sven Van Caekenberghe wrote: >>> >>> The explanation for the slowdown must be in the PgV2 driver. >> >> The PgV2 protocol is described at: >> http://www.postgresql.org/docs/7.1/static/protocol-message-formats.html >> >> Have a glance at the "AsciiRow" and "BinaryRow" message formats. The driver >> reads the data off the socket, parsing the the data, as described as >> described by the message format. With the V2 protocol design, you have to >> read the result row, one field at a time. >> >> IIUC, in the newer V3? protocol, the AsciiRow/BinaryRow message is replaced >> by a DataRow message. The DataRow message has the message size included, >> which could allow the driver to read the entire set of fields for one data >> row, using a single socket read (or a few buffer sized reads). >> >> I recall seeing an experimental V3 protocol implementation, a few years back >> - sorry, no links handy. It would be nice to see some benchmarks. >> >> Hope that helps. > > Thanks for the response. > > I believe the V3 project is here http://www.squeaksource.com/PostgresV3.html. > > Now, I probably spoke too fast and should have taken Mariano's advice to > never speculate and first measure. Here is my quick test that, for me, shows > that PostgresV2 seems more than fast enough (something that I had experienced > before without doing benchmarks). > > [ self execute: 'select longitude,latitude from log_data limit 1;' ] > timeToRun. > > => 76 ms > 76 ms for 1 records? that's quite good throughput i would say. > [ self execute: 'select longitude,latitude from log_data limit 10;' ] > timeToRun. > > => 765 ms > > This is querying for 2 floats from a huge table, over the network. Pretty > fast ;-) > > So, back to Chris: what exactly are you doing that is (so) slow ? > > Anyway, thanks Yanni for all your work on the existing driver ! > > Sven > > -- > Sven Van Caekenberghe > Proudly supporting Pharo > http://pharo.org > http://association.pharo.org > http://consortium.pharo.org > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Garbage collector & Memory Profiling
On 31 July 2013 15:14, Mariano Martinez Peck wrote: > > > > On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen > wrote: >> >> >> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck >> wrote: >> >> > As far as I know, that's not possible in Pharo unless you explicitly >> > register the desired objects in "WeakRegistry default" or similar (and >> > implement #finalize). >> > I think is the closest you have. >> > >> > Cheers, >> >> A few clarifications: >> - You can use a non-default WeakRegistry (usually one specific to your >> domain, to avoid cluttering of the default one) >> - You can specify a custom executor (any object which implements >> #finalize), rather than implement #finalize on objects you're interested in. >> >> obj := Object new. >> executor := ObjectFinalizer receiver: Transcript selector: #show: >> argument: 'Object GC''d!'. >> myReg := WeakRegistry new. >> myReg add: obj executor: executor. >> obj := nil. >> Smalltalk garbageCollect. >> > > Nice!!! I never tried with a different executor nor other instance of > WeakRegistry. That's cool. Thanks Henry. > Really? Can't believe it! You? One who implemented Marea? :) -- Best regards, Igor Stasenko.
Re: [Pharo-users] Garbage collector & Memory Profiling
On 31 July 2013 17:02, Sven Van Caekenberghe wrote: > > On 31 Jul 2013, at 16:59, Igor Stasenko wrote: > >> On 31 July 2013 15:14, Mariano Martinez Peck wrote: >>> >>> >>> >>> On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen >>> wrote: >>>> >>>> >>>> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck >>>> wrote: >>>> >>>>> As far as I know, that's not possible in Pharo unless you explicitly >>>>> register the desired objects in "WeakRegistry default" or similar (and >>>>> implement #finalize). >>>>> I think is the closest you have. >>>>> >>>>> Cheers, >>>> >>>> A few clarifications: >>>> - You can use a non-default WeakRegistry (usually one specific to your >>>> domain, to avoid cluttering of the default one) >>>> - You can specify a custom executor (any object which implements >>>> #finalize), rather than implement #finalize on objects you're interested >>>> in. >>>> >>>> obj := Object new. >>>> executor := ObjectFinalizer receiver: Transcript selector: #show: >>>> argument: 'Object GC''d!'. >>>> myReg := WeakRegistry new. >>>> myReg add: obj executor: executor. >>>> obj := nil. >>>> Smalltalk garbageCollect. >>>> >>> >>> Nice!!! I never tried with a different executor nor other instance of >>> WeakRegistry. That's cool. Thanks Henry. >>> >> >> Really? Can't believe it! You? One who implemented Marea? :) > > Yeah, incredible. > And now he is even storing 200Mb of data is his images without knowing it ;-) > well, to be honest, that something different.. when you load the code which not written by you, which explodes your image size. -- Best regards, Igor Stasenko.
Re: [Pharo-users] RFB on 2.0 + linux - semaphore primitive failed
On 31 July 2013 22:17, Paul DeBruicker wrote: > I don't know. I don't get the errors that used to occur with the max > semaphores being exceeded. I thought Igor Stasenko fixed that issue in > the VM so the array that holds the semaphores grows without blocking. > Or something. > You can have as big as you want array with semaphores. There is no limits and maxExternalSemaphoresSilently is just does nothing and ignored. > > > What I do know is that if I 'abandon' that warning and save & quit and > then reopen the image then the UI is locked and I have to use Seaside's > WAScreenshot tool to suspend and resume the UI to unfreeze it. > > weird. i would start from figuring out, why primitive failed..and for which semaphore. -- Best regards, Igor Stasenko.
Re: [Pharo-users] Process ID of VM
Thanks for your hard work! 1 important remark: NBXLibTypes class>>initialize super initialize. Display := #NBXLibDisplay. Never use 'super initialize' for class initializers. On 20 August 2013 09:42, Torsten Bergmann wrote: > I just wrapped this in NB last week, so if you have NativeBoost and Windows > you can use: > > NBWin32Process getCurrentProcessId > > (requires the latest packages from > http://smalltalkhub.com/#!/~Pharo/NativeBoost) > > I'm sure on any other platforms there are API's as well to get the PID, > like > getpid on Unix. Should be easy to wrap in NB if you follow this tutorial: > > > https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccessfulBuild/artifact/NativeBoost/NativeBoost.pier.html > > Bye > T. > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Process ID of VM
Classes forming the tree structure (one class can have many subclasses). A class initialization usually done for initializing properties shared by class and all its subclasses, and sent automatically to tools like Monticello when it loads the code to each separate class. So, if we use 'super initialize' we will end up initializing superclass 100 times if it has 100 subclasses. Moreover, if we strictly follow that rule, the class initialization will endup in Behavior>>initialize (look at that method and guess what will happen if you run it) On 20 August 2013 11:34, Tim Hendriks wrote: > I'am just learning (a few weeks) so why not use super in Class? > > Thanks Tim > > Op 20-8-2013 11:29, Igor Stasenko schreef: > > Thanks for your hard work! > > 1 important remark: > > NBXLibTypes class>>initialize > super initialize. > Display := #NBXLibDisplay. > > > > Never use 'super initialize' for class initializers. > > > > > > On 20 August 2013 09:42, Torsten Bergmann wrote: > >> I just wrapped this in NB last week, so if you have NativeBoost and >> Windows >> you can use: >> >> NBWin32Process getCurrentProcessId >> >> (requires the latest packages from >> http://smalltalkhub.com/#!/~Pharo/NativeBoost) >> >> I'm sure on any other platforms there are API's as well to get the PID, >> like >> getpid on Unix. Should be easy to wrap in NB if you follow this tutorial: >> >> >> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccessfulBuild/artifact/NativeBoost/NativeBoost.pier.html >> >> Bye >> T. >> >> >> >> >> > > > -- > Best regards, > Igor Stasenko. > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Process ID of VM
on windoze, getting pid of current process is piece of cake (GetModuleHangle). On 20 August 2013 19:16, Udo Schneider wrote: > On 20.08.13 09:42, Torsten Bergmann wrote: > >>NBWin32Process getCurrentProcessId >> > The NativeBoost approach is a really good idea! I'll check whether I can > get this working on other platforms as Win32 as well. > > Thanks, > > Udo > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Process ID of VM
see NativeBoostWin32 class>>getVMModuleHandle On 21 August 2013 04:42, Igor Stasenko wrote: > on windoze, getting pid of current process is piece of cake > (GetModuleHangle). > > > On 20 August 2013 19:16, Udo Schneider wrote: > >> On 20.08.13 09:42, Torsten Bergmann wrote: >> >>>NBWin32Process getCurrentProcessId >>> >> The NativeBoost approach is a really good idea! I'll check whether I can >> get this working on other platforms as Win32 as well. >> >> Thanks, >> >> Udo >> >> >> >> >> > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost: Null-terminated Strings
String pseudo type corresponds to 'const char *' type.. because it passes the string by copying it on stack and null terminating it there, and then pushing the pointer (which on stack), as argument to function. That means that original string is never modified, in your case function will modify a temporary string on stack, and after call finished it will be lost. If function takes pointer to write some data at given location, you can just pass a ByteArray instance as a buffer to hold that string (so function will receive a pointer of first byte in it).. and after it return, trim/convert it to ByteString. On 20 August 2013 19:45, Udo Schneider wrote: > All, > > I just wrapped a few functions using NB - as easy as it used to be in > Dolphin! Really nice. > > I'm stuck with a simple thing however. I'm passing a string buffer into a > function which fills this buffer (null-terminated String). The passed in > String however contains all the nulls as well (which is not surprising). > What's the "official" way to truncate the String to it's correct length? > > Best Regards, > > Udo > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Morph relative positions
On 20 September 2013 12:15, Norbert Hartl wrote: > Next try. I may do something stupid but it appears that all morphs draw on > the same coordinate system. Meaning that every Morph that will draw > something at 0@0 will put it in the top left corner of the image > displayed. I would expect that a morph that is positioned somewhere > provides a canvas where 0@0 is relative to the position of the morph. If > coordinates are absoulte how can I delegate work to sub components and > having them calculate the offsets properly? > > Welcome to club. To ease the pain, take a look at TransformMorph. > Norbert > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Morph relative positions
On 20 September 2013 17:37, Markus Schlager wrote: > I'd not expect though, that it should be necessary to add offsets by hand. > What is the advantage of having embedded objects use global coordinates? > > Markus > > i don't know.. i think people who could answer this question is not on this list. i think it, as many other aspects of our heritage, a result of many years of building on top of once simple and robust things, and that build-on-top-without-rethinking process led us to what we have now: once simple and robust solution, now buried under tons of layers, where some of them trying to extend design, and some trying to fix its original issues.. and all of that instead of changing design to something more adequate and simpler. -- Best regards, Igor Stasenko.
Re: [Pharo-users] Morph relative positions
On 20 September 2013 19:22, Igor Stasenko wrote: > > On 20 September 2013 17:37, Markus Schlager wrote: > >> I'd not expect though, that it should be necessary to add offsets by >> hand. What is the advantage of having embedded objects use global >> coordinates? >> >> Markus >> >> > i don't know.. i think people who could answer this question is not on > this list. > i think it, as many other aspects of our heritage, a result of many years > of building on top of > once simple and robust things, > and that build-on-top-without-rethinking process led us to what we have > now: > once simple and robust solution, now buried under tons of layers, where > some of them > trying to extend design, and some trying to fix its original issues.. > ... and some of them there is to duplicate already existing functionality. i guess because people was unaware of its existence or because coding is much more fun than reading and learning code :) > and all of that instead of changing design to something more adequate and > simpler. > > -- > Best regards, > Igor Stasenko. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Proper way of handling multiple exception sections
On 25 October 2013 13:34, Norbert Hartl wrote: > I’m thinking about what would be the proper/least annoying way of having > multiple exception sections. If I have a code block that can emit two > different exceptions is the only way doing it > > [ [ ... ] > on: Exception1 > do: [ … ] ] > on: Exception2 > do: [ … ] > > on:do: just calls a primitive that marks the context being an exception > handler. What is called in the image when the stack is scanned to find an > exception handler? > > Look at MethodContext exception handling category. Not sure if this answer can satisfies you, because the code there is hard to read and hard to debug. > thanks, > > Norbert > -- Best regards, Igor Stasenko.
Re: [Pharo-users] CogVM arguments in Win32
try double-dashed option: from vm/sqWin32Intel.c : else if (!strcmp(argv[0], "--headless")) { fHeadlessImage = true; return 1; } this is really a mess with VM options handled differently on different OSes. On 29 October 2013 11:14, Bernat Romagosa wrote: > Ok, I see Pharo -help brings up a window with command line options, but > -headless is still firing up the GUI... any ideas? > > > 2013/10/29 Bernat Romagosa > >> Hi list! >> >> I've never used Pharo on Windows before, but we're starting to package a >> multi-platform app right now and I've just found out command line arguments >> don't work like I thought they would. I need to run the image headless, so >> I figured: >> >> bin-win32\Pharo -headless shared\Pharo2.0.image >> >> Would do the trick, but it's not working. >> >> Pharo /? doesn't give any hints either, and I can't seem to find the docs >> for the Windows VM anywhere. >> >> Does anybody know where I can find a Win32 VM reference? >> >> Thanks! >> >> -- >> Bernat Romagosa. >> > > > > -- > Bernat Romagosa. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Using FFI
On 29 October 2013 16:27, Annick Fron wrote: > Hi > > I want to launch a simple init with the following C signature : > > void gst_init (int *argc, char **argv[]) > > If I write > > > > I get a Smalltalk syntax error > > Annick Fron > > To use this syntax, you must load old FFI implementation. Or use NativeBoost: init: intarg with: chararg self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: 'blaba' -- Best regards, Igor Stasenko.
Re: [Pharo-users] Using FFI
AFAIK, it should be in Configurations browser. Else try this: Gofer new squeaksource: 'MetacelloRepository'; package: 'ConfigurationOfFFI'; load. (Smalltalk at: #ConfigurationOfFFI) project lastVersion load On 30 October 2013 09:41, Annick Fron wrote: > My problem is that the Raspberry does not support native boost (as yet !). > Where can I load the old FFI ? > > Le 29 oct. 2013 à 16:57, Igor Stasenko a écrit : > > > > > On 29 October 2013 16:27, Annick Fron wrote: > >> Hi >> >> I want to launch a simple init with the following C signature : >> >> void gst_init (int *argc, char **argv[]) >> >> If I write >> >> >> >> I get a Smalltalk syntax error >> >> Annick Fron >> >> > To use this syntax, you must load old FFI implementation. > Or use NativeBoost: > > init: intarg with: chararg > > > > self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: > 'blaba' > > > -- > Best regards, > Igor Stasenko. > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Using FFI
On 30 October 2013 16:11, Esteban Lorenzano wrote: > mmm... but again, AFAIK... Old FFI will not work in ARM. > > yes. but i replied before knowing that its about ARM :) > On Oct 30, 2013, at 10:12 AM, Igor Stasenko wrote: > > AFAIK, it should be in Configurations browser. > Else try this: > > Gofer new > squeaksource: 'MetacelloRepository'; > > package: 'ConfigurationOfFFI'; > load. > > (Smalltalk at: #ConfigurationOfFFI) project lastVersion load > > > > > On 30 October 2013 09:41, Annick Fron wrote: > >> My problem is that the Raspberry does not support native boost (as yet !). >> Where can I load the old FFI ? >> >> Le 29 oct. 2013 à 16:57, Igor Stasenko a écrit : >> >> >> >> >> On 29 October 2013 16:27, Annick Fron wrote: >> >>> Hi >>> >>> I want to launch a simple init with the following C signature : >>> >>> void gst_init (int *argc, char **argv[]) >>> >>> If I write >>> >>> >>> >>> I get a Smalltalk syntax error >>> >>> Annick Fron >>> >>> >> To use this syntax, you must load old FFI implementation. >> Or use NativeBoost: >> >> init: intarg with: chararg >> >> >> >> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: >> 'blaba' >> >> >> -- >> Best regards, >> Igor Stasenko. >> >> >> > > > -- > Best regards, > Igor Stasenko. > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] [Pharo-dev] Pharo presentation at Smalltalk 2013
i got the message :) On 30 October 2013 16:22, Stéphane Ducasse wrote: > > > > http://www.slideshare.net/pharoproject/2013smalltalksconference-pharo-is-yours > > Stef > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Using FFI
On 31 October 2013 11:23, Annick Fron wrote: > Hi Igor > > I have done that, but still gets an error, do I need to remove NativeBoost > ? > Annick > > FFI not supported on ARM > Le 30 oct. 2013 à 14:12, Igor Stasenko a écrit : > > AFAIK, it should be in Configurations browser. > Else try this: > > Gofer new > squeaksource: 'MetacelloRepository'; > > package: 'ConfigurationOfFFI'; > load. > > (Smalltalk at: #ConfigurationOfFFI) project lastVersion load > > > > > On 30 October 2013 09:41, Annick Fron wrote: > >> My problem is that the Raspberry does not support native boost (as yet !). >> Where can I load the old FFI ? >> >> Le 29 oct. 2013 à 16:57, Igor Stasenko a écrit : >> >> >> >> >> On 29 October 2013 16:27, Annick Fron wrote: >> >>> Hi >>> >>> I want to launch a simple init with the following C signature : >>> >>> void gst_init (int *argc, char **argv[]) >>> >>> If I write >>> >>> >>> >>> I get a Smalltalk syntax error >>> >>> Annick Fron >>> >>> >> To use this syntax, you must load old FFI implementation. >> Or use NativeBoost: >> >> init: intarg with: chararg >> >> >> >> self nbCall: 'void gst_init (int * intarg, char ** chararg)' module: >> 'blaba' >> >> >> -- >> Best regards, >> Igor Stasenko. >> >> >> > > > -- > Best regards, > Igor Stasenko. > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] CogVM arguments in Win32
You can try something like this: | handle window | handle := NativeBoost forCurrentPlatform squeakWindowHandle. window := NBWin32Window new value: handle; yourself. window hide. or window setWindowText: 'im a main window blablabla'. :) i didn't tested it since its been implemented, but i think it should work. On 30 October 2013 11:20, Bernat Romagosa wrote: > In this direction, I'm trying to call a function in the shell32.dll lib > that apparently should let you minimize an app to the system tray, but I'm > not having much luck... I guess I don't really understand what am I exactly > doing. > > This is what I found in the > MSDN<http://msdn.microsoft.com/en-us/library/bb762159%28VS.85%29.aspx> > : > > BOOL Shell_NotifyIcon( > _In_ DWORD dwMessage, > _In_ PNOTIFYICONDATA lpdata > ); > > > So, I tried to translate this into Pharo as: > > MyClass >> minimizeToTray: dwMessage data: lpData > >'shell32.dll'> > > > But it won't let me save the method, reporting it's expecting an argument > before PNOTIFYICONDATA. > > I realize PNOTIFYICONDATA is not a primitive type, but I just don't know > how to handle it... :( > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] another talk online: Pharo: Objects At Your Fingertips
On 31 October 2013 10:30, Sven Van Caekenberghe wrote: > Beautiful and useful ! > > except that video is in Silver format, not avail on macos. :( Is there a copy with more open encoding (like mp4/mpeg?) > On 31 Oct 2013, at 10:08, Marcus Denker wrote: > > > The idea of this talk is to give an intro for someone who know OO but > not Pharo (or Smalltalk). > > (this means for someone who does it has noting new) > > > > Pharo: Objects At Your Fingertips > > A talk given at Universitat Politècnica de Catalunya on Oct 30, > 2013. > > > > SlideShare: > http://www.slideshare.net/MarcusDenker/pharo-objects-at-your-fingertips > > PDF: > http://marcusdenker.de/talks/13BarcelonaTalk/PharoObjectsAtYourFingertips.pdf > > Video: http://media.fib.upc.edu/fibtv/streamingmedia/view/2/821 > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] another talk online: Pharo: Objects At Your Fingertips
works in VLC on mac as well! :) On 31 October 2013 10:44, Bernat Romagosa wrote: > For the Gnu/Linux people, you can watch the talk via: > > mplayer 'mms:// > fibtv.fib.upc.es/videoteca/20131030-1055_Pharo_Objects_at_your_Fingertips.wmv?cat=2&vid=821 > ' > > > 2013/10/31 Sven Van Caekenberghe > >> Beautiful and useful ! >> >> On 31 Oct 2013, at 10:08, Marcus Denker wrote: >> >> > The idea of this talk is to give an intro for someone who know OO but >> not Pharo (or Smalltalk). >> > (this means for someone who does it has noting new) >> > >> > Pharo: Objects At Your Fingertips >> > A talk given at Universitat Politècnica de Catalunya on Oct 30, >> 2013. >> > >> > SlideShare: >> http://www.slideshare.net/MarcusDenker/pharo-objects-at-your-fingertips >> > PDF: >> http://marcusdenker.de/talks/13BarcelonaTalk/PharoObjectsAtYourFingertips.pdf >> > Video: http://media.fib.upc.edu/fibtv/streamingmedia/view/2/821 >> >> >> > > > -- > Bernat Romagosa. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Why won't my Pharo download run?
On 7 November 2013 14:18, PBK Research wrote: > Hello! > > I have a problem with running Pharo 2.0 on one of my machines. I have two > machines, both running Windows XP with SP3. On one of them I have a > successful load of Pharo (actually it's a distribution of the Moose system, > but that is just an application built on Pharo 2.0). This loads > successfully when I double click on pharo.exe. On the other machine, the > same action produces an immediate message: 'Pharo.exe has encountered a > problem and needs to close'. Just in case this was some problem with Moose, > I have just downloaded the latest one-click installation of Pharo 2.0 for > Windows. This displays exactly the same behaviour - an immediate fail when > I try to start it. > > I have tried to work out what may be different between the two machines. > The one which will run Pharo has an Intel Celeron processor, the other an > AMD Athlon XP (yes, they are both pretty ancient!), but I can't see why > that should make any difference. The one curious thing is that Windows > Explorer displays the type of the Pharo2.0.image file as 'Squeak image > file'. There is an old version of Squeak installed on that machine; could > that have any effect? > > I am a bit flummoxed by all this. Does anyone have any suggestions about > how to diagnose the problem? > > If you using too old VM , it simply does not supports an image format, which pharo 2.0 uses. But there could be different reasons.. a first step towards to solution is to use VM for pharo, which we maintain and use.. > Many thanks > > Peter Kenny > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Why won't my Pharo download run?
On 7 November 2013 15:31, PBK Research wrote: > Thanks. I am using the latest one-click distribution of Pharo, > downloaded today from the Pharo website. Presumably that should have the > latest VM? > > yes, but if .image file extension associated with wrong version of VM binary, which you installed previously (as you mentioned), it won't automagically use proper one. unless you run vm from command line e.g.: pharo.exe myimage.image or change the association to use different vm. -- > *From:* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On > Behalf Of *Igor Stasenko > *Sent:* 07 November 2013 13:53 > *To:* Any question about pharo is welcome > *Subject:* Re: [Pharo-users] Why won't my Pharo download run? > > > > > On 7 November 2013 14:18, PBK Research wrote: > >> Hello! >> >> I have a problem with running Pharo 2.0 on one of my machines. I have two >> machines, both running Windows XP with SP3. On one of them I have a >> successful load of Pharo (actually it's a distribution of the Moose system, >> but that is just an application built on Pharo 2.0). This loads >> successfully when I double click on pharo.exe. On the other machine, the >> same action produces an immediate message: 'Pharo.exe has encountered a >> problem and needs to close'. Just in case this was some problem with Moose, >> I have just downloaded the latest one-click installation of Pharo 2.0 for >> Windows. This displays exactly the same behaviour - an immediate fail when >> I try to start it. >> >> I have tried to work out what may be different between the two machines. >> The one which will run Pharo has an Intel Celeron processor, the other an >> AMD Athlon XP (yes, they are both pretty ancient!), but I can't see why >> that should make any difference. The one curious thing is that Windows >> Explorer displays the type of the Pharo2.0.image file as 'Squeak image >> file'. There is an old version of Squeak installed on that machine; could >> that have any effect? >> >> I am a bit flummoxed by all this. Does anyone have any suggestions about >> how to diagnose the problem? >> >> > > If you using too old VM , it simply does not supports an image format, > which pharo 2.0 uses. > But there could be different reasons.. a first step towards to solution is > to use VM for pharo, which we maintain and use.. > > > >> Many thanks >> >> Peter Kenny >> > > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Why won't my Pharo download run?
Well, it could be that your machine CPU too old and don't supports instructions (like SSE) which VM compiled with. On 7 November 2013 19:44, PBK Research wrote: > Just a little more information. Out of curiosity, I downloaded Pharo 3.0 > and tried it, with the same result - message from Windows says 'Pharo.exe > has encountered a problem and needs to close'. To complete the set, I > downloaded Pharo 1.4 and tried it. This time it failed saying 'CogVM.exe > has encoun'. I presume all versions now use the Cog VM, and it looks as > though this machine just won't run it. Is there still a 'traditional' VM I > can use instead of Cog? It might not be practical, but it would at least > prove that it is a VM problem. Is there any information about Cog giving > problems with AMD processors? > > -- > *From:* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On > Behalf Of *PBK Research > *Sent:* 07 November 2013 15:07 > > *To:* 'Any question about pharo is welcome' > *Subject:* Re: [Pharo-users] Why won't my Pharo download run? > > OK. I opened a command line prompt, cd to Pharo 2.0 directory (created > in today's download), enter 'pharo.exe pharo2.0.image'. Same result - > immediate failure. I had previously changed the association of the image > file to the newly downloaded pharo.exe. So I think I must be using the VM > in today's download. > > -- > *From:* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On > Behalf Of *Igor Stasenko > *Sent:* 07 November 2013 14:48 > *To:* Any question about pharo is welcome > *Subject:* Re: [Pharo-users] Why won't my Pharo download run? > > > > > On 7 November 2013 15:31, PBK Research wrote: > >> Thanks. I am using the latest one-click distribution of Pharo, >> downloaded today from the Pharo website. Presumably that should have the >> latest VM? >> >> yes, but if .image file extension associated with wrong version of VM > binary, which you installed previously (as you mentioned), it won't > automagically use proper one. > unless you run vm from command line e.g.: > pharo.exe myimage.image > or change the association to use different vm. > > -- >> *From:* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On >> Behalf Of *Igor Stasenko >> *Sent:* 07 November 2013 13:53 >> *To:* Any question about pharo is welcome >> *Subject:* Re: [Pharo-users] Why won't my Pharo download run? >> >> >> >> >> On 7 November 2013 14:18, PBK Research wrote: >> >>> Hello! >>> >>> I have a problem with running Pharo 2.0 on one of my machines. I have >>> two machines, both running Windows XP with SP3. On one of them I have a >>> successful load of Pharo (actually it's a distribution of the Moose system, >>> but that is just an application built on Pharo 2.0). This loads >>> successfully when I double click on pharo.exe. On the other machine, the >>> same action produces an immediate message: 'Pharo.exe has encountered a >>> problem and needs to close'. Just in case this was some problem with Moose, >>> I have just downloaded the latest one-click installation of Pharo 2.0 for >>> Windows. This displays exactly the same behaviour - an immediate fail when >>> I try to start it. >>> >>> I have tried to work out what may be different between the two machines. >>> The one which will run Pharo has an Intel Celeron processor, the other an >>> AMD Athlon XP (yes, they are both pretty ancient!), but I can't see why >>> that should make any difference. The one curious thing is that Windows >>> Explorer displays the type of the Pharo2.0.image file as 'Squeak image >>> file'. There is an old version of Squeak installed on that machine; could >>> that have any effect? >>> >>> I am a bit flummoxed by all this. Does anyone have any suggestions about >>> how to diagnose the problem? >>> >>> >> >> If you using too old VM , it simply does not supports an image format, >> which pharo 2.0 uses. >> But there could be different reasons.. a first step towards to solution >> is to use VM for pharo, which we maintain and use.. >> >> >> >>> Many thanks >>> >>> Peter Kenny >>> >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] CogVM arguments in Win32
On 13 November 2013 10:25, Bernat Romagosa wrote: > Hi list, > > I made some progress but I'm still a bit lost here. > > I managed to get Pharo to be headless in Win32, by hiding the window via > NB as Igor suggested, plus suspending the UI process (UIManager default > uiProcess suspend), which was the cause for the window to show up again > after a fraction of a second, because of the refresh interval. > > However, now I can only close Pharo by killing the process manually, which > is not very nice for the end user. So I figured I'd try to add an icon to > the system tray with a single context menu entry for closing Pharo. > > This is what I'm doing, taken from > MSDN<http://msdn.microsoft.com/en-us/library/windows/desktop/bb762159(v=vs.85).aspx> > : > > NBWin32Shell >> shellNotifyIcon: lpdata dwMessage: dwMessage > > > > ^ self nbCall: #(bool Shell_NotifyIcon( > > DWORD dwMessage, > > PNOTIFYICONDATA lpdata > > )) module: #shell32 > > dwMessage is just a 0 (flag to create a tray icon), but lpdata needs to be a > pointer to a struct of this > form<http://msdn.microsoft.com/en-us/library/windows/desktop/bb773352(v=vs.85).aspx> > : > > typedef struct _NOTIFYICONDATA { > DWORD cbSize; > HWND hWnd; > UINT uID; > UINT uFlags; > UINT uCallbackMessage; > HICON hIcon; > TCHAR szTip[64]; > DWORD dwState; > DWORD dwStateMask; > TCHAR szInfo[256]; > union { > UINT uTimeout; > UINT uVersion; > }; > TCHAR szInfoTitle[64]; > DWORD dwInfoFlags; > GUID guidItem; > HICON hBalloonIcon; > } NOTIFYICONDATA, *PNOTIFYICONDATA; > > > So, my question is: how do I translate this into NB code? How does one > define a struct and then pass its pointer to a function in NativeBoost? > > This is easy. Just make a subclass of NBExternalStructure, define its fields in #fieldsDesc method (see example subclass). Create it using #new, or #externalNew depending if structure should be non-moving in memory for the rest of its life (but i think its needed only at the moment of call, so #new should work), fill it with proper values, and then pass it to that function. Just make sure that argument type PNOTIFYICONDATA changed to class name of your structure in function signature. Also, note that there is two Shell_NotifyIcon functions under the hood: Shell_NotifyIconA Shell_NotifyIconW the 'A' stands for 'ascii', and 'W' stands for 'wide', this is how windows manages strings and characters/unicode. For 'A' functions TCHAR == char (1byte) for 'W' functions TCHAR == unsigned short (2bytes) that means the definition and size of PNOTIFYICONDATA is different depending on what function you going to be using. Thanks a lot for your help, I'm getting closer :) > > Bernat. > > p.s. Could the Windows API be any more convoluted and dev-unfriendly in > any possible sense? > hehe.. this is a typical for everything in windows: many, even basic things require passing and filling various structures with many different fields, and you may find that to initialize fields of one structure, you often need to create another one and initialize it first :) > > > 2013/11/4 Bernat Romagosa > >> Hi! >> >> Thanks Igor, that kinda worked! Pharo hides, but comes back after half a >> second or so. I'll keep digging, thanks! :) >> >> >> 2013/11/1 p...@highoctane.be >> >> Well, this should rather be: >>> >>> handle :=NativeBoostWin32 squeakWindowHandle. >>> window := NBWin32Window new value: handle; yourself. >>> window hide. >>> >>> or >>> >>> window setWindowText: 'im a main window blablabla'. >>> >>> Phil >>> >>> >>> On Thu, Oct 31, 2013 at 10:03 PM, Igor Stasenko wrote: >>> >>>> You can try something like this: >>>> >>>> | handle window | >>>> >>>> handle := NativeBoost forCurrentPlatform squeakWindowHandle. >>>> window := NBWin32Window new value: handle; yourself. >>>> window hide. >>>> >>>> or >>>> >>>> window setWindowText: 'im a main window blablabla'. >>>> >>>> :) >>>> >>>> i didn't tested it since its been implemented, but i think it should >>>> work. >>>> >>>> >>>> >>>> On 30 October 2013 11:20, Bernat Romagosa < >>>> tibabenfortlapala...@gmail.com> wrote: >>>> >>>>> In this direction, I'm trying to call a
Re: [Pharo-users] NBOpenGL on Pharo 3.0
On 13 November 2013 11:32, Stéphane Ducasse wrote: > JB can you read and reply to this mail? > > Hi > > What Doru wrote pretty much sums it up. > > CodeCity under VW was based on JUN, which provided a programmer-friendly > API built on top of OpenGL. Since there is no such thing under Pharo, when > I later started to work on CodeCity under Pharo, I needed to learn about > how to program directly to OpenGL. And the only example I had for that was > SourceCity. In the meantime I manage to get a grip on my basic needs and > was ready to move forward to implementing CodeCity. Now that does not work > anymore in Pharo 3.0 so I am stuck. I could continue to program under Pharo > 2.0, but what's the point? > > > for now probably, because if you that is the one the most interested guy > in that does not have the time to understand why others that > do not need 3D should do it. NBOpenGL was a side project to give a try of > busy people too. I'm sorry to say that > but we cannot be on all fronts especially when they are changing. > > So can you tell us if you see what changed between 2 and 3. I have no idea. > > NBOpenGL needs to be updated to sync with changes in NB about NBExternalStructure. Right now it cannot even be loaded into 3.0. But update is simple (i think JB did that already, just not published?). > I have already looked at Roassal 3d, but it was not easy to separate the > API from the code. > > > Strange because even me I could see that the shadder code should not be in > Roassal 3D but in NBOpenGL :). > Because Roassal 3d should not be about shadder but about 3D. > > And it is something completely different than what I have been using (and > SourceCity, too), because Roassal 3d is using the modern OpenGL methodology > (with FBOs and stuff). > > > Yes they changed the API and deprecated the old way of doing it. > > So, I would really appreciate if that API would find its way from Roassal > to NBOpenGL and I could use it for CodeCity. > > > See below > > Unfortunately I am able to help a lot with that, because I know very > little about this and I also don't have enough time (I am doing CodeCity in > my spare time). But, if you have concrete things that I can do, I'd be > happy to help. > > > Three remarks: > - I know that jean-baptiste worked on moving part of roassal3d to NBOpenGL > - I'm not sure that doing 3d without investing a bit in the underlying > technology is wise. Because you will be always relying > on other people and probably frustrated when things are not working. > - Since JB does not know how to communicate here is what he did for fun > instead of pushing MoosePython :) > a renderer to video to videos stream for openGL -> MKV, mp4 based one > ffmpeg). The code is openGL extra. As an example you > can get > https://www.dropbox.com/sh/uyli3tx3drendvj/qzA_Hy0jnk > > Now again if nobody builds a jun like library in Pharo it will not exist. > > Stef > > > > Cheers > Ricky > > > > > On Wed, Nov 13, 2013 at 9:44 AM, Tudor Girba wrote: > >> Hi, >> >> I guess that what Ricky is asking is what changed between NBOpenGL 2.0 >> and 3.0 such that this does not work anymore on Windows. The fact that he >> mentioned 64 bits is not relevant for this discussion :). >> >> I also guess he wants to put some effort into understanding this as well >> but he needs a bit of guidance. Right Ricky? >> >> Cheers, >> Doru >> >> >> >> On Tue, Nov 12, 2013 at 2:12 PM, Stéphane Ducasse < >> stephane.duca...@inria.fr> wrote: >> >>> Richard >>> >>> you should have a look at ROASSAL 3d because ronie improved the shadder >>> part (no more assembler) >>> and his code should be split in two and one part should go to NBOpenGL. >>> Now he is experiencing some problem with NBOpenGL on windows as you. >>> >>> NativeBoost does not work on 64 bits. Yet but igor is really busy >>> finishing the texteditor (and I can tell you that >>> he does not have fun there). >>> >>> So it is important that you help because we are FULL >>> and sorry about that but really FULL. >>> >>> Ronie will visit us in January and share an office with igor. >>> >>> Stef >>> >>> >>> > Hi >>> > >>> > CodeCity, the project I am working on is based on NBOpenGL. >>> > I'd like to start working on it using Pharo 3, but it seems that >>> NBOpenGL does not work yet with Pharo 3.0. >>> > >>> > I downloaded from jenkins the latest image with Pharo 3 and tried to >>> execute the following code on Windows 7, 64 bits: >>> > >>> > GLTTRenderingDemo new openInWorld. >>> > >>> > but I get a 'No suitable implementation found for initializing OpenGL >>> context for your platform'. >>> > It seems that NBGLContextDriver does not have a subclass for Windows >>> 64bits. Did I omit something? >>> > >>> > Cheers >>> > Ricky >>> > >>> >>> >>> >> >> >> -- >> www.tudorgirba.com >> >> "Every thing has its own flow" >> > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] CogVM arguments in Win32
On 13 November 2013 12:02, Bernat Romagosa wrote: > Thanks a lot Torsten! > > I'll invest the whole morning tomorrow in trying to get a little bit more > of this to work. > > If I don't succeed... there are lots of very good restaurants in > Barcelona, Igor ;) > > i can imagine :) I hope i will be able come there once more one day. Barcelona is very beautiful city. :) > 2013/11/13 Torsten Bergmann > >> Hi Bernat, >> >> >how do I translate this into NB code >> >> Either invite Igor (author of NB) for lunch or try this: >> >> >> Its a C-structure, you convert it by wrapping this in a sublcass >> of "NBExternalStructure". See the examples already in a Pharo 3.0 image. >> >> Basically you need: >> >> - define a subclass NBExternalStructure subclass: #WinNotifyIconData ... >> - define the correct fields in a class side #fieldsDesc method according >> to the native data types used in the structure >> - call "WinNotifyIconData rebuildFieldAccessors" >> - setup the types in a shared pool that you can include later: >> >>- define the pool: SharedPool subclass: #WinTryIconConstants ... >>- in a class initialize method you can setup the type >> >> initialize >> >> NOTIFYICONDATA := #WinNotifyIconData. >> PNOTIFYICONDATA:= 'NOTIFYICONDATA *'. >> >> - by including the pool you can use "NOTIFYICONDATA" or "PNOTIFYICONDATA" >> in any native boost call. >> >> >> If you are in Pharo 3.0 load "OS-Windows" package from the config browser. >> Check the subclasses of NBExternalStructure there. >> >> I wrapped many other windows structures already so you can get an idea >> about >> it. For instance have a look at WinConsoleConstants>>initTypeConstants, >> there you will find >> the CONSOLE_CURSOR_INFO, CONSOLE_SCREEN_BUFFER_INFO structs wrapped in >> WinConsoleCursor, WinConsoleScreenBuffer classes. >> >> Compare them with the MSDN struct description. >> >> >Could the Windows API be any more convoluted and dev-unfriendly in any >> >possible sense? >> >> This question should go to M$ not Pharo-user ;) >> >> Bye >> T. >> >> >> BTW: I'm not sure "PNOTIFYICONDATA" alone will solve your problem if I >> remember correctly >> from my Smalltalk/MT and C/C++ times also playing with tray icons. >> I guess you need a callback that gets called when the icon is >> clicked or the tray icon menu >> is choosen (see uCallbackMessage member in the struct). >> You also need a handle to an icon - either the icon from the EXEs >> resource section or >> by loading one from a bitmap. That means wrapping the icon or bitmap >> apis too... >> >> > > > -- > Bernat Romagosa. > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NBOpenGL on Pharo 3.0
t; >>> >>>> And it is something completely different than what I have been using >>>> (and SourceCity, too), because Roassal 3d is using the modern OpenGL >>>> methodology (with FBOs and stuff). >>>> >>>> >>>> Yes they changed the API and deprecated the old way of doing it. >>>> >>> >>> I will also publish some example (using shadder) that I wrote but it is >>> still not yet user friendly. >>> >>> >>> So, I would really appreciate if that API would find its way from >>>> Roassal to NBOpenGL and I could use it for CodeCity. >>>> >>>> >>>> See below >>>> >>> >>>> Unfortunately I am able to help a lot with that, because I know very >>>> little about this and I also don't have enough time (I am doing CodeCity in >>>> my spare time). But, if you have concrete things that I can do, I'd be >>>> happy to help. >>>> >>>> >>>> Three remarks: >>>> - I know that jean-baptiste worked on moving part of roassal3d to >>>> NBOpenGL >>>> >>> >>> Shader part are done for now. >>> >>> - I'm not sure that doing 3d without investing a bit in the underlying >>>> technology is wise. Because you will be always relying >>>> on other people and probably frustrated when things are not working. >>>> >>> + 1 >>> >>> - Since JB does not know how to communicate here is what he did for >>>> fun instead of pushing MoosePython :) >>>> >>> a renderer to video to videos stream for openGL -> MKV, mp4 based >>>> one ffmpeg). The code is openGL extra. As an example you >>>> can get >>>> https://www.dropbox.com/sh/uyli3tx3drendvj/qzA_Hy0jnk \ >>>> >>> >>>> >>> yes, my bad. >>> >>> Now again if nobody builds a jun like library in Pharo it will not >>>> exist. >>>> >>> >>>> Stef >>>> >>>> >>>> >>>> Cheers >>>> Ricky >>>> >>>> >>>> >>>> >>>> On Wed, Nov 13, 2013 at 9:44 AM, Tudor Girba wrote: >>>> >>>>> Hi, >>>>> >>>>> I guess that what Ricky is asking is what changed between NBOpenGL 2.0 >>>>> and 3.0 such that this does not work anymore on Windows. The fact that he >>>>> mentioned 64 bits is not relevant for this discussion :). >>>>> >>>>> I also guess he wants to put some effort into understanding this as >>>>> well but he needs a bit of guidance. Right Ricky? >>>>> >>>>> Cheers, >>>>> Doru >>>>> >>>>> >>>>> >>>>> On Tue, Nov 12, 2013 at 2:12 PM, Stéphane Ducasse < >>>>> stephane.duca...@inria.fr> wrote: >>>>> >>>>>> Richard >>>>>> >>>>>> you should have a look at ROASSAL 3d because ronie improved the >>>>>> shadder part (no more assembler) >>>>>> and his code should be split in two and one part should go to >>>>>> NBOpenGL. >>>>>> Now he is experiencing some problem with NBOpenGL on windows as you. >>>>>> >>>>>> NativeBoost does not work on 64 bits. Yet but igor is really busy >>>>>> finishing the texteditor (and I can tell you that >>>>>> he does not have fun there). >>>>>> >>>>>> So it is important that you help because we are FULL >>>>>> and sorry about that but really FULL. >>>>>> >>>>>> Ronie will visit us in January and share an office with igor. >>>>>> >>>>>> Stef >>>>>> >>>>>> >>>>>> > Hi >>>>>> > >>>>>> > CodeCity, the project I am working on is based on NBOpenGL. >>>>>> > I'd like to start working on it using Pharo 3, but it seems that >>>>>> NBOpenGL does not work yet with Pharo 3.0. >>>>>> > >>>>>> > I downloaded from jenkins the latest image with Pharo 3 and tried >>>>>> to execute the following code on Windows 7, 64 bits: >>>>>> > >>>>>> > GLTTRenderingDemo new openInWorld. >>>>>> > >>>>>> > but I get a 'No suitable implementation found for initializing >>>>>> OpenGL context for your platform'. >>>>>> > It seems that NBGLContextDriver does not have a subclass for >>>>>> Windows 64bits. Did I omit something? >>>>>> > >>>>>> > Cheers >>>>>> > Ricky >>>>>> > >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> www.tudorgirba.com >>>>> >>>>> "Every thing has its own flow" >>>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Best regards, >>> Igor Stasenko. >>> >>> >>> Best Regards >>> Jean Baptiste Arnaud >>> jbaptiste.arn...@gmail.com >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> >> Best Regards >> Jean Baptiste Arnaud >> jbaptiste.arn...@gmail.com >> >> >> >> >> >> >> >> >> Best Regards >> Jean Baptiste Arnaud >> jbaptiste.arn...@gmail.com >> >> >> >> >> >> >> >> > > > -- > www.tudorgirba.com > > "Every thing has its own flow" > > > Best Regards > Jean Baptiste Arnaud > jbaptiste.arn...@gmail.com > > > > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Lock free structures in Pharo
On 14 November 2013 10:15, Stephan Eggermont wrote: > Reading this code, made me wonder what operations are actually atomic. > Anyone having a good explanation? > > Stephan > > AtomicQueueItem>makeCircular > "Make a receiver circular, i.e. point to itself, > answer the old value of next variable. > Note, this operation should be atomic" > > | temp | > > " atomic swap here" > temp := next. > next := self. > > ^ temp > > imagine that i rewrite it with following: temp := self. temp <=> next. ^ temp here the <=> is a special 'atomic swap' operation which atomically swaps values of two variables. The best way to do that is to introduce a special bytecode in VM, which either swaps values of two temps or swaps values of temp and instance variable. If we could have such bytecode, then we would have a strong guarantee from VM about atomicity of certain operations, but since we don't have it yet, right now it is just (ab)uses the intrinsic behavior of VM, knowing that it never interrupts between two simple assignments. -- Best regards, Igor Stasenko.
Re: [Pharo-users] optimizing io
Dig deeper: IP protocol supports broadcasting/multicasting. http://en.wikipedia.org/wiki/IP_multicast On 20 November 2013 08:49, Santiago Bragagnolo wrote: > Hi all! Im making some performance enhancement on PhaROS, i realised that > one of my common scenarios is having several sockets that should receive > exactly the same information, in order to do that, im using n calls to the > vm, which does n system-calls. > > I was wondering if there something done in: > > - send the same data to all the sockets in just one primitive > - send the same data to all the sockets in just one syscall. > > I checked around in google but i didn't found anything useful, but > probably i have no knowledge about the proper words for such search :). > > > Thanks! > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] optimizing io
On 20 November 2013 13:40, Esteban A. Maringolo wrote: > If your sockets are connection oriented (it is. TCP) using IP > Multicast won't be an option. > > Multicast was made with Datagrams in mind instead of Packets. Though > there was a multicast solution that numbered the datagrams to request > retransmission in case of packet loss. > > Yeah, but that's what you probably should do to avoid duplicating traffic in a first place: use proper technology for that. > Regards, > > > Esteban A. Maringolo > > > 2013/11/20 Santiago Bragagnolo : > > Great info! Thanks! > > > > > > 2013/11/20 Igor Stasenko > >> > >> Dig deeper: IP protocol supports broadcasting/multicasting. > >> > >> > >> http://en.wikipedia.org/wiki/IP_multicast > >> > >> > >> On 20 November 2013 08:49, Santiago Bragagnolo > >> wrote: > >>> > >>> Hi all! Im making some performance enhancement on PhaROS, i realised > that > >>> one of my common scenarios is having several sockets that should > receive > >>> exactly the same information, in order to do that, im using n calls to > the > >>> vm, which does n system-calls. > >>> > >>> I was wondering if there something done in: > >>> > >>> - send the same data to all the sockets in just one primitive > >>> - send the same data to all the sockets in just one syscall. > >>> > >>> I checked around in google but i didn't found anything useful, but > >>> probably i have no knowledge about the proper words for such search :). > >>> > >>> > >>> Thanks! > >>> > >>> > >> > >> > >> > >> -- > >> Best regards, > >> Igor Stasenko. > > > > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost Questions while wrapping FMOD
On 21 November 2013 22:40, Sean P. DeNigris wrote: > I'm wrapping the FMOD cross-platform audio library. The code is MIT and > lives > at http://smalltalkhub.com/#!/~SeanDeNigris/FMOD > > > Problem #1: > > > I'm calling into the FMOD library with: > primStoreIsPlaying: channelHandle in: isPlayingHandle > > > "FMOD_RESULT FMOD_Channel_IsPlaying( > FMOD_CHANNEL *channel, > bool *isplaying);" > > ^ self nbCall: #(FMOD_RESULT > FMOD_Channel_IsPlaying(NBExternalAddress > channel, NBExternalAddress isPlayingHandle)). > > I call the above with: > isPlaying > | isPlaying | > isPlaying := NBExternalAddress new. > self primStoreIsPlaying: channel in: isPlaying. > ^ isPlaying value > 0. > > isPlaying is always 0. The method works directly from C with: > int isPlaying = 1; > while (isPlaying) { > FMOD_Channel_IsPlaying(channel, &isPlaying); > } > > I also tried changing the callout signature to "... bool* isPlayingHandle)" > and passing "isPlaying := true." instead of using the NBExternalAddress > stuff. > > err.. again, you must pass an address where value will be stored, ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying( > > NBExternalAddress channel, NBExternalAddress * isPlayingHandle)). otherwise you passing NULL pointer, and i quite surprised it not segfaults when you call it like that (looks like they have a check in the library ) you can also use NBExternalTypeValue for that: boolValueClass := NBExternalTypeValue ofType: 'bool'. "sure thing, creating anonymous class for each call is overkill, this should be done once, somewhere else" boolValue := boolValueClass new. self callTheThingWith: boolValue. boolValue value ifTrue: [... blah] (and this will work, assuming you have bool* in signature for this argument). I have a few more questions, but this is the most pressing as it's holding > up any further development. > > Thanks! > > > > - > Cheers, > Sean > -- > View this message in context: > http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Scaled PNG image
On 21 November 2013 21:27, Hilaire Fernandes wrote: > Le 21/11/2013 08:21, Stéphane Ducasse a écrit : > > > > On Nov 20, 2013, at 4:54 PM, Hilaire Fernandes < > hilaire.fernan...@gmail.com> wrote: > > > >> Hello, > >> > >> In Pharo 2.0 (true in 1.4 as well), it looks PNG bitmap are wrongly > >> rotated or scaled when they contain alpha transparency. > >> > >> In the example bellow with the joined bitmap, the alpha gray color are > >> rendered darker when the imagemorph is scaled or rotated. > >> > >> Sqeak does not suffer this problem > > > > hilaire may be you should have a look at the changes made in the > graphics package > > I took at look on the list, did not find anything yet > > not directly, right. But since symptoms are similar, i think this is most probably the same case. (and your digging shown that we actually having separate rule for premultiplied alpha blend, which i could use for correctly transferring/blending cairo surface pixels in Forms) > Hilaire > > > of squeak to identify the change. > > We should have more tests. > > > > Stef > >> > >> > >> | dir morph transform form| > >> dir := FileSystem disk workingDirectory parent. > >> morph := (ImageReadWriter formFromFileNamed: (dir / 'bubble.png') > >> fullName) asMorph. > >> transform := TransformationMorph new asFlexOf: morph. > >> transform smoothingOn ; angle: Float pi / 3; scale: 1. > >> transform openInWorld > >> > >> > >> Thanks > >> > >> Hilaire > >> > >> > >> -- > >> Dr. Geo http://drgeo.eu > >> > > > > > > > > > -- > Dr. Geo http://drgeo.eu > > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Any problems known here?
On 21 November 2013 17:55, Friedrich Dominicus < fr...@q-software-solutions.de> wrote: > Norbert Hartl writes: > > > Am 21.11.2013 um 06:57 schrieb Friedrich Dominicus > > : > > > >> Norbert Hartl writes: > >> > >>> Am 20.11.2013 um 18:42 schrieb Friedrich Dominicus > >>> : > >>> > >>>I wonder if anyone has problems running a Pharo on a 64-bit System > >>>(Debian) with multiarch. Because strange enough it can suddenly > >>>not find > >>>vm-display-X11 any more > >>> > >>> You need to install the desktop variant: > >> I guess this will do for Ubuntu and Debian. > >> > >> But my probem was much more profane > >> and ldd o vm-display-X11 has informed me that two libraries where not > >> there. I installed them manually and after that Pharo start working > >> again. > >> > >> So yeah ldd is your friend. > >> > >> But thanks for taking the time helping me. > >> > > Can you tell which libraries were missing? Maybe the dependencies of > > the package needs to be adjusted. Can you tell which debian version > > and channel (stable,…) you are using and what files were missing? I > > think you know that but if you have the file you can find the package > > that needs to be installed by doing > I've not installed from the repository. I'm using Debian. And the > missing libraries were libICE.so.6 and libSM.so > > (..roars..) i think a long-term solution is to get rid of these dependencies since they serve no purpose at all.. but for that, we need to check what and why display driver depends on those libs (but i bet it is completely unnecessary and can be avoided). > Regards > Friedrich > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost Questions while wrapping FMOD
On 22 November 2013 01:23, Sean P. DeNigris wrote: > Igor Stasenko wrote > >> err.. again, you must pass an address where value will be stored, > > hee hee... sorry... I don't understand enough of what's going on behind the > scenes to adapt well. I reasoned that since last time, the signature was > "Whatever**" and you said to make it "NBExternalAddress*", that therefore > "Whatever*" (one less *) would be "NBExternalAddress" (also one less *). > > While we're here, I'll ask my other questions... > > 1. What's the differenct between #NativeBoostPlugin> and the variant with error:? What does the second one > buy you? > > Historically, NB was first running on Squeak VM, which has no support for primitive error. Using extra #error: keyword in primitive is HIGHLY recommended, unless you want to deal with some quite rare (but possible and thus very hard to track down) wrong error reporting. > 2. instead of returning useful objects, FMOD returns error codes and you > pass a pointer to receive the object. > > - The first consequence is that I have to wrap all the calls e.g. "self > processErrorCode: self primCreate." where > processErrorCode: anInteger > anInteger = 0 ifFalse: [ self error: 'FMOD returned error code ', > anInteger > asString ]. > Is there a more graceful way to do that? > > i doubt so.. since it is library API which dictates you to use it in certain way. The proper error handling never hurts (except from causing extra code bloat, of course :) > - The second issue is how to create a Smalltalk object from the pointer. > What I've been doing is: > | soundHandle | > soundHandle := NBExternalAddress new. > self processErrorCode: (self primCreate: soundHandle on: system > handle > fromFile: file fullName). > sound := FmodSystemSound on: soundHandle. > Again, is there a better way? I thought to subclass NBExternalAddress, but > evaluating "sound := FmodSystemSound new" to pass to the callout seemed a > bit dirty i.e. it is not a invalid instance until initialized by the > callout. I also played around with NBExternalObject, but couldn't get that > to work either... > > The better way is to subclass from NBExternalObject then which made exactly for such purposes, by holding an opaque handle to something (you don't care what is inside), and simplifies a lot of things. > Thanks for all the support. This is fun!! > > You are very welcome. > > > - > Cheers, > Sean > -- > View this message in context: > http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116p4724158.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] Scaled PNG image
On 21 November 2013 14:22, hilaire wrote: > The problem is really not related to PNG bitmap as the same issue can be > exposed with simple, as in this example: > > | morph rectangle | > rectangle := RectangleMorph new color: (Color red alpha: 0.5). > morph := TransformationMorph new asFlexOf: rectangle. > morph scale: 0.7. > morph openInWorld > > > In this example, the red appears darker once the rectangle is scaled. > > Is it something related to the Blit ? I reallz don't know where to look. > > no idea.. Except that while adopting cairo surfaces i also has odd transparency issues until i realized that cairo surface stores pixel data using premultiplied alpha format,e.g.: pixelColor = (R*A, G*A, B*A, A) while bitblt assumes it is (R,G,B,A) > Hilaire > > > > -- > View this message in context: > http://forum.world.st/Scaled-PNG-image-tp4723754p4723975.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost Questions while wrapping FMOD
On 22 November 2013 05:09, Sean P. DeNigris wrote: > Igor Stasenko wrote > >> The better way is to subclass from NBExternalObject then > > which made exactly for such purposes, by holding an opaque handle to > > something (you don't care what is inside), and simplifies a lot of > things. > > I made "NBExternalObject subclass: #FMOD_SYSTEM". > I then tried to use it via: > system := FMOD_SYSTEM new. > err := self System_CreateNBExternalObject: system. > With callout: > ^ self nbCall: #(FMOD_RESULT FMOD_System_Create(NBExternalObject > system)). > > For the argument type in the signature, for good measure I tried: > 1. NBExternalObject > 2. FMOD_SYSTEM > 3. NBExternalAddress > All three with zero, one, and two *'s after. The only one that didn't > report > some variety of "An instance of Xyz expected" was > "FMOD_System_Create(FMOD_SYSTEM system)" for which the library returns an > invalid argument error code. > > yet again, you miss the right solution: you must pass a pointer to where value will be stored (since function doing exactly that). so you should do it like: 1. "NBExternalObject subclass: #FMOD_SYSTEM". 2. method to call the function will look like following: create: system ^ self nbCall: #(FMOD_RESULT FMOD_System_Create(FMOD_SYSTEM * system)). 3. and call it like following: system := FMOD_SYSTEM new. self handleError: (self create: system) ifOk: [ ^ system ] 3a. optionally, you want want to initialize it just after you know that you obtained correct handle, to do that, you could do following: FMOD_SYSTEM class>>new | system | system := super new. self handleError: (self create: system) ifOk: [ ^ self newWithHandle: system handle ] and newWithHandle: could look something like following: newWithHandle: aHandle system := super basicNew. system handle: aHandle. ^ system initialize (because it is important to set the handle first, like that you can actually initialize something more by using it, which you logically do, just after creating a new handle. and note you must not call 'super initialize' then, because it will reset handle.) and i'm sure you can find more elegant solution :) btw if anyone wants to play with it: > 1. > Gofer it > smalltalkhubUser: 'SeanDeNigris' project: 'FMOD'; > package: 'FMOD'; > load. > > 2. Download the FMOD library for your platform: > - windows - > > http://www.fmod.org/download/fmodstudio/api/Win/fmodstudioapi10208win-installer.exe > - Mac - > > http://www.fmod.org/download/fmodstudio/api/Mac/fmodstudioapi10208mac-installer.dmg > > 3. Copy the library to "FileLocator imageDirectory / 'FMOD Programmers > API/api/lowlevel/lib/libfmod.dylib'" > > The working example is: > | sound | > sound := FmodSound fromFile: '/path/to/file.mp3' asFileReference. > [ sound play ] fork. > > The broken one described above is: "FMOD exampleNBExternalObject." > > > > - > Cheers, > Sean > -- > View this message in context: > http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116p4724192.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko.
Re: [Pharo-users] NativeBoost Questions while wrapping FMOD
So, here the changes which should work (but i didn't tested). And being on your place, i would get rid of FMOD_SYSTEM class, because you can just subclass FmodSystem from NBExternalObject directly (and use it in signatures) and so it will be holding the handle, and naturally work as a representation of external entity. Also note that in this case FmodSystem is alias to C FMOD_SYSTEM* so, for every function which expects FMOD_SYSTEM*, you should just use FmodSystem, and if it expects FMOD_SYSTEM**, you using FmodSystem* basically, same as if you would have: typedef FmodSystem FMOD_SYSTEM*; in C. On 22 November 2013 15:10, Igor Stasenko wrote: > > > > On 22 November 2013 05:09, Sean P. DeNigris wrote: > >> Igor Stasenko wrote >> >> The better way is to subclass from NBExternalObject then >> > which made exactly for such purposes, by holding an opaque handle to >> > something (you don't care what is inside), and simplifies a lot of >> things. >> >> I made "NBExternalObject subclass: #FMOD_SYSTEM". >> I then tried to use it via: >> system := FMOD_SYSTEM new. >> err := self System_CreateNBExternalObject: system. >> With callout: >> ^ self nbCall: #(FMOD_RESULT FMOD_System_Create(NBExternalObject >> system)). >> >> For the argument type in the signature, for good measure I tried: >> 1. NBExternalObject >> 2. FMOD_SYSTEM >> 3. NBExternalAddress >> All three with zero, one, and two *'s after. The only one that didn't >> report >> some variety of "An instance of Xyz expected" was >> "FMOD_System_Create(FMOD_SYSTEM system)" for which the library returns an >> invalid argument error code. >> >> yet again, you miss the right solution: you must pass a pointer to where > value will be stored > (since function doing exactly that). > > so you should do it like: > 1. "NBExternalObject subclass: #FMOD_SYSTEM". > > 2. method to call the function will look like following: > create: system > ^ self nbCall: #(FMOD_RESULT FMOD_System_Create(FMOD_SYSTEM * system)). > > 3. and call it like following: > > system := FMOD_SYSTEM new. > self handleError: (self create: system) ifOk: [ ^ system ] > > 3a. optionally, you want want to initialize it just after you know that > you obtained correct handle, > to do that, you could do following: > > FMOD_SYSTEM class>>new > | system | > system := super new. > self handleError: (self create: system) ifOk: [ ^ self newWithHandle: > system handle ] > > and newWithHandle: could look something like following: > > newWithHandle: aHandle > > system := super basicNew. > system handle: aHandle. > ^ system initialize > > (because it is important to set the handle first, like that you can > actually initialize something more > by using it, which you logically do, just after creating a new handle. > and note you must not call 'super initialize' then, because it will reset > handle.) > and i'm sure you can find more elegant solution :) > > btw if anyone wants to play with it: >> 1. >> Gofer it >> smalltalkhubUser: 'SeanDeNigris' project: 'FMOD'; >> package: 'FMOD'; >> load. >> >> 2. Download the FMOD library for your platform: >> - windows - >> >> http://www.fmod.org/download/fmodstudio/api/Win/fmodstudioapi10208win-installer.exe >> - Mac - >> >> http://www.fmod.org/download/fmodstudio/api/Mac/fmodstudioapi10208mac-installer.dmg >> >> 3. Copy the library to "FileLocator imageDirectory / 'FMOD Programmers >> API/api/lowlevel/lib/libfmod.dylib'" >> >> The working example is: >> | sound | >> sound := FmodSound fromFile: '/path/to/file.mp3' asFileReference. >> [ sound play ] fork. >> >> The broken one described above is: "FMOD exampleNBExternalObject." >> >> >> >> - >> Cheers, >> Sean >> -- >> View this message in context: >> http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116p4724192.html >> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. >> >> > > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko. FmodSystem.st Description: Binary data
Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .
There is some bits which can help you in this regard. The part of it is path tesseleration, which turns any path with complex curves into polygon (which has only straight lines), from there on, i think you can easily calculate the distance between any point and that polygon. Look at AthensCurveFlattener class, and its uses. the entry point is (flattenPath: aPath transform: aTransformation). But be aware that this is not fully integrated yet and subject to change in future. On 23 November 2013 15:20, kilon alios wrote: > aahhh come on ... I am not THAT lazy :D > > of course I have searched it before asking. Unless I am blind I see loads > of bezier methods, none that detects whether a point belong to a curve. But > now you mention it I think I remember squeak was able to do add points to a > curve via click or something similar, because thats what I wan to do. So I > will take a look at it , most probably there is a method in there that does > this. > > I want the user to click on a curve or line and there a new control point > will be placed that will allow the user to shape the line or curve to a > finer detail. A standard feature for all vector editors , 3d editors, even > image editors. > > I am sorry if I miss something obvious here, its not laziness , its most > likely stupidity or just the fact I am very new with this. This is the > first time I try to make a vector editor.Again thank you all for trying to > help me, you have done already a lot. > > > On Sat, Nov 23, 2013 at 3:38 PM, Stéphane Ducasse < > stephane.duca...@inria.fr> wrote: > > >> >> On Nov 23, 2013, at 11:24 AM, kilon alios wrote: >> >> would I sound too lazy to ask in which class ? >> >> >> On Sat, Nov 23, 2013 at 11:35 AM, Stéphane Ducasse < >> stephane.duca...@inria.fr> wrote: >> >>> there are bezier algo in the system >>> >>> Stef >>> >>> On Nov 20, 2013, at 9:55 PM, kilon alios wrote: >>> >>> yes I found the formula for straight lines and I was wondering what was >>> the one for bezier curves, so your reply could not have come a better >>> moment. Thanks I will study it and implement it. >>> >>> >>> On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes < >>> hilaire.fernan...@gmail.com> wrote: >>> >>>> Hello, >>>> >>>> You may want to calculate the distance between the mouse position and >>>> your path (I guess a bezier curve). Then given this distance and a >>>> tolerance to zero you decide if the mouse position is more or less on >>>> your path. Calculating the distance you will also get for free the place >>>> where to add a point on your path. >>>> >>>> http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html >>>> >>>> Hilaire >>>> >>>> >>>> Le 14/11/2013 21:07, kilon alios a écrit : >>>> > In order to do that I will have to check that the line passes through >>>> a >>>> > specific pixel. Or to be more correct that the place that mouse has >>>> > clicked is where my path passes through. How I do that ? Can Athens do >>>> > that ? Can athens tell me which pixels my path passes through ? >>>> > >>>> >>>> >>>> -- >>>> Dr. Geo http://drgeo.eu >>>> >>>> >>>> >>> >>> >> >> >> > -- Best regards, Igor Stasenko.