Friday, October 28, 2016

Ethnic Schools

DSCF0207

Here's another science fiction story I likely won't have time to flesh out.  Instead of Gulen charter schools, which are under attack these days, the Gurdjieff lineage has flourished and USers find themselves surrounded by a Fourth Way "cult" or "covert network" as we say today, with its own charter schools.  People who read the Bible and like that.  The volumes I'm reading are intensely Gospel-oriented.

These charters would have self-discipline classes wherein students learned not to identify with their most negative moods, thinking every mood (or mode) was them.  Don't give your "I" to just any jester that happens to come along, in that back alley we call your mind.  Be discriminating.  Pay attention to the company you keep, within the theater of your own psyche.

Parents like it, as junior ends up seeming better adapted after awhile.  Something about a "triad" of forces and their clever resolution.  Some of the teachers espouse a "fourth way" almost like a catechism.

I can hear the phone ringing off the hook already, in the principal's office.  "What nonsense are you telling my child?"  Some anti-Christian no doubt.  Anyway, of course that's not realistic as the schools would have these brochures and other literature.  You'd know what you're getting into.  Charters are like that. Yes, they have ethnicity.

The thing about traditional public schools is they sweep that they have an ethnicity under the rug, as it's those "others" who are "diverse" whereas "we" the traditional white people or whatever, are the mainstream, so of course we're not "ethnic" in any way.  They actually seem to think that, outlandish as that sounds.

Whether or not to send junior to "that Russian school" would indeed be dinner table conversation.  I'm not saying I know what our family choice would have been.  Maybe it's the dad, looking for work as a teacher.  Would he teach math at Ouspensky Academy?  He'd want to do some homework at least, right?  What would the curriculum really look like?  The devil is in the details.

The so-called "traditional" public schools have already made civics walk the plank, along with art and music most likely, and then made off with the building as something they own.  I'm not saying any charters, however well designed, have the ability to rescue these pirates from storms of their own making.  What standards did those standardized tests embody?  We have anthropologists researching that now.  Don't tell me there was no "ethnicity" in the picture, of course there was.

The worst of any imperial legacy is this blindness to one's own subjectivity, as that's the objective world in one's mind.  Remembering oneself is out of the question because "I am the world" i.e. "reality is what I think it is." Questioning authority at that root level is like questioning God or something, simply beyond the pale, not done.  A blind spot, in other words, a mile wide and probably a mile deep (we'll never know for sure).  Some individuals manage to snap out of it.  Others, many others, seem to never escape the vortex.

Thursday, October 27, 2016

VPython Inside Jupyter Notebooks

Vpython in Jupyter Notebook

Getting Vpython working inside of Jupyter Notebooks is not as difficult as I'd surmised.

Check it out on Github.  The rendering machine at Github won't invoke an actual scene.  For that, you'll need to run the notebook locally, with Vpython installed.  I'm using Python 3.5 in this instance.

I'm doing the Oregon Curriculum Network thing (OCN), coding up Vector, Edge, and Polyhedron in the stickworks tradition.  Two tetrahedrons will do.  I haven't gone on to wire the corresponding Cube.

An Edge is defined by two vectors.  The six green cylinders displayed above are edges.  Vectors also draw themselves directly and show up in cyan.

Another Angle

Wednesday, October 26, 2016

JavaScript for Pythonistas

When serving somewhat as Guido's sidekick, for a Shuttleworth Foundation pow wow, I was fortunate to meet with Alan Kay, of Smalltalk fame.

Alan had been having back problems or something that kept him bed ridden for long periods and he'd used the time to tackle JavaScript.  He was pleasantly surprised.  He had some honest admiration for the language, as he did for Python.

He'd implemented turtle graphics as a way of building muscle knowledge.

I've learned more since then, about how LiveScript from Netscape was coming straight from Scheme, or in any case a functional programming background.  That the keyword "function" serves as lambda is clear from the start.

An object is like an instance __dict__ in Python, with methods even at the instance level, where classes never store them.

In JavaScript, a first order of business is to populate some prototype with shared methods, while continuing to isolate instance state.

