Tuesday, January 31, 2017

Embedded Codester Apps


Monday, January 30, 2017

On Race Again

:: stand-up philosophy by Wes Cecil ::

What I wrote on Facebook:
Really enjoyed this, because he's doing philosophy and standup comedy at the same time. Gets my attention. Yay, my discipline gets into the nightclub scene (reminds me of Tom Lehrer).
... and in a follow-up comment:
The End of Racism by Dinesh D'Souza is pretty on target in arguing many anti-racists miss a golden opportunity in buying into "race" as a tenant of their own belief systems, such a foggy and ill-designed concept as Wes Cecil takes up in his mocking philosophy talk. However, given how deeply engrained is the thought pattern, I have to accept that most Americans (at least) are terminally racist (will take belief in races to their grave) and it will be up to future generations to look back and dissect these beliefs in a more clinical postmortem manner.
But then as some of my friends point out, Dinesh has gotten in trouble with the law, and was a big Trump supporter, anti-Hillary. So does that mean races are real?
Thanks for the update about D'Souza, got me checking his website too. 
I do believe in ethnicity as meaningful. I notice racists have a hard time naming the races. The idea of races pre-dates genetic science, which has only further undermined the idea. Certainly "Anglo-Saxon" is not a race. Or maybe some think it is, as there's really not much agreement on what the races are in the first place, assuming they exist for the sake of argument.
Quoting from my Synergetics on the Web (1990s):
Western science originally portrayed race and class as characteristics of a person's blood which, as such, could be subdivided in proportion to a person's ancestry, "blood" being treated as a mathematical quantity, contributed in equal proportions by one's parents. Hence such terms as "octamaroon" (one eighth black). Whereas "class" is no longer regarded as a genetic entity, "race" has remained a popular concept for grouping genetic characteristics, even if the link to blood is no longer made. Like anthropologist Ashley Montague, Fuller felt the concept of "race" had outlived its usefulness, that the cross-breeding of the world's people, especially evident in North America, was exposing the old racial categories as mere snap-shots of genetic traits thrown together by the exigencies of time, but available in any number of permutations from that vast grab bag of traits known as the human gene pool. In the Fuller lexicon, a racist is perhaps most straightfowardly defined as someone who believes in races.

Saturday, January 28, 2017

Growing Up Quaker

A story from my boyhood: my mother Carol was working with other WILPF ladies, as a young mother, to counter the prevalence of war toys on the market. She harvested a pile of examples and stored them in our two-car suburban garage. Dad and I found them, and decided to play with them. The remote controlled Tiger Tank was especially cool.  As a general rule though, toy guns were discouraged and I didn't play with toy soldiers, as did some of my peers.

When we moved to Rome, I met friends in military families. Reggie liked to fantasize about wars and weapons. Mom served as a cub scouts den mother.  I was a Bear, with my friends Mahlon, Kijoon, Reggie, Hayden and Joe. Kijoon, son of the South Korean ambassador, had a stash of toy guns, as well as a pellet rifle and we'd play with those, more in a 007 mode than as soldiers.  Movies at the nearby Archimedes, an English-language theater, were influential.

In the Philippines, my dad started out with the UN, which was doing land reclamation in Manila Bay. Dad switched over to USAID and taught planning at the University of the Philippines as well. He was helping spread a culture of local planning, versus top-down from a central government, and flew all over the islands. Thanks to his job with the State Department, we were able to go on base, mostly Clark AB and Subic NB. We also had access to officers facilities in Baguio and vacationed there at one point.

My years in the Philippines helped me more fully grasp the global scale of US military infrastructure. The American War (Vietnam) had been really hard on my mom especially. The way USers like to rain bombs on defenseless civilians didn't impress me either.  However I also saw how a lot of brave individuals inside the military were also skeptical.  Daniel Ellsberg went to Vietnam as a Marine to check the reality of the situation. Brian S. Willson was there serving his country as well.  Dad and I also heard Ralph McGeehee talk at the Institute for Policy Studies in DC (this was later). He'd been with the CIA.

