Planet Squeak

blogs about Squeak, Pharo, Croquet and family
planet squeak - planet squeak es - planet squeak jp - planet croquet - planet squeak code - planet smalltalk

September 21, 2014

Torsten Bergmann

Calling Blender

Calling Blender using Pharo with Ephestos 0.1

by Torsten (noreply@blogger.com) at September 21, 2014 06:48 PM

PocketCube solved by DijEvolution

Dijkstra shortest path search algorithm can find solution for PocketCube using Pharo. See the video here.

by Torsten (noreply@blogger.com) at September 21, 2014 06:39 PM

September 19, 2014

Torsten Bergmann

Visualize network latency using Pharo

Visualize network latency using Pharo. Read more here.

by Torsten (noreply@blogger.com) at September 19, 2014 01:39 PM

Bootstrap (V0.12.2) for Seaside

An updates version of Bootstrap (V0.12.2) for Seaside is available. You can easily load it from the Configuration Browser in Pharo 3.0 or the project site.

Beside more tests it features vertical tabs which is a simple wrapper of a component found on the web. 

Look at the online demo for Bootstrap to see how easy one can use them: http://pharo.pharocloud.com/bootstrap/browser/Vertical%20Tabs

by Torsten (noreply@blogger.com) at September 19, 2014 08:10 AM

DataTables jQuery plugin for Seaside

If you build a web application using Seaside and Pharo, maybe using my Bootstrap wrapper project you might be interested in a good data table plugin to display tabular data.

There is a nice (commercial) jQuery plugin called DataTables. Esteban made it available as a plugin for Seaside now and describes this here.

by Torsten (noreply@blogger.com) at September 19, 2014 06:18 AM

September 17, 2014

Torsten Bergmann

Saucers 1.5

A nice little game built with Squeak using Morphic.

by Torsten (noreply@blogger.com) at September 17, 2014 07:11 PM

Pharo Sprint Lille 26th september

see here.

by Torsten (noreply@blogger.com) at September 17, 2014 02:09 PM

SciSmalltalk v0.14 is released.

Read more here and check the project here.

by Torsten (noreply@blogger.com) at September 17, 2014 09:46 AM

September 16, 2014

Torsten Bergmann

SortFunctions for Pharo

SortFunctions allow you to easily work with sorting in Smalltalk. Checkout the project at SmalltalkHub where you will also find the docu and examples.

by Torsten (noreply@blogger.com) at September 16, 2014 07:48 PM

Test Coverage with Hapao

Hapao2 for Pharo is arrived. Read more details here.

by Torsten (noreply@blogger.com) at September 16, 2014 06:03 PM

Performance enhancement of list updating operation

see here.

by Torsten (noreply@blogger.com) at September 16, 2014 06:00 PM

September 11, 2014

Squeakland News

How to do timing in Etoys?

I just got this question from my students and I thought there might be others with similar interests. So how can I control sequences of actions over time? Say, I want to use speech bubbles to tell a story. I have a number of sentences to show, one after another, and I want to let some time pass between them to give the reader time to read. How can I do that?

Well, I can build a timer and check the time to trigger actions when a certain time is reached. How can I build a timer?

First of all, you need a variable to count time steps. Open the viewer for your object. Create a variable by clicking the "v" - symbol in the top row of the viewer and give your variable a name. I choose "seconds". The default type is "Number", which is fine and 0 decimals places are perfect as well.


Now open a new empty script and drag the tiles to assign a new value to your variable into the script. Change the operation to "increase by" and the number to "1". Make sure the value of your variable is "0" at the start! Name the script "timer".


You do know already that the script, once started, will be executed repeatedly until it is being stopped, right? Do you also know how fast or how slowly this happens? You can see this when you click on the watch in the top row of the scriptor and hold the mouse button down. And you can also change it there! By default, it will be executed 8 times per second. Change this into once per second!



