Thursday, October 29, 2009

A Short Talk

On the Logic of Object Oriented thinking. Click slides for enlargements, or captions for the Flickr-saved originals.

:: slide 0 ::

Object oriented languages
distinguish between a blueprint, which defines the generic aspects of a whole class of objects, such as houses or fish, and the special case instances of that blueprint, the specific houses or fish, each occupying its own time and place, taking up room in memory.

:: slide 1 ::

Above is some code for a generic Animal.

The blueprint defines only two behaviors, one for giving birth to an instance of itself (__init__), and another for representing itself to the public (__repr__).

There's an attribute called species which will get assigned a random value, choosing from the list [ 'Dog', 'Monkey', 'Philosopher', 'Bird' ] as the four possibilities.

For now, the species is unspecified.

Because the philosopher Descartes famously said cogito ergo sum (I think therefore I am), the logician writing this code chose the name cogito within the birth method, and me within the representation method (because they're roughly synonymous).

Those of you who already know Python will agree this is somewhat pathological, but does serve to illustrate the positional nature of this handle to the specific instance, more traditionally and consistently called self across all methods.

:: slide 2 ::

What you see above is not another blueprint, but a function. In this particular brand of logic, the level of indentation is significant. The function begins with the orange signifier def, and ends with the return statement.

The many function "eats" two arguments (the parentheses are like a mouth turned sideways -- think of emoticons). It expects to know howmany, and what species.

These two parameters are like guards at the castle gates, or like butlers at the door, waiting for a hand-off, for incoming values, which they'll circulate internally to said function.

In the code below, this function many is invoked three times, each time to fill a zoo_cage with additional animals. The extend and append methods, both used in this code, are built in to each list instance, thanks to the blueprint for the list type.

"Dot notation" of the form "noun.verb(arguments)" and "noun.adjective" is what we use to interact with our blueprints and instances.

The equal sign ("=") is an assignment operator in this Logic and is used to bind names to objects in memory. Other symbols are used to compare values for equality ("==") or to test whether two names actually specify the same object ("is").

:: slide 3 ::

Secondary characteristics of color and sex get added after the zoo_cage is already full with our full complement of instances. They're set for each animal individually, irrespective of the fact that neither quality was mentioned at the blueprint level. Not every brand of object oriented logic has such a liberal (forgiving) grammar.

Note that if you trigger the representation method (__repr__) before color and sex attributes have been assigned some values, you will get an error message, as the returned self description is counting on having that information available, even if the sex is "unknown".

The choice function, imported from the random module, is not obligated to choose uniquely, only randomly. In other words, after some runs of this program, we might have only Monkeys, even all white ones, whereas other times we might have a mix of Birds and Philosophers.

:: slide 4 ::

What you see in the square brackets, denoting a list, is our zoo_cage of animals. Because of how the representation method was written, one sees the color and species, with the sex in parentheses.

Run this over and over to get a different mix of animals. Notice the shuffle function in Slide 3, also imported from random, keeps the animals in a jumble, instead of a sequence of Dogs, then Monkeys or whatever.

Comment out this line (with a #) and run the script again, to see what difference shuffle makes. You might see where we'd use it to shuffle a deck of cards, with both Deck and Card more blueprints for specific instances.

For further reading:
Trends in Early Mathematics Learning: Looking Beyond Y2K
More curriculum writing featuring Python

Wednesday, October 28, 2009

Open Source Dot Gov

In the course of discussing Python vs. PHP last night at Wanderers, someone brought up the fact that the White House has switched to Drupal, a PHP application.

Likewise the DoD has been touting open source as more of an answer to its prayers. "Just because a proprietary solution is way more expensive, doesn't mean it's that much better, or even could be worse" is a message to military intelligence personnel. Many in the commercial sector have already learned this lesson.

You might think that all this talk of automating medical records and/or outcomes research might yield some new open source assets, even outside the Forge dot mil domain. If there's tax money involved, then shouldn't the code be of, by and for the people? GOSCON is a traditional forum for such rhetoric, lots of Portland people already on board with that.

Speaking of Portland, OSCON is coming back here again next year, after bouncing down to San Jose in 2009.

Slate has been making fun of the WH decision to go with Drupal. I'm not sure the CIA's use of Plone ever got such attention. NSA put out it's own SELinux distro a long time ago, is still putting out new releases, like in March of last year.

Then of course we should remember DARPA's role in helping Guido get IDLE off the ground, a big step in making Computer Programming for Everybody (CP4E) seem a little bit more real.

Sunday, October 25, 2009

From Fred Meyer

I'm in the downstairs dining area sitting with Leslie H. who is busy grading papers for the health studies class she's teaching. We're catching up a little.

Last night I joined a large group of well wishers at Mississippi Pizza to say bon voyage to Nirel, about to launch on one of the big adventures of her life, which she's planning to blog about. She'd shaved her head in preparation, called it a "mohawk".

There I met a science teacher from the new high school in Hillsboro, which has a state of the art facility for home economics. I shared my concept of producing cooking shows ala Julia Child, multi-ethnic, imparting a mix of culinary and TV-making skills. You could even see it as chemistry.

I then headed home for my Ubuntu laptop, the Starling-1, so I could maybe get some work done from Muddy Waters, while Lindsey brute forced through her set, despite a rather nasty cold. Greg and I got to talking about geometry, paper folding, pin ball machines and computer programming among other things, also Kodak's reputation for being rather slow to adapt. Future shock is sometimes shocking, even for futurists. Get ready for a next generation of "3D" movies (director Cameron of Titanic, Aliens 2 fame has one in the wings; science fiction).

Speaking of futurists, Dr. Bolton (emeritus) filled me in on some of the latest thoughts in The Futurist over Thai food the other day. We'd missed the surprise party in their honor, mom just back from lobbying Congress in Washington DC. Chuck and Mary are old family friends, were aware of my dad at the University of Chicago before I was born there. The Boltons used to own that rustic getaway home overlooking Hood River from the Washington side of Columbia Gorge, where Dawn and I went on our brief honeymoon in September of 1993.

I posted one of my "once again, from the top" kinds of posts to edu-sig, explaining what I think I'm up to regarding education reform. You'd think The Futurist would have explained the concentric hierarchy of polyhedra by now. I recall Applewhite writing an article in that mag many moons ago, pre Chemical Intelligencer. Next time I'm in a well endowed library, I should try digging that up.

I've been digging out my basement, having gutted the garage, coming across some old papers, including the rejection letter from the Guggenheim Foundation (Ed had encouraged me to apply). I'm reminded of an episode of Family Guy when I see that (fifth paragraph from the end). I may be smart, but I also sometimes come off as kinda kooky, or quirky as Ed put it. Or just call me a freak of nature, helping to keep Portland weird.

I'll end with a quote from Wittgenstein (many thanks to Sean, for digging these up):

From Culture and Value, 1931:
“The solution of philosophical problems can be compared with a gift in a fairy tale: in the magic castle it appears enchanted and if you look at it outside in the daylight it is nothing but an ordinary bit of iron (or something of the sort).” CV 1931, 11.
... and with this Youtube about a new extreme sport (with thanks to Dave Koski).

Thursday, October 22, 2009

Hubbert's Peak: The End of Oil (movie review)

You might have trouble finding this one. Thanks to Laughing Horse Books for stocking it. The Illahee Lecture Series is locally produced, similar to the ISEPP lecture series in that way. Kenneth Deffeyes is speaking in the First Congregational Church, as Jared Diamond did, and in some ways about the same topic: why civilizations fail (or not, as the case may be).

Yes, this is the "peak oil" guy, an engaging and avuncular teacher who asserts we hit peak production around December 2005. He sketches some of the alternative sources of energy humans have developed, as well as ways to stretch what we have (remember to turn out those lights, a 100 watt bulb is like Lance Armstrong riding a bicycle, in terms of power requirements -- per an apparatus at Princeton he remembers).

Especially interesting to me was his mention of Richard Smalley, who had recently died of lukemia at the time of this talk (Kenneth was visibly saddened). Smalley was one of the Nobel Prize recipients for the discovery of buckyballs, and had been working on buckytubes in connection with high efficiency electrical current transmission.

This project was close to the heart of Bucky himself, who spent a lot of time/energy focusing on the global grid, work carried on by GENI, at least in terms of PR. Would that the popular media pay more attention to these memes, not just back office engineering firms.

This mention of buckyballs prompted me to dig out my Pergamon Press satchel from the first international conference on buckminsterfullerene in Santa Barbara in 1993, where I had the privilege of meeting both Richard Smalley and Harold Kroto. I found a fun stash of documents therein and am uploading some of them to my "chronofile" (Flickr Photostream).

Speaking of Bucky, I enjoyed chatting with D.W. Jacobs at some length by cell yesterday. He was driving along Hwy 101 from the Bay Area to LA. His play opens next June in Washington, DC.

Saturday, October 17, 2009

Equipment Drop

I'm doing an equipment drop at Circadia, patching in to the wifi for a few. Tomorrow is Burn Out, a festival relating to Burning Man. Lots of weird buses in the parking lot, a stage crammed with instruments. Lindsey is volunteering with setup, as well as taking part in the show tomorrow.

Lindsey pulled off a superb performance this evening, shades of Over the Hedge (we met the president of the homeowner's association). Another upright piano conquered in any case.

Speaking of suburbanite neo-liberals, some of these diversity groups turn out to be little more than the middle class brats seeking to extend both their comfort zone and entitlements.

Python's is different I'm hoping. As I posted earlier, to the diversity list:
The first guideline for diversity trainers might be something like: you have no human right to not be offended, as life is offensive and (here's the kicker) there's no one to blame. It's like when Lord Buddha first left the palace compound, where he'd been spoiled rotten: "who are all these sick and dying around here, is this some inferior species?" From there to enlightenment was a long and strange journey.

My talk in Vilnius (Jacob was there) featured snake defecation (snake poop), a way I teach about queues and FIFO in early Pythonic math classes, using eat() and poop() methods.

I preface this by saying kids love Grossology (some do) and have these books of Madlibs (fill in the blank stories) that are gross by design. You can code that way too. Some find this offensive, yet also find they learn Python a lot faster. No one walked out of my talk, as my slides and presentation were both tasteful, as was my three hour workshop in Chicago which mentioned Hitler's holocaust and included a scantily clad Britney Spears on one slide (first 57 minutes are on Blip TV).

All that being said, intelligent managers do tend to provide ways for humans to sort themselves, exercising their own freedoms of choice, into niches where they'll be happy and productive, with co-workers they're OK teaming with. Or call them schools (as in schools of fish, schools of thought).

I'd be pleased if Pycons were models of well attended, well managed events, and from what I've seen so far, I have no reason to expect disappointment. These are stellar and talented geeks, with every potential to accelerate into multiple Pycons happening with quite high frequency around the world. But the faster you grow, the more tourists you'll get checking you out and muddying the waters, hence my plans for more exclusive venues, where BOFs are more likely to find one another.
BOF stands for Birds of a Feather.

Speaking of Python, Scott David-Daniels was at the venue this evening. He struck up a conversation with Lindsey about arms profiteering and how to escape its grip. They found some points to agree on, given a shared background in IT.

Scott has some papers he's working on, one about a new data structure (currently undergoing testing), and maybe another about his super fast search algorithm.

Good Bye Party played the opening gig, will be here tomorrow as well.

Tuesday, October 13, 2009

To Wanderers...

[replying to internal message traffic on wwwanderers at Yahoo]

Yes, pessimism requires scientific justification these days as cognoscenti needn't be knee-jerk Malthusians to gain entre to the best parties. Of course if you're not knee-jerk... Malthus was a pretty cool guy right?

Regarding power generation, there're also those slow turning high torque thingys buried under rivers i.e. you have no unsightly or obstructive dams to contend with. The spin is slow enough to not kill the fish.

http://www.washingtonpost.com/wp-dyn/content/article/2008/09/19/AR2008091903729.html

Keep in mind that some of the best most fuel efficient cars, e.g. a 65 mpg diesel Mini Cooper, are simply unavailable in the USA because the so-called "capitalists" in this country are for the most part wimps who can't stomach real competition and puppet Congress to protect them from those with an unfair advantage, such as better engineers.

Sunday, October 11, 2009

Subgenius Devival

Subgenius Devival 2009
:: subgenius devival, pdx 2009 ::

Our company forked into parallel tracks last night, though in retrospect I wish I'd been positioned to welcome another subgenius into the fold, as this was quite a good show. Reverend Stang was in good form, as were these others from the inner circle.

I was checking out this Ash Street Saloon as a possible venue for the Lindsey Walker Show and it met my criteria: room for dancing, a distinguishable stage area (preferably raised), and no problems with the neighborhood i.e. compliant with local zoning ordinances. This place definitely qualifies, as do Red Cap, Angelo's and Ladd's Inn. That's not to say she won't book elsewhere, just this is the groove or "ground state" as it were, to get more quantum mechanical about it.

The Subgenius Church imitates televangelical fire and brimestoney speech, encourages ranting. The clientèle tend to range to the geeky side, to the point of embracing weird as a badge of honor, like Portland does, or Austin. Bob Dobbs is the titular deity with uber-femme Connie a manifestation of his luckiness (more than smarts). Bob is modeled on the pipe-smoking 1950s salesman figure well-known to Americana lovers. You'll find him everywhere in the glossy commercial literature of that era.

This morning I was more on the serious side, with other earnest Friends engaged in an overhaul of Faith and Practice, the privilege of any generation worth its salt (we're even somewhat inter-generational, though tend to be aging boomer-seniors for the most part -- "geezers" as Jane calls us). That was at Bridge City (hi Larry). Then it was back in the maxi taxi to blog and munch on some factory bread products. Now it's on to Multnomah Meeting wearing my Oversight hat (metaphorical -- the real deal is around the house someplace), going on foot, testing my iPod.

The reason my iPod needs testing is I went into the red for a Toblerone, to celebrate this first Portland Devival in like a decade. I consumed a lot of it, but stuffed the balance in my Python fleece pocket when boarding the 14 bus, not bothering to wrap it in plastic or foil. This proved to have consequences: melted chocolate all over, meaning I spent much of the service licking my iPod, trying to cleanse it of the brown stuff. This was an appropriately kinky and bizarre activity to be engaged in, given the venue. I was also drinking Jack Daniels, grateful for a little R&R in a war crazy world.

Tuesday, October 06, 2009

Triangulating

I was just posting over on Synergeo how I'm looking at a conceptual triangle as governing my projects: Wittgenstein, Synergetics, Python. Yes, esoteric (Esozone conference coming right up, but nothing scheduled yet on my end).

Wittgenstein was a contemporary of Hitler's, an Austrian, who ended up in a POW camp in WWI, where he started hammering together a world famous philosophy that made him the darling of Cambridge. After publishing his magnum opus, he hung up his academic regalia and took off into the wilds again, only to return with a slap of the forehead, realizing he'd made some mistakes, or at least now he had a better way of saying what he'd been trying to say. I did my Princeton thesis on his so-called second philosophy (Philosophical Investigations, On Certainty, Remarks on the Foundations of Mathematics, Philosophical Grammar etc.).

Synergetics is a philosophical language invented by the famous American born inventor R. Buckminster Fuller, one of the first jet setters and one of the most intrepid, never traveling as a tourist. He used this invented language as a way to anchor all kinds of incoming communications from all over the globe. He was friends with Marshall McLuhan and the two of them formed the nucleus of a subversive network which also included "Sonny", my mentor E.J. Applewhite. The magnum opus is on the web and, like Wittgenstein's stuff, is very much a topic in these blogs.

Python is a computer programming language. The first language I really respected a lot was APL by Kenneth Iversion, first encountered at Princeton. Then I followed the xBase trajectory for many years, starting with Ashton-Tate's dBase II and ending with Microsoft Visual Foxpro (VFP9). Whereas xBase was retrofitted to become object oriented, I think successfully (it's a better language than VB), Python was object oriented from the ground up and is even more intelligently designed. It reminds me of APL in some ways, although these two are not in the same language family.

How I relate these three vertices of my triangle is as follows: the later Wittgenstein introduces the notion of "language games" which relates easily to the computer science concept of "namespaces", which Python well implements. The idea of namespaces helps thinkers make room in their thinking for remote vocabularies, alien shop talks, extraordinary grammars (philosophies), such as Bucky Fuller's Synergetics. Given the latter has a lot of geometric content for its core logic, implementing Python modules to express this geometry has been yet another edge on this triangle.

The mutually reinforcing nature of this design helps guide my curriculum writing, which includes journaling in my blogs.

:: google today ::

Monday, October 05, 2009

Eyes Wide Shut (movie review)

I've long been curious about this movie, given I'm a Stanley Kubrick fan. This was my first time seeing it, and I wasn't sure what to expect. I was pleasantly surprised, as I'd been bracing for some kind of horror movie, not upper crust New York, more like Woody Allen world, lots of doormen and taxi cabs, around people who have everything and then some.

Tom and Nicole (the celeb stars in their characters) manage to get into a fight over the price of holy matrimony. It seems to work for the daddy-I-want-a-pony minded, and indeed daddy is used to spending money, but it's rough on the couple. Daddy is off at work, looking at naked women all day (he's a doctor) while mommy is highly appreciated by members of the opposite sex (as well as her own) yet does all that semi-boring staying home stuff (nice pad!), while wondering what her husband is really up to out there. Little does she know.

As a result of the fight, Tom at least gets that he's taking too much for granted. He's now haunted by the Bridges of Madison County story, with someone besides him as Clint Eastwood. That's disturbing of his equilibrium and he goes off the deep end into film noir country, in this case a kinky patriarchy full of voyeurs, ala Elizabethan Era Globe Theater (the origins of stagecraft in English, inheriting from Greeks via Romans). As private cave DVD watchers, we join the rest of the masked (and Tom) for some brief peep show. No, we don't have limos either, aren't that politically powerful, but at least we have VCRs.

What's amusing about this film is that Tom & Nicole ride so high in their social network that the "dark underworld" of pulp fiction seems just as out of reach in the sense of economically advantaged. The two temptress roommates are pretty much like my girlfriends at Princeton, well off enough to afford a slumdog apartment in The Village (we weren't actually that well off by a long shot, lived in Jersey City until finding that place in the Big Apple (where my girlfriends moved, me staying behind to teach in a Catholic girls' school, but I digress)).

Tom Cruise, being in over his head, out of his element, is what adds levity to this interesting film. He keeps flashing that doctor badge like it's supposed to justify his playing private detective or undercover cop, like "hello, I'm Kojak, just let me wake you up in the middle of the night so I can dress up and go to a kinky party in the steens" (or wherever that was).

Obviously I'm coming from some kind of economic jealousy angle, which I think the film consciously encourages. We have a hard time feeling sorry for these well off people and their exciting lives, identify more with the working class who keep getting to take Tom's coat. I'm coming from being the limo chauffeur probably, stuck outside with the taxi driver, not even blindfolded because I can't play some fool musical instrument, plus I suck at sleazy dancing like that guy at the party was doing, sucking up to Nicole (whom I'd gladly suck up to if I could figure an angle, but then glitzy LA aka Hollywood is hardly my stomping grounds; I'm a fish out of water in that neighborhood (that's more Governator turf)).

Speaking of Hollywood, earlier last night I saw Whoopi Goldberg apparently liking Google Android on the LCD flats (at Claudia's sports bar on SE 30th & Hawthorne). We also saw boomers in a Windows 7 commercial; I advised Annis to try extending the life of the old Toshiba to take advantage of Xmas discounts on new laptops with that Microsoft OS, more suitable for "normal people" than GNU/Linux maybe (a geek favorite), and less Cadillacy than MacOSX.

Open source (e.g. Python) runs on all of the above so I'm not required to be dogmatically against all proprietary layers above and below my level (talking "chip-to-cloud stack"), even though copylefting more assets remains a worthy undertaking and goal. I'd like freedom to gain and/or hold on to some stack pieces at all levels, making purists happy while continuing to leverage economies of scale. To this end, I encourage free products to advertise, given boosting sale price has never been the only motivation for flaunting what you've got. There's also simply recruiting a user base (cite the Java campaign, or the PR for ostensibly not-for-profit religious brands, Quakers included).

Friday, October 02, 2009

High School Geometry

Synergetics
:: math cast by 4D Studios ::

 My proposal to teach a non-Euclidean geometry as a part of the 4D spun DM track (digital math track) is met with ridicule in some circles, as isn't the priority to gain some grounding in Euclid first, before delving into college level topics?

These ridiculers may not appreciate the meaning of dialog and/or dialectic that much, not having studied philosophy maybe. The Platonists, taking a page from the Sophists, continued the tradition of recording conversations, debates. One needed interlocutors, like what we see on listservs today.

In other words, to really "get Euclid" you'll need to contrast his metaphysics with some other's, say that of Democritus (our "patron saint of discrete math" -- as in: "it gets down to atoms" (quanta) vs. continua).

The pragmatists don't so lazily resort to ridicule in the opening frames, but do worry we're muddying the waters. These might be neo-liberals or neo-cons, secretly and somewhat desperately hard at work to shore up some central authority (an imagined monarchy). The idea of young children questioning the existence of "infinite planes" and/or "perfect solids" just sounds like chaos to them. What will they doubt next? The existence of "real numbers"?

One solution in this case is fairly easy to implement: keep these worry wart types teaching along the creaky old analog math track (aka the status quo in 2009), a sequence of connected curriculum segments already well memorialized in any number of textbooks, some better than others (Dolciani gets some respect, also Saxon, whereas some brands of corporate pabulum cut way too many corners, leaving many in the Lower48 with mush for brains, "pseudo-educated" as Dom Rosa would say).

In other words, don't let them muddy these waters they're so worried about muddying -- leave this non-Euclidean stuff to the certified gnu math teachers, properly trained to not botch it. They have a computer at their elbow (know two or more coding languages), have enough linear algebra to teach the neo-Euclideans' XYZ orthodoxies, even as they express skepticism in the face of its more dogmatic apologists (you'll find these zealots in all walks of life).

Just zooming back from an ancient greek geometer, sketching a proof in the sand with a stick, showing it's on a beach, on a ball (ala Google Earth), not something infinitely flat, would be too subversive for some teachers to handle. The space program sort of went over their heads maybe.

But in a school truly committed to diversity (do they have a statement?), students will have some leverage, as will the parents. If you don't have a spanking new DM track, hotly relevant with lots of bright screens, maybe contact your state and/or local representatives. Ask about the new standards, the new K-12 pipeline.