After Princeton, I dove into international affairs quite a bit and thought seriously about joining the foreign service. The Woodrow Wilson School beckoned, however I decided philosophy was more my thing. Wittgenstein was doing a kind of anthropology, looking at how words mean. I also took a course in psychological anthropology, with Imee Marcos (daughter of Ferdinand and Imedla) in the same class.

Fast forward and I found myself plunging into the Bucky Fuller corpus. He was still alive and circumnavigating the world, giving those famous long talks. His blend of futurism and philosophy appealed to me. He'd been in the US Navy and credited that experience for exposing him to big picture worldviews, what the admiralty shared in officers training at Annapolis. This was a high point for him, preceding a deep low, when he needed to support his new family in Chicago and went broke, coming close to suicide.

Another author with a lot of military experience was L. Fletcher Prouty, played by Donald Sutherland as Man X in the Oliver Stone movie JFK. Prouty cites Fuller when explaining why humans are squandering resources to kill each other instead of collaborating to enjoy better living standards. The "you or me" picture of Malthus-Darwin and a belief in global scarcity had turned endless war into a means of population control.  This was the picture World Game worked to counter. In principle, humans had the wherewithal to better their lot. We had the necessary mastery over principles. Ephemeralization (more with less) was on our side.

Through my study of Fuller, I got to meet E.J. Applewhite and his wife June. I met their daughter Ashton briefly, haven't yet met their son, a boyhood friend of Sam Lanahan's (Sam accompanied Bucky to the Philippines when I was there, but wasn't tracking at the time).

My parents and I had dinner with Ed and June in DC (I forget which restaurant). Also Ed and June flew out to Portland to hang out with me there, meeting some of my people. Ed had a CIA background, having served in Berlin and Beirut. He'd been a Fuller fan as a teenager and devoted his post CIA years to collaborating with the guy, shepherding the two volumed Synergetics through to publication.

The US military had worked closely with Fuller and the companies set up around the geodesic dome invention. Don Richter, T.C. Howard, Ed Popko and many others did much of the actual engineering, in both civilian and military sectors. The radome (radar dome) became a relatively common feature of the landscape. My uncle (actually grandmother's sisters kid) had a contract to work on those in some way, doing maintenance. I only found that out recently (Bill is 91).  Soviet premier Khrushchev had been impressed by the dome in Kabul. Fuller was always friendly to the Russians, as his commitment was to all humanity (he credited that commitment for his successfully synchronistic lifestyle).

However, Synergetics is about a lot more than just geodesic domes and spheres. It's a hard philosophy book that most philosophers don't actually read, but contains some simple geometric innovations based around polyhedrons. When the World Wide Web became available, getting more of Synergetics on-line was my priority. Dr. Bob Gray got the actual text of Synergetics on the web, followed later by the Synergetics Dictionary, another Applewhite production.

Friday, January 27, 2017

Forum 206

I'm back to posting to the Math Forum a little bit.  I've contributed thousands of posts to Forum 206 over the years. I'm glad Drexel University gave us an opportunity for public debate.

As I indicate in my latest comments, I have alternative ways of covering the mix of topics, which were maybe a sign of the times. Certainly "learning to code" has grown in importance, as a PR topic.

I pay for the 4D Solutions domain out of my own pocket. No one has sponsored me. There've been tie-ins with the Bizmo idea.

I've spent a lot of time working with David Koski and others, with what I consider one of the main focal points: a way of building spatial geometric fluency by leveraging the work of Buckminster Fuller.

I've been meaning to get back to the Linus Pauling Archives at OSU to see what correspondence I might uncover between Linus and Bucky. I imagine there must be some.

Thursday, January 26, 2017

Finding Polys

Great Find

Some teachers stress about curriculum segments on polyhedrons, such as the Platonic Five, as where and when will these prove useful? Do we really have the luxury of "going there" with so much of STEM still waiting?

I don't think the arrangement of space into coherent, oft repeating, patterns is a waste of time. Glenn's recent find at Good Will reminds me:  Linus Pauling merged spatial geometry with chemistry in ways we'll never forget.

On the same topic, congratulations to Julian for that write-up in the Portland Tribune. He's the sculptor behind Alpha Helix next to the Linus Pauling House on Hawthorne, directly across from Third Eye.

I'm at the other end of the spectrum, stressed about the exclusion of polys, and curating textbook titles for our World Game Museum.

Secondary school textbooks that skimped on polyhedrons, the tetrahedron especially, while purporting to be STEM-worthy might get some critical write-ups in our retrospective.

Why the tetrahedron in particular?  Of the Platonic Five, or of any, it's topologically the simplest, called the simplex for that reason. No arrangement of fewer edges joined at corners has a spatial inside. A triangle fences a field but doesn't define a cage (enclosure).

We're in the realm of Euler's Law for Polyhedrons, likewise Descarte's Deficit of 720 degrees. The numberphiles on Youtube will explain what those mean. Such pillar concepts mark out a common core of cultural literacy.  A common core minus V + F == E + 2 would be exhibit-worthy for its grave deficiency.

If you're a teacher in a Freedom School or one of those, and have the luxury of escaping from the "down the drain" vortex of the left-behind curricula, you'll have access to the resources you need to keep it real. Help your colleagues who aren't so lucky?

Methane Molecule

Friday, January 20, 2017

Bible Stories

[ originally a comment on QuakerQuaker, new improved ]

Thank you Paul.

The story of Noah feeds into the Tower of Babel story, as the uniformity / conformity of thought enjoyed by the Great Flood survivors was a consequence of their starting over with a blank slate so to speak. Noah and Mrs. Noah were the new Adam & Eve.

What humans did not understand owing to their lack of diversity in thought, was that their Promised Land is a ball, a sphere, a planet. A lot of them still have some trouble with that concept in 2017. It's not a closed system in any thermodynamic sense. A star (the campus fusion furnace) feeds us energy for free, the basis for ongoing cell division and our daily bread.

Noah's descendants were at first under the misapprehension that they lived on some horizontal XY plane to infinity, with "God above" in the perpendicular Z direction (Z is for Zeus?). What better way to reach God and make a name for themselves as a superpower than through the construction of some humongous, homogenous skyscraper?

This seemed like normal thinking to them, so great was their confusion already (Babel and babble connect in Hebrew as well [1]).

God knew that a single culture with a single-minded approach would think nothing impossible or unrealistic about their foolish skyscraper plan. No "new Noah" would arise to prophesy this was madness, because they all thought the same way. Besides, had God resorted to another flood (having promised not to do so) He'd be facing this same predicament in a few generations.

God understood that diversity in thought patterns would guarantee that people spread out and around, and come to terms with their being on a spherical spaceship (an Ark, likewise once our Eden).

In his mercy He gave us the humanity we have today: diverse, spread around, and not organized under one uni-polar pyramid hierarchy. No superpowers here folks, just a lot of feedback mechanisms connecting hominids by means of various networks, religious, political, economic. Don't think of your skyscrapers as containing some single-minded illuminati caste that all speaks the same language.  There is no "global civilization" that traces back to some singular inner circle, much as some cabals would love you to think so.

[1] http://www.christianbiblereference.org/story_TowerOfBabel.htm

Tetrascroll

Wednesday, January 18, 2017

Chronofiles

I've been chronicling a lot of my homework topics in my Facebook scroll.  Potorando (Portland, PDX) has been under a blanket of snow for the last week, which has been stressful in some ways but also a welcome vacation from daily toil to catch up on world events. There's so much to catch up on.

I study dance and music more than you might expect, in addition to movies.  Some "AI films" I've been listing: Ex Machina, Her, Chappie, and of course Artificial Intelligence itself (Spielberg, Kubrick). In connection with Chappie, I segue to Die Antwoord.

Another thread cites Tame Impala for its retro-psychedelic Feels Like We Only Go Backwards (very Yellow Submarine).

I'm accepting there's no point assuming some uni-polar world wherein the USA has the luxury of infinite time to process future shock, while this rest of the world has to rocket through the experience.

No inner circle controls spacetime to that level if human, and if not, then which science fiction have we switched to?  No, future shock is not shielded against by lead or glass, let alone legislation.

Anyway, back to my studies: I'm ironically not the bold futurist of the Hyperloop experiment, and instead suggest more Eisenhower-style freeways, twixt Iran and the Stans, over to Istanbul and so on, more of an EU like arrangement or like what Africa is aiming for.  You don't have to show your papers just because you're moving from state to state.  That's an experience of interstate travel people really appreciate about the USA and want to emulate.  I don't blame them.

So whereas Youtubes are showing these sprawling Hyperloop networks, I'm talking about trucking lanes. The trucks might not even be autonomous. So backwoods Oregon, right?  So not Silicon Valley.  However the Hyperloop vision takes somewhat for granted what we learn at airports:  the countries you fly over don't need to bother you with paperwork.

Lets remember El Camino though, I know that sounds somewhat out of the blue, and that has not been a recent Facebook topic.  I'm just thinking about how trucking is in other ways thoroughly regulated, with weigh stations and rules about getting enough sleep.  Drivers do worry about sharing the road with other judgement-impaired drivers.  We all do.

El Camino is for pedestrians, however they'll show paperwork when staying at various hotels along the way.  Use of a credit card also marks a trajectory.  I'm not saying the traffic along these roads will be unmonitored.  On the contrary, it's so monitored that stopping at boarder crossings is almost a moot point.  Information technology is what's rendering those obsolete, not some sudden outbreak of trust between nations.

Also, I'm quite accepting of the ODNI's observation that RT is influential.  I've watched enough of these old Yuri Bezmenov tapes on Youtube to agree on his major point:  a huge percentage of what spies do has little to do with picking locks, tapping phones, or sneaking around in illegal ways.  So much of what we call "intelligence work" is what Yuri calls "active measures" and that includes spreading everyday propaganda or PR (PЯ).

But what's propaganda then?  Lets just agree, for the sake of discussion, that it's an important factor, and accept that the Kremlin was likely more afraid of Hillary's harshness than of Donald's trademark blend of buffoonery. That's not even scandalous if so. We all have our preferences and, if we're powerful nation states, we have our spies to carry out their active measures, often fully legal.

Hey great if hyperloop technology works, as it's not either / or with trucking. Cargo travels at different rates. A "fifth mode" of transportation implies four others, not going anywhere. Of course I do pay attention to skeptics who say controlling the seals will be difficult but we learn from experiment more than from arguing sometimes. I'm happy to see bold experiments with new civilian technologies. More giant domes might be nice.

I connected the Manning case to Leonard Peltier's. I got to be at an event with the latter's son in 2016, another Oregonian. The media were mostly linking to Snowden and Assange, more recent cases, higher profile in recent times (and admittedly more directly connected story-wise, given how Manning went to Wikileaks directly, helping it become what it is today).

Tuesday, January 17, 2017

Elusive Dude


This story of Howard Hughes appears to check out on every level. The things I'm still learning...

Just this First Day at Quaker meeting, when checking out the rack of books on sale for fund-raising, I stumbled upon Kafka's first novel Amerika, published posthumously, who knew? Not me.

It's not a like a fancy Princeton education back in the day made me a know-it-all. On the contrary, my time in Firestone Library reinforced my appreciation for the power of browsing freely (it's open stack, at least to students).

The advent of the web browser, after I'd left (Class of 1980) further amplified our global reach, ala the vision of MEMEX shared by Dr. Vannevar Bush, in a famous article, in Atlantic Monthly.

I've been describing "different species of capitalist" on Facebook, ranging from "bling capitalist" (more Las Vegas, more showy, ties to organized crime) to the reclusive relatively low profile type.

Howard Hughes played it both ways: high profile in his youth, then tapering off to ever-lower profile, keeping his cards especially close to his vest when the public was supposed to think him dead.

Warren Buffet (Oracle of Omaha) is more middle of the road. My taxonomy is not fully fleshed out yet.

US Presidents may come from the rough and tumble organized crime side of the business (e.g. the Kennedy brothers), wherein "bling" is big. Thanks to Prohibition, huge sectors of the economy had become criminalized. Amerika was a nation of scoff-laws and sinners.

No one knows the inner psyche of Americans better than the Mafia, the industry in charge of catering to forbidden desires. No wonder Nixon got in.

The Silicon Forest capitalist, in contrast to the "bling" school, has a more egalitarian dress code, with net worth inversely correlated to the presence of a neck-tie.

The management structure is also "flatter" or "thinner" in many ways (fewer levels or ranks), more Pacific Rim, more Japanese, with less towering of software and hardware engineers over one another.

Grounded in the sciences, engineering is more about shared humility before nature. The ability to intimidate is hardly the point, when dealing with cosmic forces and exceptionless principles (Van Allen Belts and so on).

The Quaker capitalists of the roaring 1790s were less tycoon-tyrants or "rubber Barons" (as in Fitzcarraldo) than experimentalists in management theory. The ideal of a workers' paradise loomed large in these early days of automation (freedom from dirty jobs).

This ideal proved threatening to satirists with an investment in the status quo. George Bernard Shaw took on Cadbury. Having well-treated workers made everyone else look bad. Demonizing any such ideology as necessarily "anti-capitalist" (i.e. "socialist" or "communist") would be a future innovation.

The exploiter class needed to keep the standards low and therefore frustrate any lofty Quaker visions. "Go to Pennsylvania if you want to try out those zany experiments" was the word from on high, from the would-be competition.

William Penn's forestland ("Sylvania") would be our Quaker utopia.  Didn't happen.  Indian Wars came instead.

Neither health care nor education was a part of the deal in Oliver Twist's merry England. The public laws more about the ones on top, staying on top, than anything more broadly constructive for the common people.

That status quo explains the American Revolution in large degree.  Idealism doesn't like to be frustrated at every turn, needs creative outlets.

Even if no generation seems to "finally arrive" in the Promised Land, there may still be a sense of direction, a sense of continuing to escape tyranny.

Amerika

Saturday, January 14, 2017

Upcoming Commitments

I've got two Princeton alum interviews in my inbox, and a Welcoming Committee with the Quakers.

In the first case, Princeton has a time-honored tradition of matching up each applicant with an alum, for some meetup time. I see it as an opportunity to hear from someone who actually went there what it was like, and a first thing I might say is way different for different people.

In the second case, Quakers have a tradition of recording membership which, once gained, should not have to be regained over and over as one transfers between meetings.  So there's a hand-off process, involving some record-keeping and actual face time.

Speaking of Princeton, I'm observing on Facebook that people will start talking engineering and science when arguing pet theories about what did or didn't happen.  It's one thing to dismiss others' belief systems as "crazy", another to get good exercise stating what one believes to be recognizably science.  There's skill-building involved, not redundant with doing crossword puzzles or Sudoku. So does Princeton teach science this way, is the question.

What I'm suggesting is that a bright kid, fresh from high school, may have seen over 1000 hours of Youtubes on such disputed whodunits as 9-11. Where at Princeton is the course where adult discourse in this area is role modeled? Shall we expect panel discussions? Might we study the history of deceptions in general, back through the phony military build-up under Paton (the US general), concealing the ramp-up to Normandy? Lets not always pick the same examples, and if you do Gulf of Tonkin make sure you connect to The Doors (quiz question: what's the connection?).