When you now start the script, each second it will increase the value of your variable "seconds" by 1! Now you can use the value of the variable in other scripts:


Use a all-scripts-tile from the supplies to start both, your script and the timer, at the same time and watch :)

Please note: It depends on your computer and what other programs are running on it at the same time, if a second in the Etoys project will be the same as a second at a real clock. It may not be exactly the same, but probably close. It is definitely good enough to control the flow of a story, but for scientific experiments, you should use a real timer!

There is another approach to time handling in this post from Ricardo Moran.

You can also find a tutorial to build a timer in project 6 of the book "Powerful Ideas in the classroom" by Kim Rose and B.J. Allen-Conn.

by Rita (noreply@blogger.com) at September 11, 2014 11:48 AM

September 10, 2014

Torsten Bergmann

Seaside 3.1.3

is released. Read the announcement or browse the change log.

by Torsten (noreply@blogger.com) at September 10, 2014 11:22 AM

PointerDetective

A small tool to find references to an object visually. Code is on SmalltalkHub.

Also on PharoWeekly.

by Torsten (noreply@blogger.com) at September 10, 2014 07:52 AM

OSMMaps

OSMMaps is a Pharo package to interact with OpenStreetMap. Read more here.

by Torsten (noreply@blogger.com) at September 10, 2014 06:51 AM

September 09, 2014

Torsten Bergmann

New Release of Essence Sharp: Nīsān-2 (Alpha Build 23)

A new Release of Essence Sharp: Nīsān-2 (Alpha Build 23) is available. Read more.

by Torsten (noreply@blogger.com) at September 09, 2014 06:47 AM

Invitation to Smalltalks 2014

The Fundación Argentina de Smalltalk (FAST) invites you to the 8th International Conference on Smalltalk Technologies. Read more.

by Torsten (noreply@blogger.com) at September 09, 2014 06:45 AM

Kontolino demo vide

Kontolino.de - a Seaside Smalltalk application from germany company Objektfabrik is now also demonstrated in a first video:


by Torsten (noreply@blogger.com) at September 09, 2014 06:43 AM

September 05, 2014

Torsten Bergmann

Pyonkee

A Scratch clone running on iPad, read more here.

by Torsten (noreply@blogger.com) at September 05, 2014 07:35 AM

September 03, 2014

Torsten Bergmann

Pharo Seaside : Looking at HTTP Traffic

If you want to easily look at the HTTP traffic in your Pharo based Seaside application then just evaluate:

       ZnLogEvent open

This will open an spy on the Zinc announcements. Then start your server using:

     ZnZinServerAdaptor startOn: 8080.

and use the webbrowser to browse your Seaside application. You will now see any HTTP exchange between the client and the server.

The video demonstrates this:

by Torsten (noreply@blogger.com) at September 03, 2014 07:30 AM

IDE4PLC based on Pharo

A free IDE for Programming PLC's (Programmable Logic Controller) based on Pharo Smalltalk written by Eric Nicolás Pernia from the Universidad Nacional de Quilmes.

Read more on the page site or browse the code on GitHub.

by Torsten (noreply@blogger.com) at September 03, 2014 07:09 AM

How to run Pharo 3.0 on top of Linux 64 bits

Read more here.

by Torsten (noreply@blogger.com) at September 03, 2014 06:19 AM

September 02, 2014

Torsten Bergmann

Reddit.st — In 10 Cool Pharo Classes

Another nice article published by Sven on how to use Pharo, the Seaside web framework and the Glorp ORM together with Postgres DB to create a Reddit.st version.

Read more here.

by Torsten (noreply@blogger.com) at September 02, 2014 08:18 AM

August 30, 2014

Gilad Bracha

Taking it to Th’emacs

Emacs is my preferred text editor. I don’t use old-fashioned text editors as much as I used to, because I often need more specialized tools.  I use IDEs for various programming languages and other things when producing high quality documents. And yet, I often wish I could subsume these with a tool that had the basic goodness of emacs.

