Monday, August 29, 2016

Code School Evening

DSCF8358
minecraft-based demo of on-board GPU

The new bike has a nifty pump, which I used tonight, to get back over Tillikum.  Then I walked it home, slanting through to Palio in Ladd's, up Harrison passed St. David of Wales, and the LDS campus.  Home before 9:30 PM, with a bright red rear light the whole way, even when walking.

Ladd sisters, of the family for which this Addition is named, before my time, used to have a photography school way up the Gorge on a houseboat.  The Columbia Gorge had only recently opened to a new form of tourism involving scenic photography as a hobby.

At the code school tonight I fired up the Pi again, on the HDTV. I had my 4D stills.  Ray traced.  I say 4D as a kind of branding, not referring to Time.  Ben had a new Pi too, same make and model, and he and another guy helped me catch up on Minecraft a little, at least in create mode.  Peter Farrell is still ahead of me there.

These 4D shapes are ordinary convex polys, generated using the geodesic program in Antiprism, a suite of tools by Adrian Rossiter.

I've been working on getting his C++ to compile on the ARM chip in a small Raspberry Pi 3, Model B. The thing boots off its GPU which doubles as a sort of BIOS.  The Pi3D module, imported within Python, seems to be getting full value from said Graphics Processing Unit.  Farrell's Hacking Math Class, uses Pi3D quite a bit, also the turtle module.  Wifi is also built in.

I also compiled Povray, a program I used in Windows a lot, way back in the days of CompuServ.

Now that this tool chain is working, I can do something like this...

geodesic -c 1 -f 6 > output.off
off2pov render_me.pov output.off
povray -Irender_me.pov

That's roughly how it goes, minus some switches. I get a PNG file out the end, suitable for tweeting.  Some of the STEM teachers already have a stack of Pis and are looking for worthy projects.  I've been filing my reports.

I introduced myself quickly as "a lobbyist" as we went around the circle, mentioning my work with the teachers, especially high school math teachers.

I had Peter Farrell's book in my briefcase, strapped to the bicycle.  It sits next to my Pi Station in the CodeCastle as well (I've also used CodeCastle with reference to a certain neighborhood "ghost church", but that's still speculative fiction at this point).

Someone brand new to Portland, just moved here, expressed his intent to dive into Natural Language Processing more. We talked about Elisa, Racter (another "convo-bot"), the Tom Sawyer corpus, and setting up a measuring protocol of some kind.  The algorithm could measure negativity in some way, for example.

This wish for a protocol is characteristic of Nat's project as well, relating to motion and profiling autistic features. Nat and I have followed up a bit since our meeting, regarding the recently proved Kepler Conjecture, seeing as how the proof bridges mathematics and computer science, a theme in my lobbying for Measure 97.

(Art + Code + High) * School = 
Art School + Code School + High School

Here's a way for teachers to generate more synergy amongst themselves, from which their students might benefit.

I'm back in the world of bicycle tubes and tires, not a bad world to be in.  It got me there just fine, even with the slow leak.  Coming back, I needed the walk anyway.

Regarding Antiprism, I don't currently use antiview, the included highly capable viewer, because the flavor of OpenGL used on the Pi was not Antiprism's target OpenGL or development platform.  Antiview compiles, just isn't displaying content correctly. That's OK.  Having povray working gets me where I want to go.

DSCF8350
antiprism + povray on a Pi 3

Wednesday, August 24, 2016

Geeking Out



Down in the basement, in the VML, I've got the Raspberry Pi cranking on installing a free GLUT. That's a library Adrian Rossiter depends on for his antiprism, or at least the antiviewer component thereof.  He thinks it might work.  I promised to update him on my progress.

So far the installation is going well, thanks to these clues for installing freeglut3-dev, after which ./config, with no other switches, reported "good to go" on antiviewer.

2016-08-24-155017_1824x984_scrot

Carol (WILPF) is out with Barbara (WILFP), at Denny's, "the America I believe in" as Carol put it, going out the door.  She doesn't believe in this "other America" they're outing by snailmail.

She's getting around more slowly, I think still quite strong.  She needs another checkup tomorrow.

I met with Friend Leslie last night to sort out health care issues, and then Nat, an expert on autism.  I suggested he check this Youtube by EBN for all the characteristic movements it invokes, through the magic of video editing.

