Sunday, November 29, 2015

MAMP Success

mamp_pro_demo
control panel:  manage MySQL + Apache


MAMP is the community / free version of MAMP Pro, a product out of Germany.

I'm having a pleasant experience getting it to work with the latest Anaconda, meaning I'm able to get not only PHP working against its MySQL database, but also Python 3.5 as a mod_wsgi application under Apache.

Not only that, my Anaconda Spyder IDE is happy to let me connect to the same MySQL database interactively, through the REPL, after using conda install to grab mysql.connector -- pretty painless.

conda_connecting
talking to MAMP's MySQL on localhost:8889 (other ports possible)

First I scared myself with some reading on StackOverFlow, then these excellent two blog posts, at Racing Tadpole by Arthur Street, and this WSGI tutorial from where I grabbed some code.

In practice however, much less was involved in getting all this to work.  I've learned to study log files more and the Apache error log told me what I needed to know:  Target WSGI script '/Applications/MAMP/htdocs/pyhello.py' does not contain WSGI application 'application'.  Thank you.


need_wsgi_app
MAMP shows Apache log files

conda_sql
using conda install to get mysql-connector-python

OK, now that we're through the headlines, let me given some more background:  you might want to use MAMP to mirror whatever LAMP stack you're developing, perhaps still learning about LAMP in general.

I'm using MAMP to finally tackle PHP which the Quakers are using at NPYM.org.  As their Technology Clerk, I want to bring my skill set more into alignment with that org's needs.

I'm reading through a book in Safari On-line, Head First PHP & MySQL by Beighley and Morrison, where we're trying to rescue this guy's dog Fang, which was abducted by aliens. Thanks to mysql.connector, I'm reading the very same database of alien abuction reports from Python as well.

php_book

Anaconda from Continuum Analytics is the hot Science Oriented Distro (SOD) for those wanting a cutting edge slice into scientific Python.

Am I saying it's either / or, as if web development were anti-scientific?  No of course not.  I'm just exulting at the inter-operability of these two well-supported tools.  Note that I'm using #!/Users/kurner/anaconda/bin/python as my shebang line of the wsgi scripts.

wsgi_anaconda
remember to tell Apache which Python we're using i.e. Anaconda's 3.5

Yes, I'm on a Mac.  I'm not sure how all this comes together in Ubuntu, I hope just as seamlessly, and of course on Windows.

Saturday, November 28, 2015

THG: Mockingjay, Part 2 (movie review)

We're like people in the time of Charles Dickens, getting Oliver Twist or whatever in serial format. The episodes are not all collected in one novel yet.  Or at least I gather that's how it went with many of his printed works:  they came spread out over the months or even years.

Like Star Wars, these serialized spectacles come to be seen against the backdrop of one's own life.

I still remember my first Star Wars (the first ever), with the Brodheims on Long Island, all of us fresh from the Philippines, the younger generation heading for college, their family tradition being a Christmas Day movie (do I have that right?).

Mr. Brodheim, a holocaust survivor, hadn't known what to expect (he wasn't following the culture closely), and he wasn't prepared for a soap opera (a melodrama -- not implying a musical).  Was he thinking more a documentary about astronomy or something? -- at least this wasn't Wagner.

The Hunger Games remains interesting to me, a source of reflection.  Katniss is intuitively following the action and like the others is highly fatalistic about her role.  A sense of choice is lacking.  That kind of freedom is in short supply.

The tension between the districts, and the capital, drives a deadly serious game, a form of spectacle, which reminds us of our own role, as consumers of slickly produced broadcasts, filled with spin.

Our screens in this region have filled with relatively benign sports (non-mandatory viewing), mostly featuring an oblate (non-hexapent spherical) ball.  Yesterday (while I was in THG matinee) was the so-called Civil War, an annual event in Oregon, starring Oregon State University (Beavers) versus University of Oregon (Ducks).  Today it's Michigan State versus Ohio State (on right now, 2nd quarter).  Ducks and Ohio Buckeyes won against the Beavers and Wolverines respectively.

Our screens also fill with the violence of the ages (including our own).  On the fear-versus-longing axis, we're tilted towards fear, as the future has mostly been left blank by political leaders, but for some projected Mars adventure. We're afraid we might blow up or starve.

Civilians suffer at the hands of those with ordnance (landmines a lasting legacy). Producing killingry (a Bucky word) with the intent to abort human lives remains more profitable than producing livingry in the form of safe cities e.g. the people of Flint have been poisoned.  Food Not Bombs is still considered a subversive message in 2015, although NPR did focus on food waste recently, with its review of the new movie Just Eat It.

