GeistHaus
log in · sign up

Zaries’s Blog

Part of wordpress.com

Just another WordPress.com weblog

stories
Evolution is not our path, it is our eco. (Editors Version)
Uncategorizedaiartificial-intelligencechatgptphilosophytechnology
The original article was written purely on gut feel and internal common sense. Out of curiosity, I went digging for confirmation and sources that could support the arguments presented in the original. Yes, I know it proves nothing; there are likely many references for counterarguments, but I still find it interesting and a good base […]
Show full content

The original article was written purely on gut feel and internal common sense. Out of curiosity, I went digging for confirmation and sources that could support the arguments presented in the original. Yes, I know it proves nothing; there are likely many references for counterarguments, but I still find it interesting and a good base for further exploration. Have fun.


The eco is remembrance itself — only what endures is ever written into it.
“Evolution is not our path, it is our eco.” — Phil Marneweck.

Research note. Philosophers of biology stress that evolution is a historical record of what persists under selection; it is not a teleological journey with foresight. The Stanford Encyclopedia’s entries on natural selection and teleology make two points: (1) selection explains the existence of adaptations without purpose, and (2) purpose-language in biology is mostly a heuristic and must not be mistaken for goal-directed mechanism. This frames “eco as remembrance” precisely as record, not plan. [1], [2]


We often speak about humans “evolving,” but in truth, what we do is adapt. Evolution isn’t something we consciously walk along — it’s the echo left behind when adaptation endures.

Research note.

  • Source (SEP: Natural Selection). Summary: natural selection is a causal, population-level process that, over time, yields evolutionary change; individuals do not “evolve”—they adapt (or fail to) within lifetimes. Relevance: supports the contrast: deliberate adaptation vs. evolution as after-the-fact echo in populations. [1]
  • Source (SEP: Teleology in Biology). Summary: attributing “aims” to evolution misleads; teleological phrasing is not how selection works. Relevance: justifies the wording that evolution is not a road we “walk.” [2]

In real time, we face only two options: adapt, or vanish. The environment doesn’t negotiate, whether natural, social, or technological. Evolution is the system; adaptation is the act.

Research note.

  • Source (Ashby, An Introduction to Cybernetics). Summary: Law of Requisite Variety—to remain viable, a regulator must possess at least as much response variety as the disturbances it faces. Relevance: “adapt or vanish” matches Ashby’s viability criterion: without adaptive repertoire matching environmental variety, the system fails. [3]

Source (Ashby, An Introduction to Cybernetics).
Summary. The Law of Requisite Variety says: if you want a system to remain viable (stay within acceptable bounds), the regulator’s response variety must be at least as rich as the environmental variety of disturbances trying to push it out of bounds. In Ashby’s language:

  • Disturbances = the different ways the world can shove your “essential variables” around (e.g., bursts of heat, sudden load spikes, missing data).
  • Environmental variety = the count (or richness) of those distinct disturbance states the world can throw at you.
  • Response variety = the count (or richness) of distinct moves the regulator can make to counter them (not just more moves, but distinguishable and appropriate ones).
  • Viability criterion = the requirement that the essential variables stay inside safe limits (e.g., temperature 20–24 °C, cash ≥ 0, latency ≤ 200 ms).
  • Adaptive repertoire = the set of responses you can actually deploy in time when a given disturbance shows up.

Ashby’s punchline is a lower bound: if the world can hurt you in N different ways, you need ≥ N effective ways to answer—or some combination of filtering/absorbing that reduces the world’s variety before it hits you. In his own examples, you can meet the bound by (a) adding responses, (b) attenuating disturbances (buffers, filters, standards), or (c) altering the mapping so one response covers many disturbance states. [3]

Make it concrete (one-minute picture).

  • Thermostat: Disturbances = {too hot, too cold}. Response variety = {cool, heat}. Viability = keep room 20–24 °C. Two distinct pushes, two distinct counters → viable.
  • Edge case: Disturbances = {too hot, too cold, door left open}. If the regulator only has {cool, heat}, sometimes it loses. Restore viability by:
    1. Add a response (close door automatically),
    2. Attenuate the disturbance (slow-close hinge), or
    3. Broaden one response (variable-speed fan covering multiple heat-gain profiles).
      Different levers, same aim: match or beat the world’s variety.

Why this fits “adapt or vanish.”
This is Ashby’s viability criterion in plain speech: if your adaptive repertoire doesn’t at least match environmental variety, sooner or later a disturbance passes through unregulated and knocks you out of bounds. “Adapt” here literally means increase effective response variety (or reduce incoming variety) until the bound is met; “vanish” is what happens when you don’t. [3]