I held court at The Bagdad, these two appointments back to back.  Leslie connects to FCNL, the Quakers' lobby.

Although I've found ways to install gcc 6.1 or one of those, the gcc version on standard Jessie (the Raspian distro) should be OK, says Adrian.  I'll go downstairs and resume operations in a sec.

Carol and Barbara work with WILPF (Womens International League for Peace and Freedom), over a century old by now.  Mom went to their Centennial in The Hague.  They're mailing around the poster shown below.

Funny how what used to be treasonously cynical criticisms of the Pentagon have now become marketing memes.  "Animosity towards Russia is good for business".  Yeah right.  "Yes it's a jobs program."  "Yes it's 1984, did you have any better ideas?"

I see a lot more promise in the space program, where we continue in the tradition of Apollo-Soyuz.

I'm surprised the DoD still finds many scientists willing to sacrifice their reputations for what's empirically speaking a dumb campaign.

Around the Beltway you'll find anything for a price I suppose.  Maybe that's why more think tanks have moved west (e.g. Stanford)?

Leave the legalized / sanitized media to practice their pseudo-science and witch doctor rattling (no offense to real witch doctors).

Yesterday I paid a visit to the Veteran's Administration hospital and got the above pictures.  My friend served in Vietnam, but he's not disabled but for the dental problems.  He's therefore only eligible for tooth extractions at above market rates.

If Americans don't want as many refugees to seek refuge here, there's always being more up front about how we're poor. Uncle Sam is broke and it shows.  Why come here of all places?  I think many refugees know that, and are staying put or walking elsewhere.

This morning I worked with NPYM's cloud provider to get to the bottom of an email glitch that's been driving our Secretary wild.  We may have gotten to the bottom of it finally, a faulty Mx record on their end.  Time will tell.  I was on the phone for some time, bouncing around in tech support world.

World news:  attack on the American University in Kabul, where one of our Thirsters is on the faculty; big earthquake in Burma; another in Italy; teenage girl in a cross walk hit by driver with suspended license doing like 50 mph on Hawthorne Blvd.

DSCF8076

WILPF PR

DSCF8164

Sunday, August 21, 2016

Refugees / Camping

I've been writing on QuakerQuaker about the "camping" meme, more.

Back on the infamous Forum 206, since tied off, but still publicly archived, I wrote a lot about "scouting".  They go together.

Lifestyles involving "camping" and "scouting" would seem in the cards for much of humanity, and has been normative for millennia.

"Outdoor lifestyles" are marketed as voluntary activities to a privileged few.  Most campers are not in their refugee camps by choice.  Many were born there (like Kiyoshi on Heart Mountain).

Given advances in technology, "living outdoors" doesn't need to always invoke the same mental pictures, drawn from centuries gone by.

I'm finding Twitter rather impoverished when it comes to projecting positive lifestyles that seem more like camping than city living.  Is this perception a consequence of whom I follow?  I don't think so.

The culture is fixated on driverless cars, drones, and AI-everything. Dreams from Silicon Valley.

As I express on QuakerQuaker, I'm not sure if we're still able to take on geodesic domes and spheres like we saw in Montreal in 1967.

We've not moved ahead in architecture that much?  We had a golden age, now passed?

However, I'm thinking we could bring those back and do more experiments ala the Garden of Eden domes in Cornwall.

The gardening tenters work within, in a climatron.  Maybe they have other shelters as well.  Living conditions are improving.

Unless we show ourselves these projections, they won't gel.  Showing ourselves only war scenarios prepares us for those, hardens our hearts.

As the Paul Allen Museum of Science Fiction in Seattle exhibits:  our fantasies about the future are more than idle entertainment.

My essay explores the notion of transplanting colonies en masse, but with a game plan.

I'm not some pyramid schemer selling the notion of getting individually rich and retiring in Beverly Hills somewhere.

A large camp of refugees in Costa Rica is determined to try its luck further north, and what I gather through WILPF in Ojai, and through my mom, that this camp is collectively projecting such a future.

Would more movies help?  Who makes documentaries for refugees, showing them what the realities are.  Letting the world understand we're all in the same boat, not rich versus poor, might spark more of that spirit of innovation.

America is a nation of refugees already.

How might refugee camps be upgraded?  That's addressing the root causes of war and so is waging the war.