If you're a Pythonista, you take for granted that the __dict__ of your type holds the methods, be these instance, class or static, while each instance has its __dict__ as well, for state, perhaps immutable state if any changes must go to some __new__ version.

That's more immutability than most OO programmers want.  Keep being the same self, just change your driver's license and bank account numbers from time to time.

That being said, immutability is a source of sanity in code.  I would never scale a vector, make it three times longer, without returning a new vector.  If your code wants to recycle the name, and keep v always pointing to "the same" object in that sense, fine.

Naming conventions signal continuity of identity if that's the best way to think about it.  The underlying object is free to return a new vector instance upon scaling or rotation, keeping vectors more like integers and strings, both immutable object types in JavaScript and Python.

The Pythonista community gives the JavaScript natives that useful second pair of eyes on OO, without requiring as much real estate as Java or C++, both of which are career paths in themselves.

Python is no toy language, just it rewards even a little study more quickly, so the JavaScript user stays busy and productive, while the Python implementation of OO concepts, clarifies the advantages such strategies might bring.

Scientists and those in need of analytic powers more generally appreciate Python for similar reasons.  "Python fits your brain" is the slogan.  For many, that's true.  The language works as expected, once you get the hang of it.  Eric Raymond (The Cathedral and the Bazaar) had found that true for him as well.

Since people in many walks of life are eager to get on with it, whatever "it" is, and not detour too deeply into some side track in computer science, it's gratifying to meet a language that meets them more than half way.

JavaScript programmers will grow into ES2015 / ES6 and ES7 more gracefully perhaps, as they more than double their overall design pattern savvy, in learning from the Pythonista perspective.

Monday, October 24, 2016

Revisiting Lambda Calc

Technical readers may consider my version of the "lambda calculus" watered down, much as the Python "little lambda", in being just the one expression, is but a pale shadow of the Great Lambda worshiped further to the north of Python Nation, were such nations to geographically exist.

OK, I've likely lost the rest of you too, so never mind.

But you've heard of "functional programming" yes?

There's this wish to say

UI = visualization (immutability )

or

subjectivity = interpretation (objectivity) 

-- or something like that.  The context may be as mundane as "functional CSS".

The goal is to straightforwardly image some model's state.  Take a picture of the world, or some small part of it.  Keep the model and its rendering separate, with the rendering pipeline consisting of deterministic components.

My story, in defending my use of "lambda calculus" is I'm keeping memes that belong together, together, so what's the fuss?  I'm contrasting it with "delta calculus" as a way to get traction with my would be end users.

What end users?

As you'll recall, where I'm taking my "lambda calculus" is in the Sesame Street direction (some might suggest we call it that) towards any-school's interpretation of some "computer math" pre-college.

Even oldsters as old as me, and older, will feel somewhat duty-bound to keep sharing, with other teachers if not directly with their students, about how to maybe summarize what's happening behind the scenes, succinctly and concisely.

This "computer math" includes the basics of Group and Number Theory, with a practical application in RSA, the public key cryptographic algorithm.  That's an outline of your curriculum right there, minus the spatial geometry component, the global data (big data, round data).

No, I've got nothing against Diffie-Hellman (what Ian featured at the Chicago Pycon) and I don't dictate a choice of computer language.  Use Ruby if you prefer. Try a bunch.  JavaScript is improving.

I just so happen to share about the RSA algorithm using Python, making use of the binascii.hexlify() and unhexlify functions to turn a sample phrase into a number ready to raise to a power, then raise again to get it back. My goal is to keep it simple.

In modulo arithmetic, operations tend to be circular and in RSA we keep secret what pairs with some N to make an encrypted message come back around again.  The genius is the secret never needed to leave Alice's computer for Bob to be able to send her encrypted (private) stuff.

I'm not diving into RSA in a spirit of high dudgeon, though I'm plenty aware that governments might have preferred a world wherein "we the people" did not include every little mom & pop shop.