Side note (math-lite intuition, optional).
Ashby’s maxim “only variety can absorb variety” can be read in information-theory terms: the uncertainty left in outcomes can’t be less than the uncertainty in disturbances minus what your regulator can cancel. Operational test: Can we name the distinct ways the world hits us, and do we have distinct ways to answer each—or to blunt them before they arrive? [3]


Another way to put it: adaptation is the choice; evolution is the record.

Research note.

  • Source (SEP: Natural Selection). Summary: selection explains adaptations and their persistence; “evolution” names the record of what persisted across generations. Relevance: maps directly to the sentence—choice happens in local adaptation; “record” accrues via selection. [1]

This shift in perspective matters especially now, in the age of AI upheaval. Many articles say “humans must evolve.” But evolve is the word we use for what gets recorded after selection. What we can do now is choose and enact adaptations—specific, constrained actions—and then the world decides what remains. Framed that way, agency sits where it belongs (in present choices), without pretending we can decree the outcome.

Research note.
Source (SEP: Natural Selection & Teleology) — Individuals act/adapt; evolution names population-level change recorded by selection and has no foresight. Relevance: we can choose adaptations; we cannot choose to have evolved. Agency ≠ guarantee; it’s choice under constraint with outcomes settled retrospectively. [1], [2]


Tiny terminology guardrail (optional sidebar)
  • Choice: the agent’s decision among available acts now.
  • Action: the concrete intervention you actually perform.
  • Adaptation (attempt): an action meant to improve fit under current pressures.
  • Selected adaptation: an adaptation that persists (was kept).
  • Evolution: the recorded shift in a population’s traits/behaviours over time (what was kept).

Rule of thumb: Choice is necessary but never sufficient. We choose adaptations; we do not choose their evolutionary status.


We need to adapt our thinking, our societies, and our use of technology. To survive AI in the long run, humans will likely need to integrate with it — to become like, or even greater than, AI itself. Otherwise, we will be wiped from the game board.

Research note.

  • Source (Engelbart, 1962). Summary: Treats the human–method–artifact as one designed system whose purpose is to increase capability for complex problems—interactive augmentation of perception, comprehension, and problem solving. Relevance: Engelbart gives the design stance: the unit of improvement is the composite human–machine system. He stops at augmentation, but that stance is the bridge to full integration. [7]
  • Source (Clark & Chalmers, 1998). Summary: Cognitive processes can literally include external mechanisms when coupling is reliable and functionally integrated; mind is not bounded by the skull if the loop is tight. Relevance: A philosophical license for cognition that spans brain–body–artifact, moving from “tool use” toward being partly machine in a principled way. [8]
  • Source (Implant-level integration: intracortical BCIs & adaptive DBS). Summary: Wireless intracortical BCIs (e.g., BrainGate) show home use for communication/control; adaptive deep brain stimulation demonstrates closed-loop sensing+stimulation in humans. Relevance: Empirical proof that chronic, bidirectional, embodied coupling is feasible—the trajectory from augmentation to literal merger is already under way (early, imperfect). [9]

Here lies the danger: because this feels inevitable, many will embrace integration passively, adopting it at the consumer level with the masses. That won’t be enough. Half-measures delay the outcome; they don’t change it.

Research note.

  • Source (Illich, Tools for Conviviality). Summary: Distinguishes convivial tools that enlarge user autonomy from radical monopolies that create dependency. Relevance: “Consumer-level integration” tends to make you more controlled, not more in control; without authorship, “integration” becomes capture. [4]
  • Source (Winner, “Do Artifacts Have Politics?”). Summary: Technologies can embody power; designs “settle affairs” by hard-wiring certain social arrangements. Relevance: Accepting default integration means inheriting the politics of the device/platform. Half-measures keep the defaults; they rarely change outcomes. [5]
  • (Context for full integration): If the end state is biological/mechanical merger, the stakes are identity, agency, dependency. Extended Mind and clinical BCI work together imply: design for authorship and reversibility at the integration layer, or expect to be shaped by someone else’s defaults at the level of your own body. [8], [9]

Which leaves the real question: if half-measures fail, what might moving beyond them look like? If we look closely, there are already hints — small choices that, taken together, could lead somewhere greater:

Research note.

  • Source (Meadows, “Leverage Points”). Summary: Durable change in a system comes from shifting goals, information flows, and rules, not just parameter tweaks. Relevance: For a path toward full integration, the “small choices” with compounding force are: who owns the data/feedback loops of the merged system, what the goal function optimizes (capability vs capture), and which reversibility/consent rules are baked into implants and integrated workflows. These upstream edits change long-run selection pressures on what integration becomes. [4]

