Monthly Archives: March 2016

CDB implementation

Hi guys

just a little announce. Four students in our lecture released a Pharo implementation for CDB http://cr.yp.to/cdb.html .
We published a configuration in the Pharo40 Catalog
Code is here:

MCHttpRepository
location: ‘http://smalltalkhub.com/mc/TheProfessionals/CDBFormat/main’
user: ”
password: ”

Stef

Advertisements

Pharo FogBugz In Pharo

Hi,

played with the JSON API of Pharo FogBugz issue tracker with the outcome of 
another little Pharo tool that lets you:

 - login to FogBugz from Pharo
 - enter a string and search for according issues
 - open a browser on a selected issue in the result list (works on Linux and Win so far)

The project repo is at:

   http://www.smalltalkhub.com/#!/~TorstenBergmann/FogBugz

One can use the client also directly:

|client|
client := FogBugzClient loginUser: 'abc@def.com' password: 'secret'.
(client query: 'UFFI') inspect.
client logout

You can download the tool in latest Pharo 5 (50660 or later) from catalog
or by opening the Spotter and entering "FogBugz", wait and hitting ENTER.

Attached is a screenshot.

Enjoy
T.fogbugzbrowser.png

New Version of Ghost: the proxy library

Hello.
I finished new version of Ghost:
  • DNU approach for basic proxies instead of #cannotInterpret: trick (trick used only for class proxies)
  • Abstract proxy classes uses Ghost name instead of Proxy: there are GHObjectGhost and GHClassGhost.
  • GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should implement #ghostBehaviour instead of #proxyHandler.
  • GHGhostBehaviour should define #currentMetaLevel to specify set of messages which should not be intercepted. Such meta messages will be executed under ghost instance by subclass of GHMetaMessages.
In previous version there was dictionary which maps meta message selector to implementation selector. It was not suitable. Now meta messages should be directly implemented on particular GHMetaMessages subclass and all it methods are considered meta.
So GhostBehaviour should return instance of GHMetaLevel with meta messages implementation class:
    • GHMetaLevel with: GHEmptyMetaMessages “when all possible messages should intercepted”
    • GHMetaLevel with: GHStandartMetaMessages “when tools specific messages should not be intercepted”
For example standard meta messages implements #inspect:
GHStandartMetaMessages>>inspect
“Create and schedule an Inspector in which the user can examine the receiver’s variables.”
^ Smalltalk tools inspector inspect: ghost
  • Traits for methods explicitly defined on ghosts: TMinimalProxy, TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete proxies can add this traits to itself independently from meta level. For example traits supply convenient methods to retrieve ghost information in polymorphic way with objects:
    • ghost isGhost
    • ghost ghostClass “returns actual class of receiver”
    • ghost ghostPrintString “returns string which represents ghost from meta level point of view”
This traits are suitable and they provide some kind of optimisation for proxies (methods from traits are executed directly instead of complex meta messages mechanizm). But maybe they are superfluous. For example they can’t be reused for class proxies which substitute real object classes (to intercept all instance messages).
  • GHClassGhost able to replace class of real objects. It implements cannotInterpret: trick to intercept all instance messages. Subclasses should define two behaviours: #ghostBehaviour (as any other ghost) and #instancesBehaviour which will process instance messages. In previous version it was different message to same #ghostBehaviour.
  • New kind of proxies:
    • GHObjectVirus. It is special kind of GHClassProxy. It infects real object to intercept it messages. From meta level infected object looks like healthy object which means that meta messages are executed by infected object itself. As class virus looks like real victim class. So in case when virus is created with standard meta level tools will not differ him from health object. There are special messages which allow ask object about viruses:
      • infectedObject isInfectedByVirus
      • infectedObject virus
      • infectedObject recoverFromVirus
    • GHLearningObject. It is suitable proxy which retrieves all unknown methods from teacher class. Thank’s Stephan for this idea.
