Showing posts sorted by date for query Clojure. Sort by relevance Show all posts
Showing posts sorted by date for query Clojure. Sort by relevance Show all posts

Tuesday, March 08, 2022

Five Letter Land

I was in Horse Brass again yesterday, loving Guinness.  That was after ascending Mt. Tabor, by means of the west side steps.  Then we (Dr. D. and I) descended to Belmont.  Deke was in the loop, and joined us later, from his beat.  Derek (Deke the Geek) is a generic community helper, delivering food 24/7, a discipline reminiscent of earlier gigs in less Mad Max conditions.

I was celebrating a successful restoration of drivability to my car earlier.  I'd made it out to Bethany Village and back.

The little private Silicon Forest school where I field test and further develop my online curriculum, consistently with whatever they hand me, has been a source of gigs for some time.  During the height of covid I only worked over Zoom, but these days I show up in person, masked and vaxxed for my own protection.

Our focus has been Number and Group Theory of the type that's relevant when developing coding skills, which these students very much are, and pretty quickly.  I like to showcase several technologies:  JupyterLab, Github, Replit.  Python features as one of many languages, not necessarily the be all end all. I'm somewhat partial to Clojure and could use some classes.  I'm 80% in student mode, 20% in teacher mode, a healthy ratio given there's always so much more that one doesn't know, than one knows.