To Katniss, it's all personal i.e. her personal dynamics, high voltage and intense, mirror the war she's fighting.  Others are more caught up in a labyrinth they may not understand, or see differently.  She personifies even as she channels her world's global tensions.  Except I'm unclear on the history, not having read the books.  What was the basic issue anyway?  Lack of food?  I never got a good look at the globe.  That must be Earth?  But when?  I lack the backstory.

The ethics of dealing with "extras" i.e. of turning others into mere pawns in one's own brand of theater, is a core focus of this film.  Collateral damage is inflicted deliberately though perhaps counterproductively.  People will turn against their titular masters if they believe in the effectiveness of their supposed liberators.  What do their potential liberators say on television?

Turning civilians against their own leaders, or spreading mutiny in the ranks, may involve false flag operations, engaged in to manipulate public opinion.  THG is all about media wars, psychological parries and feints.  Snow and the Mockingjay are both spin doctors.  In that world, ethics has a lot to do with one's ability to solve puzzles.  Minus a strong ethical compass, paralysis (staying very still) may seem the better bet.

I might go so far as to suggest these movies are a study in precession: consequences that may be equal, in the sense of conserving angular momentum and inertia, but far from 180 degree opposite in the Newtonian sense of action + reaction.  Maybe split that into three (action + reaction + resultant) for more complexity, a needed leap if intending to play games, war or world, in some militarized theater.

A lot of unpredictability and butterfly effects influence any game worth watching.  Even chess has this element.  Sometimes only the impossible seems to happen, against all odds.

Saturday, November 21, 2015

Permutations

permutation

I'd say a Permutation is a sweet spot in computer science, in that it's a mathematical primitive that's just complicated enough to require enough code to be interesting.

You will gain some traction, in whatever language you're learning, if you can implement a Permutation in that language.

What is a Permutation then?  A one-to-one scattering of elements to themselves in another order.

Picture an arbitrary pairing of the numbers 0 through 9 with themselves again, in any order: {0: 7, 1: 1, 2: 0, 3: 6, 4: 8, 5: 4, 6: 5, 7: 3, 8: 2, 9: 9}.  In Python, the dictionary object works perfectly.

I get to teach about the Permutation type live through a microphone, then upload the source code for asynchronous inspection.

Permutations of finite elements may be multiplied, and therefore powered.  They may also be inverted, for which operation I use ~.  A permutation times its inverse is the identity permutation, which maps every element to... you guessed it, itself.

For further reading:
November 2015 postings to edu-sig
Group Theory for Beginners (MathFuture Google Group)

Monday, November 16, 2015

Going Clear (movie review)

By the time this documentary is over, we have to see it as mostly critical, in the sense of damning.

But lets review a few points made early on:  there really is quite a bit of fuzziness on what constitutes a religion; Hubbard (LRH) was living the life of a novelist who had come to believe in his narrative and cast himself within it.

He didn't take the money and run, as the more cynical charlatan might have.  He continued to work out with his E-meter, trying to make it more powerful, that the last of the BTs (body thetans) might finally be removed.  He absorbed a lot of military memes and used them to build his top-down org / pyramid.

More a dupe then, though with elements of shyster certainly.  The guy had tremendous hubris and saw himself as larger than life.  He let it go to his head, but then what did he have to lose after a certain point?  "Might as well see it out to the end, in for a penny in for a pound" would become the operative psychology.

Given an army of doting minions, he could also afford to be aggressive, leading a charge against other temporal powers (the IRS mainly), a battle he eventually won.  That's saying a lot given the old mantra about death and taxes.  That was quite a feat, to beat "the man".  Who does that?  He did have impressive skills.

In the sense of eating his own dog food, he's not that different from other religion founders who've bought into their own tales.  That doesn't prevent us from seeing him as a seriously messed up individual.  But then what exactly is mental illness?  Again lots of fuzziness.  We're not talking settled science.

His original struggle was to break free of mental illness, criminality and war.  Travolta:  what's to argue with there?  As a Quaker, I have to like the beyond war rhetoric.  Is Scientology anti nuke weapon? My Google search suggests that it is and mom confirms a Scientologist wanted to join their recent UNA meeting in Missouri, but was not especially welcomed by others on the board (mom said he seemed like a good guy).

In bringing up "fuzziness" I'm not looking to dodge the hard questions.  I've never spent a dime on Scientology nor read Dianetics cover to cover.  My friend Ray Simon admired LRH and worried he might have died already (early 1980s).  He wrote some letters.

I remember Ray's delight upon getting a note, believably from Hubbard, saying he wasn't sure what Ray's question was.  That was about 1981, so yes, that was likely an authentic letter.