Remember all the 9-11 stories involve deception, as hijacking is certainly that, not to mention dive-bombing the airplanes into stuff, outfoxing defenses. How do we have substantive discussion of what's raised in all those Youtubes, now that we're paying for the privilege?

For all I know, Princeton has been offering such courses for years. I'm somewhat out of date. I advise prospective students to check out a course catalog, regardless of their interests. This is the time to comparison shop. Many schools will be excellent but for different reasons, so it's up to each applicant to decide which reasons are the best reasons.

Wednesday, January 11, 2017

Alt Worlds


Thanks to Wanderer Bob Mcgown for cluing me about the above BBC special, which I watched start to finish across several Youtubes.  I'm pretty much snowed in; a day for studying.

The son of a quantum physicist tracks down what the story was. What was his dad really up to. They hardly talked while he was alive.

I tend to not think of "particles in transit" along specific trajectories, but of pressure building with a probability wave to "be seen" (materialize) collapsing in a discrete place.

The recipient [atoms] "see" (we could say "sense") the source through the double slit; a game of  quantum physics bingo determines which target actually gets to "tune in" the photon or whatever.

Putting detectors in harm's way means the collapse happens in the detector.  The receptive space (sensing surface) has changed its shape. In "transmission" it's a probability wave of finite speed, until detected.