• Mental Adaptation — Choosing agency over automation. Treat adaptability as a discipline.

Research note.

  • Engelbart (1962): Treat the human–method–artifact as one designed system whose aim is to increase capability (perception, comprehension, problem-solving). This is the conceptual on-ramp: design the composite, not just the tool. [7]

• Skill Adaptation — Learn to shape systems, not just use them. Keep alive the human edges of judgment, ethics, and leadership.

Research note.

  • Herbert A. Simon, The Sciences of the Artificial. Summary: Design is reasoning about how things ought to be; expertise is representation, decomposition, and reversibility. Relevance: “Shape systems, not just use them” is classic Simon: move from operator to author—able to reframe problems, change representations, and back out bad moves. [12]

• Social Adaptation — Build networks that adapt together. No one designs alone.

Research note.

  • Malone / MIT CCI. Summary: Properly connected groups + computers can form superminds that outperform individuals or AIs alone; structure and communication patterns determine collective intelligence. Relevance: “Adapt together” is the work of coordination design—shortening the perceive→decide→learn loop at group level. [11]

• Digital Twin — Craft a live extension of yourself (a structured reflection that amplifies learning and action).

Research note.

  • Grieves & Vickers (history/origins). Summary: A digital twin is a virtual counterpart linked by data to the real system, used to monitor, simulate, and anticipate states across the lifecycle. Relevance: A personal twin applies the same loop (action → data → updated model → next action) to individual work and learning, making adaptation stateful and cumulative. [10]

• Technological Integration — Mean literal merger (biological/mechanical), not just “using AI.”

Research note.

  • Engelbart gives the design stance (unit = human–machine system), but stops at augmentation. [7]
  • Extended Mind (Clark & Chalmers) shows cognition can constitutively include mechanisms beyond the skull when coupling is tight. [8]
  • Implant-level integration (iBCI, aDBS) demonstrates chronic, bidirectional human–machine coupling in practice. [9]
  • Why relevant here: “Integrate with it” names the end stateno half-measures—where perception/decision/action span brain, body, and artifact as one system.

• The Architect Mindset — Move from adoption to authorship. Design the eco itself (constraints, signals, repertoires), not just survive within it.

Research note.

  • Meadows, “Leverage Points”. Durable change comes from shifting goals and information flows, not just parameter tweaks. [4]
  • Ashby, An Introduction to Cybernetics. Only variety absorbs variety—to stay viable, your response repertoire must at least match environmental variety. [3]
  • Why relevant here: The Architect edits upstream levers (goals, signals, rules) and curates a reversible, diversified response set—so adaptations actually persist under selection.

In the end, nothing about adaptation is guaranteed. Passivity is not neutral — it is the root of most harm. The eco does not punish by intent; it simply records what endures. If you choose to remain a Consumer, you choose invisibility: no authorship, no agency, no place in the record. The only viable alternative is to become an Architect — to pursue mastery, build your extension, and shape the eco itself. This is not an invitation to modest tinkering.
It is a demand to climb the whole ladder: from augmentation to true integration — biological or mechanical — on terms you author. Half-measures only delay erasure; they do not change it.

Research note.

  • Source (Ashby). Summary: without requisite variety, systems fail under disturbance; passivity narrows repertoire. Relevance: grounds “passivity is not neutral.” [3]
  • Source (Meadows). Summary: outcomes change when you reshape information flows and aims; timid parameter tweaks (half-measures) rarely persist. Relevance: justifies the call to authorship over acceptance. [4]
  • Source (Engelbart). Summary: capability grows when we co-design human + tool as one system. Relevance: “build your extension” is the immediate step — the stance that makes eventual integration something you control, not something done to you. [7]