Ray exposed me to improv and a NYC Scientology celebrity center.  This was after college, when I began to more seriously understand "show business" and the hunger for star status, notoriety, visibility, a place in the sun (or The Sun as the case may be).

As a logistics supervisor for est in New York City, which I did get involved with, I was starting to meet more people trying make a living through acting, in soaps, in commercials, in whatever gigs they could get.  Scientology offered to help with that, with other stars, like Tom Cruise, helping recruit new adherents by advertising Scientology as a key to their own success.

I hadn't known how deeply Hubbard's roots were right there in LA.  Makes sense.  That's where we see all those buildings, which I noticed one Christmas season, some years ago, walking up and down Hollywood Boulevard.  It's a religion that works in synergy with Hollywood.  Celebrities help build the church which in turn helps them build their careers.

Given how much depends on image and reputation, tarnishing accounts are seen as a threat and it's part of the church apparatus to defend the brand, especially against buyers' remorse, buyers being, of course, a main source of revenue.   A goal is to help the faithful keep their faith.  Don't let Hollywood go hollow.  Making an example of public dissenters discourages any public dissent.  Excommunication as a "suppressive person" is a form of banishment, and therefore feared.

Following the arc of Scientology helps us explore other religions and governments, as the same patterns are oft repeated.  What's so amazing about Scientology is how Hollywood it really is, in how it lives up to a caricature of itself, as if a screenwriter set out to make a cinematic science fiction movie about a religion by, for and about actors.

For an institution so real in the history books, it has the flavor of implausibility, a fevered dream.  Really, this could happen?  History is stranger than fiction sometimes, that much is clear.

Speaking of est, many stories on how C/S attacked Erhard's reputation are already out there. Erhard was perceived by Hubbard as stealing Church IP and was therefore considered "fair game" by its Office of Special Affairs.

Tuesday, November 10, 2015

Teaching Philosophy

I posted this to Bradford (cc Koski) recently, on one of the listservs:
I'm teaching adult philosophy students mostly.  We study Hegel, Heidegger, Fuller and Wittgenstein with a little Kierkegaard and Kaufmann around the edges.  From these greats, one may branch to others.

My friend Applewhite (collaborator on Synergetics) liked the Fuller + Wittgenstein combo quite a bit.  That's something I've developed.  Quadrays are a "language game" we use to investigate the foundations of mathematics. 

Is Kantian space 3D or 4D?  Verdict:  it's cultural. 

We also do some mathematics of course (philosophers always have), writing in Python perhaps (very pithy).  We might watch some of your Youtubes and have some paper plate sculptures in the Gallery.
I should be clear that the verb "to teach" as in "I'm teaching..." has come to mean new things.

Like I've been teaching Python for years without walking into 1879 Hall at Princeton and actually lecturing students.  I even teach in real time, yet not in a classroom.  Continuing to quote the same post (one typo fixed):
But the goal is not to disabuse Earthlings of their Cube fixation by coercive means.

We'll infuse some Martian thinking, that's unavoidable, but there's no "takeover" planned.  Humans are known to be violent and paranoid.  Partly why the Martians left their kids home (see "ratings" discussion) and surrounded their apartment with a LuxBlox fence [tm] is they know humans dislike anyone defying their Orthodoxies.  "When in Rome..."
However, philosophers especially, given their reputation as once at the top of the academic pyramid, have a need to be deeply informed about matters literary as well as political, and it's come to the point where not understanding Synergetics at all is like having egg on your tie.  They might eventually laugh you out of the department. 
So we needed a quick intro that's over quick, and Martian Math is it.  Takes maybe 10-15 minutes to get it in brief, with more background optional, and you're good to go.  Next time someone says something knowing about Fuller's Synergetics, you'll know to nod knowingly as you'll be in on it too.  Did you know there's a Synergetics Dictionary in four volumes (Garland Press) now on-line?
Most of my in-classroom realtime stuff has been for Saturday Academy, off and on, like when I did Martian Math @ Reed College.

Saturday, November 07, 2015

More Chores

Before Firing

 Really, an FM radio station that's all oldie-goldies and no commercials?  Seriously?  KWLZ 96.3.

Now that I have the Bluetooth headphones, I'm more likely to be on SomaFM again, a streaming service out of the Bay Area.  Send 'em some dollars if you appreciate commercial free streams.

Warming to my subject:  pumpkin pie.  More seriously, I think Linus Pauling somewhat confirmed our intuition that our bodies depend on the outside world for some macro-molecules.  It's not just low level elements a body craves, like phosphorous, the flame of life (ATP cycle), but vitamins, and who knows what else?

