Monthly Archives: May 2017

Building the STACK VM for Android

https://github.com/sbragagnolo/pharo-vm/blob/spur64/README-Android.md

Advertisements

Powerful Pointer Finder

The pointer finder finds the shortest paths so it is good for finding the reference that is causing the memory leak.

MCHttpRepository
location: ‘http://www.smalltalkhub.com/mc/JohnBrant/ReferenceFinder/main’
user: ”
password: ‘’

Once loaded, you can evaluate something like “ReferenceFinder findPathToInstanceOf: MyClass”.  That will return a reference path or nil if no path exists from the Smalltalk global to an instance of MyClass. If you want to find a path to a particular instance, you can use “ReferenceFinder findPathTo: myInst”.

In the past, I’ve found that NECController and some compiler infrastructure (I forget the class) have been culprits for memory leaks with their caches.

John Brant

New Booklet: a nice Bloc tutorial

Hi

We are happy to announce a nice tutorial on Bloc. The turorial is still in alpha version but fully working for now. We will add animations and more in the future.

http://files.pharo.org/books-pdfs/booklet-Bloc/BLOCDRAFT.pdf

A. Chis, S. Ducasse, and A. Syrel

Pharo Server Tools

Tools to deploy and manage headless Pharo servers from the command line.

To deploy and manage a Pharo based server application on a Linux system. More specifically, Pharo 4 on Ubuntu 14.04 LTS server.

The goal is to integrate well within the standard Linux world,

  • create an entry in /etc/init.d or /etc/systemd/system/ for automatic start/stop/restart
  • create an entry in /etc/monit/conf.d for monitoring with automatic restarts whenever the check fails
  • setup logging to daily files
  • setup secure REPL access to the running application

This document describes the basic manual installation procedure. There is also an interactive scaffold script that automates most work.

https://github.com/svenvc/pharo-server-tools

Pharo-Chrome

Hi Torsten and All,

Quick Introduction for those not familiar with Pharo-Chrome:

Pharo-Chrome enables Pharo to control and query Chrome / Chromium, in
particular to retrieve the DOM of a page.  This is useful as many modern
pages are just a template which then loads some javascript to
asynchronously build the DOM, meaning that the ZnEasy / Soap combination
doesn’t get the bulk of the information on a page.

Pharo-Chrome is now mostly working, i.e. it is possible to open
a connection to Chrome, navigate to a requested URL, wait for it to
load, retrieve the DOM and then navigate the DOM using a subset of the
Soap API, e.g. #findAllStrings:, #findAllTags:, attributeAt:, etc..

GoogleChrome class>>exampleNavigation has been updated to retrieve the
DOM from http://pharo.org.

GoogleChrome class>>get: is analogous to ZnEasy class>>get:, although it
returns a ChromeNode, not an html string.

I wasn’t able to get rid of the delay while waiting for the page to
finish loading.   This actually makes sense, since, as mentioned above,
many modern pages build the DOM asynchronously, so there’s no clear
indication of when it is complete.  The default delay is currently 2000
milliseconds, which is about twice the maximum I saw needed (983ms), but
this can be changed (ChromeTabPage>>pageLoadDelay:).

I had three use cases for this library: one which works with
ZnEasy+Soap, one that used to work with ZnEasy+Soap, but doesn’t due to
a page redesign, and one which I hadn’t got working before.  All three
are working now.

Unlike Soap, I’ve currently modelled the nodes as a single class, and
have only implemented a subset of Soap’s methods, but is enough for what
I need.

I’ve introduced a dependency on the Beacon logging framework.  I find it
useful, but can remove it if you don’t want the additional dependency.
(I’m planning to add some GoogleChrome specific logging classes and use
those to better understand what pageLoadDelay should be).

I was focussed on trying to understand the events that Chrome generates,
so documentation is still lacking (read “missing” :-)).

I’ll generate a pull request after some more testing, tweaking and
documenting, but if you would like to take a look, the code is available
at:

https://github.com/akgrant43/Pharo-Chrome/tree/development

I haven’t yet updated BaselineOfChrome with the Beacon dependency.  I
did merge in your two commits from May 23.

If you, or anyone else, finds this useful, I welcome any feedback.

P.S.  I’ve just realised that I need to tidy up #sendMessage:,
#sendMessageDictionary and #sendMessageDictionary:wait:.  I’ll do that
as part of the general tidy up.

Cheers,
Alistair

Reading JSON Feed format

Here is a quick example using the new JSON Feed format (https://jsonfeed.org).

json := ZnClient new
systemPolicy;
url: ‘https://daringfireball.net/feeds/json‘;
accept: ZnMimeType applicationJson;
contentReader: [ :entity | NeoJSONObject fromString: entity contents ];
get.

json items collect: #title.
json items collect: [ :each | each title -> each url ].

Note how you can just pretend that the objects understand #items, #title or #url.

Sven

Chrome DevTools Protocol and Pharo

Hi,

I played around with remote controlling Google Chrome from
Pharo using Chrome DevTools Protocol [1] (based on WebSockets).

The video shows an example using latest Pharo 6 on Mac:

Initial Code is on GitHub [2] if someone is interested,
requires OSOSX and Zinc Websockets to be loaded.

Have fun
T.

[1] https://chromedevtools.github.io/devtools-protocol
[2] https://github.com/astares/Pharo-Chrome

New booklet: Voyage :)

A new booklet is joining the collection and it is on Voyage the object to document mapper developed by E. Lorenzano.

Available in beta http://files.pharo.org/books/ and open to contributors at https://github.com/SquareBracketAssociates/Booklet-Voyage

Enjoy

Stef

Pompeii Volcanic Graphics, a mesh based 2D graphics API

Hello,

I am releasing a first version of a new 2D graphics API that I am making for Pharo, using OpenGL.

unnamed.png
http://smalltalkhub.com/#!/~ronsaldo/PompeiiGraphics
https://youtu.be/emE6_1RpAo8

This 2D graphics API is not vectorial based becase it does not use SVG style paths. This API is triangle mesh based, so it is more friendlier with the GPU than Athens or Sparta.

With this API I did a basic gui toolkit, with only two widgets: buttons and label. I did this Widget toolkit to not mess with Bloc, and because I need something relatively stable for the Woden 2 level editor. For now, I am leaving this widget toolkit mostly as a demo. Hopefully it is possible to make Bloc backend using this API.

During the process of making this API, I had to fix several bugs with OSWindow, and bugs in the interaction between OSWindow and OpenGL. The biggest problem was a race condition between the creation of an OSWindow using SDL2, and the events (such as Expose) that are sent to the just created Window.

As for Mac OS X, OSWindow is out of service until a pull request ( https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/138 ) gets integrated into the VM.

Best regards,

Ronie