bsmall2 Learning Racket

Racket

Two articles ( -1 -2) about Corona Virus taught be about Infection Reproduction Numbers and Case Fatality Rates. But the graphic for one reminded me of Edward Tufte's Visual Explanations and its criticism of “pop journalism.” ( -3) The offending graphic ( -4) made me think of Howard Wainer's advice about ordering data also. Racket's sort lets us implement the advice with one-line of code.

Plain Plot for Seven Disease Reproduction Numbers

The reproduction numbers for these seven diseases are simple enough to provide good visualization practice. This might be a good case study to ease into Racket Plot coding and Data Visualization.

DrRacket Screenshot The code is below.

もっと読む…

Inspired by a Diaspora* post about simple gui programming in Red , I played with gui programming in Racket. Just a few tweaks to the example in Racket's Windowing documentation(fn:2) and a button in a frame shows an insult. Gui programming seemed too complex too learn, but the Red example got me over the off-putting idea. For some tasks, gui-programming might be simpler and shorter than generating html pages.

Racket Gui: Shakespearean Insults

The code and .csv data are below

もっと読む…

It was a good exercise to make slides that show Japanese characters going from top to bottom and the lines going from right to left.

TomiMatsu YoshiO YamaNiYosete slide

都城の詩人、 富松良夫は「南九州の宮沢賢治」と呼ばれているようです。興味深い人です。

The motivation for the exercise came from last week's opportunity to see a talk about a local poet. Paul Goodman wrote somewhere about the importance of “incidental poetry.” His example was the dedication of a local monument or park. The comment about incidental poetry came to mind again when the speaker said that the local poet Tomimatu Yoshia wrote the local school's song. The writers Ueno Hidenobu and Kawahara Kazuyuki are known for singing a school song by Miyazawa Kenji.

TomiMatsu YoshiO AkiToKirishima slide

Unless I get a chance to read Practical Typography (by the writer who also did Beautiful Racket)the troubles with punctuation will make me display these poems with html and css3. But in the meantime this code works for the contemplation of simple Japanese poems on a screen.

I had to write an extra utility, character->string and then kept acclimating myself to naming conventions with string-separate. It was while working on these poems that I saw the similarities among the empty list '() and (blank 0) along with cons and vc-append . There never seems to be a need for iteration loops once you get used to recursive procedures, aux or helper functions, and accumulator or keep expressions. Maybe I can use this approach as part of a Ogden's Basic English-style approach to a Basic Scheme (or Basic Racket) that gives humanities students the most widely useful expressions for programming tasks on computers.

Read more...

Last week's talk about a local poet reminded me of I.A. Richards. I read that he used to put a poem on a slide up before large groups of people. William Empson may have written a poem about the slides.

Yeats King and No King slide

I like the simple slides, maybe I'll use them to contemplate poetry while staring at a screen. On the other hand commercial presentation software ( PP ) seems too flashy.

Yeats The Witch Slide

The loud colors distract from contemplation on the poem. If putting poems up on a screen can be constructive, a simple way to see simple slides may be useful.

Using DrRacket to show poems in the tradition of I.A. Richards seems appropriate. As learners of poetry and programming we want grounds to approach an “overwhelming sense of correctness” (fn:1) ... to reach a judgment that we can have confidence with.

Read more...

アンケートのデータ表を視覚化した。 データ表の視覚化の図グラフ

Read more...

Getting information from a table is like extracting sunlight from a cucumber. (Farquhar & Farquhar, 1891) (fn:3)

Working with data from Minamata Disease materials seems like a worthy way to learn Racket and Data Visualization. I see graphs of chemical production from the factory that I would like to merge with the fishery depletion data. The units are Kan貫: 3.75kg or 8.6lb. If there is a need, I'll have to translate the fish names and units for an English version.

原田正純水俣病p.11 魚類別漁獲高調査表2

Hopefully the “Reproducible Research” approach will become common practice everywhere. It would be nice to have tables of data for every visualization we see, it seems like a responsible approach.

