Category Archives: Announce

Pharo by Example 50 Released!

Dear book readers, Pharoers and others

I would like to announce the release of the PDF  version of the new edition of Pharo by Example. Pharo by Example has been adapted to Pharo 50. The printed version is under checking.

http://books.pharo.org

I would like to thank Dmitri Zagidulin, Nicolai Hess and Dimitris Chloupis (especially for the cover) for their help. Now Pharo by Example is available in the Pillar format so this means that we will soon publish an HTML version. I want to thanks Damien Cassou, Cyril Ferlicot, Yann and Thibault for their work on Pillar.

The PDF version benefits from a really cool design made by Damien Pollet.

Stef!

Doing is more difficult that talking, but at the end you have something in your hands 🙂

2016-11-03-07-37-miniCover.jpg

Advertisements

Remote Debugger now available

I glad to release first version of RemoteDebuggingTools project. It allows explore and debug remote images.

Any feedback is welcome.
Best regards,
Denis.

Phratch 40 is out

Phratch 4.0 is out of the box !
Phratch 4.0 is cleaner, faster and more stable than phratch 3.0.
After the version 3.0 that was a release for usability and stability, phratch 4.0 is released to prepare the future.
The new features are:
– phratch is more modular, eg having a kernel and lots of addons.
– cleaning a lot the source code
– customizable environment
– each block can be made visible or invisible
– each category can be made visible or invisible
– it is possible to add translation for addons with the pragma <phratchTranslation: ‘fr’> in the class PhratchTranslator. This make the translation more modular.
– first integration of phratch with the pharo environment. Using the pragma at the class side of any class in Pharo make the class visible and usable in phratch.
– There is a lot of things to do with phratch, you are welcome to contribute ! The documentation for new features will arrive soon.
See you on phratch.com

Blog translator

Udo Schneider wrote a nice blog article on how to use block as translators.

All,
I just finished a blog entry. It shows how to use Smalltalk blocks as parsers/translators. E.g. translating a Block
[:customer | (customer joinDate year is: Date today year)]
into an SQL-like String
(YEAR(customers.joinDate) = 2014)
The SQL stuff is just an example – you can create nearly any output.
Check out http://readthesourceluke.blogspot.de/2014/09/block-translators-parsing-magic.html
Maybe that’s old stuff for some of you – but I hope it’s interesting for some at least 🙂
Comments and feedback appreciated.

CU,

Udo

Network latency analysis with Pharo

Lionel Morino from the University of Bern announced his work on understanding network latency!
PastedGraphic-6
Here is his announce!
Hi All,

I have been working on a visualisation of latency on a network. I found an interesting dataset with latency information of 140 cities around the world.
In the visualisation I show different metrics regarding latency such as from each city which other has the best/worst latency; cities that geographically are close but have high latency; far cities that have low latency; and average latency for each city.
When visualising the worst latency for each city I found that, for this network (at least), Valencia and in a minor extent Nairobi represent the worst endpoint for connections (in terms of latency). Also in the visualisation of far cities with low latency, Newmarket in Canada and Toledo in Spain concentrate the best endpoint for connections coming from Europe and North-America respectively.
Here there is a screencast:
If you want to load the code:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gofer new smalltalkhubUser: ‘merino’
        project: ‘NetworkLatency’;
        package: ‘ConfigurationOfNetworkLatency’;
        load.
(ConfigurationOfNetworkLatency project version: ‘0.1’) load.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=–=-=-=-=
To execute the visualisation:
NLVisualise new open
PastedGraphic-4
I would be glad to have your comments and suggestions.
Best regards,
Leonel Merino

Master your tests with Hapao2

Hapao2 a great test analysis tools was released by ObjectProfile! Here is their announce:

We are happy to release Hapao2 for Pharo. Ricard Jacas and Alejandro Infante put quite some work on Spy2 (an über cool profiling framework for Pharo) and Hapao2.
Hapao2 is about assessing the test coverage of your code and is a major revamp of Hapao1, which was presented a couple of years ago by Vanessa.
Hapao2 does not only list covered and uncovered methods, as most test coverage tool on Earth will do. Hapao gives a great visualization to easily navigate in your code, assess its complexity, and give you a great visual output telling its coverage.
You need Roassal in your image:

