bs2facdev

Scheme

This code was broken for a while, the .png-generation portion is still too repetitive. The code takes questionnaire results and provides a faceted (R ggplot2-like) view with an .html page that list questions with a visualization of their results for the individual, the individual's department(faculty), and the department's(faculty's) university.

Faceted-like view in Browser

Experience with Racket's path utilities over the past weeks (and today's discovery that regexp-replace works with paths!) helped to clean up the part that filters plot images.

Filtering plot images is better with paths

Other work demands attention and time, but it's awful to leave code in a broken state.

Example of a  generated .png file

code

Read more...

D.R.Y. for Teachers

If it wasn't for SJIS (or some sort of MS Windows Encoding Page) troubles, this script would probably be useful and reliable. I'm fudging the possible encoding issues by, using “key” and “value” as backups when assoc doesn't find what it should in an associative list (alist, als). Playing with Scheme/Racket gives you the confidence to deal with any problem, if some detail isn't working, just throw in an if or cond statement, and maybe the results will help you figure out where the trouble is. DrRacket is great for showing where errors are, it even produces bright red lines that trace the errors for you...

There is a pattern, where I develop the script to generate useful pages to process one data file and then adapt it to handle several files in a directory. After the script seems to work for one data file, I get all the define definitions used to transform data (not those used to make functions) from the original file, and put those definitions into a let* expression (or clause) within a procedure that is used with for-each to go through a list of data files. Some definitions remain global, but all the definitions that rely on the data file go into a let* clause.

This code is re-working of earlier code (fn:1) that, from one .csv data file generated three files: a racket data file, a browser page to print roll sheets, and a browser page to print a seating chart. To get code that will generate three useful files (a rkt data file, a roll sheet, and a seating chart) for each .csv data file in a directory, I just had to see what belongs in a let* clause of the function that is mapped (with for-each for the side-effects and the list-generation) over a list of file paths.