References
  1. Stanford Encyclopedia of Philosophy — Natural Selection. https://plato.stanford.edu/entries/natural-selection/
  2. Stanford Encyclopedia of Philosophy — Teleological Notions in Biology. https://plato.stanford.edu/entries/teleology-biology/
  3. Ashby, W. R. — An Introduction to Cybernetics. https://ashby.info/Ashby-Introduction-to-Cybernetics.pdf
  4. Meadows, Donella — “Leverage Points: Places to Intervene in a System.” https://donellameadows.org/wp-content/userfiles/Leverage_Points.pdf
  5. Illich, Ivan — Tools for Conviviality. https://arl.human.cornell.edu/linked%20docs/Illich_Tools_for_Conviviality.pdf
  6. Winner, Langdon — “Do Artifacts Have Politics?” https://faculty.cc.gatech.edu/~beki/cs4001/Winner.pdf
  7. Engelbart, Douglas — “Augmenting Human Intellect: A Conceptual Framework” (1962). https://www.lri.fr/~mbl/ENS/FundHCI/2018/papers/Englebart-Augmenting62.pdf
  8. Clark, Andy & Chalmers, David — “The Extended Mind” (1998). https://www.alice.id.tue.nl/references/clark-chalmers-1998.pdf
  9. BrainGate / Intracortical BCI (home-use review). https://pmc.ncbi.nlm.nih.gov/articles/PMC8218873/
  10. Grieves & Vickers — “The History of the Digital Twin.” https://ftp.demec.ufpr.br/disciplinas/EMEC7063/Prof.Eduardo_Lopes/Grieves%20and%20Vickers-the%20history%20of%20digital%20twins.pdf
  11. Malone, Thomas W. — MIT Center for Collective Intelligence overview. https://ilp.mit.edu/sites/default/files/2020-01/Malone.2018.ICT_.pdf
  12. Simon, Herbert A. — The Sciences of the Artificial (chapter: The Science of Design). https://academics.design.ncsu.edu/student-publication/wp-content/uploads/2016/11/Simon_H_ScienceofArtificial.pdf

evoluiton-is-not-our-path
zaries
http://zaries.wordpress.com/?p=732
Extensions
Evolution is not our path, it is our eco.
Uncategorizedaiartificial-intelligencephilosophysciencetechnology
The eco is remembrance itself — only what endures is ever written into it. “Evolution is not our path, it is our eco.” — Phil Marneweck We often speak about humans “evolving,” but in truth, what we do is adapt. Evolution isn’t something we consciously walk along — it’s the echo left behind when adaptation […]
Show full content

The eco is remembrance itself — only what endures is ever written into it.

“Evolution is not our path, it is our eco.”Phil Marneweck

We often speak about humans “evolving,” but in truth, what we do is adapt. Evolution isn’t something we consciously walk along — it’s the echo left behind when adaptation endures.

In real time, we face only two options: adapt, or vanish. The environment doesn’t negotiate, whether natural, social, or technological. Evolution is the system; adaptation is the act.

Another way to put it: adaptation is the choice; evolution is the record.

This shift in perspective matters especially now, in the age of AI upheaval. Many articles say “humans must evolve” — but evolving is not something we can actively do. Framed that way, it sets us up for failure, as if the outcome depends only on external forces.

We need to adapt our thinking, our societies, and our use of technology. To survive AI in the long run, humans will likely need to integrate with it — to become like, or even greater than, AI itself. Otherwise, we will be wiped from the game board.

Here lies the danger: because this feels inevitable, many will embrace integration passively, adopting it at the consumer level with the masses. That won’t be enough. Half-measures delay the outcome; they don’t change it.

Which leaves the real question: if half-measures fail, what might moving beyond them look like? If we look closely, there are already hints — small choices that, taken together, could lead somewhere greater:

  • Mental Adaptation — Choosing agency over automation. Treating adaptability as a discipline.
  • Skill Adaptation — Learning to shape systems, not just use them. Keeping alive the human edges of judgment, ethics, and leadership.
  • Social Adaptation — Building networks that adapt together. No one designs alone.
  • Digital Twin — Crafting a digital extension of yourself: a structured reflection that amplifies your reach, learning, and earning power.
  • Technological Integration — Exploring augmentation carefully, always asking: does this put me more in control, or more controlled?
  • The Architect Mindset — Moving from adoption to authorship. Designing the eco itself, not just surviving within it.

In the end, nothing about adaptation is guaranteed. Passivity is not neutral — it is the root of most harm. The eco does not punish by intent; it simply records what endures. If you choose to remain a Consumer, you choose invisibility: no authorship, no agency, no place in the record. The only viable alternative is to become an Architect — to pursue mastery, build your extension, and shape the eco itself. This is not an invitation to modest tinkering. It is a call to become elite in capability and intent, because half-measures will only ensure you are forgotten.

#adaptation #evolution #AI #future #ArchitectMindset

evoluiton-is-not-our-path
zaries
http://zaries.wordpress.com/?p=727
Extensions
cl-naive-store
Uncategorized
In 2016 I decided to have another go at writing my own database because I wanted a database that was blindingly fast for queries but with files that are machine and human-readable. Not to mention that I have a fondness/weakness for plists. Thus cl-naive-store was born. Like any pet project, it took on a life […]
Show full content

