Planet Smalltalk

May 01, 2016

ESUG news - ESUG'16 registration is open

SUG'16 registration is open!

Register here

We also provide you a selected list of hotels here

See you @ Prague!

Pharo Weekly - From Configs to Baselines

I got tired of manually converting Configs into Baselines, so I wrote a
little script. You pass it the selector of a #baselineXyz: method, and it
converts it (i.e. changes the pragma, removes the blessing and repo, etc)
Hopefully you will find it useful. Cross posting to Metcello list...

ConfigurationOf>>#createBaselineFrom: selector

	| projectName baselineName baseline methodTree commonBlockBody repoSetter |
	
	"Create new class"
	projectName := self name allButFirst: self superclass name size.
	baselineName := 'BaselineOf', projectName.
	baseline := BaselineOf subclass: baselineName asSymbol
	instanceVariableNames: ''
	classVariableNames: ''
	category: baselineName.
	
	"Convert baseline##: method"
	methodTree := (self methodNamed: selector) parseTree.
	methodTree selector: #baseline:.
	methodTree pragmas at: 1 put: (RBPragmaNode selector: #baseline arguments:
#()).
	commonBlockBody := methodTree statements first arguments last body.
	repoSetter := commonBlockBody statements detect: [ :e | e selector =
#repository: ].
	commonBlockBody removeNode: repoSetter.
	
	"Compile baseline method"
	baseline compile: methodTree newSource classified: 'baseline'



-----
Cheers,
Sean
--

April 30, 2016

Pharo Weekly - New OpenGL bindings for Pharo 5

Hello,

I made new OpenGL bindings for Pharo 5 using the UFFI (Available at: http://smalltalkhub.com/#!/~ronsaldo/UFFIOpenGL ).
Unlike the old NBOpenGL, these new bindings make a heavy use of OSWindow SDL2 which is integrated and enabled by default in the Pharo 5 image. These bindings do not provide a way to create an OpenGL context or to create a Morphic window using OpenGL unlike NBOpenGL.
For testing quickly OpenGL in Pharo 5, it should be enough to do the following in the playground:
(ConfigurationOfOSWindow project version: #stable) load: ‘WithOpenGLAndExamples’.
(Smalltalk at: #OSGLExampleBasic3) new.
As for Woden, it is now working in Pharo 5 with the UFFI. For loading Woden in a Pharo 5 image, is enough to do the following in the playground (Also available at the Woden Smalltalkhub page):
Gofer new smalltalkhubUser: ‘ronsaldo’ project: ‘Woden’; package: ‘ConfigurationOfWoden’; load. (Smalltalk at: #ConfigurationOfWoden) loadBleedingEdge.
For an example the following script should be executed in a Playground:
WDFPSSimpleExample6 new open.

April 29, 2016

The Weekly Squeak - ESUG’16 Registration

ESUG

Dear Smalltalkers,

ESUG’16 registration is open!

http://www.esug.org/wiki/pier/Conferences/2016/Conference-Registration

We also provide you a selected list of hotels here:

http://www.esug.org/wiki/pier/Conferences/2016/Hotels

See you @ Prague,

Luc


Dr. Luc Fabresse
Associate-Professor in Computer Science
Mines Douai, Institut Mines-Telecom, France
http://car.mines-douai.fr/luc/


Torsten Bergmann - Aqueducts

Nice quote on Twitter:

"Every time I look at Smalltalk, I feel I know how Dark Age engineers must have felt looking at the Roman Aqueducts."

Torsten Bergmann - FullBlockClosureInstaller

In Pharo installing Kernel classes is far from trivial (the SlotClassBuilder raise error and one cannot modify the Kernel classes using the IDE).

This package from Clement allows to install the correct classes for the FullBlockClosure, and update everything so all the state is correct. Nice.

Torsten Bergmann - Smalltalk VM History

Did you notice that the commits from Eliot Miranda to the Squeak/Pharo/Cuis/Newspeak VMMaker packages follow a year pattern (1850, 1851, ...) and include not only a description of the changes but also what happened in the year corresponding to the commit number.

Wonder what happens when he reaches 2016 and following commits...

April 28, 2016

Pharo Weekly - Happy with Pharo 50 release!

Hi guys,

This is just to let you know I am very happy with Pharo 5.0 upcoming release. I was already used quite a lot for other projects (OSSubprocess etc), but a couple of days ago, I started to develop my client’s app (Quuve) and so far so great. It only took me an hour or so to update all my dependencies in my Metacello conf (I have a lot of dependencies). So..thanks for all those who have been updating their confs!
I was already familiar with all the GT tools so I was happy with that. I really notice a speed up (I guess in big part thanks to Spur) and so far it was quite robust. I also noticed some memory leak fixing…as previously in 4.0 I was re-building images all the time because I get to 500MB in no time. Right now I keep using the same image as for several days and so far no problem with memory.
Finally…let me say…. if for Pharo 6.0 we finally get Git support directly integrated into the image and we get expected Sista speedup, I think it will be the best release ever hahahahha.
Thanks for all your efforts and congratulations for the upcoming release. I am already enjoying it since several weeks already.

Pharo News - Pharo MOOC starts May 2nd

<p>The Pharo MOOC start next Monday, May 2nd.</p> <p>It is still possible to subscribe <a href="https://www.fun-mooc.fr/courses/inria/41010/session01/about?platform=hootsuite">here</a>. (Videos are in French with english subtitles, all course material is available in english).</p>

April 27, 2016

Pharo Weekly - A nano tuto on Command Line …

pharo Pharo.image  --list 

will give you the command lines available, then 

pharo Pharo.image  aCommand --help 

will give you the subcommands possible

in your case, you want something like this: 

pharo Pharo.image eval “99 factorial”

cheers, 
Esteban

Pharo Weekly - Pharo Monthly Newsletter April 2016

Pharo Monthly Newsletter April 2016

The Pharo Community is busy preparing the release of Pharo5 for May. We got so busy that we forgot to send out a newsletter for March…

For this April Newsletter, we have three topics:

  1. The Pharo MOOC
  2.  Pharo Consortium: Membership Matching Campaign
  3. Pharo Days Report

To get Pharo related news every day, follow us on twitter @pharoproject.

Pharo MOOC
The Pharo MOOC is a new online course about Live Object Programming in Pharo.

The MOOC starts with over 2000 registrations on May 2nd. Register today!

Membership Matching Campaign
The Pharo Board is proud to announce a special campaign for attracting new Consortium Members during 2016.
A new fund has been created from which the Consortium will receive the equivalent of one yearly membership fee for every new member, and the increment in yearly fees for every upgrading member. For example, if a new company joins the Consortium as a Silver member (2000 EUR / year), the fund will contribute a one-time amount of 2000 EUR to the Consortium. Similarly, if a company upgrades from Bronze (1000 EUR / year) to Gold (4000 EUR / year), the fund will contribute a one-time amount of 3000 EUR.

This campaign will take place until the end of 2016, or until the fund is depleted. Currently, the fund totals 21000 EUR, a sum which is graciously supported by three companies: LabWare, Object Profile and Fenk.
http://pharo.org/news/membership-matching-campaign

Pharo Days
Pharo days were organised on Thursday March 31 & Friday April 1 in Namur (Belgium). It was a great moment to encounter other Pharo programmers, to feel community spirit, to discuss about the Pharo ecosystem and the improvment of the language, listen many interesting talks about various themas.

The schedule was interesting: We were lucky to listen talks about Seaside 3.2, data formats and protocols, Unified FFI, Bloc, Spur, etc. If you didn’t go to Namur, all the slides will be available on this website soon.

Many photographies and a video are already available on the web:

Thanks to the event organizers for their incredible work. The Pharo Days took place in a beautiful place (Le cercle de Wallonie).


Pharo Weekly - Arff Generator for Pharo

Hello everyone,

For a university project in ”Datamining and Datawarehousing”, I have to convert data stored as text files in different formats to the Weka[1] ARFF format[2].

I did it with Pharo of course!:)

So, I wrote this little project [3] to share what I have done with you, just in case someone else needs to export data from Pharo objects to an ARFF string for further analysis with Weka.

Cheers,

Julien

Links:

[1] Weka’s website: http://www.cs.waikato.ac.nz/ml/weka/

[2] ARFF format spec: https://weka.wikispaces.com/ARFF

[3] Arff generator for Pharo: https://github.com/juliendelplanque/Arff


Torsten Bergmann - Genetic Algorithm for Pharo

A genetic algorithm implementation is available from the Pharo Catalog provided by Alexandre Bergel.

I helped Alexandre in providing the config for this. I like the package. His genetic algorithm code is nice and interesting - it allows to play with Genetic algorithms in the regular Smalltalk tools (workspace, inspectors, ...) and the package also provides Roassal visualizations for them.
You definitely should check this package out. Code is on STHub.

April 26, 2016

Noury Bouraqadi - Open positions for Permanent Assistant Professors in Computer Science and Robotics

The Ecole des Mines de Douai has open positions for Permanent Assistant Professors. Candidats must be from EU. The application dead-line is the 15th of may! Below a description of the position. We expect candidates to join the CAR team and work on software engineering and coordination of mobile autonomous multi-robot systems. Our recent projects… Continue reading

April 25, 2016

Torsten Bergmann - Arff Generator in Pharo

Weka is a collection of machine learning algorithms for data mining tasks. Weka defines a format called "Arff" to be used for data importation. On GitHub you will now find an Arff generator written in Pharo.

Torsten Bergmann - Changing Pharo background picture

Want to style your Pharo image with a wallpaper image? Peter describes the possible options in detail.

Pharo Weekly - Soup1.8 [ANN] Introspect web content

Hi,

I added a few GT inspector extensions to Soup and cleaned up a little bit. Released as a new version 1.8 of Soup - you will find easily in Catalog 
for Pharo 5 or by opening Spotter and entering "Soup" to load.

As the attached screenshots shows you now have a nice way to introspect 
the structure of a web page as a tree in the inspector or see the 
attributes of tags/nodes in a table.

Thx
T.

soup.png

April 24, 2016

Pierce Ng - SQLite and JSON

SQLite 3.9.0, released in Oct 2015, introduced the json1 extension that provides functions to manage JSON content stored in an SQLite database. The extension source code is included in the SQLite source amalgamation and is enabled by the -DSQLITE_ENABLE_JSON1 option.

The following assumes that the json1 functionality is available. As sample data, I use the stocks data set from jsonstudio.com. Here’s what the wrapped first line of the JSON data file looks like partially:

{ "_id" : { "$oid" : "52853800bb1177ca391c17ff" }, "Ticker" : "A", "Profit
Margin" : 0.137, "Institutional Ownership" : 0.847, "EPS growth past 5
years" : 0.158, "Total Debt/Equity" : 0.5600000000000001, "Current Ratio" :
3, "Return on Assets" : 0.089, "Sector" : "Healthcare", "P/S" : 2.54,
"Change from Open" : -0.0148, "Performance (YTD)" : 0.2605, "Performance
(Week)" : 0.0031, "Quick Ratio" : 2.3, "Insider Transactions" : -0.1352,

To load the file into an SQLite database using NBSQLite3:

| jr db |
jr := (FileSystem / 'tmp' / 'stocks.json') asFileReference readStream.
jr ascii.
db := NBSQLite3Connection openOn: '/tmp/s.db'.
[   db execute: 'create table s (d json)'.
    db execute: 'begin'.
    [ jr atEnd ] whileFalse: [ 
        db execute: 'insert into s values (json(?))' "<== Note."
            with: (Array with: jr nextLine) ] 
    db execute: 'commit'.
] ensure: [ db close ]
jr close.

Note the invocation of the json() SQL function, which verifies that its argument is a valid JSON string and returns a minified version of that JSON string.

Let’s inspect the created database with the sqlite3 shell tool:

$ wc -l stocks.json
6756 stocks.json

$ sqlite3 s.db
SQLite version 3.9.2 2015-11-02 18:31:45
Enter ".help" for usage hints.
sqlite> select count(*) from s;
6756
sqlite> .schema
CREATE TABLE s (d json);
sqlite> 

The json_extract(X, P1, P2, …) function extracts and returns one or more values from the JSON structure X:

sqlite> select json_extract(d, '$.Sector', '$.Company') 
   ...> from s 
   ...> where json_extract(d, '$.Ticker') = 'AAPL';
["Consumer Goods","Apple Inc."]
sqlite> 

The json_each() table-valued function walks the JSON value provided as its argument and returns one row for each element. The schema for the table returned by json_each() is as follows:

CREATE TABLE json_tree(
    key ANY,             -- key for current element relative to its parent
    value ANY,           -- value for the current element
    type TEXT,           -- 'object','array','string','integer', etc.
    atom ANY,            -- value for primitive types, null for array & object
    id INTEGER           -- integer ID for this element
    parent INTEGER,      -- integer ID for the parent of this element
    fullkey TEXT,        -- full path describing the current element
    path TEXT,           -- path to the container of the current row
    json JSON HIDDEN,    -- 1st input parameter: the raw JSON
    root TEXT HIDDEN     -- 2nd input parameter: the PATH at which to start
);

Here’s json_each() in action:

sqlite> select key, value 
   ...> from s, json_each(s.d) 
   ...> where json_extract(d, '$.Ticker') = 'AAPL'
   ...> limit 10;
_id|{"$oid":"52853800bb1177ca391c1809"}
Ticker|AAPL
Profit Margin|0.217
Institutional Ownership|0.621
EPS growth past 5 years|0.424
Total Debt/Equity|0.14
Current Ratio|1.7
Return on Assets|0.186
Sector|Consumer Goods
P/S|2.75
sqlite> 

Let’s run the same query in Pharo:

| q db v |
q := 'select key, value from s, json_each(s.d) where json_extract(d, "$.Ticker") = "AAPL" limit 10'.
db := NBSQLite3Connection openOn: '/tmp/s.db'.
[   (db execute: q) rows do: [ :r |
        Transcript show: (r at: 'key') asString, ' = '.
        v := r at: 'value'.
        Transcript show: v asString, ' (', v class asString, ')'; cr ]
] ensure: [ db close ]

Transcript displays thusly. As we can see, SQLite and NBSQLite3 handle numerical values in the JSON data properly.

_id = {"$oid":"52853800bb1177ca391c1809"} (ByteString)
Ticker = AAPL (ByteString)
Profit Margin = 0.217 (Float)
Institutional Ownership = 0.621 (Float)
EPS growth past 5 years = 0.424 (Float)
Total Debt/Equity = 0.14 (Float)
Current Ratio = 1.7 (Float)
Return on Assets = 0.186 (Float)
Sector = Consumer Goods (ByteString)
P/S = 2.75 (Float)

Notice that the first row is well-formed JSON. If we use json_tree() instead of json_row(), that JSON structure will be returned as a key/value row as well.

Finally, let’s read the first JSON record using NeoJSON:

| q db  |
q := 'select json_extract(d, "$") as data from s limit 1'.
db := NBSQLite3Connection openOn: '/tmp/s.db'.
[   (NeoJSONReader on: ((db execute: q) rows first at: 'data') readStream)
        next explore
] ensure: [ db close ].

This is powerful stuff. Well worth a look.

April 23, 2016

Torsten Bergmann - Scratch performance

Tim optimized Scratch for the Raspberry Pi ... now it runs much faster. Read more.

April 21, 2016

Torsten Bergmann - Minimal tODE API

The GemStone/S GCI code was ported to UFFI and now allows to have a minimal tODE API for accessing the object database from Pharo 5.0. Read more.

April 20, 2016

Torsten Bergmann - Mocketry 3.0

New version of Mocketry 3.0 for Pharo is available. Read more.

Smalltalk Jobs - Smalltalk Jobs – 4/20/16

Smalltalk job in Berlin.  German is nice to have, but English is required.  They want someone with lots of experience who can start now, and, the contract looks to be 6 months and ending in November 2016.  It could be extended.


Filed under: Employment

Torsten Bergmann - PolyMath-Extensions

Newton's method for vector problems (experimental) is in ‪#‎PolyMath‬ Extensions. Read more

Pharo Weekly - Pillar 3.0.0 release

Hi everybody,

I’m happy to announce the latest release of Pillar.

This release has been possible because of the hard work of Damien Cassou, Cyril Ferlicot, Damien Pollet, Stephan Eggermont, Yann Dubois, Thibault Arloing and Lukas Komarek.

What did it bring and what are the largest changes ?

  • Addition of an AsciiDoc Exporter
  • LaTeX exporter:
    • external links now produce footnotes
    • replace \begin{code}{} with \begin{listing}[language=XXXX]
    • replace \ct with \code
    • use \textasciitilde instead of \texttildelow to represent a ~ character in Pillar
    • SBALaTeX writer for sba book (by Damien Pollet) https://github.com/cdlm/sbabook
  • HTML exporter:
    • default template charset is UTF-8
  • Features: For more  you can see Pillar documentation at https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/PillarChap/Pillar.html
    • hideable scripts with the option hideable.
      •  e.g., [[[hideable=true
        with a parameter in pillar.conf “scriptHide”=true this text will be hidden.
        ]]]
      • It’s, for example useful if you’re a teacher and you want to have two versions of your document, one with solutions (for you) and one without (for students)
    • auto anchor for headers
      • e.g, in a level configuration
        “level1”:{
        “numbering”=true,
        “autoAnchor”=true
        }
        there will be an automatic creation of an anchor for headers of level 1.
      • It’s useful when you want to link a title in the text, for example for a table of contents
    • header capitalization in a level configuration with options: capitalize, capitalizeEnglish, uppercase, lowercase
      •  ex: “level1”:{
        “capitalization”:”uppercase”
        }
        Will render all headers of level 1 to Uppercase.
      • It’s useful if you want all headers of a same level to be capitalize likewise
      • e.g., if you have “==i am a level 1 header” with “capitalizeEnglish” it will produce “<h2>I Am a Level 1 Header<\h2>”

Cheers,

Thibault


April 18, 2016

Torsten Bergmann - Algernon-Launcher for Squeak

Back from the days when I used Squeak there was a nice tool called "Algernon" which was a simple "type in search" tool. I used it very often.

Later in Pharo days such a tool was missing - but after a while the "Spotter" tool for Pharo was provided by the GT team based on the same idea.

The nice thing is that now also the Algernon code was updated for latest Squeak in a project called "Algernon-Launcher".

BTW: Spotter does not allow to evaluate the given text as expressions, but the tool is extendable and maybe should provide this Algernon feature by default as well.

April 17, 2016

Smalltalk Jobs - Smalltalk Jobs – 4/17/16

  • Bangalore, IndiaApplications Developer (SmallTalk) (Job ID 160037167) and Applications Developer 3 (SmallTalk) (Job ID 160037171) through J.P. Morgan
    • Required Skills:
      • The candidate should have an understanding of an object oriented programming language (e.g. Java, C++, C#, Python, Ruby, Smalltalk) and their underlying principles
      • Data modelling
      • Code version control
      • Understanding of performant coding and optimisations
      • Enthusiasm for increasing knowledge of financial markets and products is essential
      • Willingness to adopt an agile development process
  • Fremont, CASystems Engr Staff at Lam Research
    • Required Skills:
      • B.S or Masters in Computer Science, Computer Engineering or related field
      • 8+ years experience in software development
      • Knowledge of embedded software development and design.
      • Design, code and debug applications in various software languages and OS environments
      • Experience working in VxWorks real time operating system
      • Experience creating Windows Embedded Standard 2009 and 7, and develop application in these OS.
      • Knowledge of Object Oriented Software implementation and design
      • Knowledge of source control and software development life cycles.
      • Analytical approach to root cause analysis
      • Knowledge of multithreading is a must (preemptive thread scheduling)
      • Understanding of Networking/TCPIP and various forms of communication such as UART, USB, Lon, ECat.
    • Wanted Skills:
      • Smalltalk, C++, C# experience
      • ControlWORKS framework experience
Good luck with your job hunting,
James T. Savidge

View James T. Savidge's profile on LinkedIn

This blog’s RSS Feed


Filed under: Employment Tagged: jobs, Smalltalk, Smalltalk jobs