A typo(bug) that disturbed my flow made me appreciate first and second in place of car and cadr. I had build-path errors that confused me for a while. when I moved the define cls-als (class associative list: alist: als) into the let* clause, I forgot the a in cadr. In place of a one-key one-value associative list, I ended up with, not a string, but a long list as the value. Without the string, I could build paths for file-generation. I imagine using first and second could make it easier to spot a mistake like that. But cddr is probably still useful instead of (rest (rest ....

There is another bug, where the first seat is taken up by the keys for associative list, or what could be viewed as column headers in a table of data. If there is time I'll see where in the chart-generation process to intervene, and get rid of the header intrusion. But the bug could be a feature, it can be nice to have an open table at the front of the room for returning papers, for set-up. With the Graded Direct Method teachers haul a lot of “realia” into the classroom, and tend to need tables and seats for demonstrations...

code

Read more...

It might be easier to share Dont' Repeat Yourself (D.R.Y. or OnceAndOnlyOnce) techniques if I get the Guile Scheme scripts(fn:1) to work in DrRacket(fn:2). If Convention Over Configuration principles can direct teachers toward a directory in their home-directory, and toward keeping their .csv data in particular folders, and to look for useful pages in particular folders… Given all that, a script like this could be useful for other people too.

Screenshot of Generated Pages: Roll Sheet and Seating Chart in Firefox Windowshttps://snap.as/bsmall2/racket-facdev/Binke65

I got a Guile script go through a directory of .csv data files (encoded in SJIS) and produce three useful files (encoded in UTF-8) for each data file. The next step is to get DrRacket to do the process below for several .csv files. And then another script should make it possible to use an edited ~-roll-data.rkt file to produce another seating chart. Sometimes the class needs a different ordering of seats: for example, people with hearing trouble might do better at the front of the class. And some class-rooms demand a wider row, in stead of a six-person row, a large class might need a ten-person row. But for now, this code, with build-path is probably more portable than my first attempt in Guile Scheme. (fn:1)

And comparing this Racket Script with the Guile Script is a chance to see differences among regexp-replace\* and regexp-substitute/global, scribble\html\html with its output-xml and sxml simple with its sxml->xml. I enjoyed the oppornity to practice quasiquote while learning to work with sxml->xml, but for the pages I generate here scribble\html and output-xml seems simpler. My regular expression needs are met by the simpler regexp-replace\* , but with more complex processes the pre andpost approach for regexpt![img](images/SJIS-csv-to-RollSheet-SeatingChart-1.png) -substitute/global might be helpful.

A Screenshot of DrRacket with the code used to generate  Roll Sheet and Seating Chart pages https://snap.as/bsmall2/racket-facdev/SNzGnvo

code

Read more...

The code needs editing, but I like this view of questionnaire data where “factor” responses of 1 and 2 are negative, 3 is seemingly neutral, and 4 and 5 are positive. It seems possible to see things with this view that might not be possible with an average/mean of the responses.

Synoptic View of Positive and Negative Responses for a Questionnaire

The visualization needs to be on a page with the full text for the questions, the symbols for the numbered responses, the tables for the data, and an attempt to explain the visualization.

Screenshot of the page output by the code below, includes the image above

Read more...

While using questionnaire data to learn plotting, questions come to mind. Averages don't make sense for “ranked” “factors”, for numbered responses to questions about how much a person agrees or disagrees with a question. Maybe seeing the percentage and number of positive responses versus negative responses will help in the search for meaning in the data.

Top of Browser page showing first two question-result sections

With Racket it is possible to transform and view the data however you like. It's nice to be able to implement a view out of curiosity. I'm hoping the stacked lines with their labels provide enough hints for people to figure out that they are combinations of responses of 4 and 5 in a positive direction, and 1 and 2 in a negative direction.

Negative responses were most frequent for the question about student speaking, questioning in class

If there is time to go over the code again there must be less repetitive way to stack negative lines after stacking positive lines. Getting started on that gave me a change to use Racket's define to give the pnt-w-lbl procedure an optional argument.

Years ago with gnuplot I plotted “enthused”熱意 results against “satisified”満足 responses. Naomi Klein quoted a Harpers article by a professor that said he refused to be “cool” like a Marshall McLuhan screen.

For now though, I just want to see how Racket can replace two pages oddly scaled visualizations and averages. It's time to move into other work, after adjusting the css styles so that the generated page fits onto two A4 papers.

Here's proof that the code pasted in below worked in DrRacket:

DrRacket Screenshot

Read more...

Developing faculties for designing programs and visualization with Faculty Development Questionnaires. In the spirit of “Nothing about us without us”, ideally, students would design the questionnaires. We would view the data with Racket's help, and get started thinking about what sort of classes, what sort of universities, we need.

Racket plots viewed on output page in Firefox

It was good to get that feeling that capacities/abilities/powers were growing while doing this. Racket's documentation, DrRacket, and Emacs are great for self-directed exploratory learning. With enough time to become the equivalent of a “native speaker” in Racket, developing a Graded Direct Method for learning the language could be one way of developing “effectively capable people”(I.A. Richards).

Read more...

This sort of visualization may let me replace bar charts. The panel or facet approach to interleaved discrete histograms might be good for on-screen browsing, but this sort of plot might be easier on the printer and ink supply.

Discussion in Diaspora* post comments provides motivation to explore more code and presentation. (fn:1~

Now I have to see about getting these separate images aligned into one eye-span for analytical viewing.

code

Read more...

I was feeling overwhelmed while try to label the bars in interleaved, discrete histogram plots of percentages. So I went back to the basics: lines and points. There is probably a straightforward way to montage a series of plots together, but I haven't found it yet. Maybe series of this sort of plot panel for different results can be helpful if grouped and aligned on an .html page and seen in a browser.

Racket Plot, lines for percents, labels for counts

code

Read more...

DrRacket is great for checking code developed with Emacs geiser-mode. After pasting the text from and Emacs buffer and clicking the “Run” button, DrRacket reminds me of all the definitions from previous scripts and REPL experiments that never made it into the file.

DrRacket Code and Plots for Interleaved Discrete-Histograms

This code is still clumsy, the process isn't clear enough in my mind for elegant solutions. But working through the process is great for learning. This may be a way to re-discover the faceting that R/ggplot2 makes possible. I think this is the best way to get a feel for how an individual teachers results are situated in relation to the groups: the individual's department and school.

Read more...

Racket plot and scribble/html with stacked-histograms and output-xml are working well. It was fun to play with plot keywords and think about printing the data visualizations, but for quick comparisons in the browser the defaults seem better.

I imagine DrRacket will make the code below work with a Windows computer too. How would Windows users be able to find their home directory, Racket's (current-directory) and get their bowser to show “/FD201801/FD-Anketo-Results.html”... The file-separator slashes are probably different too. But that sort of detail can be overcome when a Windows user shows an interest in testing the code and visualization...

Screenshot of DrRacket with code and plotted images on generated page in browser window

It was good training to work with associative lists, to use two a-lists to generate a new a-list. Using a-lists allows for the generation of useful titles and file names that match the data used for the visualization.

Read more...