The only reason we have a modicum of transactional security, including to some degree around cyber-monies like bitcoin, is because "computer math" is commercially oriented, not just some military secret, a weapon, as it might have been. I understand the need to protect this civilian heritage.

However I'm coming mainly from a pragmatic impulse to share a "how things work" approach to everyday tech.  If our people are to reason about the world they're in, then understanding about Bob and Alice, and "evil Eve" (to whom we owe so much as a penetration expert) is just a part of the package.

We'll also want to keep talking about tcp / ip more generally, and not just DNS (much in the news lately).  What's the issue with IPv6?  Is there a road block of some kind?

We want the journalism to stay technical, and we want to stay savvy enough to follow it.

Lets start building the necessary reading skills pretty early, using cartoons and puppets if that helps.

In many cases, we simply want to be able to follow our own stories to their logical conclusions, and not get lost in the woods because we've forgotten our lambda calculus.  How can we keep playing glass bead games if we're missing too many marbles?  Keep the puzzle pieces on the table, so that random individuals have a fighting chance of figuring stuff out.

I'm not saying every high school kid needs to tackle the Y-combinator pattern, but why not get to within striking distance?

You may still opt for the usual "delta calculus" of Newton and Leibniz, of Cauchy and Weierstrass, perhaps exclusively, perhaps in addition.  Nowadays we have this other math, this lambda calculus stuff for you too.  We offer choices.

Saturday, October 22, 2016

State of Control (movie review)

About Tibet circa 2008

I grabbed this one, along with Michael Moore's latest for Carol, because of my longstanding fascination with Tibet.  I've been right up to the border, from the Nepal side, but never tried to get in.  Our family lived in Bhutan for some years.  I've met a relative of the Dalai Lama thanks to James Lambert.  There's more.

The movie focuses on the trials and travails of two journalists trying to break into a region under lockdown, at the time of the 2008 Olympics in Beijing.  Not surprisingly, they're harassed, as no one is fooled as to their ulterior motive, to make this documentary.  Some of the story lines stretch into 2014.

I watched this after Carol's night of storytelling at the meeting house, about her time in Southern Africa.  I'd partially overlapped with the Dalai Lama then as well.  My wife had gone to Durban for his workshop.  My family were guests of South Africa's Deputy Minister of Defense and her family.  We were in Cape Town for the Parliament of World Religions.  Long story.  Quakers and all that.

Also apropos:  after a 3rd debate between Hillary and Donald, in which cyber-attacks featured, much of North America was treated to a major Internet outage this morning, though no state was blamed (North Korea was ruled out by some report I read).  "Things" were maybe implicated, as in washing machines and elevators, behaving badly, because of malicious programming.  In the case of the debate, the Russians were implicated, whereas in this film, it's China.

The cyber-war is ongoing, with this DVD now adding its voice against censorship.  I've been wading through some Swedish and Finnish literature on the same question:  how to protect free speech, and also where is the line between free and commercial speech, by which we / they mean highly paid for propaganda?  I'm glad at least some people are focusing on these questions.

Just blacking out what's happening only amplifies the impact.  But sometimes the goal is more realistic:  to defer and provide time to process later, or as some would say "a day in court".  However most cases never come before a court, just as most crimes go unpunished in the legal sense, whereas karma never needed lawyers or judges to roll onward.

I found it telling that a star Tibetan activist and co-producer underlined the Chinese leaders were "engineers".  There's a note of respect for totalitarianism, without any endorsement thereof, but then speaking of engineering, how much is reflex-based and automatic?  To the extent we live according to a shared internalized narrative, it's like we already know our lines.  Top down, bottom up or both?

From a physics and information theory angle, I do think it'd make sense if our need to reduce entropy was getting closer to our actual ability to purge misinformation from the system.  There's an ongoing computation, or call it a puzzle in need of solving.  Stories that don't add up, that lack sense, tend to leak away their credibility more quickly in a world that makes cross-checking fast and easy.

Monday, October 17, 2016

Meme Machine


Many amnesiacs are staring at their TVs in perpetual disbelief at the prevalence of genitalia in political discourse.  "When will this stop?" they ask, in a frozen moment of perplexity.