Sure, it all "breaks down" in digestion but it could be a side effect, some enzyme spike thanks to that pumpkin pie you just baked, yourself, from fresh ingredients.  Like a hormone.

Am I saying you'll lose weight baking pumpkin pie?  No.  The two shells I filled asked for a cup and a half of white refined sugar.  That's not a trivial ingredient even for royalty, going back not so far.

Sugar was kept on a shelf for special occasions, not pumped through on virtual IV, starting with sweetened cereals.  They'd rot our teeth for free in exchange for cartoons.  Hey, everything in moderation.  Go crazy with the Froot Loops or Cocoa Krispies (one of my faves) once in a blue moon.

What might you get from pumpkin pie in the fall, the hemisphere returning to Winter?  C'mon, right?  Sure it's psychological, as if if what, like "psychological" doesn't matter?  Duh it does, right?

But I'm thinking more than that, some actual chemical, released through special food interactions.  I bet the French have whole bookshelves devoted to this subject am I right?

Let me check the frequency of this station again:  96.3 KWLZ-FM.

Just Out

Wednesday, November 04, 2015

Homering

DSCF1776
PDX, 2015

The term "Homering" is used as a term of sneering disrespect in some circles, and relates to the fictional Homer Simpson of cartoon fame.  The connotation is "comporting oneself in ways unbecoming of a true man" as Homer is seen to do, including simply puttering about in a domestic manner, a way customarily associated with the female role (in charge of the household -- while men go out and hunt).  Such are the stereotypes in some circles.

As for me, I use "homering" with much less judgement, and if anything am admiring of the term for its becoming "anti-macho" flavor.  Vanity about one's weight (female: figure) comes within this ballpark i.e. cosmetics, glamour concerns.

Which brings me to the "no beer diet" which I've embarked upon again, up to January 1, then assess -- probably continue a few weeks at least.  This is not about abstinence from alcohol, and to reassure the "body politic" (my fat cells) I ostentatiously invested in $70 worth of high proof liquor, which I've been enjoying, including mixed with eggnog.

I know, I know, how can I lose weight if I'm sucking down buckets of nog, spiked or not?  Plus since it rained big time on Halloween, how is helping myself to a whole basket of candy in any way in the name of "slimming down"?  My skeptics are fierce, but in the long term I find eliminating ten or so pints of distilled grain per week ("liquid bread" lets call it) pays off.  I've already largely eliminated "liquid meat" (i.e. milk) from my diet with the occasional seasonal deviation permitted by religious lights I follow.  I was brought up to guzzle the stuff based on some government PR then in circulation.

Today Carol departed for Missouri. We breakfasted at Beaches, per usual.  She's involved in the public rebellion against being treated as "collateral damage" by the Nukehead Authorities.

Environmental tourism (eco-tourism) is already big and bringing groups through Kansas City, Missouri to gawk at this city-owned nuclear weapons factory should prove lucrative.  With or without plant tours (I'd think with, but that costs extra) we'll have the dioramas and documentaries, showing how these good citizens made their homeland proud. The PR displays are all a part of the eco-tourist friendly museum, similar to the one about Gitmo (see storyboards).

We also visit Washington DC of course, as a part of our eco-tour, a place akin to Guam in terms of representation in the Federation.  The idea was to create a semi neutral District, mostly Mason-controlled, that could be trusted to managed the money.  That didn't last long of course, as money management was turned over to a separate Central Bank (the Federal Reserve), and DC became more like a Caribbean colony.  Its representative still has American values though, in wanting the US to lead us out of the Nukehead Era.  She introduces the bill every year and of course is ignored by a mostly nukehead Congress.

Weapons retirement, i.e. decommissioning nuke plants that make the weapons grade fuel, is going to consume the time of many highly-educated, students who freely choose such important work as their principal area of concentration.

OSU has made a good start, with its "duck and cover" museum (it has a more formal name).  A network of academic and collaborating government agencies is beginning to prepare students for such a career.  Cleanup & Disposal of Radio-toxic Waste is going to be a job for well trained professionals from many backgrounds, for the foreseeable future.

The US national parks administration, under Department of the Interior, is thinking to take on memorializing the Nukehead Era in the wake of making these areas safe enough at least for eco-tourism.  Hanford and so on, are hosting interpretive centers, with exhibits like the one at OMSI, explaining the project to forestall more leakage into the global ecosystem, a disaster not unlike the Fukushima experiment.

Showing maps of the health effects of nukehead experiments, not just in Micronesia but on the North American mainland as well, goes with the territory.  Showcasing Missouri is just for starters, and is made all the more dramatic thanks to the underground fire.
DSCF1368