Monday, June 13, 2011

GemKit for VisualWorks 7.8

Well, I've received permission to make the following announcement.  I'll be working with Cincom to upgrade GemKit to VisualWorks 7.8.  Here's the current status:

    1) We have confirmation of the work request.  Work should begin sometime in July.
    2) We have permission to fully disclose and share all work and all progress we make with the Smalltalk community.
    3) I will document all steps, progress, issues, problems and successes here on my blog:
       http://simberon.blogspot.com
    4) I will publish major versions to the Cincom public Store repository
    5) I will setup another public Store repository from Simberon for holding intermediate versions which aren't yet ready for public use but may be of interest to others
    6) I will coordinate with anyone involved to merge their changes into my versions and publish them
    7) I've setup a mailing list at gemkit@simberon.com.  Send an e-mail to me at david@simberon.com to add or remove your name from the mailing list.


If you have any questions or comments, feel free to e-mail them to me.

Fluid Positioning

I'm working on a feature for VisualWorks called Fluid Positioning.  The idea is to simplify the layout of user interfaces in the UI Painter by making the layout automatically fill in the Position tab information in a natural way.

The following video shows what I have working so far.  The video below is a bit blurry.  A better version can be found on the Simberon Web Site.  The demo shows a lot of flickering of the user interface.  This is because I've disabled some optimizations at this stage to allow me to see exactly what's going on at all times.  When I re-enable the optimizations, most of the flicker should disappear.

Friday, March 18, 2011

Yesterday, I parked my van in the parking lot and went to work as usual.  When I returned at the end of the day, I found this:


I was more confused than anything - how could anyone park that close? Neither of us would be able to open our driver's side doors at all.  The driver of the other vehicle had to get out on the passenger side.  But it makes no sense - how could you get the two vehicles this close without scraping up each of them?  There were no scrape marks at all.

A few minutes later, the owner of the other vehicle arrived.  He was just as baffled. He claimed that he parked properly, left by the driver's side door, and went to work.

As it turns out, that morning there was a small layer of ice in the parking lot.  Through the day, the temperature rose, the ice melted and the car slid sideways slightly downhill into my van.  We called a tow truck to pull my van sideways to the right.  After that, I could back straight up.  There was no damage at all.


If there was damage, however, it would have been a confusing call to the insurance company.  "You see, both cars were turned off and in park at the time of the collision.  Neither driver was present.  The colliding car moved sideways toward the driver's side door."  It would have been a fun conversation.

Monday, February 21, 2011

OCSTUG meeting Feb 24, 2011

Ottawa Carleton Smalltalk Users Group:

The Great Apple Experiment Software
David Buck A few weeks ago, our local Scout troop did an experiment to earn their science badges. David wrote some software in Smalltalk to organize the experiment and calculate the results? How do you capture over 2000 numbers collected from 20 scouts and calculate results within an hour? Come and find out.


Location: The Code Factory
246 Queen Street, Ottawa
Thursday, February 24th, 2011 at 6:00pm

Thursday, February 3, 2011

Great Apple Experiment results

Well, the Great Apple Experiment by my son's scout troop is finished.  We had all the scouts rank their own apples then rank all of the other apples on a scale from 1 (best looking) to 9 (worst looking).  Excluding the scout's ranking of their own apples, I averaged the ratings for each type of apple and got the following results:

  • Love
    • Mean: 4.23
    • Standard Deviation: 2.43
    • Mean rating of scout's own apples: 3.31
  • Hate
    • Mean: 4.54
    • Standard Deviation: 2.34
    • Mean rating of scout's own apples: 3.5
  •  Neutral
    • Mean: 4.82
    • Standard Deviation: 2.41
    • Mean rating of scout's own apples: 4.9
  •  Control
    • Mean: 4.18
    • Standard Deviation: 2.41
    • Mean rating of scout's own apples: 3.8
  • Lemon
    • Mean: 3.48
    • Standard Deviation: 2.57
    • Mean rating of scout's own apples: 3.38
  • Open Air
    • Mean: 7.50
    • Standard Deviation: 2.11
    • Mean rating of scout's own apples: 7.75
The following graph shows the number of each of the rankings from 1 to 9 for each type of apple.



The  Lemon line clearly shows a benefit with 62 apple slices being ranked as 1.  The open air apples were the worst with 109 being ranked as 9.  The remaining apples seemed to follow a very similar distribution.

The results don't demonstrate any positive effect of saying nice things to apples or any negative effect of saying bad things to apples.  We're left with the null hypothesis that saying things to apples is ineffective.

Thanks to all the scouts who participated and congratulations on earning your science badges.

Sunday, January 30, 2011

The Great Apple Software

I bet you guessed that there was a software aspect to my last post on the Great Apple Experiment.  You were right.

First, there's the fairly easy job of randomly assigning numbered jars to Scouts and marking them for their purpose:  Love, Hate, etc.  This was a fairly straightforward job of maintaining a collection of jars and a collection of spots (22 Scouts x 6 jars per Scout = 132 spots).  Then I just use a pseudo-random number generator to pick a random jar and assign it to a random spot until all the jars are gone.

The harder part is collecting the results from the experiment.  My goal is to have all 22 Scouts rank all 132 apple slices and to crunch the numbers before the end of the meeting.  Entering the 2904 numbers by hand will be a serious challenge within the one-hour limit I have.  So, I decided to speed up the process.  I can bring a scanner to the meeting and scan the score cards to produce black and white bitmap images.  The only problem now is capturing the results from the bitmaps.