However, talking like that may not make any difference to the mathematics. English offers a variety of grammars, complete with mental images, to fit the data.

I especially enjoyed the visit to Princeton University, with scenes of the "Dinky" (the suburban train from the campus out to Princeton Junction) and inside various halls and arches, part of my personal memory bank as well.

I've also been reading "Roger Rabbit's" thesis regarding cosmic gamma-ray bursts and one possible interpretation. It's making waves amongst some of my Facebook friends (the author, Charles Fleischer, did the voice for Roger Rabbit).

Monday, January 09, 2017

Sharing the Gospel

:: stories of Finland ::

Given news stories need to be brief on prime time TV, we have to expect homework through other channels, say History Channel or, more likely, Youtube. No that isn't me in the video.

Case in point:  Portland Public Schools pays close attention to Finland's public education system for good reasons.

We get it WDC doesn't care about the same things we do, different priorities and ventures.

They're into financial values over there, vouchers, paying off balances due. That's an important aspect of doing God's work, certainly. Thinking purely in terms of money has its limits though.

I'm in touch with public school teachers quite a bit, thanks to the Measure 97 campaign, which didn't succeed in passing.

We did get #CodeCastle to off the ground to some degree.  I've turned more towards MIT Scratch for my memes.

True, we have no budget for that microwave tower, replacing or in addition to the cross, facing @OMSI.  That's fine.  Plan B is in effect instead.  Teacher trainings in the Roost?  Not happening, to my knowledge.  We had to shelve our Plan A.