In suggesting we make camp life less miserable I'm not being altruistic or selfless, so much as strategic and tactical.  War talk is too moralizing though, as it preys on "extreme criminals".

I focus on bases as well, a kind of "camp" though more about "campaigning".  We have refugees here as well.  The para-military encampments have their refugees also.

Rather than "divide and conquer" pitting "vets" against "refugees" or "homeless", we need to tune in the homeless vet refugee.

Silicon Valley is seeing the writing on the wall.  We wanted a lot of automation to save ourselves from drudgery.  Semi-autonomous communities that do more of their own farming would do well with high tech.  So how do we get there from here?

DSCF8015

Friday, August 19, 2016

Addendum Regarding SSL / TLS

My previous post in this blog is about a world readable tiny web application I'm using for work, to teach the basics of web dev in Python.

The specific micro-framework solution I'm using is named Flask, a free and open source project, BSD licensed.

How long I'll keep my teaching demo going in it's present form I don't know; that's a business decision depending on more businesses than mine.  For example, I'm using the PythonAnywhere service as my host.

Flask is a WSGI application, which is like the DB API for talking to SQL databases, except in this case to web servers.

The Flask application is imported and renamed from "app" to "application" in the auto-generated script below, which also provides a path to my codebase, here added to sys.path if need be:

wsgi_config

Anyway, notice I'm using HTTP and not HTTPS when serving from my PythonAnywhere account.

The added "S" is for "secure" and the difference will likely be signified graphically with a little picture, an icon, of a say a padlock, next to the URL (web page address) in question.

The "secure icon" appears once handshaking has established a mutual understanding about what encryption algorithm to use, a multi-step process carried out automatically between the client and server.

Otherwise, if plain old HTTP is used, the browser may show an "I" for "FYI" and that well tell you "not secure" i.e. not using HTTPS.

Different browsers have different ways of graphically signifying whether or not encryption is being used.

Talking over the wire in HTTP or HTTPS does not actually require a "browser" on the client end, as many web API calls are possibly coming from simple scripts.

My API models talking with both types of clients, in JSON to the latter, in HTML to the former.

My goal in the forty hours (or less in some cases) is more to establish a strong reading knowledge of Python in particular, and this Flask app marks our foray into that territory.

In my discussion of the application, I'd likely take this opportunity to dive back into encryption as again relevant to our "API economy".

I say "again relevant" because more than likely we'll have already waded through the code of something more like my "Permutation class".

My Permutation class is Python class designed to show off operator overloading capabilities while introducing the Group Theory notion of a "permutation", a "scramble" of objects mapped to themselves in some different order.  I used a Python dictionary wrapped in a class.

"A 'scramble' of objects" sounds like encryption already, right? :-D  Or shuffling a deck of cards.

If the purpose of a website is simply to sit there like a book on the shelf in a public library, pretty much put there for the purposes of public inspection, then I'm not concerned if it's using HTTP and not HTTPS.

What's more important than "which protocol" is that we keep in mind that there's a difference.  Driving the unencrypted APIs into an underground API economy would be ironic, no?

On the other hand, in a presentation taking us more deeply into web dev in particular, less focused on generic Python, one might dive more deeply into the specifics of TLS, as Cristina Formaini does in the linked presentation above, in my "tweet".

My focus in sharing Python in forty hours is somewhat like Amit Saha's in that my audience might be high school math teachers seeking to integrate more coding skills into their chosen field.

Wednesday, August 17, 2016

Dissecting a Flask App

elems_app

"How might I share content to the world through some web thing?"

I'll show you how we might do that in Python.

http://thekirbster.pythonanywhere.com is where I'm serving my example.

The source code is on Github.  Also:  see Addendum (followup blog post).

The engine sitting behind the HTTP listening port is a WSGI process named Flask, which is an already completed project that just needs to be hacked on (customized).

flask_app.py, the custom Flask process (written in pure Python), routes (dispatches) incoming web requests (web addresses, URLs) to Python functions.

Each function develops an appropriate response, either as HTML (styled for human browsers) or JSON (bare bones data, more for machine readers).  We call this a web API.

HTML or "hypertext markup language" is what your web browser is designed to render into web pages, possibly interactive thanks to JavaScript, if you have your JavaScript engine turned on.