That snapshot of the shocked TV viewer has something of a Norman Rockwell flavor, as decorated by MAD Magazine. Lets remember the long slog through the Monica story on shock TV and radio just a few seasons back.  Horrific right?  A real nightmare for the poor girl.

We do scandal, then war, which is scandalous, then back to scandal, and so on.

What gets old first, the soaps, or the expressions of shocked amazement?  Aren't they but one and the same?  We call it the tabloid press.  There's a reason it sits there at supermarket checkout lanes, and as click bait at the bottom of each newspaper article.

However, lest I fall into my own trap, and register shocked outrage, that my neurons are being so expertly played, let me say again that the meme machine is well-oiled, and with a note of respect.

People get paid by the tweet I'm sure, in some industries.  Entertainment, i.e. show business, is one of those "must go on" kinds of things ("too big to fail").

The danger is less in having an Idiocracy than in allowing these soap operas to get so out of hand that we don't get any work done.

When will the US citizens of Puerto Rico be allowed to vote?  Not this cycle either?  When then?  Snore.  The TV viewers didn't come for that.  They came for more scandal out there in scapegoat land, not the nasty business of thinking through a problem and implementing a solution.

I think a counter to frenetic TV is to change channels.  Not all TV is like that.  You maybe expected I'd say "kill your television", but if you haven't yet, then that's maybe stale advice.

Youtube, which is TV on demand, is the same way. If your goal is to get something done, to get on with your life, then learn to ratchet forward. Challenge yourself with some worthy goals.  Learn. Study.  Don't just get outraged that the world is going to hell.

Don't get carried away by the swill we might call the "mass mind".

Have a mind of your own instead, it's worth the extra effort.

Meanwhile, in Mosul...

Friday, October 14, 2016

Shop Talk

Intro to Python

Last night I met with my current crop of students for the eighth time, wondering if we might be in for some weather.  Apparently the media were full of rumors of an impending tropical storm, or the tail end of one, and indeed the Pacific coast of Oregon was already taking a pounding.

Two days before, as chronicled below, we'd experienced a significant power outage in Asylum District, causing drivers, pedestrians, cyclists to mutually encounter Chavez & SE Hawthorne with no traffic signals ("the robots were dead" as a South African might put it).

However by the time class rolled around, the valley was still, just getting more rain, not unusual in October, given our rainforest ecosystem.  "Rainforest" is recognized as a single word in Wikipedia, so I'll be adding it to my spellchecker, goodbye red wavy lines.  Speaking of which, I don't like typos in my tweets and will go back and delete some for that reason alone.

What we got to, in this class on Python programming, was a second pass through both decorators and context managers, as topics, first encountered on Tuesday.  Then I ripped back the veil to reveal some of the deep mysteries behind the keyword yield, one of two still giving problems on the quiz, the other being nonlocal.

I needed this running jump to reach my goal in the final segment, before the last lab:  using a decorator from contextlib to wring a decent context manager from a generator function.

Steve Holden covered all this in his O'Reilly School curriculum, meaning I'd iterated through this material for some years.

I'm no stranger to this area, in other words, and so act as a tour guide for those venturing this deeply into the Land of the Pythonistas (sounds like Florida, doesn't it?).

Python is not the only language to sport something called "decorator syntax", basically a way to transform the behavior of callables with other callables, at design time.  It's syntactic sugar really, but really useful syntactic sugar.

I'm working with Jasand Pruski on the quadray stuff a little.  Keeping my remarks on Synergetics to thumbed SMS messages and Tweets is good discipline.  All we're missing are polyhedron emoji.

Regarding the mysteries of yield, the story got deep when the send( ) method came along, and then throw() and close().

I'm grateful to David Beazley for helping me to disentangle and distill the concept of co-routine from what could be a big mess.  That little decorator he does to "prime the pump" i.e. take us to the first (yield) ready to accept a value, is most illuminating and worth passing on.

Today I hacked on thekirbster.pythonanywhere.com, a minimalist web application implemented in Pythonic Flask, a WSGI application.