OCR technology would be rather hard to use - especially when the Scouts will be writing the results by hand with pencils. I decided to go with a "fill in the dots" approach.  Now the problem is that the scanner isn't perfect and the page can be rotated by several degrees.  I can't just look at an x/y point on the page and expect the circle to be there.

Here's a scanned score card:

And here's a magnified version of the top left part of the card with red marks added by my software:

The circles are arranged in 4 columns of 33 rows of circles. At the top of the page, I include a circle at the top left and top right of the page for registration marks.

I was able to locate the registration marks and find their centers. Based on this information, I knew the orientation of the page compared to a carefully-scanned sample. I was able compute the centers of the circles on the sample sheet and stored that information in the program.  Then, with the scanned image, I take each point (the centers of the circles shown as red dots in the image above), transform them according to the registration marks, draw a 21x21 square around them (shown as red squares), and capture the bits (1 or 0) in each square.  Any square that had more than 200 black bits (0's) was counted as ON.

This actually worked (wow) and I was able to get reliable results. The result is an array of 132 numbers from 1 to 9 or 0 if no circle was filled in.  This is exactly the information I need to run the stats.

You'll notice that I print a series of bars at the top of the page.  My thought was that I'd scan the Scout's number by scanning it and collecting which bars were long and which were short.  I'd always start and end with a long bar then within the code, short bars are 0 and long are 1 making a binary number representing the Scout's number.  I decided in the end not to use it because it doesn't take long for me to manually enter the Scout number and it allows me to print generic score cards instead of ones specific to each Scout. I expect that some of the Scouts will mess up the score cards and will need to re-do them.  It's a whole lot easier if I can just give them a generic sheet.

Part 2 of the experiment is on Tuesday.  I'll let you know how it goes.

Saturday, January 22, 2011

The Great Apple Experiment

My son's Scout troop has taken me up on my offer to help them get their science badges. To do this, we're going to run the Great Apple Experiment with the whole troop.  Basically, Nikki Owen made a claim that cutting an apple in half and talking nicely to one half and meanly to the other half makes the nice one rot more slowly than the bad one.  Rebecca Watson ran an experiment on this claim and invited everyone to write their results on a Facebook page.

We have 22 Scouts in the troop and I'm going to get them all to run the apple experiment.  We'll start by discussing bias, blinding and controls. We'll then cut up the apples, place them into marked containers, and have the scouts talk to them every day until the following week's meeting.  We'll then have all the Scouts assess all of the apple slices and collect the results.

I don't have much time to develop and get feedback on the protocol for the experiment, so I thought I'd post it here and get feedback.

Protocol (thanks to PZ Myers for his suggestions):
  • Discard any apples that are obviously bruised or nicked
  • Wash the apples and slicer before beginning
  • Slice apples into 8 pieces (Rebecca suggests 2 pieces but I don't have a budget for that many apples considering the other things I want to do)
  • Apple slices are placed into clear containers which are marked by unique numbers
  • Each Scout gets 6 apple slices (Love, Hate, Neutral, Untouched Control, Known Preservative, Open Air) chosen at random from the available containers
  • For Known Preservative, we'll coat the apple slices with lemon juice
  • For Open Air the slice will be kept in a container with no lid.  We will use paper towel on top held on by an elastic band to prevent any insects from entering.
  • Each container will have a window into which we'll slide a label saying "Love", "Hate" etc.  This is to help prevent mistakes while the Scouts have the apples home during the week.
  • The container numbers are recorded indicating which number goes to which Scout and what the label on that container reads (Love, Hate, etc).
  • Each container will be sealed with a lid that won't be removed for the remainder of the experiment
  • The Scouts take the containers home.
  • Each day, they will take the Love container to another room, say nice things to it and return it.
  • They then take the Hate container to another room, say bad things to it and return it
  • They then take the Neutral container to another room, say neutral things to it and return it.
  • All other containers remain untouched for the week
  • At the end of the week, the Scouts will bring the containers to the meeting
  • Each Scout will rate his own 6 slices (knowing which is which) on a scale from 0 (not rotted at all) to 10 (very rotten). We'll provide photos of each level for reference.
  • Each Scout will then remove the labels Love, Hate etc. leaving only the numbers on the containers and place them in a line on a table
  • A Scout leader will re-arrange all containers randomly
  • Each Scout will rank each apple (skipping their own which they've already ranked)
  • Scouts cannot show their rankings to other Scouts or discuss the experiment with other Scouts until the experiment is complete.
After the results are collected, we will analyze the results:
  • Each slice will be grouped by category - Love, Hate, Neutral, etc excluding the Scout's assessment of his/her own slices.
  • In each category, the ratings will be averaged and standard deviation calculated
  • Each Scout's assessment of his or her own slices will be compared to the averages to determine if the Scouts exhibited bias in assessing their own slices without blinding
  • All results will be published on the Internet with photos and videos
PZ Myers suggested that the Scouts may try to write up their results for an article in Skeptic Magazine which we'll look at for a follow-up meeting.

If you have any comments or suggestions on this protocol, please e-mail me at david@simberon.com or post them as comments to this post.

Thanks