JavaScript is also known as ES (ECMAScript) and is not the same as Java.

Python also talks to SQLite databases on the server, to look up and serve the requested information. The application also handles POST requests, with a simple hard-coded string for authentication.

Add chemical elements to the Periodic Table database (Elements table) or new terms to the Glossary database (Glossary table).  No delete or update features have been implemented, as a goal is to keep the application's anatomy fairly simple.

I'm using Python "context managers" to open and close the database files, as needed.


In my forty hour Python course, I take you through building a context manager using contextlib, from the "batteries included" Standard Library.

Forty hours is about right to develop a strong reading knowledge of Python, which in turn provides enough traction to keep improving your own code through practice.

SQLite is also included in the Standard Library, as sqlite3.

The HTML is developed through a Flask component named Jinja2, which allows Python to pass content from the database into a web page that's being built.

Jinja2 uses templates as raw material, very like HTML files, which in turn link to Cascading Style Sheets (CSS files) and any JavaScript (.js files) we might need.

The well-known Django framework, also in Python, is quite similar to Flask in structure, and also includes a templating engine.  Web2py is another one.

A standard development process for writing these things is to have your localhost serve a developer version, the one you hack on, then practice (A) keeping the Github version up to date and (B) maintaining a world readable cloud instance.

We also do a lot with Jupyter Notebooks during the forty hours (or less if the course is accelerated).

DSCF3099

Monday, August 15, 2016

Martian Math in Chinese?

4dsolutions


Chinese Peace Corps


Saturday, August 13, 2016

Basement Revolutionary

DSCF7842


John Taylor, the retired regional planner from Indonesia, working on his autobiography, took Carol and I out to Maru last night, our favorite local Japanese restaurant.   

Maru was quite busy on a Friday night, however we were seated quickly and enjoyed stellar service and menu items.  I had Tokyo Ramen with IPA.  We shared Korean cold sesame noodles and some tofu delights.

Earlier in our story, when John was thinking twice about whether his HP Notebook computer was good enough for such authoring, Patrick and I had suggested buying an "inexpensive" or even "junk" computer just for the duration.

Loading it up with Office Libre and leaving the beast behind when heading back to Jakarta.

The operating system is legally free, as are office-related applications.  I've added a Chromium browser to mine.  The device came from Amazon already loaded with Office Libre, two flavors of Python, and Wolfram Language.

However, John is on a tight schedule and catching up on Linux technology is made no easier by the absence of these technology magazines from many stores that used to carry them.  The campaign to dumb us all down, into "mindless consumers" is endless and quite effective.

Given the photo op studio I'd created anyway, that very morning, the Verboton Math Lab (VML), I could load up a copy of his autobio from a USB stick.  It all went smoothly.  I'd purchased two 16 gig USB sticks earlier, for under $8 each, at Fred Meyer's.