This kind of proxy allows me easily find required set of messages to support inspectors and debuggers. You can create instance of learning object by:
GHLearningObject withTeacher: Object.
And any operation with it will fill studiedMessages dictionary. In my case I opened GTInspector on it and got all messages which was needed for him.
  • Ghosts works correctly with latest Pharo 5 tools (basic inspector, GTInspector, SpecDebugger, GTDebugger). Required methods for tools are extracted to ‘Ghost-GTSupport’ package.
  • Repackaging:
    • Ghost-ObjectProxies. It contains all core classes and abstract GHObjectGhost which is based on DNU
    • Ghost-ClassProxies. It contains code for proxy which can substitute class of real object. GHClassGhost implements cannotInterpret: trick to intercept all instance messages. And it implement support for debugging such methods.
    • Ghost-LearningObject
    • Ghost-ObjectVirus
    • Ghost-GTSupport
    • test packages
  • All code moved to Pharo repository http://smalltalkhub.com/#!/~Pharo/Ghost (in includes packages from CAR repo too)
You can load new version by:
Gofer it
smalltalkhubUser: ‘Pharo’ project: ‘Ghost’;
configurationOf: ‘Ghost’;
loadStable
I use it now in Seamless and Mocketry.

Seaside for Pharo50 call for early users

Hi Pharoers,

If you are looking to use Seaside in Pharo 5, please go ahead and let us know if you run into any issues.
Seaside 3.1.5 and 3.2.0 (unreleased) load into Pharo 5 and all tests are green [1].
Also: I know the finalization of 3.2.0 is long overdue, so news about that is coming soon.
cheers,
Johan
“Load release 3.1″
Metacello new
    configuration: ‘Seaside3’;
    version: #’release3.1′;
    load.
“Load pre-release 3.2″
Metacello new
    configuration: ‘Seaside3’;
    version: #’3.2.0′;
    load

Preparing PharoLauncher for the classroom

Hi,

I was asked on #slack by user embee (Martin Baehr) how he can create an up to date setup with "PharoLauncher" 
configuration locally that he can afterwards easily distribute ("unzip and go") to 40 Windows PCs for a 
training/presentation.

He was preparing Pharo for Singapore FOSSASIA conference workshop at the science center computer lab.

I helped him with the following short guide that may be useful to others too.

Have fun
T. 


-------------------------------------------------------------------------------------------------------------------------------------------------