It takes a certain sort of focus and patience to create a visualization, but I think the work makes the data tables more meaningful. It's hard to keep your attention on this sort of reading. Maybe visualizations could help. Now I have to print these visualizations out and write essays for them. If the plots help create decent, useful writing they will have served a purpose.

books and laptop for data visualization

As always the code and data are below, Reproducible Research!!

Read more...

Getting information from a table is like extracting sunlight from a cucumber. (Farquhar & Farquhar, 1891) (fn:3)

Slum Populations with percent of Urban Population table

With repetition I'll be able to abstract and simplify the code to produce an alternative for histograms(bar-charts). With that in mind, I re-visited some data from Mike Davis's Planet of Slums to make this Percent-Scale-Labeled-Line plot of data.

Racket Plot of Mike Davis's Slum Table

The countries are ordered by millions of residents in slums, but the lines show what percentage of the urban population is taken up by those millions. The USA has a million more people in slums than Egypt, but twelve point eight million people is smaller percentage of its urban population. Later it might be interestingto compare my too-complex gnuplot code with my getting-simpler Racket code for this data and visualization.

While working with the PercentScale-LineLabel code, some advice came to mind. Visualizations get better with higher ink-to-information ratios so we should avoid labels and any other “presentation bureacracy” when possible. I also felt that it was disorienting to label the percent-scaled lines with the figure for millions of people. With an Howard Wainer article (fn:3) coming to mind, it seemed better to make the visualization simpler, more table-like, but still with the aid to understanding provide by lines showing how the figure for millions relates to a particular country's total urban population. I keep the lines because of a few paragraphs from Solomon Messing's blog post(fn:4): > ... judgements about position relative to a baseline are dramatically more accurate than judgements about angles, area, or length (with no baseline).

I'm hoping the lines and position of the percentage figures will be helpful since they all share the same baseline. And I thing the figures in millions needs some sort of context for each country.

I suppose the plot above could help with the book's table. With more time I'd like to work in a line that shows the percentage of the entire world's slum population in each country. Or maybe a line that shows each country's population in proportion to the country with the greatest population. But I suppose it's easy enough to answer certain questions with this simple visualization. It's not too hard to mentally calculate that Ethiopia and Tanzania, while having a high proportion of their urban populations in slums, have less slum populations that are less than ten percent as large as China's.

Read more...

In Miyazaki last Friday, Hiroaki Koide(小出裕章) gave a speech on the dangers of nuclear power, and the responsibilities to stop it cold and clean it up. It was a thought-provoking presentation in a lot of ways. The event motivated me to work with an interesting visualization of the relations between Energy Use and Life Expectancy in Hiroaki Koide's 2010 book 「隠される原子力、 核の真実」 I have been wanting to work with it for years and finally got it started with Racket Plot over the weekend.

小出裕章 隠される原子力、 核の真実 p. 144

Read more...

宮崎県立都城農業高校の冷水機

A water fountain at Miyakonojyo Agricultural High School reminded me of a Financial Literacy lesson idea. I used to do this with emacs org-mode tables and it was fun. But now, with Beginning/Basic Education in the back of my mind, I try to do everything in DrRacket (and then use emacs to get a shell script to work).

Water Fountain Financial Literacy with DrRacket

Code

Read more...

At some point, I should use student comments to help explain teaching English with the Graded Direct Method. (fn:1) At the start of the semester more than half the students write comments at the bottom of the class worksheets. (fn:2) I print out the comments and leave them on the table where students collect the previous's classes worksheets at the start of every class. With emacs org-mode I used two windows and a keyboard shortcuts to keep a list of comments and their student's numbers in sync. Then I exported just the comments. Without consent to publicize the comments it seemed like a decent way to share the comments in class. (The few comments included in the script were edited and/or translated beyond recognition from among 58 comments.) After working with Guile and Racket over the past month or so, it seems simpler to just work with nested association lists. At least the data entry part will be simpler. I might end up re-inventing the wheel in the area of data-base-like approaches, but re-discovery will be good for my learning when/if I ever need to learn/use databases.

Nested Association Lists to Generate Pages of Class Comments.

During a rainy afternoon, I wondered how working with nested association lists would be. The exercise helped me clear up vague misunderstandings about association lists.

もっと読む…