Updates

Scratch to Smalltalk

The journalist Virginia Heffernan wrote a wired article titled Stemtrails:

The contemporary STEM curricula in lower schools seem, in fact, to have very little as a through line, unless you count the popular Scratch app, a production of the Siegel Family Endowment, which is heavily subsidized by Google and the Cartoon Network. The app lets kids learn loops and if-then blocks in a kind of baby programming language that no adult uses. It’s fun.

When reading the phrase "real languages", my first reaction was: We don't send kids down into salt mines either. If kids are using the same languages that are used in production today, should it surprise anyone that they don't have any new ideas?

For several years, I have been using Pier for years, but the Pillar project never seemed like anything more than an academic tool - it specializes in generating Latex for publishing in journals. After thinking on Virginia's quote I realized I had fallen into the same trap and ignored Pillar documentation. One benefit that I immediately gained after opening it was that I could use annotations instead of HTML for creating the above quote.

Several years ago, I wrote about principles learned using the EToy's Painting Tool, however there could be more done to move Scratchers to Smalltalk programmers where more principles could be discovered.

Posted by John Borden at 24 February 2020, 2:11 pm link

iPhone Hung on Apple Logo

After applying the 13.2 upgrade, I was dealing with a space issue when I restarted my phone, and it only displayed the Apple logo. I was still able to connect through my watch, but the phone screen was unresponsive.

Resolving it by restoring from a backup required the forth solution from this site:

  1. When your device is connected to the computer, open iTunes on your computer.
  2. Then on your iOS device, quick-press and release the Volume Up button.
  3. Now, quick-press and release the Volume Up button. 
  4. Finally, press and hold the Power button until the Recovery Mode screen (Connect to iTunes screen) appears.

It took several attempts to find the right timing, and a careful eye to see the latest backup, but it worked in the end.

Posted by John Borden at 3 February 2020, 3:47 pm with tags Apple, iPhone link

Pharo Starter Scripts

The https://github.com/jborden23/PharoStarterScripts repository contains several scripts used with Pharo, while I still use Pharo Launcher, there are some reasons not to:

  • It writes to ~/Documents, on my Mac this is takes iCloud storage
  • I've had problems starting it on Fedora, it doesn't seem reasonable for a Raspberry Pi

There are several projects similar to this:

The goal is to eventually improve the scripts used on https://pharo.org/download.

Posted by John Borden at 18 January 2020, 2:17 am with tags Pharo link

Committing Pier-Seaside in Iceberg

Working on the code for Pier Table of Contents, found that it can be resolved by defining:

PRTocRenderer>>start: anObject in: aComponent on: aRenderer
	self component: aComponent.
	self renderer: aRenderer.
	self start: aComponent owner

This is the same as version it its grandparent PRRenderer, except the start is sent anObject (aCompoent is the value:toc link). This code is loaded on this wiki (which is why the table-of-contents is displayed correctly from the main blog.

Committing the code to GitHub hasn't been as easy as expected. Steps taken:

  1. Using Pharo 7 and installing Pier (like Loading Pier 3.2 into Pharo 7), but using the NewDev branch instead of master:
    Working copy of Pier3
  2. Modify the code and use the git username as the author (not certain if this is required).
    Browser for adding method, Author identification
  3. From Iceberg, the Pier3 repository is green, indicating that it has changed. Open the packages to verify that pier-seaside is modified. Choose the option to commit the change.
    Commit on Pier3 branch NewDev
    It is also possible to commit in one step and push in a second, but that doesn't change the results of this.
  4. After clicking Commit, a status bar shows that it is committing and then pushing; however the comment is cleared out and it returns to the same screen:
    A comment for your commit.
    Reloading the code does not show that it was modified.
Found that renaming the package pier-seaside to Pier-Seaside resolved the problem, but it required adding another code change (like a class comment) to make it write-able from Iceberg.

Posted by John Borden at 2 January 2020, 3:39 am with tags Pier link

Pier Table of Contents

Pier Table of Contents Contents:


Problem Description

Pages in Pier can have a table-of-contents based on the header items (such as Problem Description on this page). Another TOC is at the top of this page.

As pages get larger, it makes sense to break them up into both separate pages as well as sections with their own heading. Unfortunately the TOC widget doesn't always work for the page that it calls home.

Large Page Example

Consider the following large page:

*value:toc*
!Problem Description
Text
!!Sub Problem
Text describing what else is wrong.
!!Another Related Problem
Text and links to different problems
!Failed Solution 1
What didn't work
!Failed Solution 2
What else didn't work
!Working Solution
The quick answer.

If Problem Description needs to be broken into another page with the sub-problems, it would be useful to have a way to step into the sub-problems in the table-of-contents.

Existing Behavior

Unfortunately when a page is broken up, a TOC on a sub-page when embedded in the larger page does not display the TOC for the sub-page. If the large page example above is broken up as:

*value:toc*
!Problem Description
*Problem Description|embedded=true*
!Failed solution 1
What didn't work
!Failed Solution 2
What else didn't work
!Working Solution
The quick answer.

With the page Problem Description having:

*value:toc*
Text
!Sub Problem
Text describing what else is wrong.
!Another Related Problem
Text and links to different problems

Then the page will be displayed as:

  • 1 Problem Description
  • 2 Failed Solution 1
  • 3 Failed Solution 2
  • 4 Working Solution

Problem Description

  • 1 Problem Description
  • 2 Failed Solution 1
  • 3 Failed Solution 2
  • 4 Working Solution

Text

Sub Problem

Text describing what else is wrong.

Another Related Problem

Text and links to different problems

Failed Solution 1

What didn't work

Failed Solution 2

What else didn't work

Working Solution

The quick answer.

The problem is that the TOC is listed twice because the PRTocRenderer runs over the main page twice.

Failed Attempt

A first attempt was to update the renderer to always assign visitors to start on their owner. This caused a walkback on displaying a simple page.

Another Solution

Another attempt was to add PRTocRenderer>>start:in:on: so it starts on the in: argument's owner and ignores the original start argument. So far the test pass and pages are displayed correctly.

Posted by John Borden at 24 December 2019, 4:52 pm with tags Pier link
<< 1 2 3 4 5 6 7 8 9 10 >>