After several iterations and some month of efforts, the new version of Pharo by Example is finally available in print form and pdf.
Tx all the contributors.
at Synectique, we are using cache for lots of projects and for now we were always using another instance variable or a dictionary to store many. It is complicated to maintain and we are always reinventing the wheel.
That’s why i created a first implementation (very naive but functional, documented and tested) of a cache.
It is available here (with usage explication):
and you can get it by doing:
smalltalkhubUser: ‘GuillaumeLarcheveque’ project: ‘SmallCache’;
Tell me if you are interested in it or if you have ideas about it.
This is my weekly ChangeLog, from 27 February 2017 to 5 March 2017.
You can see it in a better format by going here: http://log.smallworks.eu/web/search?from=27/2/2017&to=5/3/2017
3 March 2017:
* And now I made +libssh2.so+ compile on linux too
I think Iceberg is fixed now for linux, can someone with linux try +vmLatest60+.
* I worked on VM for linux, this time fixing dependencies for libgit2: it was not working because it was trying to link libssh2 existing in the system instead the one we provide (a problem with rpath)… I figured out I need to add some CMAKE options:
otherwise +make install+ was ignoring the +-Wl,rpath,.+ configuration. With this it seems to be working, but now I have a problem with +libssh2+ compilation.
I’ll see this next.
* I took some moments to fix a problem on new UFFI version (0.26): Now, structures use a class variable to keep the offset value of a field. So now, instead having an accessor to a field of the form (for example):
^ handle unsignedLongAt: 42
… now you have an accessor of the form:
^ handle unsignedLongAt: OFFSET_MYFIELD
this is necesary to allow different platforms to use same structures (because sizes of fields, and in consequence of offsets of them inside a stricture are different). This ‘offsets’ are calculated (as structure compiled specs) at first access to +#compiledSpec+ of structure, which usually happens when you use it first time… but now always, as [case: 19788](https://pharo.fogbugz.com/f/cases/19788) shows.
Well, now I fixed that
2 March 2017:
* I added a Discord link on [http://pharo.org/community](http://pharo.org/community)… I want to slowly start moving our community there. I know Slack is very popular among us this days but Dicords offers some advantages (like no 10k limit on messages and a powerful search).
1 March 2017:
* … and now I made the [case:19783](https://pharo.fogbugz.com/f/cases/19783), to make SDL2 work on 64bits (it works!)
* Yesterday I spent the full day debugging a VM to see why Athens was not working for 64bits and I finally figured out the problem was in image and not in VM
As a result of the work, I produced these fixes:
With this two cases, Athens works in 64bits (almost)
Now there is a problem in 64bits callbacks that makes the +VGTigerDemo runDemo+ to fail after some cycles. Since this problem does not happens on 32bits, I assume there is a problem on how callbacks work on 64bits. I’m not working on that (I will work also in migrating SDL2).
27 February 2017:
* Well, I spend some time trying to blindly figure out why athens may crash time to time when drawing surfaces, basically testing the approachs [Ronie proposes](http://forum.world.st/Too-frequent-crashes-td4927143i20.html#a4934027).
First approach consists on copying data to not rely on a surface at all. Problem with this is that it involves a whole full copy, that causes a lot of GC that pauses a lot the image… so smoothness is gone.
Second approach seems a lot more doable, but I still don’t know if it works:
Form subclass: #AthensCairoSurfaceForm
surface := anObject
“create a form and copy an image data there”
^ (AthensCairoSurfaceForm extent: (self width@self height) depth: 32 bits: id)
this will prevent surfaces to be garbage collected before its time and seems to be working fine (at least in my machine).
I wrote a little tool to test regular expressions and verify that
given samples match it. It also helps to divide an expression into
subexpressions to retrieve parts of a matched string.
Screenshot is attached. Code, load instructions and full tutorial
on how to use it is on https://github.com/astares/Pharo-Regex-Tools
Hope it is useful for others too. Have fun!
if you work with UML, modeling tools or model data exchange often you might know XMI –
the XML Metadata Interchange format.
I wrote a little package that makes it easier to work and browse data based on this
format within Pharo.
For instance you can open an XMI object either from a given stream
(XMIFile fromURL: ‘http://www.omg.org/spec/UML/20131001/UML.xmi’) inspect
You can also open a file
Code is available on https://github.com/astares/Pharo-XMI
The package includes a small GT extension allowing you to walk and dive through the XMI
structure (see attached screenshot) and as the XMI nodes are unified it is easy to
code some code generators or transformers in Pharo afterwards.
For instance I used this package for a simple Pharo code generator based on Eclipse EMF models/diagrams.
Within the code you will find some examples to browse through prominent XMI models like:
– UML Spec
=> (XMIFile fromURL: ‘http://www.omg.org/spec/UML/20131001/UML.xmi’) inspect
– VISUAL PARADIGM
=> (XMIFile fromURL: ‘https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi’) inspect
– ENTERPRISE ARCHITECT
=> (XMIFile fromURL: ‘https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi’) inspect
=> (XMIFile fromURL: ‘https://www.reflektis.com/repos/archimate-3.0.xmi) inspect
Once the inspector opens you have to select the “rootNode” and then the “Hierarchy” tab.
In Pharo 6 you can load “XMI” right from catalog. Hope the package is useful for others too.
Concerning the World menu you first define your menu in a method, and
tag it with a dedicated pragma, for example in Dr. Geo I wrote:
(aBuilder item: ‘New’ translated)
action: [DrGeo newFullScreen];
icon: ThemeIcons current smallNewIcon;
(aBuilder item: ‘Open’ translated)
action: [DrGeo openFigureThumbnail: nil];
icon: ThemeIcons current smallOpenIcon;
(aBuilder item: ‘Quit’ translated) action: [DrGeo quit]; order: 999
Then you register this as your new world menu using the pragma name:
WorldState desktopMenuPragmaKeyword: ‘drgeoMenu’.
I have published a short video of the Pharo bootstrapping from a Ring model that is browsed and modified by the Calypso browser.
No audio, please enable subtitles for the description.