In 2016 I decided to have another go at writing my own database because I wanted a database that was blindingly fast for queries but with files that are machine and human-readable. Not to mention that I have a fondness/weakness for plists. Thus cl-naive-store was born.

Like any pet project, it took on a life of its own and has become a bit of a beast (by 2022) with the best of intentions. The reason is that you can customize just about anything (you could say it was designed to be customized) and it has a lot of additional packages that can be loaded to layer on more and more functionality. The “base API“, creating, deleting, querying etc stays the same no matter how many layers of functionality you load. So you can incrementally use more and more of the possible functionality without rewriting code. That means quick proto-type code can be fleshed out later if needed.

In its simplest form cl-naive-store is a collection of plists with or without keys. In its fully loaded form, it’s a lazy-loaded, in memory, persistent, hierarchical, declaratively described, document universe with indexing and sharding thrown in for good measure. You can choose what you want to use and what not its all up to you.

Query speed was always the number one priority, though with lazy loading and sharding the loading and persistence of data runs at a respectable clip. It was also never meant to be a database that would host terabytes of data in one collection. That being said, it can deal with millions of records without too much effort and I would wager that it could deal with tens of millions if sharding is used properly.

One peculiarity of cl-naive-store is that it does not use data definitions (like table definitions found in SQL), a package for such definitions is available (thus the “declaratively described”) but the inner workings of the cl-naive-store don’t need them to load, query or persist data. Collections of data only need a name and maybe keys to function. That means what a document looks like today compared to yesterday has no consequences as far as cl-naive-store is concerned. Such power could come at the cost of your sanity if you abuse it, so a framework for data definitions is supplied but not enforced.

I think cl-naive-store is pretty well documented and there are simple but comprehensive examples.

I have been blessed to have been assisted on this project by some really exceptional people, so it has been a really fulfilling experience in more than one way.

Try it out and let me know what you think.

zaries
http://zaries.wordpress.com/?p=718
Extensions
Quick Self Signed SSL Certificate with SAN
UncategorizedCertificateSANSelf SignedSSL
There are thousands of articles and entries in stackexchange but none of them worked for me out of the box. So after hours of battling with this issue here is my short recipe. Create the Root Key: openssl genrsa -out rootCA.key 2048 Self-sign this root certificate: openssl req -x509 -new -nodes -key rootCA.key -sha256 -days […]
Show full content

There are thousands of articles and entries in stackexchange but none of them worked for me out of the box. So after hours of battling with this issue here is my short recipe.

Create the Root Key:

openssl genrsa -out rootCA.key 2048

Self-sign this root certificate:

openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 3560 -out rootCA.pem

Create a certificate request for the domain you want:

You need the following in your san.cnf file to use in creating the certificate request. Just create the file where you are the certificates.