For example, when the popularity of Wordle (which I still haven't played at the official website) took off, I found that famous five-letter word list at Stanford Graphbase.  Except at first I didn't know the size of this tiger I had grabbed by the tail.  Computer Science itself branches out from this file and some others, given the curriculum (that metaphoric set of circuit boards) we have today.

Wednesday, January 10, 2018

Network Theories

Jeff Presents

Sorry for the dry title folks.  I tire of the journalistic headline, today known as click bait. Lets keep it low key, yet warm to the topic, as network theories (lots of math) are both interesting in themselves, and have real world applications.

Jeff Goddard shared with Wanderers about his work for LittleBird, at one time a free-standing company, but with a tool that makes sense more as one in a suite, if you're a big company seeking to maximize the potential of social media.

The Twitter API has many powerful and unique attributes and is a great place to start.  We might think of LittleBird as living at the headwaters.

Suppose I want to find the top most influential people around the topic of Climate Change.  Jeff ran that search for us, also Beer, Python, and a few others.  Terry Bristol, author of Give Space My Love, wondered how these search tools might help with book sales.  Jeff had some suggestions.

@DekeBridges was there, asking good questions.  He's also the man behind @LeadersBest.  Deke is our most influential Wanderer by far, from the standpoint of Twitterverse.

So what is LittleBird? Jeff has poured in the hours, using Clojure and ClojureScript, to implement those network theories, or shall we say algorithms, to query Twitter through its API in high volume (more than a single developer account would afford, times ten thousand).

The information one obtains through the API is the same info tweeters agree to share by virtue of establishing a Twitter account.  

It's not like those using this "back door" have any special access to otherwise hidden data.  Rather, they have the ability to aggregate the data more successively (at higher volume), as a "front door" individual user, using human eyeballs, is like a 300 baud modem compared to a T1, relatively speaking, and using tech terms most will have forgotten by now.

LittleBird was acquired by Sprinklr, adding to the tools brought to bear on behalf of clients seeking to manage their cyber-presence and/or media campaigns through this company. 

We did a test run using "Python" as our topic and, sure enough, the tweeters percolating to the top were mostly people I recognized.  I showed up as influential regarding Python when we ran @thekirbster individually, but that doesn't mean I'd make it to the top thousand. 

P1040084

Monday, April 18, 2016

Work / Study Notes

MathPiper in Action

I used some of my time at the meetup tonight to follow Ted Kosan's homework assignment, as I'd agreed on the listserv (i.e. in front of witnesses) to enroll in his work / study program.  

He's going over the basics of a computer algebra system (CAS) which begins by parsing an expression into a tree, as shown above.

He's sharing a JEdit-based framework he wrote and shares with the general public under a GNU v2 Open Source license.

The Document Object Model is tree-like in having nodes containing more nodes.  A Tree is a subtype of Graph and is typically a first recursive data structure (think "fractal").

"Phi is the first Fractal" one might suggest as a mantra, on the basis of its self-referencing proportionality.

I'd started the day's meetings with Mr. Stockton (Global Matrix) wanting to share some Graph Theory, showing me the same nodes edge-connected in two different ways.

What could I learn from this picture?

The first graph was like spokes around hubs with longer distance connections between the hubs.

The second graph was more like connecting all neighbors to nearest neighbors.  No spokes were evident, more like a quilt or lattice.  Same nodes.  Different stories regarding their relationships.

The first graph might be "cell phone provider" (some nodes represent "towers"), whereas the second graph might display "who borrows sugar from whom".  I might assume the same geographic layer for both in this story, whereas graphs need not be geographic at all (just topological).

Visitors to the code school tonight included a German-speaking duo, from Austria and Switzerland respectively.  I talked with the Swiss guy who sat next to me, about his bioinformatics work, training computers to get better at diagnostics.

I explained about my work with tetravolumes in Clojure, inside MathPiper.  He also liked my Nonsense Numbers.

I learned about ternary logic, discussed in Knuth (I'll look it up) and an early Russian prototype named Setun.  Ternary logic is non-boolean, yet a logic nevertheless.  I've been pointing out that even True and False based languages have Null and/or Undefined but that's not what "ternary logic" means exactly.  I'll be doing some more self-study.

Another topic already in the wind, that I learned about only recently, is clockless chips, meaning CPUs that are less clock-driven, more asynchronous.

We've had something of a paradigm shift in that respect at the software level.  I'll be looking for parallels in the literature.

I demonstrated doing symbolic calculus to another attender deep into Doing Math with Python (a new title).  He'll be getting to all that in a next chapter anyway.

An old student of mine (from Accelerated Intro) was there when I arrived, and is currently enrolled in one of the evening boot camps going on in the Business Accelerator building.  I'm glad.

With Sheri (the director) I discussed the Gift Shop meme, a way for any code school to showcase its own ability to source an on-line swag store, shopping cart model.

An on-line Gift Shop is precisely the type of application students come to code school to learn to code, so the Eat Your Own Dog Food aspect is evident.  I came away with a T-shirt myself.

A code school might stock any number of partially developed Gift Shop variants, some as group projects, some starting out solo.  Having a working project on the front lines does not imply other solutions do not exist.

We'll always have need for a "next Gift Shop" if only to give students and instructors opportunities to hack on something well-understood (like anatomy lessons).

Speaking of gifts, my thanks to Benjamin for cluing me about pathlib and py.test.

Sunday, August 02, 2015

Asynchronous Learning Engine (ALE)

Flights of Fancy

I created a stub outline of an Asynchronous Learning Engine on GitHub today (link below).  That may sound impressive however all the classes are abstract stubs, with an underlying metaphor.  The implementation is left as an exercise.

The metaphor (living at the base class level) centers on picturing airplane flights as courses of study, with a beginning, middle and end.  One could do ships and cruises -- hey, they're just metaphors, feel free to mix 'em.  "Geek cruises"are a reality already, including of the non-metaphoric kind.

Names like Student, Course, Mentor make up the foreground, but without leaving our extended metaphors behind.  The course fills to a minimum, gets start and stop dates, but in many models students manage their own time (talking months) and finish anytime before deadline.

Some are in a hurry, some not.  Some have time to study hard, others have only tiny windows in their day, to inch ahead.  Few if any synchronized events are required therefore.  It's not about all moving in lockstep, even if in the same course.  That doesn't preclude some exercises involving a stop watch or timer.

The Flight Recorder (built in to the Course or Airplane class) saves the transactions, meaning submitted and handed back work, communications to and from a mentor. Quality Assurance (QA) is about going over these records and learning from them.

DSCF9346

Feedback loops are the name of the game.  Mentors improve by learning from each turn in the cockpit, perhaps we have co-pilots (like co-clerks, of committees).  One might be the apprentice of the other in one course, the senior pilot in another.  Mentors are students themselves as there's never a shortage of new stuff to learn, new skills to pick up.

Some designs encourage chatter amongst the passengers however more typical is the private one-on-one experience, with the mentor interacting individually with everyone and anyone in the course (or courses -- in this world a mentor may fly several airplanes simultaneously, called "multi-tasking", just as a student may take more than one course at a time, just like in college).

What I envision as a typical use case are EC2 / AWS (Amazon) type implementations of the Personal Studio or Personal Workspace (PWS) model, such that learners remote in to their personal Ubuntu or whatever, the instance pre-configured per whatever course design.

Are we doing 2D & 3D graphics?  Is VPython installed?  That all depends on the course, although presumably there are many parts of the Ux (user experience) that are common to all courses, giving a branded and perhaps eventually familiar, look and feel.  A student might work on more than one course within a given PWS instance.

Containerized services at the other end of a student dashboard given the "traveler" (wanderer, browser, tourist, visitor, guest... scout) a way to "book flights" including with "connecting flights".

The mentor dashboard shows the task queues (see source outline below).

Student and mentor are connected asynchronously through the ALE.  That's it's primary job, to glue together all the components required to run an airline (or railroad, if you prefer).

For example:  { Ruby ↣ Rails ↣ JavaScript in the Browser (including JQuery) ↣ JS on the Server } would earn a merit badge or certificate in our "learning by doing" space (hiking trail metaphors apply also -- as in scouting).

I've been looking at { Python ↣ Java ↣ Clojure }  as a set of connecting flights, perhaps spanning grades 10 to 16.  The ALE does not nail down curriculum content per se.  Its job is to organize students into courses, assign them mentors, and keep things moving forward towards completion.  Course designers have a known framework to work with -- whatever version of ALE the client / school uses. 

Mentors, like students, have different availability, different schedules, as well as areas of expertise.  That's where Air Traffic Controlling (Dispatching) comes in.  We need admin to help us with load balancing such that no one mentor burns out under the caseload.  

"Adding to the fleet" where demand is high is easy with ALE (our in-house system, not Open Source, isn't called that).  Smaller more esoteric courses may have higher marginal costs, but add to a school's luster in other ways (guest mentors may be celebs in their fields).

Colleges and universities may be set in their ways and may as yet have no internal "dog food" they might eat and/or modify, nothing Open Source to share and partake in.  

Sometimes upstart companies, including not-for-profits, NGOs, are better positioned to try new things.  ALE is not just another Moodle or Banner. 

For further reading:
ALE Use Case
GitHub Repo
clojure-python

Thursday, July 30, 2015

Ramping Up

Synergetics Modules
Fig 1: Clojure IDE:  IntelliJ

In this classroom, we foreground Python while ramping up at a slower rate in the background with Clojure. That lets us dabble in Functional Programming while absorbing the Object Oriented mindset, providing a strong basis for future exploration and new skills acquisition.

The segue computation, twixt Python and Clojure, is this "volume of a tetrahedron based only on six edge lengths for input" algorithm handed down to me from the ancestors, and in my subculture fine tuned by one Gerald de Jong (of Elastic Interval Geometry fame) to natively output in what we call tetravolumes, i.e. when all edges are one, the thing is calibrated to return one (unit volume in this system).

Gerald shared his results on Synergetics-L which used to run in the Teleport domain.  I brought the result to sci.math, coming under attack (by some guy named Chapman) for not getting my priorities straight.  I have not gone back to sci.math with anything important (too frenetic!).

David Chako, Gerald, myself, and later Tom Ace, were all working on Quadrays at the time, which we also called Chakovian coordinates. I became aware of Darrel Jarmusch's parallel efforts somewhere in the course of this R&D.

Imagine a regular tetrahedron centered at O with four radial arms to its four vertexes.  These are the unit vectors, at most three of which are needed, in linear combination, to span each quadrant. All IVM (= CCP) ball centers have positive integer or zero coordinates with origin O at (0, 0, 0, 0).

Quadrays may be used in combination with tetravolume measures to show all Waterman polyhedrons have whole number volume, as do all tetrahedrons with all four corners at IVM points (proof by Robert Gray, the original transcriber of Synergetics onto the Web).

To use the Volume function (below), one gives the three edges from a common apex, call it O, meaning we input OA, OB, OC.  The next three edges are the AB, BC, CA respectively, i.e. going around the base.  The algorithm works with 2nd powers of these lengths, forming products of "open", "closed" and "opposite" sets of edges.

new_improved
Fig 2:  Call-out:  the Volume function

In the above figure, the summary Volume computation is matched with a special case example, that of the A module, for output of:

All edges D=1, Volume: 1.0
Amod volume: 0.04166666666666668

The labeling in that case corresponds to some plane net in Synergetics. The unit volume tetrahedron fragments into 24 such modules, 12 left and 12 right (inside-outs of each other), and therefore each with a volume of 1/24 (same as B and T modules).

The Clojure program, just like the Python version, then goes on to compute other module volumes, including the E and S module volumes, from published plane nets, with the S / E volume ratio named "sFactor" in other computations relating to the Jitterbug Transformation (see CSN blog).

I recommend Wittgenstein's philosophical investigations, into mathematics especially, for those balking at the very notion of a unit volume tetrahedron, which may at first seem counter-intuitive, just as Clojure's LISP-like syntax may feel too alien (remote) at first.

Showing how the tetravolumes language game extents to the planar case, along with the payoff in terms of whole number volumes, may lower the student's skepticism level enough to where engaging in hands-on exercises with these concepts, using computer languages, does not seem a waste of time on some purely nonsensical activity.


DSCF9317

Sunday, November 30, 2014

Progress...


After watching a few motivational Youtubes about Neo4j, which I'd been playing with using the default Movies tutorial, py2neo just started working as advertised.

What I'm still not clear on is where this data persists, and will Tom Hanks come floating to the surface, some castaway, perhaps lost in our Quaker terminal?

The "4j" should be seen as meaning "for Java" i.e. Neo4j targets the JVM, as do Scala and Clojure.  No matter:  the C-family of Pythons have an API to the engine, just as they have the standard DB API for talking to SQL engines.

Neo4j, in being an open source graph database, is "not SQL" or "~SQL" per the graphic below, aimed at elucidating Model, View, Controller architecture in the form of a web application.


Sunday, July 20, 2014

Scala Tutorial at OSCON

My notes from Get Started Developing with Scala by Jason Swartz and Kelsey Gilmore-Innis.

This is my day for JVM languages i.e. languages that compile to the Java Virtual Machine.  Clojure and Scala both fit that bill and have other features in common as well:  immutable data, functional programming, first class functions.

I opted for this tutorial based on a lunch conversation at one of the i18n tables and showed up with nothing working or even installed.  One of the minders got me up and running, getting stuff off a memory stick.

Turns out my version of Java was too old on the OST Mac Air.  I'm grabbing jdk-7u65-macosx-x64.dmg.  That worked.

Now I have a little web servlet going, controlled by the tutorial code.

Starting SBT for OSCON Scala tutorial
mackurner:scala-tutorial kurner$ ./sbt.sh 
Starting SBT for OSCON Scala tutorial
[info] Loading project definition from /Users/kurner/Documents/scala-tutorial/project
[info] Set current project to Scala Tutorial (in build file:/Users/kurner/Documents/scala-tutorial/)
> console
[info] Generating /Users/kurner/Documents/scala-tutorial/target/scala-2.10/resource_managed/main/rebel.xml.
[info] Starting scala interpreter...
[info] 
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_65).
Type in expressions to have them evaluated.
Type :help for more information.

scala> "Hello, Scala"
res0: String = Hello, Scala 
scala> var started_programming: Map[String,Int] = Map("Kirby" -> 24, "Odd" -> 25)
started_programming: Map[String,Int] = Map(Kirby -> 24, Odd -> 25)

The language is not entirely unlike Java, statically typed, object oriented, but is more spare, more "expression-oriented" according to our presenter.  Someone who knows Java might move to Scala next.

Like Python and Clojure, Scala has a REPL (shown above).

I'm sitting next to a man named Odd Are. I like that.

For those who know Python:

>>> list(filter(lambda i: i < 3, [1, 2, 3]))

is the same as

scala> List(1, 2, 3).filter(i => i < 3)

or even

scala> List(1,2,3).filter(_ < 3).

Both Python and Scala feature top-level functions, meaning you're free and encouraged to pass them as arguments on occasion.  The methods map, reduce and filter give you a basis for functional programming.

Our presenters recommend easing into Scala by using it to write tests for Java code.

Recommended followup tutorial:  The Neophytes Guide to Scala.


OSCON 2014 Tutorials (Day 1)



My notes from: The Simplicity of Clojure presented by Clinton Dreisbach and Bridget Hillyer.

Collections in Clojure:  Vectors, Lists, Maps, Sets.

Vectors are heterogeneous, as are all the collections, so like Python's lists. Also 0-based.

(nth [3 6 9] 1) ;=> 6.

A List is a unit of execution in that the first element is the function. Above: [3 6 9] is the Vector whereas (nth ...) is a List.

Collections are also immutable, like Python's tuples, so (conj (list 1 2) 3) ;=> (3 1 2).

Maps are similar to Python dicts.  Why are they associative again?  Sets (#) are like Python sets: no duplicates

:keywords have a magical property of serving as functions. (:a {:a 1}) ;=> 1.

A :keyword is a symbol that evaluates to itself.

Function names (symbols) are common to all the collections wherever that makes sense.  This has to do with their all being Sequences (not just Collections).  The laziness of the Sequence should evoke Pythonic ideas of lazy iteration, as well as the general notion of sequence.

Strings are not sequences but get coerced into same in using sequence functions:

(first "this is it") ;=> \t

...where \t is the character type.

Python's special names enforce a kind of uniformity across types.  We get to the syntax level with __getitem__ and __getattr__ i.e. obj[x] and obj.x are things we define within the obj type.

First exercise (I'm in a tutorial):

(list "Professor Plum" "Mrs. Peacock" "Mr. Green" "Mrs. White" "Colonel Mustered" "Miss scarlet")

(nth (list "Professor Plum" "Mrs. Peacock" "Mr. Green" "Mrs. White" "Colonel Mustered" "Miss scarlet") 3) ;=> "Mrs. White"

They had us download LightTable to follow along.  Here are the slides.  LightTable works with Python as well!

I met up with Tatia and Ed Leafe at the break.  Ed shares my FoxPro lineage.  Tatia is fresh off the plane from Brazil.  She's a Pythonista, like Ed and myself, fluent in both English and Portuguese.  We compared notes on Ruby (another OO language like Python) and clojure (functional, more LISP-like).

In a local scope, function let takes a Vector to give its bindings.  defn contracts def and fn.

Thanks to prefix notation, the hyphen is fine in variable names (symbols), no confusion with the minus symbol.

Polymorphism:  how?  If you don't have objects.  multi-methods maybe.  Helps to know some Java maybe as defrecord relates to Java's classes and interfaces.  "Make a Piece protocol" to model chess pieces, say with possible-moves and can-move? as methods.  OO thinking involves dispatching.

Functional reactive programming:  Javelin treats your data like a spreadsheet.  Check core.matrix for an example of professional clojure code.  What's ClojureScript?  Read more at Hoplon.io.

For further reading:  Clojure for the Brave and True.

Sunday, July 28, 2013

OSCON / ORM

Steve held an OSCON Survivors' Breakfast at the Hilton.  I was pleased to have some face time with Deb Bryant, Allison Randal, Eric Holsher, Lindsay Epstein and others.  Some of us Portland natives also attend the Wanderers meetings.

Later that evening, again with Steve as a catalyst, I enjoyed a fine dinner with Julie Steele (with O'Reilly Media), Steve and Yarko, followed by more conversation at Greater Trumps.  From Julie I learned I should never skip the Friday keynotes, which I had.  Good thing they're taped.

The chair's party was well attended.  Edd Dumbhill is the outgoing chair, with incoming chairs Matthew and Simon.  I got permission to invite David Feinstein to this party and introduced him to Simon.  I then drifted off and joined Yarko and Alex Martelli, who were speaking with the Code for America CTO, Michal Migurski.

Code for America focuses on making government more accessible and transparent.  The process has its pitfalls.  Local IT is maybe itching to try its hand with newer technologies but gets slapped down by management.

Then C4A shows up, a whiz bang team, and wins praise from the same management as genius outsiders.  The natives grumble.

How might C4A catalyze more appreciation for in-house talent?  Show management what's possible but then fade away.  It's a tiny program anyway.  Inspire but don't micromanage.

Of course I'm thinking "USA OS" the whole time, what with whitehouse.gov folks working on some public APIs.  These petitions people sign:  there's mineable data there, which should be shared.

The confusion about Open Source versus Open Data is still prevalent.  When you invite development using shared open source tools, you are helping to level the playing field.  They have access to these tools without high cost barriers.  However tools are not data and confidentiality stays important.

When the free tools are used, the schools aren't left out, because they can afford free software. They can also help improve it, to where the free tools are often among the best tools in their class.

One trains up an army conversant with PostgreSQL, other open APIs.  So then what?  Does government have the courage to use the same tools that schools can afford to teach?

That's a critical equation.  In some countries the verdict is in:  yes.

Open data offers its own set of advantages, but should not be confused with sharable tools.  Just because you know how to hack does not mean you have automatic access to private records.

I missed way more talks than I managed to attend, that much is certain.  Netflix gave a good one I'm told.  People are turning to the Internet for their information and entertainment more and more.  Cell phones have only accelerated this trend.

Facebook is building special data centers with their own power specs, for all those pictures you want to keep in your profile, but which no one retrieves on a daily basis.  Cold storage, which doesn't mean unresponsive.  Humanity is evolving new organelles.  Motherboard Earth is an evolving picture.

As usual, I was inspired to dive more deeply into various technologies thanks to these talks.  Simon's talk got me interested in Erlang, while the drone talk (a keynote -- nothing weaponized) impressed me with the relevance of Clojure.  I now have both installed and am working through Safari Books in my copious free time (sarcastic chuckle).

Tomorrow:  more chauffeuring of MVPs.  Another trip to the airport.  I'm happy to play the role.

Congrats to Tara, who attended the brunch, on getting the driver's license and repairing her phone, two summer goals.

Company Logo