What makes emacs interesting all these decades after its inception is not what keyboard shortcuts it supports or what its basic editing functionality is. Rather, what matters are some of its underlying design principles.
As a consequence, you can control everything emacs does programmatically. This makes emacs extensible in a way that is far deeper and more powerful than a plug-in architecture. A plug-in architecture must anticipate every desired extension to the system. Since it never can, it always disappoints in the end. Along the way it grows ever more complex and bloated in its futile attempt to foresee every possible need. With a language, you can code any extension you need.

If the scripting language is truly dynamic, and allows you to not only extend but also modify the running system, the possibilities are truly unlimited.

The points above are not limited to editors. They are fundamentals of system design.

There was a time when even Microsoft recognized this, making apps that could be programmed via VisualBasic. Sadly, they concocted a security nightmare, because malware can also control your application. Which is why being able to secure your application’s scripting language is critical as well. 

Last June, I spoke at QCon NY, and demonstrated a number of interesting web based systems that had some these properties (as well as a couple that did not, but were interesting for other reasons):
We really need an Emacs for the modern age.  An editor, surely, but one that lets you edit rich text, images, audio and video. In fact, you should be able to embed arbitrary widgets. And of course it needs to be scriptable I just explained. So you might evaluate code that creates a UI element and inserts into the editor.  

Now you can make the editor modify its own GUI. In fact, the editor can be extended into a general purpose GUI builder just like Lively. And every such GUI can modify itself if you wish; sometimes you may wish to modify it so it can no longer modify itself, and then you have a frozen application. Your editor has become an IDE. In fact, it is a live literate programming environment

If the editor’s scripting language interoperates well with the surrounding environment, it can be used to control the computer and everything the computer itself controls. You can check in to the environment and hardly ever leave. You can lead your cyber life in it.: email, social media, live chats, streaming audio and video can all be incorporated. Moreover they can all be controlled and customized by you, the lucky user. 

To a degree, Lively is such an editor. It’s biggest drawbacks are a lack of polish due to lack of engineering resources and that its scripting language is Javascript.

Now, imagine that the editor was polished and robust. Even more importantly the code you created in this environment was modular and secure and written in an elegant and principled language. Imagine you could deploy the same code either on the web, or natively on both desktop and mobile. Imagine that the applications built with the language support online and offline use out of the box, automatically synchronizing data and code between clients and servers. Imagine that they have built-in support for collaboration, either syncing in real time or merging offline as required. 

Of course, it is the vision of such a language and platform that has always motivated the Newspeak project.  I have discussed many of these points before. In particular, I’ve talked about the weaknesses of traditional IDEs (see for example this post and this one), and the need for a platform that supports synchronization over the net (here and again here) for a long time. Yet the message bears repeating. 


by Gilad Bracha (noreply@blogger.com) at August 30, 2014 10:07 PM

August 29, 2014

Bert Freudenberg

Deconstructing Floats: frexp() and ldexp() in JavaScript

While working on my SqueakJS VM, it became necessary to deconstruct floating point numbers into their mantissa and exponent parts, and assembling them again. Peeking into the C sources of the regular VM, I saw they use the frexp() and ldexp() functions found in the standard C math library.

Unfortunately, JavaScript does not provide these two functions. But surely there must have been someone who needed these before me, right? Sure enough, a Google search came up with a few implementations. However, an hour later I was convinced none of them actually are fully equivalent to the C functions. They were imprecise, that is, deconstructing a float using frexp() and reconstructing it with ldexp() did not result in the original value. But that is the basic use case: for all float values, if

[mantissa, exponent] = frexp(value)
then
value = ldexp(mantissa, exponent)
even if the value is subnormal. None of the implementations (even the complex ones) really worked.