He enjoyed posing for my diorama as it were:  a Quaker revolutionary (in the sense of overcoming the idiocracy's collective degeniusing).

Per Lindsey's advice from Kathmandu, it's an average Portland basement, not impermeable to groundwater when it rains heavily.  Water pools.  Our last house, the rental around the corner, was so much worse, in terms of permeability.

There's nothing permanent about a Pi-station necessarily, plus I'm free to use the Air down there too.

We're enjoying a heatwave at the moment and the basement is cool.  I don't run airconditioning and rarely heat.  Our climate is like that.

Besides, I'm busy waving Pis around as less dumbing down that what Church of TI says you should use.  TIs don't come with Office Libre.

I've featured the XO (One Laptop per Child) as a "basement revolutionary" of sorts in earlier chapters, and that it was, in the sense of "covert game changer".

You may remember raising expectations that laptops would become way more affordable, and in the hands of more children, was a goal, and the XO set a higher bar in terms of quality (swivel screen), and a lower one in terms of price.

The market enjoyed a significant reshaping as a result of this newly achieved price point, mixed with an effective marketing campaign (G1G1).

The Pi is somewhat in the same lineage, but is just the guts of a computer, sans peripherals, not a laptop per se.  I understand it will run Windows, just have that on the SD card when it boots up.

Basement Revolutionary

Thursday, August 11, 2016

Broadband Church Networks

Transceiver Station Location





Comm Tower

Further reading: Re: US District Court 6 versus FCC

Tuesday, August 09, 2016

Disarm Day 2016





For further reading:
Disarm Day in PDX (on QuakerQuaker)

Monday, August 08, 2016

Indo Expo


Glenn and I were curious about this Expo and Jobs Fair, and so took the Yellow Line out to the Expo Center.

If in tourist mode, then right off the train, check out the subtle memorials to the days when Japanese were proving economically successful, especially as vegetable growers.

Other farmers were jealous of the Japanese (or "Japs" for short) and wanted less competition and more land.  WWII gave them exactly the excuse they needed, to confiscate the lands and own all the vegetables.

Today's Expo was about "vegetables" as well, cannabis in particular.  Prohibition has only been repealed in a few states as of this writing, to the degree where only a tiny minority of US Americans might legally enjoy what God put freely on this Earth.

Lots of money and jobs are stemming from this boom economy, however most states have no such opportunities as the Feds are still criminalizing it, like they used to do with booze.  The repeal of the 18th Amendment, in the form of the 21st, did nothing to make cannabis less of a controlled substance.

However, tax-starved states and municipalities recognize a cash cow when they see one.  Since they're allowed to get money from gambling and selling alcohol, why not from marijuana as well?

The presidential candidates, meanwhile, are about as silent on the issue of rolling back Prohibition as they are about US colonialism in Puerto Rico.

We might tie our story back to the theme of unwanted competition at this point.

When US corporations started large scale farming in Hawaii, they found themselves up against those productive Japanese again.

Japanese were uppity and believed they had human rights.  The solution was to bring in more Puerto Ricans and Filipinos, who would work harder for lower wages.

In a later chapter, the GM-type corporations would again become heatedly anti-Japanese, as their local car industry started feeling the competition.  Demonizing Japanese was in vogue once again.

Of course Korea, still smarting from America's supporting Japan after the war, in keeping Korea partitioned, is not inclined to support Japan all that much either.  Korea is a lot like Russia in asking why America stayed so friendly with the Nazis.

Because history is messy?  Many Nazis were good at STEM and the military industrial complex needed more lethal weapons, the better to fight anti-colonialist nationalists or "Communists". Guatemala, El Salvador, Nicaragua, Grenada... and that's just in the "backyard" (where a lot of the fruit and vegetables come from).

Lets remember that many "governments" (i.e. the "gangs in charge"), if wanting to stay eligible for Drug War money (to buy weapons), which the US dispenses with largess, need to kill, maim and imprison their own people, just like the Big Daddy USA does.

Having extorted money for weapons from drug-using US Americans (mostly prescription, pushed on TV), the USG then uses it in Afghanistan to destroy lucrative opium crops, and cocaine crops in Latin America.  Ruthlessly destroying the competition is what "capitalism" is all about.

This ongoing destruction of infrastructure and local economies is done in the name of Christianity as well in many cases, as religion hates competition from medications.  Priests alone must do the healing.  Remember what Marx said about "opium of the people"?  Exactly.

Other insecure religions besides Christianity fear the competition, from entheogens in particular.  Only the officially designated and approved authorities should mediate between the masses and the many varieties of religious experience.  That usually means psychiatrists, or priests, not shamans.

Demonizing drugs not authorized by state licensed practitioners, the ones who play the game and pay for the privilege, is the point of endless propaganda campaigns.

Now that Oregon has licensed its growers and sellers (many of them), there's a ceasefire in the demonizing, as there's money to be made.  The bankers are especially miffed, as they're under pressure from the Feds to not play on the "wrong side". But then which side is the losing side?

Years of Prohibition turned US Americans into criminals and scofflaws pretty much across the board.  As Americans, we're used to thinking of laws as tools of oppression, meant to be broken, with pride and a clear conscience.  Laws against interracial marriage were about dividing and conquering the workforce.  In retrospect. Apartheid looks like Jim Crow which looks like Nazi Germany.

The stereotypical cannabis users (or "stoner") has not even a smidgen of guilt or remorse for indulging in such "depraved" (i.e. "sinful") activity.  They're typically not bombing and terrorizing others, so actually feel morally superior to those doing the bidding of company slave masters.

The USG is relatively easy to demonize on the other hand.  It's really hard to see why anyone would want to be a US president.  Why have something that ugly on one's resume?  Who wants to brag about being a warlord?