[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = req_ext
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
stateOrProvinceName = State or Province Name (full name)
localityName = Locality Name (eg, city)
organizationName = Organization Name (eg, company)
commonName = Common Name (e.g. server FQDN or YOUR name)
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1 = app.somedomain.co.za

openssl req -out app.somedomain.co.za.csr -newkey rsa:2048 -nodes -keyout app.somedomain.co.za.key -config san.cnf

To verify that the .csr has the SAN in it

openssl req -noout -text -in app.somedomain.co.za.csr | grep DNS

Sign your final domain certificate with your root certificate and makes sure the SAN ends up in the resulting certificate:

openssl x509 -req -in app.somedomain.co.za.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out app.somedomain.co.za.crt -days 3560 -sha256 -extfile san.cnf -extensions req_ext

Verify the result:

openssl x509 -noout -text -in app.somedomain.co.za.crt | grep DNS:

Verify the result once you have uploaded the certificates to your web server:

echo | openssl s_client -connect app.somedomain.co.za:443 | openssl x509 -noout -text | grep DNS:

What is left is to import your root certificate into your browser, and that is another nightmare since it works differently for different versions of chrome and different operating systems. You will have to google and try until it works, but at least you will have a certificate that you know is not at issue.

zaries
http://zaries.wordpress.com/?p=707
Extensions
Ubuntu 19.10 interferes with Emacs keybindings
LinuxLispProgrammingUbuntuCtrl+Alt+EmacskeybindingsUbuntu 19.10
So far I had to remap the following key-bindings to not interfere with emacs. You can use dconf-editor to view all the org.gnome.desktop.wm.keybindings and even edit them. Here is the list I remapped and what I the remapping using gsettings: Alt+` Ctrl+Alt+Down Ctrl+Alt+Left Ctrl+Alt+Right Ctrl+Alt+Up
Show full content

So far I had to remap the following key-bindings to not interfere with emacs.

You can use dconf-editor to view all the org.gnome.desktop.wm.keybindings and even edit them.

Here is the list I remapped and what I the remapping using gsettings:

Alt+`

gsettings set org.gnome.desktop.wm.keybindings switch-group "['<Super>Above_Tab']"

Ctrl+Alt+Down

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['<Super>Page_Down']"

Ctrl+Alt+Left

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['[]']"

Ctrl+Alt+Right

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['[]']"

Ctrl+Alt+Up

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['<Super>Page_Up']"
zaries
http://zaries.wordpress.com/?p=704
Extensions
Lisp Use
LispProgramming
I often find little gems of where lisp is used and where it was used in history but if you google for it later you cant find it. So I am starting my own little list, inspired by this reddit post. Formal JavaScript Semantics The current ECMAScript semantics are written informally and contain many amgibuities […]
Show full content

I often find little gems of where lisp is used and where it was used in history but if you google for it later you cant find it. So I am starting my own little list, inspired by this reddit post.

Formal JavaScript Semantics

The current ECMAScript semantics are written informally and contain many amgibuities and errors. In addition, while experimenting with new language features it is difficult to modify the informal semantics and be assured that the result remains self-consistent and still behaves as expected. In an attempt to remedy these problems, waldemar is writing formal semantics for JavaScript together with an engine that can:

  • pretty-print the semantics for human readability
  • grammar-check the semantics to make sure that the grammar is unambiguous
  • type-check the semantics to make sure that the rules are self-consistent
  • execute the semantics directly to check their behavior on sample JavaScript programs or verify against a test suite

Check out the actual LISP code here.

Interface Builder

Interface Builder first made its appearance in 1986 written in Lisp (for the ExperLisp product by ExperTelligence). It was invented and developed by Jean-Marie Hullot using the object-oriented features in ExperLisp, and deeply integrated with the Macintosh toolbox. Denison Bollay took Jean-Marie Hullot to NeXT later that year to demonstrate it to Steve Jobs. Jobs immediately recognized its value, and started incorporating it into NeXTSTEP, and by 1988 it was part of NeXTSTEP 0.8. It was the first commercial application that allowed interface objects, such as buttonsmenus, and windows, to be placed in an interface using a mouse. One notable early use of Interface Builder was the development of the first WorldWideWeb web browser by Tim Berners-Lee at CERN, made using a NeXT workstation.

more on Interface Builder by Denis Bollay

ExperTelligence introduced “Interface Builder” in 1986. We took it up to neXt to show Steve Jobs – the rest is history. In 1988, Denison Bollay built a much more dynamic interface tool, in which the interface was fully modifiable AS the program was running. Since it was built in incrementally compiled LISP, all other functions and methods were also modifiable on the fly. Denny took it to Seattle to show Bill Gates, but MicroSoft wanted a version written in basic (no objects, no methods, etc back then). I explained one couldn’t do that without OO. They built Visual Basic.

The Remote Agent Experiment: Debugging Code from 60 Million Miles Away

Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem.

zaries
http://zaries.wordpress.com/?p=701
Extensions
SBCL on Ubuntu 19.04: Unable to load any of the alternatives – Error – cl-ssl
LinuxLispProgrammingSoftwareUbuntu
Since 2007 when I started using Ubuntu I have been doing upgrades to the latest version a month before the release. Yes I am a sucker for pain. After the upgrade to 19.04 today I had issues loading projects that used cl-ssl getting the following error: The fix was (after trying installing latest sbcl first) […]
Show full content

Since 2007 when I started using Ubuntu I have been doing upgrades to the latest version a month before the release. Yes I am a sucker for pain.

After the upgrade to 19.04 today I had issues loading projects that used cl-ssl getting the following error:

Unable to load any of the alternatives:
   ("libssl.so.1.0.2m" "libssl.so.1.0.2k" "libssl.so.1.0.2"
    "libssl.so.1.0.1l" "libssl.so.1.0.1j" "libssl.so.1.0.1e"
    "libssl.so.1.0.1" "libssl.so.1.0.0q" "libssl.so.1.0.0"
    "libssl.so.0.9.8ze" "libssl.so.0.9.8" "libssl.so.10"
    "libssl.so.4" "libssl.so")

The fix was (after trying installing latest sbcl first) was to update quicklisp libraries.

(ql:update-dist "quicklisp")

I don’t know if there are fixes in cl-ssl, I suspect that maybe it just needed to be recompiled….

zaries
http://zaries.wordpress.com/?p=697
Extensions
react-native suspense no more fetch hell
Programmingreact-native
While reading up about hooks I ran into a blog post by Daishi Kato about a custom useFetch hook. Having a purely hate relationship with fetch in react-native it immediately caught my eye! In the blog post I learned that suspense could solve the fetching of data conundrum. Hooks where forgotten and I went googling […]
Show full content

While reading up about hooks I ran into a blog post by Daishi Kato about a custom useFetch hook. Having a purely hate relationship with fetch in react-native it immediately caught my eye! In the blog post I learned that suspense could solve the fetching of data conundrum. Hooks where forgotten and I went googling suspense.

There where three things I did not like with what I found, first all the code examples where using (or punting) other libraries, the second was that a lot of the code examples where related to code splitting, and third there was just so much over kill. I wanted a simple example (but still useful when applied to real world problems) that did not use external libraries, and after some trial and error here it is.

The gist of the solution is that you need to fetch data, put it some where so you can use it later and a function to display the data where suspense will take care of the delay for you.

Place to put data – Simple Cache

This was inspired by unstable_createResource used in a lot of the examples. The gist of which was kindly broken down here.

const createCache = (handler) => {
  let resolved = new Map();
  return (cacheKey,args) => {

     if (!resolved.has(cacheKey)) {
      //*
      throw handler(args)                                 
        .then(val => resolved.set(cacheKey, 
                                  {data: val, error: null}))
        .catch(err => resolved.set(cacheKey, 
                                   {data: null, error: err}))
    }  
    return resolved.get(cacheKey);
  };
}

Note that I wanted to be able to catch errors and display them in a separate area of the app like a notification bar. So catching the error in the right place and separating it from the data became and issue. ** If you try to combine the data and error into a structure in the actual fetch, suspense looses sight of the promise. So I made it part of the cache.

Fetch the Data and put it in the cache

const myFetchCache = createCache(
  (args) => {
     return fetch(args.url, {
      method: args.method
    })
      .then(r => r.json())                                         
  });

The fetch is not hard coded so the cache can easily be used for many different urls or variations of the the same urls etc

Display Function

function DataDisplay({dataQuery, setError}) {
  //***
  const data = myFetchCache("cacheKey",dataQuery);
  setError(data.error);  
  return <Text>{JSON.stringify(data.data || "Unknown", null, 2)}</Text>;
}

The display function fetches the data from the cache, passes any errors back via a useState hook and displays the data.

APP – putting it all together

import React, { useEffect, useState, Suspense } from 'react'
import {SafeAreaView, StyleSheet, Button, Text} from 'react-native'

.....createCache
.....myFetchCache
.....DataDisplay

export default function App() {
  const [dataQuery, setdataQuery] = useState(null);
  const [error, setError] = useState(null);
  
  return (
    <SafeAreaView style={styles.container}>
      <Button title="Get Data from httpbin.org"
              onPress={() => setdataQuery(
                             {url: "https://httpbin.org/get",
                              method: "GET"})} />
        
      {dataQuery ? (
        <Suspense fallback={<Text>loading...</Text>}>
          <DataDisplay dataQuery={dataQuery}
                       setError={setError}/>
        </Suspense>
      ) : null}

    {error ? (
      <Text>{JSON.stringify(error)}</Text>
      ) : null}
    
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: "#fff",
    flex: 1,
    margin: 20
  },
  textInput: {
    backgroundColor: "#eaeaea",
    borderColor: "#cccccc",
    borderWidth: 1,
    height: 40,
    padding: 10
  }
});

