Tuesday, July 18, 2017

Rocky Horror Picture Show (movie review)

I've seen very little mention of the geodesic dome, featured as a part of the spooky castle above.  Much could be made of this link to another counter-cultural icon, from a domain of sexual mores breaking out of their bounding box, thanks to ETs.

The point was to visit Clinton Street Theater where teens, mas o meno, have been doing the audience participatory version of this cult film for some twenty odd years, starting midnight on Saturdays.  The torch gets passed, one generation to the next.

Getting picked as a cast member means knowing the right people, in addition to exhibiting some talent to entertain. Participating in a RHPS is something of a rite of passage.

I went with a professor of gender studies and international development who'd never seen the film, turned off by the word "horror", a genre she doesn't enjoy.  The raucousness of the audience overwhelmed the soundtrack and she came away with a garbled version of the plot, but that's easily rectifiable with later study.

I like pointing out that Tim Curry has a later role in the movie Kinsey, where I plays an ironically prudish professor. One of the best ways to study a culture is by delving in to its sex ed, but then don't make the mistake of thinking education == academia.  All media have an educational role.

My first induction into this cult came way back in my Princeton years, in the late 1970s, much closer to the time when this film, originally a stage play in England, where that castle is, first came out.

Audience Participation

Tuesday, July 04, 2017

Coursera Homework

The on-line course I'm taking asked us to build a circuit of two push button switches, both of which need to be pressed for the LED to come on. The Arduino motherboard is used only to power the breadboard, very not fancy.

Note that a yellow LED on the motherboard itself, distinct from the always-on power light (green), is flashing intermittently. This would have to do with some earlier-loaded blinking light program, unrelated to the current project. The Arduino does retain the last loaded program, even when powered down.

Saturday, July 01, 2017

Retro Coding

:: talks about CGI in the client / server context ::

Retro Coding is where one deliberately dials back to an earlier point in time and uses tools at that time considered cutting edge, but since abandoned.

A case in point:  "Common Gateway Interface" or "CGI" programming. "Computer-generated Imagery" is the more common decoding; a name collision (just get clear on the namespace, for less cognitive dissonance).

In Python, we import the cgi module primarily for access to FieldStorage, an object that plays the role of sys.argv in some ways, the latter being a list object intermediary between "__main__" (the running namespace) and the shell command used to start a script.

For example: 

$ ./get_chem.py Au 

passes Au as a string string element to the running get_chem.py, which finds it in sys.argv[1].  'get_chem.py' itself, the name of the running script, is what's in sys.argv[0].
Here's an example lookup operating, running the above lookup about gold ("Au"):

Server and Client 

That's Python's standard library CGI server in the background, plain vanilla.  The going rate is not included. This pared down database lists he abbreviation and longer name, number of protons, and atomic mass.  The long integer and KTU track when a user last touched the record, me in this case.

>>> num
>>> datetime.datetime.fromtimestamp(num)
datetime.datetime(2017, 4, 29, 3, 39, 52)

The invocation in the foreground triggers a little script to send an HTTP request to said server, with a chemical element symbol (e.g. Au for Gold), which, if all goes well, returns a JSON string which the little script converts, to a list. Print to console. We're done:

looking up an element through localhost

Taking a look at that script, we see the Python DBI in action. That could have been Oracle we were talking to, like in the good old days (mythological allusion).

Serving Data

I've changed the shebang line to /usr/bin/env python, which is fine if you're running Python3 or greater, and shared the two scripts via Github, for educational use.  Thanks to WorkingIt!

The database table, periodic_table.db, is likewise available.  I'm continuing to evolve this little project, adding AJAX to the mix.