I had to implement it myself, and here is my implementation (also as JSFiddle):
function frexp(value) {
    if (value === 0) return [value, 0];
    var data = new DataView(new ArrayBuffer(8));
    data.setFloat64(0, value);
    var bits = (data.getUint32(0) >>> 20) & 0x7FF;
    if (bits === 0) {
        data.setFloat64(0, value * Math.pow(2, 64));
        bits = ((data.getUint32(0) >>> 20) & 0x7FF) - 64;
    }
    var exponent = bits - 1022,
        mantissa = ldexp(value, -exponent);
    return [mantissa, exponent];
}


function ldexp(mantissa, exponent) {
    return exponent <= 1023 ?
        mantissa * Math.pow(2, exponent) :
        mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023);
}
My frexp() uses a DataView to extract the exponent bits of the IEEE-754 float representation. If those bits are 0 then it is a subnormal. In that case I normalize it by multiplying with 264, getting the bits again, and subtracting 64. After applying the bias, the exponent is ready, and used to get the mantissa by canceling out the exponent from the original value.

My ldexp() is pretty straight-forward, except it needs to be able to multiply by very large numbers. The smallest positive float is 0.5-1073, and to get its mantissa we need to to multiply with 21073. That is larger then the largest float 21023. By multiplying in two steps we can deal with that.

So there you have it. Hope it's useful to someone. And here is the version I put into SqueakJS, if you're curious.

by Bert (noreply@blogger.com) at August 29, 2014 09:06 PM

August 28, 2014

The Weekly Squeak

Pyonkee (Scratch on iPad)

pyonkee

From Masashi-san:

Hi all,

 

I have just released a Scratch clone running on iPad. It is based on Scratch 1.4 from the MIT Media Laboratory.

The app is now called “Pyonkee” – freely available on App Store.

https://itunes.apple.com/us/app/pyonkee/id905012686

 

Pyonkee was originally started as a fork of John M McIntosh’s Scratch Viewer.

https://github.com/johnmci/Scratch.app.for.iOS.

 

While Scratch Viewer just works as a viewer of the existing Scratch projects, Pyonkee supports creation/edit of projects.

 

Other features:

- User interfaces are optimized for iPad

- Native font support

- Embedded camera support

- IME support

- Auto-saving project

- Sending projects via e-mail

- Project import/export through iTunes (currently disabled)

 

Moreover, source code is open on github. Feel free to fork it.

https://github.com/SoftUmeYa/Pyonkee

 

Enjoy!

[:masashi | ^umezawa]


by Ron Teitelbaum at August 28, 2014 05:00 PM

Torsten Bergmann

KelticKnots with Pharo

See here.

by Torsten (noreply@blogger.com) at August 28, 2014 12:08 PM

August 25, 2014

Torsten Bergmann

Teapot - another way for Pharo to serve the web

There are various options to write web applications in Pharo. You can use Seaside or Aida web framework or play with the new Tide framework connecting Amber with Pharo.

If you want to quickly write something you can use the plain Zn framework as this nice tutorial from Sven describes.

And now there is something inbetween that allow you to quickly write an application that serves static or dynamic content from Pharo. It is called Teapot and with a few lines of code you can provide JSON to the outside world or other REST based functionality. It also includes support for the Pharo port of Mustache (the templating engine).

The basic concept of Teapot is to define one or many URL Route(s) - either direct or as pattern (for instance with a Regexpression) and return an appropriate response from the Smalltalk side. Simple, lightweight and easy to use.

by Torsten (noreply@blogger.com) at August 25, 2014 11:00 AM

Woden - 3D graphics engine for Pharo

Woden is a multi-media graphics engine written in Pharo. This graphic engine is being designed for video-game development and data visualization.


Read more here.

by Torsten (noreply@blogger.com) at August 25, 2014 09:50 AM

TaskIt Version 1

The first version of TaskIT - a Task management library for the Pharo Language - is released. Read the announcement.

Also read the chapter for the upcoming Pharo for the Enterprise book.

by Torsten (noreply@blogger.com) at August 25, 2014 09:32 AM