Showing posts with label Issues. Show all posts
Showing posts with label Issues. Show all posts

Monday, 23 November 2015

Timing Issues in Squeak and Pharo and Cuis Smalltalks

I was profiling yesterday, and discovered these issues:

Issue:
=====
Time and DateAndTime both show human-readable time information to
micro-second precision.  Time also holds information to nano-second
precision.

Both objects are only providing information to the nearest millisecond.

The digits beyond milliseconds are always (on my PC) filled in as '902'.

In the nanoseconds instvar of the Time objects, the nanoseconds are
always filled in as '000'.


Root cause:
=========
When Times (and DateAndTimes) are created, they use the
Time>>primUTCMicrosecondsClock method to generate the time

primUTCMicrosecondsClock
"Answer the number of micro-seconds ellapsed since Squeak epoch.
That is since 00:00 on the morning of January 1, 1901 UTC.
At least a 60-bit unsigned integer is used internally which is enough
for dates up to year 38435.
Essential. See Object documentation whatIsAPrimitive. "

<primitive: 240>
self primitiveFailed

Potential for solution:
================
[The following is taken from Stack Overflow,
http://stackoverflow.com/questions/2607263/how-precise-is-the-internal-clock-of-a-modern-pc]
Modern PCs have a hardware  High Precision Event Timer (HPET) which
specifies a clock speed of 10MHz
http://www.intel.com/hardwaredesign/hpetspec_1.pdf
Even newer PC architectures take this and put it on the Northbridge
controller and the HPET can run at 100MHz or even greater. At 10Mhz we
should be able to get a resolution of 100 nano-seconds and at 100MHZ
we should be able to get 10 nano-second resolution.

The following operating systems are known not to be able to use HPET:
Windows XP, Windows Server 2003, and earlier Windows versions, older
Linux versions
The following operating systems are known to be able to use HPET:
Windows Vista, Windows 2008, Windows 7, x86 based versions of Mac OS
X, Linux operating systems using the 2.6 kernel and FreeBSD.

Saturday, 17 October 2015

Pharo By Example Issues

All the issues are occurring from
Pharo-1.0 Latest update: #10517
installed on Windows 7 from the PBE-OneClick zip
Pharo By Example version of 2009-10-28

1) Section 1.4
meta-click does not bring up the Morphic halo on the BouncingAtomsMorph
For screenshots, see How to kill the BouncingAtomsMorph

2) Section 1.6 p14
Inspect it does not bring up the "newInspector", just the inspector.

As opposed to what's shown in the book:
3) Section 1.6 p14
Explore it does not bring up the explorer shown in the book
PBE

Pharo

Clicking on the triangle in Pharo only toggles the trianle from pointing down to pointing right.

PBE Ch. 2.2

Book tells you to click on "accept", where you actually click on "OK".

PBE Ch 2.3

The book talks of the code pane of the PackageBrowser being outlined in red when there are unsaved changes,  

In PBE-OneClick, there is a small orange gradient-filled triangle at the top-right of the code-pane.

It then talks of typing in a class comment, but it is not obvious where this should be typed in.  Other Packages and other Classes do not seem to have Class comments.

Ch. 2.4

a) 
In the object Inspector, we're told to enter self bounds: (200@200 corner: 250@250) and do it.

This results in either :
Message Not Understood: Rectangle>>bounds: in the debugger or 
or, without the parentheses, 
Message Not Understood: Array>>bounds:corner: in the debugger or 
 or 
Unknown selector  When bounds:corner: is selected in the Unknown Selector list of possible matches, it then provides bounds:corner:  MessageNot Understood by class SmallInt

No LightsOut! window appears on-screen

Correction.  

It does appear in Pharo 1.4 #14457

(Other than inspecting up the parent object hierarchy, nothing different was done) 

This does not work in either the download recommended for use with PBE (1.0 ~ #10515) or with Pharo 1.4 #14457.

b) We are told to add a class comment for the new class in the new package in the pane below the code-editing pane.

There is no pane below the code-editor.

What you need to do is click on the button labelled '?' below the Class listing pane, and that swaps editor pane to work on the Class comment.

c) 
Meta-click does not work on 3 button mouse on Windows 7

Shift-Alt-Left-click is the default workaround.

So you cannot bring up the Morphic halo for the LOCell instance
There is no Preferences Browser in Pharo 1.4 #14457

d) Method 2.9

is mouseAction and should be mouseAction: ?  i.e. should be a setter, not a getter.

e) Filing out is to the Contents | Resources folder of the Pharo install