I made the CSS a little tighter, organized the landing pages (yes, I still hand code HTML tables), and stuck a dashboard of navigation buttons across the top).  I'm deliberately using code cut and pasted from well known teaching sites, such as w3schools.com. I'm using the the Mars.2 Release (4.5.2) Build id: 20160218-0600 version of Eclipse in an effort to stay in practice with that capable IDE.

coroutines

Wednesday, October 12, 2016

Wanderers 2016.10.12

Fall 2016

The Pauling House block and environs were enduring a power outage this morning.  Even the busy intersection twixt Chavez and Hawthorne was without signals.  Drivers and pedestrians had to play the game of round robin.

Our speaker today was Roger Paget, who has appeared previously in my blogs.  He speaks in a Chomsky-like baritone, looking back over a long history of living around the Pacific Rim, including as a translator for Indonesia's Sukarno at one point.

He reminds me of John Taylor quite a bit, another native English speaker who has developed fluency in Indonesian (one of thousands of languages used in that region).

For most of the talk, I attended to his use of the pronoun "we" and possessive "our".  He looks somewhat like a king, the way Santa Claus does, so it was easy to slip into hearing a "royal we" -- a perceptual shift I'm used to making (I focus on pronoun use a lot).

I concluded we were kings of rather different kingdoms in that my use of "we" bears only some resemblance to his.  For the most part, his kingdom sounded rather alien.  We both think of ourselves as US citizens, but differ in the details of what that entails (in terms of how we each use our respective "we").

Nevertheless we may learn from one another, as kings and queens often have.  Better to learn than simply argue.

Elizabeth Furse and Marianne Buchwalter and were among those who joined us.

I didn't participate in the discussion other than to eat some of the donut pieces Marianne brought from Blue Star.  We didn't have coffee thanks to the power outage.

Monday, October 10, 2016

Flying Circus 2016.10.10

Monitoring IP Traffic in Real Time

Tonight was brilliant I thought, with many interesting threads, plus an excellent talk by Charles CosséFlying Circus is taking off.