Button onPress populates the url to be used when fetching data for display. The url and other parameters is used in the suspense call to display data. Suspense has a fallback argument which is a good place to put your data spinner instead of “loading…”. The fall back is what is displayed while we wait for the fetching of the data.

I also pass the setError function to the Display so that it can populate the error state when fetching the data. The error state is then displayed at the bottom of the screen.

Things I have to think about:

* Why use throw in createCache to call the handler?

UPDATE: Then answer is that suspense is expecting a thrown promise! Have a look at what Brian Vaughn says in this reddit post. The bit that brought on the aha moment for me was:

“Suspense works by throwing Promises. Reach catches the thrown value. If it’s an error, it looks for the nearest ancestor error boundary. If it’s a promise (or thennable) it looks for the nearest ancestor Suspense.”

** How does a promise bubble up from functions to get to suspense?

UPDATE: This article by Javier Calzado clears it up and also put some light on a pet peeve of mine, await …

“…the await operator ‘pauses the execution’ or ‘waits for a promise’. You may have read this definition before, but be careful, it suggests the wrong idea that await blocks or waits synchronously, and it does not.”

*** Not to happy with the fact that the data is fetched in the display. Would like to do it out side of display, would also simplify error stuff.

UPDATE: If you pass the promise/data to suspense instead of generating the promise inside the suspense you get an error that says there is no fallback.