Gofer new smalltalkhubUser: ‘ObjectProfile’
project: ‘Roassal2’;
package: ‘ConfigurationOfRoassal2’;
load.
(Smalltalk at: #ConfigurationOfRoassal2) load

and you need S2py:
MCHttpRepository
location: ‘http://smalltalkhub.com/mc/ObjectProfile/S2py/main’
user: ”
password: ”

You can run the test coverage on :
– the class classes you have modified,
– on a particular
– on a particular class category
– on the last class categories you have modified

 – on the last packages you have modified
Here is a portion of a large coverage:
Screen Shot 2014-09-16 at 12.00.11 PM
A technical description of Hapao may be found on http://bergel.eu/download/papers/Berg12c-HapaoSCP.pdf
We are daily using Hapao to help us understand our tests.
Cheers,
Ricardo, Alejandro & Alexandre


_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.

Datatable support for Seaside

Esteban Maringolo announced the support of datatables.net for Seaside.
Here is his announce. 

Hi folks,

This mail is just a heads-up to anybody already using DataTables
(https://datatables.net/) or that developed a Seaside wrapper for it.
I just uploaded my initial working version of DataTables to STHub. If
your current wrapper is better than mine we can merge our efforts.

This initial version supports the basic features to instantiate a
DataTables jQuery object, plus support for AJAX+JSON responses and
also Server-side Processing
(https://datatables.net/manual/server-side).

I still have to write a proper example of how to use it, but if you
load the DataTables-Magritte package it will include a
DTMagritteReport that you can use to replace the "stock" MAReport.

Once I have time I'll try to set up an example to show the different
ways it can be used. Meanwhile look at the DTMagritteReport class to
see a particular use case. It includes support for server side sorting
(multiple columns), filtering, pagination, search.

To load it with all the dependencies run:

Gofer it
  smalltalkhubUser: 'emaringolo' project: 'DataTables';
  package: 'ConfigurationOfDataTables';
  load.

(Smalltalk at: #ConfigurationOfDataTables)project development load: 'Magritte'.

The STHub is:
http://smalltalkhub.com/#!/~emaringolo/DataTables/

Regards!

Seaside 3.1.3 is released

Seaside one of the most exciting web frameworks http://www.seaside.st got a new release.

Hi Seaside users,

We have released Seaside 3.1.3 [1].

A big thanks to everyone involved for making this release happen!

best regards,
The Seaside Team

[1] https://code.google.com/p/seaside/wiki/Seaside313Changelog

JNIPort for Pharo 3.0

Hi everybody,

JNIPort for Pharo 3.0 alpha is now available at SmalltalkHub.

JNIPort is a Smalltalk library which allows Java code to be invoked from
Smalltalk. It acts as a bridge between the world of Smalltalk objects and a
Java Virtual Machine (JVM) where Java code is executing.

When I first ported JNIPort to Squeak and Pharo 1.x, I used Alien as the FFI
library. As NativeBoost has superseded Alien, the interface to the Java
Native Interface library had to be rewritten. There are still some
undocumented and obscure parts in NativeBoost, so this has taken some time.

If you want to try it, load it via the ConfigurationOfJNIPort. I hope this
works. If it does not, load the packages individually in the order in which
they appear in the ConfigurationOfJNIPort.
http://www.smalltalkhub.com/#!/~JNIPort/JNIPort
The next step is to read the documentation at
http://jniport.wikispaces.com/
Otherwise, you won’t know what to do next. 😉
Download the extra files from the download page at Wikispaces, you will need
two jar files from there.

Start a Java VM attached to Pharo by adapting and executing the following
code snippet:

—-
| jvmSettings |
“You can set the path to the Java VM library by editing the path as
needed.”
JNIPortJNIInterface libraryFile:
‘/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libclient.dylib’
.
“JNIPortJNIInterface libraryFile:
‘C:\Programme\Java\jre7\bin\client\jvm.dll’ .”

jvmSettings := JVMSettings new.
jvmSettings usesGhosts: true.
jvmSettings supportsCallbacks: true.
jvmSettings jniPortSettings useJNIHelperLibrary: false.
jvmSettings ghostClassSettings retainMethodSource: true.

“On Mac OS X and Linux, class path entries are separated by colons.”
“On Windows, you have to use semicolons instead. Edit the following line as
needed.”
jvmSettings runtimeSettings classpath:
‘.:/Users/myname/JNIPort.jar:/Users/myname/JNIPort-Tests.jar’.
” jvmSettings runtimeSettings classpath:
‘.;.\JNIPort.jar;.\JNIPort-Tests.jar’.”

“Uncomment the following if you want the Java VM to emit verbose messages.
How to access these messages depends on your platform.
On Mac OS X, they are visible in the Console application.”
“jvmSettings runtimeSettings addOption: ‘-verbose:jni’; addOption:
‘-verbose:gc’; addOption: ‘-verbose:class’.”
Cursor execute showWhile: [JVM newWithSettings: jvmSettings].
—-

Then the fun starts:

—-
| zfClass zipfile entries |
zfClass := JVM current findClass: #’java.util.zip.ZipFile’.
zipfile := zfClass new_String: ‘JNIPort.jar’.
zipfile size. “–> answers an Integer”
entries := zipfile entries.
entries asAnEnumeration do: [:each | Transcript cr; print: each].
—-

And now to the ugly little secret reason why I call it an alpha version:

While everything seems to work, it is *much* slower than it used to be in
Pharo 1.2 with Alien. And when I compare it with VisualWorks, I wonder if
the Pharo version secretly does some additional work for SETI:
– Starting the JVM:
VisualWorks 0.7 seconds
Pharo 7 to 8 seconds
– A benchmark using some methods of java.io.BufferedReader and
java.util.StringTokenizer:
VisualWorks 114 milliseconds
Pharo 12 to 13 seconds

I have not yet found the reason. The TimeProfiler is not very helpful, as
its 1 millisecond resolution is too coarse. It would be nice if it had
microsecond resolution. From the TimeProfiler results, it seems that calling
a JNI method with NativeBoost is extremely slow, but I don’t trust those
profiles too much.

So, give it a try, and if you find something useful concerning the bad
performance, please send me a message.

Best regards,
Joachim Geidel

Tagged

Timezone in ZTimestamp project

Sven (the author of many cool Pharo packages: JSON, STON, CSV, HTTP, HTTPS) released a new version of ZTimestamp. Here is his announce:

I just added a first version of timezone support to the ZTimestamp project – a small, lightweight, non-intrusive, self-dependent alternative to DateAndTime and friends. With this addition, it is now possible to work with UTC/GMT timestamps internally yet present correctly localised timestamps in any timezone, based on the standard Olsen database. ZTimestampFormat was extended with optional timezone support.

About ZTimestamp

https://ci.inria.fr/pharo-contribution/job/PharoProjectCatalog/HTML_Report/ZTimestamp.html

https://github.com/svenvc/docs/blob/master/neo/ztimestamp.md

ZTimestamp can be loaded most easily from the Pharo 2 or 3 Configuration Browser.

StHub

http://www.smalltalkhub.com/#!/~SvenVanCaekenberghe/Neo/packages/ZTimestamp

CI job

https://ci.inria.fr/pharo-contribution/job/ZTimestamp/

From the class comment of ZTimezone

https://github.com/svenvc/ztimestamp/tree/master/repository/ZTimestamp.package/ZTimezone.class

===

I am ZTimezone, representing the timezone information in the standard Olsen database.

http://en.wikipedia.org/wiki/Tz_database

Usage

You reference timezones by their ID. The list of supported identifiers is accessible using

ZTimezone timezoneIdentifiers.

To access a timezone do

ZTimezone id: ‘Europe/Brussels’.

The necessary information will be loaded, parsed and cached from a binary file of the zoneinfo database (see also man tzfile). This should work automagically on Mac OS X and Unix, on Windows you have to download the necessary files and specify their location

ZTimezone zoneInfoLocation: FileLocator C / ‘foo’ / ‘bar’ / ‘zoneinfo’.

Once you get a handle on a timezone, the main operation is to query the sub timezone that is applicable at a certain point in time

(ZTimezone id: ‘Europe/Brussels’) subzoneForTimestamp: ZTimestamp now.

The ZSubTimezone instance returned contains information like the UTC offset. Since you’ll probably only be interested in that aspect there is a convenience method

(ZTimezone id: ‘Europe/Brussels’) offsetForTimestamp: DateAndTime now.

The flow is that for every GMT timestamp, you get the concrete offset to use for a specific timezone. Note that this is not a constant, it depends on the time periode the timestamp falls in.

The are 2 more convenience methods to quickly convert between GTM and local wall time

(ZTimezone id: #’Europe/Brussels’) gmtToLocal: ZTimestamp now.
(ZTimezone id: #’Europe/Brussels’) localToGmt: DateAndTime now.

Also note the zoneTab and the timezones are cached in the image. When the TZ database changes, it might be necessary to either call #cleanUp or #reloadAll. When moving images between machines, either all info should be loaded and cached, or it might be necessary to use #zoneInfoLocation: again.

Implementation

A chronological array of transition points in unix time specifies which sub zone is active from that point on to the next.

===

Tagged