For those new to this blog, I'm referring to a weekly meetup at PDX Code Guild, for which Neil Raja and I have been serving as co-organizers.  We're not the Portland Python User Group, which meets elsewhere (we're smaller and stray from Python quite liberally).

Charles plugged his Raspberry Pi 2 Model B into the big screen monitor using the HDMI out, and shared both slides and working application, at that time about 75% complete.

He shared a generically useful pattern (see slides), which is to have Django, the Python web framework, talk to a suite of daemons (one or more), each monitoring some data source, and then sharing summary visualizations with a web client running JavaScript, talking to Django over AJAX, using JSON.

Django talks to the Python daemons over xml-rpc (remote procedure calls).  The daemons might monitor IP traffic in various ways.  Think of a patient's vital signs.  The heart rate, oxygenation level and so on go back to d3.js, a 2D visualization library that updates a dashboard in real time.

In this particular application, the Raspberry Pi serves as a hotspot with two Wifi connections, one for random clients, e.g. the smartphones of people there, the other connected to the school's hotspot.

The Pi is acting as a wifi enabled router in other words.  Since d3.js contains maps (as in Mercator Projection), the mere fact of logging in to the service registers as a dot in Portland, Oregon.  Then we can watch who's hogging bandwidth, other stuff.

Electron is to Chromium as XUL is to Firefox, providing a client container capable of hosting a DOM and running client side JavaScript.

Sheri, the school's director, clued me about a free course at Oregon State in permaculture, that starts on Halloween.  I signed up.  I'm interested in Biosphere 2 type experiments, or just maximizing efficiencies -- ala New Alchemy Institute -- in some Bucky dome someplace.  The campus is remote, so best if the fruits and vegetables are grown locally.

As has happened in some previous Flying Circus meetups, crypto-curriences, such as bitcoin, became a topic.  We had some people who'd one their homework.  I'm not claiming any of us were actual bitcoin miners, a technical term, but some of us knew people who are or were.  Neal and I are both working in support of Measure 97.

Pro 97

Saturday, October 08, 2016

Nuclear Summit


Here's one of mom's friends, Alice Slater, yakking with a journalist on Russia Today.

She sounds pretty sensible to me.  She makes the good point that Indian Point, not far from New York City where she lives, is itself a "dirty bomb" once hit by terrorists hell-bent on creating some kind of Fukushima situation.

RT does a good job streaming archival footage on the left panel, not getting into showing the missiles or atmospheric detonations, keeping to the theme of (non-submarine) nuke plant internals.  Slater ventures to talk about WMDs as well.

I'd probably sound more fringe in that I'm still skeptical of the conspiracy theory that Al Qaeda was behind 9-11 (Slater brings this up), which attacks just seem too sophisticated in retrospect, to have been conducted from some cave in Afghanistan.

I'm by no means alone among Friends in finding the official History Channel conspiracy theory somewhat hard to believe.  David Chandler, in our Meeting, is all over Youtube expressing his brand of skepticism. I know many Mormons think the same way.

Wednesday, October 05, 2016

Doing Homework


I've been digesting David Beazley videos this morning, among others, once again tackling the topic of asynchronous multi-tasking in the Python computer language, by means of coroutines.

Coroutines are a new type of object in Python, a "subtype" of generator in that they use much of the same implementation code as generators.

However they're a whole different animal, are not a subclass in the Pythonic sense.  What coroutines do is surrender control back to the awaiting caller.

Coroutines ratchet forward as driven by some whip-cracking task master, cranking forward a notch at a time, perhaps awaiting on other coroutines internally.

Getting a lot of coroutines notching forward "at once" (each inching forward, then surrendering control) is what gives us the multi-tasking flavor, but it's all happening in the one thread.

The trick is knowing when to gracefully say "not ready yet" in a non-blocking manner.  Don't make the waiter stand there while you consider your order.  Let the waiter cycle back again in a few minutes (milliseconds or less).

Followup:

Tuesday came off without a hitch except Carol left her favorite bright green water bottle at Providence.

Carol chatted with Wanderers about the obsolescence of outward wars.  That doesn't mean all the engineers engaged in "destructive engineering" (aka "anti-civil engineering") have retired yet of course.

Uncle Bill actually used to be a maintenance engineer for the DEW line radomes; I hadn't known that.

Uncle Bill

Sunday, October 02, 2016

Living Room Overhaul

XO Reappears

Carol (mom) was hoping I'd wake her up for Quaker meeting today.  I rattled around in the kitchen some, making coffee, however her health is a priority and getting enough sleep is a big part of that.

She's been slaving over WILPF deadlines, pulling all nighters.

I woke up Saturday not planning to overhaul the living room, but once into it, I found it hard to stop.  I also yanked out a kitchen drawer in our fall-apart metallic cupboard system, a kit kitchen from the 1950s or so, already a relic of another age when we got here in 1995.

For awhile I despaired of getting it working again, but then paused to realize there was an intelligent design to it all, that I just needed to work with, not against.

Part of overhauling the living room was discovering where Lindsey left the XO-1, in a nice little bag with the charger.

I got to playing with it, nostalgic for One Laptop Per Child (OLPC) and before ya know it I was grabbing a newer copy of Sugar and all that, from the Lab.

I've got it on WiFi, though not for any good reason.  I'll likely pass it around at the next Flying Circus.

I got the fireplace cleaned up as well, however I don't have a habit of using it much.  Unless a client needs to work in the CenturyLink room and pay for mainstream heat, I'm happy enough with most rooms running cold, more European in flavor (more Greek).  We could space heat that room too.

Portland just doesn't get below freezing that often (more Mediterranean around here) and I already have space heaters in the snake room (where we keep the snake aquarium) and in Carol's office.

The previous owners had a giant wood stove right in the middle of the living room.  We had that taken out first thing.

I see Carol managed to wake up on her own ("I should have used an alarm, that was silly of me"), so maybe we'll make it to at least the last part of meeting.

Winter Configuration