UPDATE:UPDATE: Once again Brian Vaughn comes to the rescue ,look at the second part of his answer here, the trick is in how react works/gets compiled.

**** useContext instead of cache? Since the cache in this example is not a long term thing nor is it suppose to be.

UPDATE: The more I look at Context the less I like it, personal peeve, and its over kill for this example.

zaries
http://zaries.wordpress.com/?p=684
Extensions
react-native hooks = functions not classes
Programmingreact-native
I wanted to try Suspense so spun up an new project with react-native init in 0.59.0-rc.3 (react-native init myprojectname –version react-native@next) . The examples for Suspense I found also used hooks. So I thought fine might as well investigate that to. So I cut and paste code into the App.js, this got syntax errors and […]
Show full content

I wanted to try Suspense so spun up an new project with react-native init in 0.59.0-rc.3 (react-native init myprojectname –version react-native@next) .

The examples for Suspense I found also used hooks. So I thought fine might as well investigate that to. So I cut and paste code into the App.js, this got syntax errors and then run time errors etc. What I had not grokked was that hooks is all about eliminating/replacing class components with functional components. And not about doing state with out componentDidMounted and its friends…eish

Long story short instead of this APP template created by init

export default class App extends Component<Props> {
  render() {   
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
           Welcome to React Native!</Text>
        <Text style={styles.instructions}>
           To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
      </View>
    );
  }
}

you need this template code to get going with hooks successfully

export default function App() {
  render() {  
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
           Welcome to React Native!</Text>
        <Text style={styles.instructions}>
           To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
      </View>
    );
  }
}

For the curious the following is required reading for a hooks aha moment https://reactjs.org/docs/hooks-intro.html#motivation

Happy hacking.

zaries
http://zaries.wordpress.com/?p=680
Extensions
react-native ubuntu 18.10 quick and easy install
LinuxProgrammingreact-nativeUbuntureact-native ubuntu install
I had to install react-native on a clean laptop so I thought I would pen this recipe to my self and any others who need a quick reference. Firstly I need to say that react-native is much easier to get up and running than it was 6 months ago! The install of components was never […]
Show full content

I had to install react-native on a clean laptop so I thought I would pen this recipe to my self and any others who need a quick reference.

Firstly I need to say that react-native is much easier to get up and running than it was 6 months ago! The install of components was never to bad but you had to hack config files to get your first project running, that does not seem to be the case any more. The first time I tried react-native it took me a couple of days to successfully run my first app! This recipe should take you less than 15 min if you have fast internet and can type. And the default app runs first time!

Step 1:

Install nodejs.

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs

The nodejs install will install npm for you.

Step 2:

Install Java.

Install JDK 8 (Java 9 to 11 will just give you gradle build issues avoid for now)(https://launchpad.net/~webupd8team/+archive/ubuntu/java)

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

sudo apt-get install oracle-java8-installer
sudo apt install oracle-java8-set-default

Check your java version to see if all is well.

javac -version

Step 3:

Install Android Studio.

(For more options and pictures go to https://itsfoss.com/install-android-studio-ubuntu-linux/)

sudo snap install android-studio --classic

On running Android Studio for the first time do the following

choose custom
select intellij
select emulator
click finish

Step 4 (Optional):

Follow kvm instructions.

https://developer.android.com/studio/run/emulator-acceleration?utm_source=android-studio#vm-linux

Step 5:

Install react-native client.

sudo npm i -g react-native-cli

Step 6: 

Set some paths.

(read this https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc)

nano /.bashrc

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator

Create your first project.

react-native init myprojectname

OR

Step 7: 

If you want to use the latest and greatest RC version. You would want to do this because that will give you access to react Hooks and Suspense, really worth it and by the time you have your are ready to ship your project the stable release should be out.

react-native init myprojectname --version react-native@next

cd /myprojectname

You can run the app in emulator and native. If you want to run it in native you need to start an emulator in Android studio first. I dont really use this so you will have to google it for your self.

To run on your phone, enable development and debugging in your phone and plug it into the usb port.

Find your device with

adb usb

Use your device name to set up

adb -s ce07171678151c0d0c reverse tcp:8081 tcp:8081


Now you are ready to let rip.

react-native run-android

To see log output in a separate terminal window

react-native log-android

Hopefully you now have your first react-native app running on your phone!

zaries
http://zaries.wordpress.com/?p=676
Extensions