A. Portable version of Launcher vor Windows
===========================================
  1. Go to https://ci.inria.fr/pharo/view/Launcher/job/Launcher/ and click on "VERSION=stable"
     for a green build  
  2. Download "Pharo-win.zip"
     (Direct link is https://ci.inria.fr/pharo/view/Launcher/job/Launcher/PHARO=40,VERSION=stable,VM=vm,label=linux/lastSuccessfulBuild/artifact/Pharo-win.zip)

  3. Extract this to c:\ so you end up with a directory "c:\Pharo"

B. Create some folders
======================
  4. Create a new folder "images" 

  5. Create a new folder "vm" with two subfolders "spur" and "nonspur"
  
So you end up with  
  
  - Pharo 
  !- images
  !- vm
   !- spur
   !- nonspur

C. Install stable "non-Spur" VM
=============================== 
The existing stable VM (before the introduction of Spur) is required for all "PreSpur" images with image version <= 50496
(so latest Pharo 4 and initial images when Pharo 5 was started before switching to Spur during Pharo 5 development)
  
  6. Visit http://files.pharo.org/vm/pharo/win/ and download "Pharo-VM-win-stable.zip"
  
  7. This is the Pharo 4 stable Cog VM. Extract the contents to "C:\Pharo\vm\nonspur"

  8. Copy the source files
           C:\Pharo\PharoV10.sources also to C:\Pharo\vm\nonspur
		   C:\Pharo\PharoV20.sources also to C:\Pharo\vm\nonspur
		   C:\Pharo\PharoV30.sources also to C:\Pharo\vm\nonspur
		   C:\Pharo\PharoV40.sources also to C:\Pharo\vm\nonspur  
 
D. Install latest Spur VM 
=========================
The new, fast and shiny Spur VM is required for all "Spur" images with image version 50497 onwards
(so latest Pharo 5)

  9. Visit http://files.pharo.org/vm/pharo-spur32/win/ and download "PharoVM-Spur32-win-latest.zip"   
  
 10. This is the "bleeding edge" Spur VM. Extract the contents to "C:\Pharo\vm\spur"
  
 11. Copy only the source file
           C:\Pharo\PharoV40.sources also to C:\Pharo\vm\spur

E. Configure Pharo Launcher
===========================
 11. Start C:\Pharo\Pharo.exe by double clicking on it, this will open the Pharo Launcher window
 
 12. At the bottom right corner of the Window there is a button called "Open Settings". This opens 
     the settings browser for Pharo Launcher. Click on the node "PharoLauncher" in the settings tree.

 13. For the setting "Spur VM Full Path" enter ".\vm\spur\Pharo.exe" and hit ENTER
 
 14. For the setting "VM Full Path" enter ".\vm\nonspur\Pharo.exe" and hit ENTER
 
F. Hack the "images" folder location to be relative
=================================================== 
 15. When you try to change "Location of your images" to be relative like ".\images" you will 
     notice that it always changes back to an absolute path "C:\Pharo\images". So we need to hack
	 this:
 
 16. Hit "SHIFT" + "ENTER" to open the Pharo Spotter. Enter "PhLDirectoryBasedImageRepository" 
     to open a browser on this class. and change the class method #location to look like
     that
 
       location
	       ^ FileSystem workingDirectory / 'images' 
 
 17. Close the class browser, close the settings browser and leave the Pharo Launcher by
     clicking on "Quit" in the bottom right corner. Note that the launcher image is saved
	 on exit - so our code change will be in effect when we start Launcher again.
	 
Now ZIP the c:\Pharo folder and you can extract it on any computer that you like.

So when you distribute the ZIP the image folder should be clean. But you can also download
and include preconfigured images that you like your audience to be working with.
	 
G. Sharing caches
=================
With the above setup each time you download and start an image using the Launcher a new
"package-cache" for Monticello/Metacello downloads will be created for each image directory.

To avoid such a cache per image and use a general cache for all images it is helpful to
change the package-cache location in each image. This can easily be done:

  18. Start an image and evaluate 
  
        StartupPreferencesLoader preferencesGeneralFolder
	  
	  to find out which preferences folder usually is used. In my example this is 
      C:\Users\root\AppData\Roaming\pharo	  

  19. Go to this folder and create a file called "startup.st" with the following contents:
  
        |mczCache|
        mczCache := 'C:\Software\Pharo\cache' asFileReference.
        MCCacheRepository cacheDirectory: mczCache.
        UIManager inform: 'Package cache set to', mczCache fullName

If you solely work with the setup and following our path logic you can even give this as 
a relative path in the startup script:
  
        mczCache := FileSystem workingDirectory parent parent / 'package-cache'
		
Details on further startup customization can be found on 
https://marianopeck.wordpress.com/2012/05/12/startuploader-running-startup-scripts-in-pharo/		


Another batch of enhancements

50643
17801 EditingState/RubEditingState >>#addUndoRecord: sends a unimplemented message
https://pharo.fogbugz.com/f/cases/17801

17534 Transcript does not work after image save and restart
https://pharo.fogbugz.com/f/cases/17534

16274 Text-Core should not depend on Tool-Base
https://pharo.fogbugz.com/f/cases/16274

17820 QualityAssistant v2.5.1
https://pharo.fogbugz.com/f/cases/17820

50642
17811 { film . FILM } is formatted as { film . FILM . }
https://pharo.fogbugz.com/f/cases/17811

17807 WorldMorph settings should be able to set both background image and color from the settings
https://pharo.fogbugz.com/f/cases/17807

50641
17793 Get coherent diff for metacello packages
https://pharo.fogbugz.com/f/cases/17793
50640
17791 RPackage-Core extends Monticello
https://pharo.fogbugz.com/f/cases/17791

17794 MCStWriter should be able to do not write initializers
https://pharo.fogbugz.com/f/cases/17794

17809 Can not create a subclass of TestCase
https://pharo.fogbugz.com/f/cases/17809

50639
17788 Clean old startup mechanism – part 5
https://pharo.fogbugz.com/f/cases/17788

50638
17806 Make Metacello rules optional in Versionner
https://pharo.fogbugz.com/f/cases/17806

17816 SystemSettings should be last in the startupList of SessionManager
https://pharo.fogbugz.com/f/cases/17816

17813 TransformationMorph rightClick behavior is broken
https://pharo.fogbugz.com/f/cases/17813
50637
17800 load UnifiedFFI 0.15
https://pharo.fogbugz.com/f/cases/17800
50635
17182 Unify adding slots and correct initialization of class slots
https://pharo.fogbugz.com/f/cases/17182

17717 Clean old startup mechanism – part 4
https://pharo.fogbugz.com/f/cases/17717
50633
16537 FTDataSource>>elementAt: should not be there.
https://pharo.fogbugz.com/f/cases/16537

16330 Text*Link users should use RubText*Link
https://pharo.fogbugz.com/f/cases/16330

17774 Use isIntegerPoint instead of “x isInteger and: [ y isInteger ]” in some Point methods
https://pharo.fogbugz.com/f/cases/17774

17773 CircleMorph should use default initialize methods instead of #initialize
https://pharo.fogbugz.com/f/cases/17773

50632
16368 refersToLiteral: should (for now) just call hasLiteralThorough:
https://pharo.fogbugz.com/f/cases/16368

17768 remove again isEphemeronClass and isImmediateClass
https://pharo.fogbugz.com/f/cases/1776

50631
17766 StandardSystemFontsTest is either unfinised or obsolete
https://pharo.fogbugz.com/f/cases/17766

17736 Growl raise debugger instead of a popup at startup
https://pharo.fogbugz.com/f/cases/17736

17758 Rectangle>>#areasOutside: inconsistent return value
https://pharo.fogbugz.com/f/cases/17758

17752 Point>>#asFloatPoint and Point>>#asIntegerPoint should not create new instances all the time. Add Point>>#isFloatPoint
https://pharo.fogbugz.com/f/cases/17752

50630
17761 move #astNodes messages to the Reflectivity package
https://pharo.fogbugz.com/f/cases/17761

17763 RingChunkImporter>>#msgClassComment:with: still uses Text for class comments
https://pharo.fogbugz.com/f/cases/17763

17747 Nautilus history navigation hotkeys prevent entering square brackets on german/spanish Mac OS X
https://pharo.fogbugz.com/f/cases/17747

17764 Update UFFI
https://pharo.fogbugz.com/f/cases/17764
50629
17745 RBParser>>parseLiteralByteArrayObject doesnt consume token on error
https://pharo.fogbugz.com/f/cases/17745

17762 move DisplayScreen related DummyUIManager messages to the Graphics-Display Objects package
https://pharo.fogbugz.com/f/cases/17762

17760 QualityAssistant v2.4.0
https://pharo.fogbugz.com/f/cases/17760
50627
13376 Wrong TextMorph extent for ButtonMorphs
https://pharo.fogbugz.com/f/cases/13376

15733 let MessageTally ignore #home and just use #sender to handle block closures correctly
https://pharo.fogbugz.com/f/cases/15733

15562 rewrite tests that are skipped when old compiler is unloaded
https://pharo.fogbugz.com/f/cases/15562

17746 adding a Slot to an anonymous class sets name ivar.
https://pharo.fogbugz.com/f/cases/17746

17739 remove duplicated methods from Traits
https://pharo.fogbugz.com/f/cases/17739

50626
17392 FreeType numCharMaps nil causes Array>>basicNew: to fail
https://pharo.fogbugz.com/f/cases/17392

17740 RBSelfSentNotImplementedRule needs to ignore Traits methods
https://pharo.fogbugz.com/f/cases/17740

17215 Proposed fix for OCLiteralVariable>>emitValue:
https://pharo.fogbugz.com/f/cases/17215

17132 better comment for flushcache
https://pharo.fogbugz.com/f/cases/17132
50625
16422 BlueInk Formatter breaks line even with enough space
https://pharo.fogbugz.com/f/cases/16422

17197 CheckBoxModel & RadioButtonModel desactivated* => deactivated*
https://pharo.fogbugz.com/f/cases/17197

50624
17733 add support for enums and valueholders
https://pharo.fogbugz.com/f/cases/17733
50622
17655 Changes in package loading behavior
https://pharo.fogbugz.com/f/cases/17655

17692 ProfStef does not correctly use code font
https://pharo.fogbugz.com/f/cases/17692
50621
17716 Clean old startup mechanism – part 3
https://pharo.fogbugz.com/f/cases/17716

17698 Debugger step through proxies is not always working
https://pharo.fogbugz.com/f/cases/17698

50620
17727 failing test: testWorkspaceIsNotAValidContext
https://pharo.fogbugz.com/f/cases/17727

17721 Starting Image 50617 raises MNU
https://pharo.fogbugz.com/f/cases/17721
50618
17704 Failing test on CI for mac: KMCombinationTests>>#testMacMetaShouldBeCmd
https://pharo.fogbugz.com/f/cases/17704

17713 select right fallback UIManager
https://pharo.fogbugz.com/f/cases/17713

17686 Add rules about Rubric method precedence
https://pharo.fogbugz.com/f/cases/17686
50615
17711 Reset Registry of MetacelloProjectRegistration to remove Obsolete configuration instances
https://pharo.fogbugz.com/f/cases/17711

17712 clean old startup mechanism – part 1
https://pharo.fogbugz.com/f/cases/17712

17655 Changes in package loading behavior
https://pharo.fogbugz.com/f/cases/17655
50614
17706 deprecate #implementorsExistOf:
https://pharo.fogbugz.com/f/cases/17706…

50613
17700 add stub NB classes to easy migrations
https://pharo.fogbugz.com/f/cases/17700
50611
17686 Add rules about Rubric method precedence
https://pharo.fogbugz.com/f/cases/17686

17689 BoxedFloat Fix remaining Tests
https://pharo.fogbugz.com/f/cases/17689

17685 Add rules to check if Float system classes are referenced
https://pharo.fogbugz.com/f/cases/17685

Monthly Newsletter Feb 2016

Pharo Monthly Newsletter Feb 2016

We will start our monthly email to keep you in touch with the Pharo world.
You receive this mail because you subscribed at some point at http://pharo.org
In case of a mistake: there is link at the end of the mail to unsubscribe.Many things are happening as usual, far too many to list in one email.

The plan is to send one mail per month, never more, with just a selection of
all the things happening. (This one is late, it was for Feb 2016… there will
therefore be one more end of March)

If you are interested in all the news, there are blogs and twitter accounts to
follow. For example:

For a complete list, see http://pharo.org/blogs

Pharo 50 beta is getting well on track. We expect to have a release in Mid-April. We now have:

  •  Spur the new memory manager developed by Eliot Miranda.Spur includes new GC, new object representation, support for ephemerons, pinned objects and a lot more.
  •  new uFFI compatible with latest Spur memory manager.
  • new version of GT toolkit tools.
  • … and many great enhancements (break point, browser improvements,…)

To play with Pharo5, the latest development snapshot is available at http://pharo.org/download

PharoDays 2016: Two days at Namur to talk and exchange ideas about Pharo, see http://pharodays2016.pharo.org

More manpower: Pavel Krivanek, the creator of the Pharo mini image shrink, has joined on a one-year position to work on the bootsrap and other projects.

The Pharo consortium is growing, we are preparing an announcement for later this month. http://consortium.pharo.org

One Page Browser

| classToView browser list nav |
classToView := TextMorphForFieldView.
nav := SystemNavigation new 
			browsedEnvironment: RBBrowserEnvironment new;
			yourself.
browser := MessageBrowser new
	title: 'aTitle'; 
	autoSelect: classToView name; 
	messages: #();
	yourself.
list := FTEasyListMorph new
	hResizing: #spaceFill; 
	vResizing: #spaceFill;
	elements: (classToView  withAllSuperclasses reversed flatCollect: [ :cls | cls instVarNames ]);
	beSingleSelection;
	yourself.

list onAnnouncement: FTSelectionChanged do: [ :ann | | ivar |
	ivar := [ list dataSource elementAt: ann newSelectedRowIndexes anyOne ] ifError: [ nil ].
	ivar ifNotNil: [ browser messages: (nav allAccessesTo: ivar from: classToView ) ]].

(AlignmentMorph new
	setAsRow;
	addMorph: browser buildWithSpec;
	addMorph: list;
	layoutChanged;
	fullBounds;
	openInWindowLabeled: 'Stuff')
	position: 20@20;
	extent: 900@620.


And you get!

Screen Shot 2016-03-09 at 22.07.56.png



SelectEntity, a new widget for Spec

When using data entry applications,
we often have to select one entity out of a large list.
Spec provides the entryCompletion option for text fields for that.
That works well for small lists
When the number of different entities grows large however,
or when we want to be able to add a new entity,
the traditional solution is to combine an entry completion field
with a button that opens a dialog. This is what SelectEntity provides.
In addition, it supports limiting the choices shown based on
the context in which the field is shown.

https://vimeo.com/158063568

I’ve created a small demo application that can be found on smalltalkhub:

Gofer it
smalltalkhubUser: ‘StephanEggermont’
project:’Ancestry’;
package: ‘Ancestry’;
load.

It can be started with:

ANPersonList new openWithSpec.

Stephan

Thanks to Peter Uhnak for the design comments & debugging