Sunday, August 14, 2022

Cochrane Collaboration and Campbell Collaboration

I'm enjoying reading Tim Harford's book The Data Detective. (Looking at that link for it, I'm amused to see a blurb from Malcolm Gladwell on the cover; if I didn't already know Harford, I would consider this a negative endorsement.) Harford mentions two groups I'd like to keep in mind, both of which aim to do systemic reviews of the literature:
  • Cochrane: "Cochrane is for anyone interested in using high-quality information to make health decisions... We are an independent, diverse, global organization that collaborates to produce trusted synthesized evidence, make it accessible to all, and advocate for its use."
  • Campbell Collaboration: "The Campbell Collaboration is an international social science research network that produces high quality, open and policy-relevant evidence syntheses, plain language summaries and policy briefs."
What other groups are there like these, doing systematic reviews to try to produce consensus docs? (I know it's pretty common to see survey articles in journals.)

Tuesday, January 4, 2022

Factorial in Forth

I've been enjoying playing with Forth. Here's what I came up with to implement factorial:
: fact dup 2 < if drop 1 else dup 1 - recurse * then ;

3 fact . 6  ok
6 fact . 720  ok
This looks pretty similar to the example code here: http://progopedia.com/example/factorial/253/.

Tuesday, June 8, 2021

Finding years on which December 5th was a Friday in Squeak

2000 to: 2021 do: [ :year |
  date := Date year: year month: 12 day: 5.
  date weekday == #Friday ifTrue:
    [Transcript print: year; cr; flush.]
]
Answer:
2003
2008
2014

Wednesday, May 19, 2021

Playing with Racket: random lines GIF

I'm enjoying playing with Racket. Takes me back to some good old college days writing Scheme, but I don't think creating a GIF was so easy in any of the Scheme systems we were using then. (Which ecosystem -- language + standard libraries -- provides the nicest environment for making animated GIFs?)
#lang racket

(require mrlib/gif)
(require racket/draw)

(define (random-lines-bitmap width height line-count)
  (let* ([target (make-bitmap width height)]
         [dc (new bitmap-dc% [bitmap target])])
    (begin
      (send dc draw-rectangle
       0 0   ; Top-left at (0, 10), 10 pixels down from top-left
       (- width 1) (- height 1))
      (for ([i line-count])
        (send dc draw-line
              (random width) (random height)
              (random width) (random height)))
      target)))

(define (write-random-lines-gif width height line-count frame-count filename)
  (write-animated-gif
   (for/list ([i frame-count])
     (random-lines-bitmap width height line-count))
   10
   filename
   #:loop? true))

(write-random-lines-gif 300 200 50 10 "random-lines.gif")

"Why Concatenative Programming Matters"

I enjoyed reading Why Concatenative Programming Matters. I'd like to do more with Factor sometime. Is it still under active development? I see that new binaries are still getting generated for it anyway.
"https://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html" >url http-get* length
...
261104
(This seems to work. Am I leaving extra stuff on the stack?)

Sunday, May 16, 2021

Clojure!

https://clojure.org/guides/getting_started emphasizes Homebrew, but MacPorts has it too. I also had to install OpenJDK too. I think for me, the minimal set of commands could have looked like:
sudo port install clojure +rlwrap
sudo port install openjdk11
clj
user=> (+ 1 1)
2
Woohoo!

Friday, April 30, 2021

Notes on "Mythical Man-Month": "Why did the tower of Babel fall?"

Brooks uses the metaphor of the tower of Babel to again emphasize the importance of but difficulties with communication. Several times he (again) brings up problems with potential superlinear complexity owing to to the number of pairs or other groupings of workers.

"How, then, shall teams communicate with one another? In as many ways as possible: Informally... Meetings... Workbook..."

He goes into some detail talking about the workbook and processing surrounding it. It seems that online documentation has solved a lot of his problems though introducing new ones. He talks about the introduction of microfiche to avoid printing out an unwieldy number of pages, but notes the lack of ability to add notes as an important limitation. We have that problem too with online docs -- no margins to write in as an individual reader. Also, support for showing diffs in documentation is pretty uneven.

"If there are n workers on a project, there are (n^2 - n)/2 interfaces across which there may be communication, and there are potentially almost 2^n teams within which coordination must occur. The purpose of organization is to reduce the amount of communication and coordination necessary... The means by which communication is obviated are division of labor and specialization of function."

A tree structure arises because no one should have two bosses. Brooks also notes even if the reporting change forms a tree, plenty of communication outside this is necessary, forming a network.

Necessaries for any subtree:
  1. a mission
  2. a producer
  3. a technical director or architect
  4. a schedule
  5. a division of labor
  6. interface definitions among the parts

What Brooks calls "producer" sounds very much just like "manager" or "technical lead manager" to me while "technical director" seems to map very closely to what I think I know of as "tech lead". (In the group I'm reading this with, we had noted some of the roles he described seemed a bit unfamiliar, but here even if the names are different, the roles seem pretty close to what we have today.)

He talks about three possible arrangements between producer and director: same person, director reports to producer, or producer reports to director. He illustrates the 3rd arrangement, which I don't believe I've seen in real life, with a quote from Heinlein's "The Moon is a Harsh Mistress" where the top engineer is happy to be freed from management work.