Those caring about Washington DC and its new Orange Party rules (corporate media still using the color Red for some reason, misunderstanding GOP did not survive Election Day #singularity), will obviously seem more up to date than little moi.

Given my job description, I can't afford to get sucked in to domestic / nationalist politics at every turn.  I'll check back in a few years on that #WallwithMexico campaign, how that all went.

Just kidding, that's a fun one.


Thursday, January 05, 2017

Get Baked Portland!

Get Baked PDX

People my age start checking for signs. I remember when Mary Bolton was so disheartened when signing her check Mary Butter at the checkout lane, when buying some.  Hey, we all make mistakes.

Still, I was worried when Deke the Geek kept telling me about this Bizmo in the middle of our local supermarket, and I kept going there, in a trance no doubt, and not seeing it.

So today I made a special point of looking it up.  Franz was important in my childhood, before I left for Italy.  Our Markham elementary school, it had to have been, did a field trip.  A real bread factory.  Impressive.

I've always enjoyed seeing things being made.  Kim Jong Un must really enjoy all those tours he gets, of factories, as a part of his job.

I went on some tours of Chinese factories in the 1970s, during the Four Modernizations.  We were looked up to, as a tour group, as a possible source of ideas.  Mostly high school teachers, from the bases, with me and Glenn Baker tagging along as diplomatic corps (expat brats).

I bought a loaf on the spot, in recognition of the company's acumen as much as anything.  Of course it's a hippie bus.  No reason to go overboard and go all Vortex.  Grateful Dead bread sells itself.

Meanwhile, back at Starbucks, Deke the Geek was catching up on Adweek. We did a mini-photo-shoot right there and then.

Age of Aquarius

Bakery Bus

Tuesday, January 03, 2017

On the Move

If you dig back into the early days of freeways and Detroit, and the future-world of the 1960s, Disneyland brand new, you'll find "traveling circus" caravans converging to schools, putting on corporately sponsored "futurama" shows. Am I right?; I remember looking into it.

Anyway, that's where the "bizmos" sometimes fit. I wasn't originally thinking food pods and food courts, which is where Portland and some other cities went with the idea. I'm not saying the food cart people read my blog or anything, just it makes sense for a van-sized vehicle to self contain some types of businesses. I thought that too.

When the vans or bizmos arrive at a school, they have some show or experience to create, lets call it a science fair and a kind of job fair. Students feel like they're being recruited, but usually with no way to make specific commitments, as these events are more informational than missionary.  If you want to follow-up you'll be able to but the bizmos produce a standalone event.  Something like that.

In one incarnation, these "GNU mobiles" would mostly be sharing the essentials of the POSIX world, already an esoteric place, where the typewriter starts talking back to your commands.  An operating systems keeps a computer engaged with tasks, sometimes running in the background. I could as well imagine an Hour of Code van set to share Scratch or one of those block-based languages.

Today I signed up as a co-speaker on two Pycon 2017 proposals. That's the local North American one (so far, in radius), a "mother ship" in some ways, as the PSF showcases it as a model.  Other Pycons use the trademarked name to certify a level or standard, not a new idea in business models, one with a proven track record.  Finally, many Python (the computer language) related events may not use the "Pycon" trademark at all. PyOhio comes to mind.

The talks I signed up to co-speak about have to do with a scheme Charles Cros wants to share publicly, having developed a working demo and used it with his own family. A use case would be a parent wanting kids at home to earn their play time on the web by winning at games deemed in advance to be suitably educational.  Games may involve extensive readings, in other words I'm not always suggesting the stereotype "twitch game" associated with pinball and other arcade games.

Speaking of Python, what's going through my head these days was inspired by Trey Hunner's recent delving into the iterable : iterator distinction.  The former category of object, if run through iter( ), will trigger an inner __iter__ that comes back with a new object containing __next__, thereby completing the iterator protocol.  For example, an ordinary list object is an iterable with no __next__.  Run it through iter( ) and a __next__ appears in the new butterfly-from-caterpillar iterator object.

The plot deepens however, in that even __iter__ is not required, so long as a __getitem__ is present. The latter handles square-bracket indexing as in object[0], object[1], object[2]... The idea of "advancing an integer" from zero outward, is intrinsic to our notion of iteration. So if your class (type of object) at least implements __getitem__, then iter( ) will know enough to pull an iterator rabbit out of an iterable hat.

Here's the script. Iterable is a generic type with a way to set a starting value through __init__ (at birth), and then reflect the ever increasing value of n, as next( ) drives some internal __next__ to keep driving __getitem__. I'm not talking about code we anywhere write, as Python programmers. We simply count on next( ) to feed successive integers, starting from zero, to __getitem__, to "do the right thing" behind our __next__ calls.

Safe to say, your own __getitem__ may not be quite as simple as this one.

slide1_iter
slide2_iter

The output, showing "before" and "after" tests, with iter(it) run in the middle, returning a new object in which __next__ is indeed a part of the API (the "bag of tricks" associated with a class of object).


slide3_iter

As Trey well explains, we don't necessarily use next( ) to drive the action. The for loop construct is precisely "that which uses an iterator" to iterate through some body (block or suite) of code.

When we get to the end of the rope and push passed the last in the series, should one ever be reached, a StopIteration is raised, which the for construct handles in stride as a simple signal to stop, with a possible run through an else clause if present.

The iterator later hatched into a full-fledged co-routine by way of the function generator concept. The keyword yield gives another way to provide a __next__, short of feeding anything through iter( ). A generator begins life as an iterator right out of the gate.  We will pick up on their story in a future blog post.

Sunday, January 01, 2017

More PЯ









Praise Bob!