Status? Or Update?

 

Since my last edition in March, I've been refining the design of Videlicet: a
script I hope will aid in maintenance of digital art collections.

Although I haven't yet finished work, it is near completion, as you can see in
this abridged snapshot:
 http://www.mediafire.com/file/l0mh2dac75t63wl/TK-GreatestHits-2017-06-15.zip

Presently, the only available functionality is a label-maker. Soon, it will be a
label maker with tentacles. (Full disclosure: tentacles are metaphorical in
nature, and the program is so described for the sole purpose of setting up this
joke about octo-pythons.) Hopefully the finished work will be available to you
by this July, at which time I will issue the complete edition.

In the meantime, here are some computer-related trivia.




Factual computer tidbits, each in 80 columns -- the canonical console width.
(These are with considerable reference to FOLDOC and the Jargon File.)




We say "computer" about machines these days, but it once meant one who computes.

Computer machines are a kind of difference engine. They calculate math rapidly.

The first such difference engine is attributed to Charles Babbage.

The first reprogrammable machine, however, is reputed to be the Jacquard loom.

Source code is a series of instructions telling a computer what to compute.

Source code is interpreted by a compiler that translates it to assembler code.

An electronic calculator is, in abstract, an infix notation algebra compiler.

Assemblers translate human-legible mnemonics into computers' "machine language."

Machine language, an abstraction of electrical potential (EMF), is binary code.

The Volt, defined by the IEC in 1983, is the unit of electro-motive force (EMF).

Metal oxide semiconductor field-effect transistors (MOSFETs) are logic circuits.

Logic circuits encode inverse Boolean algebra: NAND, NOR, and NOT.

Computer programming languages evolved to assembler mnemonics from machine code.

From assembler, programs further evolved to high-level language (such as C).

Very high level language (whatever that means - perhaps interpreters?) was next.

Modern computer programming reads much like calculus. (C.f. ASM = arithmetic.)

Object-oriented programming arranges data in nested structures, then computes.

Functional programming computes with nested functions, then arranges the data.

File systems are tree-like data structures encoding allocation of disk memory.

Compressed archives use something like LZMA to squeeze redundant bytes in files.

Non-volatile memory (disk space) lasts longer than volatile (RAM).

Harddisk capacity is measured in Gigabytes. They're magnetic platters or EAPROM.

Magnetic storage functions by "reading" and "writing" magnetic fields.

Electrically alterable programmable read only memory blows fuses & antifuses.

Operating systems handle tasks, as process scheduling, incidental to human use.

Mainframes ("clouds") have one central OS; the clients are dumb terminals.

Dumb terminals have no independent processing or storage capability.

Personal computers, by contrast, have processing, storage, and an OS.

Graphical user interfaces (GUIs) are the modern point-and-click metaphor.

Command line interfaces (CLIs) are the "antiquated" terminal console metaphor.

Computer networks are any set of computermachines "speaking" to one another.

Sessions are by way of protocol. The Worldwide Web uses HTTP over TCP/IP.

The Internet & WWW evolved via cookoffs: see the Requests for Comment.

Bandwidth on the Internet has increased from baud to megabytes per second.

All computing resources can be served on a network, bandwidth permitting.

^- Senator Ted Stevens' famous "series of tubes" quote was accurate, BTW.

Human interface devices are a material tool humans use to interact w/ computers.

Graphical computer displays evolved from oscilloscopes etc, to CRTs, to LCDs.

Cathode ray tubes work by shooting electrons at a phosphorescent matrix.

Modern television-size liquid crystal displays contain millions of circuits.

CPUs handle arithmetic and logic. These days, there are 4 of them on one chip.

Frequency of a CPU's oscillation is measured in Gigahertz. For example, 2.5 GHz.

The chip's clock speed (oscillation) determines how fast it computes.

All arithmetic can be computed by adding: by 1 only, too, I think.

Ones Complement and Twos Complement are binary encodings for negative numbers.

Microchips are printed circuit boards (PCBs) that execute various functions.

The chips on a mainboard are connected to one another by a bus ("omnibus bar").

Computer hardware is the aforementioned assemblage of circuit boards.

"Firmware" (between hardware & software) is on-board (on-chip?) control logic.

Computer software is some instructions compiled & ready to run: a core image.

"Bootstrapping" a computer refers to a story about a man who flew in the air.

The Basic I/O System of yore was supplanted by the Extended Firmware Interface.

Personal computer workstations are sometimes called "boxes," due to their shape.

Alan Turing's model of a finite state automaton is a supposed computer.

Emulators, or virtual machines, are also logical computers.

 

And Now For A Bit Of Fun. (Redux.)

(Title is a line from _Monty Python’s Flying Circus_.)

Frigid northern Idaho winters be the times what try gender-nonexclusive souls:
A nifty Python script & some data recovery have been my only accomplishments
as naughty pictures of Amaterasu hastened the thawing of my heart. Boi~ng!

Today’s the day I will write of myself in the third person.
But first, I will link you to my work and some auxiliaries.
This will take some time.

I must warn you: My portfolio is now sexually explicit, because I have recently
assembled portions of a dossier documenting my life to date.
If you’re too young, why not go play Narbacular Drop instead?

So, the PARENTAL DISCRETION caution is no longer entirely sufficient. Instead
you are advised that the work is ADULTS ONLY: don’t even touch it if a child.
The “Adults Only” category applies to ALL of these links, which are external to
WordPress, and the content hosted there is not necessarily endorsed by either
WordPress or the external host. Which is good for them, because it’s naughty.

I have at last retitled the archives with less confusing file names, and I have
rearranged the directory structure to be more sensible and easier to handle with
the unzip (manual section 1, by Info-ZIP) decompression utility: because each
archive contains similar directory structure, extracting them all into the CWD
will produce a less confusing output. Warning: Windows 10 will fail to extract
some of the files due to long filenames. 7zip (incl.) and unzip don’t do this.

If you download all the archives, you’ll need several hundred MB to decompress.
I’ve done what I could to ensure that all the megabytes are permissible by law,
but censorship laws in my country (USA) are restrictive and becoming more so…
exercise discretion.
If you wish to maintain a strictly lawful archive, then delete the banned books.
Actually, you might like to just delete everything, on the off chance that your
local apparatschik might declare you mentally ill due to unapproved thoughts.

A standalone version of MLPTK (0.7 MB / 0.2 MB), in case you have no time for the larger archives:
http://www.mediafire.com/file/zu0vmah7egko759/TK-Standalones-2017-03-09.zip

 
My complete portfolio is, owing to recent (and, I hope, conclusory) additions from auld lang syne, 22.8 megabytes. Compressed, it is 12 MB:
http://www.mediafire.com/file/3d77cvmujtvg3c7/TK-Portfolio-CompleteWorks-2017-03-09.zip
(New: duplicate file culler in Python, MLPTK’s “roman” module, & naughty chats.)

Syntax-highlighted illustrations in candy-colored HTML format are available (23.8 MB uncompressed / 3.3 MB compressed):
http://www.mediafire.com/file/6pp764w8n7w8vll/TK-SyntaxHighlightsOnly-2017-03-09.zip

My book, “Yawnie’s Whole” fills about 1,100 A4 pages (13.3 MB / 7.1 MB), and I have corrected the typesetter malfunction that caused images not to appear in their respective chapters:
http://www.mediafire.com/file/0c27018vy8nb14h/TK-Book-YawniesWhole-2017-03-10.zip
(These are the Ice Capades.)

Another 5,000 pp document my past (27.2 MB / 14.9 MB), and I have corrected the typesetter malfunction that caused images not to appear in their respective chapters:
http://www.mediafire.com/file/m2989o7e39hiepm/TK-Book-Addendum-YawnieSpots-2017-03-10.zip
(These are the Buttscapades.)

The companion curriculum (“Relevant Works By Others”), now its own archive (64.5 MB / 31.1 MB), contains the indispensable Berkeley Utilities and a diverse assortment of other excellent resources for programmers and Windows users:
http://www.mediafire.com/file/ttrd55i2xd85r35/TK-CompanionCurriculum-2017-03-09.zip

Recently I’ve been exploring elderly volumes.
Here are some other curios I won’t be distributing after this time:

34.4 megabytes of finely crafted TrueType fonts (9.4 megs zipped):
http://www.mediafire.com/file/ucjwc2pvqbu9mrx/TrueTypeFonts.7z

A Windows compilation of the SWFTools suite version 0.7.0. (32.5 MB / 5 MB):
http://www.mediafire.com/file/78o25vg2hhythnn/SWFTools070exe.7z

A selection of episodes of the out-of-print children’s television series, Sonic the Hedgehog (SatAM, not AoSTH; 100.8 MB / 98 MB):
http://www.mediafire.com/file/b9c19a9dut3fx0g/SatAMSelections.7z

A miscellany, including other out-of-print works (58.3 MB / 35.4 MB):
http://www.mediafire.com/file/ohrnagw6q27n3k9/Curios.7z

The combined size of all the downloads is about two hundred Megabytes.

Think not that those ten archives contain the Owl of Thebes; for, gentles all,
the foregoing hyperlinks were created with the courteous assistance of MediaFire
— a file host serving via Hypertext Transport Protocol. You may have observed
their advertisements on the interstitial page: I haven’t yet clicked one, but I
guess they might be OK — if not, then wouldn’t BBB complaints have been filed?

And here is a faux press release I’ve been working on since January…

      ADORING MASSES SWOON AT UMPTEENTH DEBUT OF _TOYS 4 TOTS_ CANDIDATE!
  _Toys for Tots_ not as enthusiastic about introducing children to Falstaff.

Archivist Thor King once again spins a dreidel squarely into the Public Domain
with his much trumpeted posting today of MLPTK's officially final edition.

The composition, titled "MLPTK", contains his portfolio: a simple command line
tool written in JavaScript for use with Web browsers, as well as assorted other
"sideshows" sufficing quotidian archival tasks. In these latter, work continues.

Full to brimming with thousands of lines of invective artfully hidden among tens
of thousands of lines of source code, Thor's publication -- not as much textbook
as periodical, considering his publication schedule -- is both an indispensable
companion to the casual programmer and an ominous reminder of what Wyrd sets in
store for unlucky engineers: namely, the affection of rodents.

A cursory bibliography is included.

Included also: assorted trinkets & curios collected during the Worldwide Web's
toddling days -- late 1990s through about 2010, when Internet access in the USA
had grown ubiquitous but before the only use we ever put to it was gift shopping
-- and items from his unique body of knowledge, the swashbucklers' lore.

Like asking a grown man why he carries his midday meal in a child's lunchbox,
inquiring of Thor why he does not restrict his archive to only those items of
immediate utility (or indeed, even to his own exclusively) is just Not Done(TM).

As a bovine might deposit a patty of brown gold in a happy orchard as it grazes
its way past, the portfolio (as it is typeset for PDF format) also includes the
autobiography of a vagabond, replete with rhapsodical reprisal of recollection:
a fantastic story of intrigue is belied by the writer's apparently (& actually)
mundane personal wont of tedious exactitude in mediocrity, although the tale is
hindered by its cumbersome and banal scrivening.

His reasoning regardless, we note that his book ("Yawnie's Whole: the complete
Yawnie, for Yawnie enthusiasts"), as set for A4 area, numbers aproximadamente
one thousand pages, of which perhaps half is in English and the rest in code.
One way or the other, "Yawnie's Whole" is a gaping chasm of analytical logic fit
to tie Gordian knots around the necks of capitalist pigs: cut them as you will.
The PDF file was created with the technical assistance of LaTeX via TeX Live, &
DocBook via DBLatex, with appearances by an all-star cast of GNU core utilities.

For those not yet initiated into the candy-striper's bespec{k,tac}led part-time
wonderland, and in addition to the PDF, Thor's portfolio is supplemented by yet
another archive containing colorfully syntax-highlighted HTML documents. With
these, Thor's intends to illustrate the so-called "look & feel" (ambience) of
his day-to-day working environment: which is, to paraphrase a line from the film
"Night Flyer" by Stephen King, redder than the Devil's eye on one side, blacker
than a woodchuck's ass on the other. (And it is not known to drink.)

Although Thor once cautioned children to speak to their parents about reading
his portfolio, due to force of law he now advises them to avoid it entirely: his
recent inclusion of several explicit portions renders him uncouth. Because, as
we all know, a child once warned is forever guarded, Thor discharges his further
obligation to the youngsters of the Internets and returns to his lab equipment.



The author lives in scenic Idaho, where he spends his days asleep and his nights
shipping furry slash fiction in thirty two languages.

Thor, 30, has written for two decades, pausing occasionally to pick his nose.

In his copious spare time, he keys source code using only his left pinky toe.

Unless a massive government conspiracy hangs like a thunderhead over your entire
way of life, you may be able to reach him at these additional locations:

         ┌─────────────────────────────────────────┐
         │ Thor King                               │
         │ 1433 Flannigan Creek Road               │
         │ Viola, ID 83872                         │
         │ United States of America                │
         │                                         │
         │ colonel32.dll@gmail.com                 │
         │ https://plus.google.com/+ThorYawnieKing │
         │ https://www.facebook.com/thor.king.524  │
         │ https://www.twitter.com/NotAYawnoceros  │
         └─────────────────────────────────────────┘

Cheroot Privileges: a Potpourri of Pointlessness.

Cheroot (Tamil "shuruttu" meaning "a roll"): a cigar. Reputed to be pungent.
chroot (GNU coreutils, manual section 8): run command in special root directory.
Potpourri: a compost heap, montage, medley, or ragout. NB: never compost meat.
Root privileges: to have these is to be the super-user, operator, admin, etc.
Root: a dental nerve, et c.



My foregoing post touched on socket programming, when I mentioned TFTP. (BTW, MS
Windows has a TFTP client built-in: in the Programs & Features control panel app
open "turn Windows features on or off.")

Sockets are a hardware abstraction layer that deals with computer networking.
As usual, gritty details are beyond me and I gloss them over. (Tee hee. That's a
pun about oyster pearls.) Suffice to say that sockets are ports of call for data
transmitted between computers: hardware and protocol not withstanding, bytes fly
out one socket and land in another. We built this Internet on socket calls.
(A pun on Jefferson {Airplane,Starship}'s "We Built This City.")

For more information, consult the RFCs, and the IEEE's 802.* network specs.
Perhaps ftp.rfc-editor.org, www.faqs.org/rfcs, or www.ietf.org/rfc are of use?

And an update to my Javascript snippet in the remedial lecture...
    function initnary (ctr) { for (var i=0; i < ctr.length; ctr[i++] = 0); }
    function incnary (counter) { // Faster, but rollover instead of sentry.
        for (var L = counter.length, i = L - 1;
             (nary[i] = ((nary[i--] + 1) % L)) == 0 && i > -1;
        ) ; // Faster than the example in WP12, but rollover not sentry.
    } // end incnary(): Increments N-ary counter (length >= 1), by reference
    // ...
    var nary = new Array(items.length);
    initnary(nary); // nary's state: 0 0 0 ... 0
    incnary(nary); // nary's state: 0 0 0 ... 1
    // ...
... which is possibly a bit faster than the other one, although neither will be
optimized by an optimizing compiler (due to the complicated loop initializer), &
therefore both are of marginal utility.



It's 2017. To begin my new year on the right foot, I began it on the wrong foot.

My first hint that I'd need to effect some impromptu renovations to my skeleton
came to me when I noticed that I had begun to experience an unpleasant taste of
musty dust after picking clean my right anterior maxillar tricuspid. (The reason
why shattered teeth taste of moist chalk is probably because dentine & chalk are
both calcareous substances. I'd guess chalk rots too, if infected.) Another way
I could describe the taste of a rotten tooth is "like hard-boiled eggs that were
rotten before they were boiled," because they smell and taste alike. The dentine
(the material composing the interior of teeth) also feels distinctly like chalk,
or like gritty soil, when I palpate it with my tongue.

Anyway, my left anterior mandibular tricuspid has also been a goner since auld
lang syne, and the bone fragments left over inside my gums have really begun to
bug me, so a taste of fetor was the last straw.

Luckily, I had a small piece of surgical gauze left over from when I foolishly
had my wisdom teeth removed. (If you're considering removal of yours, then I am
here to tell you: DON'T! It's a waste of money, and, unless your teeth are truly
rotten or a source of pain, there is simply _no reason_ to remove even one.) If
you haven't tried to get a grip on one of your teeth before, you wouldn't know,
but even a tooth you've wiped dry is difficult to grasp without gauze.

I'm also the lucky owner of a pair of surgical forceps. These handy little tools
look like a long and delicate pair of pliers with the fulcrum very close to the
gripping side of the levers. ("They really pinch.")

In case you were curious, forceps are usually employed to grasp small objects in
surgical procedures. They can also be used as roach clips. (For avoiding burns &
stains of the fingers while smoking. Wide pipe stems containing packed cotton
accomplish the same end: you can make one from a hollow ballpoint pen and cotton
balls sold at any general store. Nevertheless a forcep is more generally utile.)

Those teeth's days had long been numbered. Their time had come!

So it was that I spent tedious hours doubled over with my fingers crammed in my
mouth, wiggling that thrice-damned curse of a bone to try and work it loose.
I quite unwisely, and disregarding the risk of breaking my jaw, channeled thirty
years of pent aggression into what remained of my tricuspid molar, as malodorous
flakes of rotten enamel & dentine fell upon my tongue like evil snow.

I knew I had effected some kind of progress when I heard a muffled click inside
of my head -- bones have eerie acoustic properties, like an unsettling resonance
and a tendency to produce a crunching sound (rather than a snap) when fractured
-- and felt a stabbing pain travel up the side of my head. Thankfully the pain I
felt due to prolonged migraine headache rendered this somewhat less intolerable.

I repeated this procedure until I lost consciousness.
Well, that's how I had hoped that this would end, but it didn't.
I could not bear the pain, and had to stop trying to pull my tooth.

Unfortunately for me, although I did manage to work the molar somewhat further
out of my jaw than it had loosened already (my dental hygiene, in case the memo
hasn't reached you, is worse than Austin Powers'), I didn't completely extract.
All I managed to do was cause a hairline fracture of my maxilla, which will un-
doubtedly be a source of major difficulty and pain to me in the decades to come.

Worse yet, my application of too much pressure via the forceps caused additional
shattering of the tooth; further attempts at extrication are counterindicated.
That's just as well, because the kind of general-purpose forceps I had available
aren't for dental extraction: this requires a special kind of forcep I hadn't.

I suppose it's just as well: considering the fact that some dentine remained in
the shell of the tooth, its nerve was probably still alive and well. The nerves
connecting teeth to the root canal are extremely sensitive, and interconnected;
what's worse, I could easily have broken my jaw by violently levering the tooth;
therefore, extracting my tooth myself would very likely have been suicide.

So, as far as sockets go, my teeth will be rotting in theirs for some time yet.



Other noteworthy pratfalls during January:
1. Accidentally locked myself out of Windows by attempting to install Ubuntu 16
   alongside, which occurred after it prompted me to designate a BIOS boot part
   (prior installs didn't manifest the prompt and gave me no trouble).
2. Locked myself out of Ubuntu too by trying to unbrick Windows.
3. Flashed in the backup EFI system partition and boot sector from a disk image,
   reset the partition table with fdisk, thanked lucky stars, began again at 1.
4. Broke shiny new laptop's fragile keyboard connector. Cursed fate.

Incidentally, I had some luck using this procedure to regain access to a Lenovo
IdeaPad 100-151BD 80QQ's UEFI Firmware Configurator after I had set my boot mode
to Legacy Support before installing Ubuntu, which locked me out of the config:
    1. At GRUB operating system selection screen key 'c' for a command line.
    2. normal_exit
    3. initrd
    (initrd fails because you didn't load the kernel, but then Windows Boot
     Manager tries to load in UEFI mode for some reason & presents a screen
     politely offering to give you the FW Config if you give it the ESC key,
     which it doesn't usually when your boot mode is Legacy Support instead
     of UEFI with or without secure boot.)
I ought note: Ubuntu 16 boots the configurator automagically in UEFI boot mode:
the option reappeared when I `sudo update-grub`ed while in UEFI mode.

Speaking of GRUB, here's a boot procedure (in case you've never driven stick):
    1. root=hd0,gpt8
       (Linux is at sda8 on my system)
    2. linux /vmlinuz
    3. initrd /initrd.img
    4. boot
Or, to shift gears into Windows:
    1. root=hd0,gpt1
    2. chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    3. boot

While I'm on the topic, here's how to play a tune at boot time using GRUB:
    A.1. @ boot menu (operating system selection), key 'c' for a GRUB shell.
    A.2. play TEMPO PITCH1 DURATION1 PITCH2 DURATION2 P3 D3 ... ad infinitum
         Pitches are frequencies in Hertz; duration is a fraction of tempo.
or
    B.1. In Ubuntu, Control + Alt + T to open a terminal emulator window.
    B.2. sudo gedit /etc/default/grub
    B.3. Feed the recordable piano by editing the line at the bottom:
         GRUB_INIT_TUNE="325 900 6 1000 1 900 2 800 2 750 2 800 1 900 2 600
5 0 1 500 1 600 1 800 1 750 2 600 2 675 2 750 4"
         # ^- The Amazing Water (NiGHTS)
         GRUB_INIT_TUNE="1024 600 2 650 2 700 2 950 10 900 20 0 10 600 2 650
2 700 2 950 20 1050 10 1100 5"
         # ^- Batman, the Animated Series.
         GRUB_INIT_TUNE="2048 600 5 0 1 600 5 0 1 575 5 0 1 575 5 0 1 550 5
0 1 550 5 0 1 575 5 0 1 575 5 0 1 600 5 0 1 600 5 0 1 575 5 0 1 575 5 0 1
550 5 0 1 550 5 0 1 575 5 0 1 575 5 0 1 900 8 0 4 900 24"
         # ^- classic Batman.
    B.4. Save the file, and then sudo update-grub && sudo reboot
Musical notes within the 500-1500 Hz range tend to be within 100Hz of each other
(therefore ± 50 Hz for flats & sharps) typically, but act strange around 600 Hz.



GNU/Linux is dandy for computer programming, especially data processing, because
it is now (thanks to Ubuntu) easier to use than ever; but it changes so quickly
that I've barely skimmed over the repository before the next long-term support
version has been finalized. The installer wizard also sometimes makes mistakes.
The software repository is slowly morphing into a dime-store, any software worth
using requires considerable technical expertise cultivated @ your great expense,
and if anything breaks then you have to be the fastest teletype gun in the west.

And, because my comments re: Linux may mislead, I'm thrilled about Windows 10.
Have you played Microsoft Flight Simulator recently? Great game.

Automaton Empyreum: the Key to Pygnition. (Trivial File Transfer Protocol edition.)

(I have implemented the Trivial File Transfer Protocol, revision 2, in this milestone snapshot. If you have dealt with reprogramming your home router, you may have encountered TFTP. Although other clients presently exist on Linux and elsewhere, I have implemented the protocol with a pair of Python scripts. You’ll need a Python interpreter, and possibly Administrator privileges (if the server requires them to open port 69), to run them. They can transfer files of size up to 32 Megabytes between any two computers communicating via UDP/IP. Warning: you may need to pull out your metaphorical monkey wrench and tweak the network timeout, or other parameters, in both the client and server before they work to your specification. You can also use TFTP to copy files on your local machine, if for whatever reason you need some replacement for the cp command. Links, courtesy of MediaFire, follow:

Executable source code (the programs themselves, ready to run on your computer): http://www.mediafire.com/file/rh5fmfq8xcmb54r/mlptk-2017-01-07.zip

Candy-colored source code (the pretty colors help me read, maybe they’ll help you too?): http://www.mediafire.com/file/llfacv6t61z67iz/mlptk-src-hilite-2017-01-07.zip

My life in a book (this is what YOUR book can look like, if you learn to use my automatic typesetter and tweak it to make it your own!): http://www.mediafire.com/file/ju972na22uljbtw/mlptk-book-2017-01-07.zip

)

Title is a tediously long pun on "Pan-Seared Programming" from the last lecture.
Key: mechanism to operate an electric circuit, as in a keyboard.
Emporium: ein handelsplatz; or, perhaps, the brain.
Empyreuma: the smell/taste of organic matter burnt in a close vessel (as, pans).
Lignite: intermediate between peat & bituminous coal. Empyreumatic odor.
Pignite: Pokémon from Black/White. Related to Emboar & Tepig (ember & tepid).
Pygmalion (Greek myth): a king; sculptor of Galatea, who Aphrodite animated.

A few more ideas that pop up often in the study of computer programming: which,
by the way, is not computer science. (Science isn't as much artifice as record-
keeping, and the records themselves are the artifact.)

MODULARITY
As Eric Steven Raymond of Thyrsus Enterprises writes in "The Art of Unix
Programming," "keep it simple, stupid." If you can take your programs apart, and
then put them back together like Lego(TM) blocks, you can craft reusable parts.

CLASSES
A kind of object with methods (functions) attached. These are an idiom that lets
you lump together all your program's logic with all of its data: then you can
take the class out of the program it's in, to put it in another one. _However,_
I have been writing occasionally for nearly twenty years (since I was thirteen)
and here's my advice: don't bother with classes unless you're preparing somewhat
for a team effort (in which case you're a "class" actor: the other programmers
are working on other classes, or methods you aren't), think your code would gain
from the encapsulation (perhaps you find it easier to read?), or figure there's
a burning need for a standardized interface to whatever you've written (unlikely
because you've probably written something to suit one of your immediate needs:
standards rarely evolve on their own from individual effort; they're written to
the specifications of consortia because one alone doesn't see what others need).
Just write your code however works, and save the labels and diagrams for some
time when you have time to doodle pictures in the margins of your notebook, or
when you _absolutely cannot_ comprehend the whole at once.

UNIONS
This is a kind of data structure in C. I bet you're thinking "oh, those fuddy-
duddy old C dinosaurs, they don't know what progress is really about!" Ah, but
you'll see this ancient relic time and again. Even if your language doesn't let
you handle the bytes themselves, you've got some sort of interface to them, and
even if you don't need to convert between an integer and four ASCII characters
with zero processing time, you'll still need to convert various data of course.
Classes then arise which simulate the behavior of unions, storing the same datum
in multiple different formats or converting back and forth between them.
(Cue the scene from _Jurassic Park,_ the film based on Michael Crichton's book,
 where the velociraptor peeks its head through the curtains at a half-scaffolded
 tourist resort. Those damn dinosaurs just don't know when to quit!)

ACTUALLY, VOID POINTERS WERE WHAT I WAS THINKING OF HERE
The most amusing use of void*s I've imagined is to implement the type definition
for parser tokens in a LALR parser. Suppose the parser is from a BNF grammar:
then the productions are functions receiving tokens as arguments and returning a
token. Of course nothing's stopping you from knowing their return types already,
but what if you want to (slow the algorithm down) add a layer of indirection to
wrap the subroutines, perhaps by routing everything via a vector table, and now
for whatever reason you actually _can't_ know the return types ahead of time?
Then of course you cast the return value of the function as whatever type fits.

ATOMICITY, OPERATOR OVERLOADING, TYPEDEF, AND WRAPPERS
Washing brights vs darks, convenience, convenience, & convenience, respectively.
Don't forget: convenience helps you later, _when_ you review your code.

LINKED LISTS
These are a treelike structure, or should I say a grasslike structure.
I covered binary trees at some length in my fourth post, titled "On Loggin'."

RECURSION
The reason why you need recursion is to execute depth-first searches, basically.
You want to get partway through the breadth of whatever you're doing at this
level of recursion, then set that stuff aside until you've dealt with something
immensely more important that you encountered partway through the breadth. Don't
confuse this with realtime operating systems (different than realtime priority)
or with interrupt handling, because depth-first searching is far different than
those other three topics (which each deserve lectures I don't plan to write).

REALTIME OPERATING SYSTEMS, REALTIME PRIORITY, INTERRUPT HANDLING
Jet airplanes, video games versus file indexing, & how not to save your sanity.

GENERATORS
A paradigm appearing in such pleasant languages as Python and Icon.
Generators are functions that yield, instead of return: they act "pause-able,"
and that is plausible because sometimes you really don't want to copy-and-paste
a block of code to compute intermediate values without losing execution context.
Generators are the breadth-first search to recursion's depth-first search, but
of course search algorithms aren't all these idioms are good for.
Suppose you wanted to iterate an N-ary counter over its permutations. (This is
similar to how you configure anagrams of a word, although those are combinations
-- for which, see itertools.combinations in the Python documentation, or any of
the texts on discrete mathematics that deal with combinatorics.) Now, an N-ary
counter looks a lot like this, but you probably don't want a bunch of these...
    var items = new Array(A, B, C, D, ...);       // ... tedious ...
    var L = items.length;                         // ... lines ...
    var nary = new Array(L);                      // ... of code ...
    for (var i = 0; i < L; nary[i++] = 0) ;       // ... cluttering ...
    for (var i = L - 1; i >= 0 && ++nary[i] == L; // ... all ...
        nary[i--] = ((i < 0) ? undefined : 0)     // ... your other ...
    ) ; // end for (incrementation)               // ... computations ...
... in the middle of some other code that's doing somewhat tangentially related.
So, you write a generator: it takes the N-ary counter by reference, then runs an
incrementation loop to update it as desired. The counter is incremented, where-
upon control returns to whatever you were doing in the first place. Voila!
(This might not seem important, but it is when your screen size is 80 by 24.)



NOODLES AND DOODLES, POMS ON YOUR POODLES, OODLES AND OODLES OF KITS & CABOODLES
(Boodle (v.t.): swindle, con, deceive. Boodle (n.): gimmick, device, strategy.)
Because this lecture consumed only about a half of the available ten thousand
characters permissible in a WordPress article, here's a PowerPoint-like summary
that I was doodling in the margins because I couldn't concentrate on real work.
Modularity: perhaps w/ especial ref to The Art of Unix Programming. "K.I.S.S."
Why modularity is important: take programs apart, put them together like legos.
Data structures: unions, classes.
Why structures are important: atomicity, op overloading, typedefs, wrappers.
linked lists: single, double, circular. Trees. Binary trees covered in wp04??
recursion: tree traversal, data aggregation, regular expressions -- "bookmarks"
Generators. Perhaps illustrate by reference to an N-ary counter?

AFTER-CLASS DISCUSSION WITH ONE HELL OF A GROUCHY ETHICS PROFESSOR
Suppose someone is in a coma and their standing directive requests you to play
some music for them at a certain time of day. How can you be sure the music is
not what is keeping them in a coma, or that they even like it at all? Having
experienced death firsthand, when I cut myself & bled with comical inefficiency,
I can tell you that only the dying was worth it. The pain was not, and I assure
you that my entire sensorium was painful for a while there -- even though I had
only a few small lacerations. Death was less unpleasant with less sensory input.
I even got sick of the lightbulb -- imagine that! I dragged myself out of the
lukewarm bathtub to switch the thing off, and then realized that I was probably
not going to die of exsanguination any time soon and went for a snack instead.

AFTER-CLASS DISCUSSION WITH ONE HELL OF A GROUCH
"You need help! You are insane!"
My 1,000 pages of analytical logic versus your plaintive bleat.

Pan Fried Programming

(Here's the update -- nothing much is new:
MLPTK: http://www.mediafire.com/file/m3u25i445lqkztb/mlptk-2016-12-16.zip
Source Highlight: http://www.mediafire.com/file/ygxb14ie94cwcuy/mlptk-src-hilite-2016-12-16.zip
Book: http://www.mediafire.com/file/vg439qruq3do90q/mlptk-book-2016-12-16.zip
)

Remedial (adj.): intended to rectify, amend, heal.
Panacea (n., myth): goddess of healing, daughter of Aesculapius.
Pansear (n.): Chili's Pokémon.

This remedial lecture will tersely cover a semester's curriculum,
similar to what you have learnt in your high school algebra class,
comprising the fundamentals of programming with synthetic languages
(those that are above machine code).

If you don't know what computer programming is, I would recommend that you study
some tutorials & encyclopedia articles. Much is available on the WWW (Worldwide
Web). The Web is a part of the Internet, and it is the Web you access from your
Web browser when you navigate to a Web page. You could also try one'a them there
"<name of programming language> For Dummies" textbooks: the "For Dummies" books
are excellent "Cliff's Notes"-style crash courses, and each aims to be similar
to a "101" course in the topic advertised.

To make a beginning with any programming language, all you must know is that a
computer computes: your instructions, issued in the program you write, tell the
machine how to progress from its input or initial state to a resultant output or
final state. These instructions look different in different languages -- some
languages require more or fewer -- but every computer program is an algorithm,
or "recipe for computation."

Computers and computer programs can be characterized as finite state automata.
They're like assembly-line robots who know where to weld each sheet of metal.
Also like assembly-line robots, they are "blind" in the sense that they'll kill
you with the soldering iron should you step between it and the sheet.
Computing machines do what they're told, even when it is particularly stupid:
that's why computer viruses, worms, and computer espionage exist.

In simplest terms, the computer's processing units receive some numbers and an
instruction that says what mathematical operation to execute, then operates:
like a calculator. High-level programming languages are more synthetic, like a
human language is, and comprise such ideas as objects (amalgamations of data) &
functions (modular sub-routines). Compilers or interpreters read these languages
and translate them into machine instructions, simplifying the lengthy series of
instructions necessary to make the calculator execute these difficult tasks.

In a high-level language, there are few technical concerns.
You can begin immediately with the abstract concepts.
Here are some:

VARIABLES
As in algebra, a variable is a name that represents a value.
As in solving a system of equations, values are typically assigned to some vars
and the value of the other variables is computed using the values given.
For example, in Javascript:
    var a = 2;
    var b = a + 2;
The variable <b> is now equal to 2 + 2. Similar operations function similarly.
In Javascript and other very-high-level languages, variables aren't only scalars
and can point at any object. They're like placeholders for procedure.
Although "variable" implies a value stored in memory, and "identifier" only its
mnemonic, the words "variable" & "identifier" used loosely mean about the same.
    "Just don't try that with the Captain."
        -- Geordi LaForge, to Data, _Star Trek: the Next Generation._

POINTERS, REFERENCES
These are important ideas that are abstracted away in VHLLs. A pointer stores an
address in memory, for a later indirect read/write or similar operation. In HLLs
a pointer/reference accesses an object directly instead of copying its value.
You'll rarely have to make the distinction in Javascript; but, for example:
    var a = new Array(1, 2, 3); // a[0] == 1, a[1] == 2, a[2] == 3
    var b = a; // Incidentally, b === a, and that is why in the next line...
    b[0] = 555; // ... b[0] == 555, and now a[0] also == 555!
As opposed to:
    var c = new Array(3); // c is a new array of length 3
    c[0] = b[0]; c[1] = b[1]; c[2] = b[2]; // copy scalar values one-by-one
    c[0] = 0; // c[0] == 0, but b[0] remains == a[0], which remains == 555.
    var d = 2;
    var e = d;
    e = 4; // e == 4, but d is still == 2.
As you can see, operating on an object (such as via array subscript operation)
changes the object, even if the object is pointed by multiple variables.
Likewise, objects passed as the argument of a function are passed by reference:
they aren't simply copied, and operating on the argument within the function is
equivalent to changing the object, whose scope is above that of the function.
Some high-level languages, like C, permit you to explicitly specify what is a
pointer or reference, which eliminates some of this confusion but requires more
exacting attention to detail in your design specification.

STATE
The state of a program is the value of all its variables, the current location
within the instruction set, and the environment of the operating system (or the
interpreter). In Javascript, within Web browsers, the browser typically provides
access to some of its state via the Document Object Model.

CONDITIONAL EXECUTION
Heuristics, or "guesswork," could not exist if there were no way to execute some
different code depending on the state of the program. Furthermore there are some
mathematics you can't write as exactly one set of instructions that produces one
semantic value: for instance, a function defined only on an interval, or an even
root of a positive number. In this circumstance, you are writing branches:
    if (5 > 10) { /* of course, the code in this block never happens. */ }
    else if (2 < 0) { /* neither does this, b/c cond'n is also false. */ }
    else { /* but all of this code happens, because the others didn't. */ }
... One of the branches executes, and the others don't.
The part in parentheses is the "conditional statement:" it's evaluated as either
"true" or "false," like in Boolean logic. 

SCOPE
Identifiers are only valid within the block (curly brackets, or { ... }) where
they were declared. Well, they're supposed to, anyway. Therefore, if you declare
a variable inside a function, you can't use it outside of the function or within
another function. Why would you want to, anyway? The next time you invoked the
function, the value of the variables you were using in there would change again.

LOOPS
Computers are great at repetition. Loops repeat a set of instructions: they are
typically written as a prefix, conditional, postfix, and body. For example:
    for (var T = 10; T > 0; T--) { alert("T minus " + T); }
... which counts down from ten to one with annoying alert popups.
While or do-while loops have only conditions & bodies.
A loop is an example of an "iterative algorithm." Each time the loop's body is
executed, it's called an "iteration." In computing fractal geometric patterns,
"iteration" means more like "recursion:" which, see below.

FUNCTIONS
A function is a modular segment of your program: a sequence of computation that
is repeated a few times, or can be reused as part of another computation.
Functions are "invoked," or called by name, with values supplied as arguments,
and return a value, similarly to how functions behave in algebra. When declaring
a function, you'd typically write the name of the function followed by its args
in parentheses and then the function body. For example, again in Javascript:
    function intp (N) { return (N % 1) == 0; } // integer predicate
... which returns true if N is probably an integer, or whole number:
    if (intp(5)) { alert("Yes. 5 is probably an integer."); }
    if (intp(5.55)) { alert("This box never appears..."); }
    else { alert("... but this one does, because 5.55 is a floater."); }
(Floating-point numbers are inaccurate, in Javascript as likewise elsewhere.)

RECURSION
A function that invokes itself is a recursive function. Any function invoking an
other function, which subsequently causes the original function to be invoked
again, causes a recursion-like situation that I think is called "re-entrancy."
It is essential to note that _any_ and _every_ recursive function you can write
for a computer to execute can be rewritten as an iterative algorithm. The proof
of this is complex: it follows from Alan Turing's model of finite state automata
and the read-execute model of arithmetic and logic units (CPUs), and basically
asserts that you'd never be able to execute recursion if you couldn't do it by
reading one instruction at a time. In other words, each time your function calls
itself again, it's simply storing its state in memory temporarily while the
machine executes a fresh copy: after the copy is done, the former state is re-
loaded, and execution proceeds from there. This is achieved with stacks: data
structures that grow in size as more is "pushed" onto them, and shrink when some
is "popped" off of the top.

OBJECTS
An object is a collection of data that comprises a several datum. That is, when
data are related to one another, they can be envisioned as a "shape" or "motion"
that is the sum of its parts. For example, a vector has direction and magnitude;
an individual has a first and last name; a parser has an input stream, a stack,
and a procedure. In Javascript, you'd write something like this:
    function Blah (newz) { if (newz) { this.z = newz; } return this; }
    Blah.prototype = new Object();
    Blah.prototype.z = 555;
    Blah.prototype.tell_me_z = function () { return this.z; }
    var a = new Blah(222), b = new Blah(); // a.z == 222; b.z = 555.
... syntax varies among languages. Essentially an object is a data structure
containing some members ("variables" attached to the object, like Blah::z above)
and, if the object is a class, some methods (functions, like ::tell_me_z).

Yarredux!

(Here be an update, as of November 8th, 2016. Me old war wound be actin’ up too much, and I think these’ll be the last for some time.

http://www.mediafire.com/file/ib2ezsch9jfz2te/mlptk-2016-11-08.zip

http://www.mediafire.com/file/n5pvhc8snk7nkcn/mlptk-src-hilite-2016-11-08.zip

http://www.mediafire.com/file/afkkza6ywlfrc75/mlptk-book-2016-11-08.zip

)

Ahoy, mateys. Today be the nineteenth of September — ye’d be better knowin’ it as International Talk Like A Pirate Day — and I’ll wager that upon this fine occasion ye’d be askin’ yerselves: “where’s me booty? ”

Well, and I’d make a poor excuse for a captain if I couldn’t deliver ye at least that! (But avast: ye might be findin’ it somewhat unholy, and parental discretion be even more advisable than in previous revisions.) I have prepared for ye a fine trove o’ source code, the likes of which are fit for Kings. Although me mother be the only one likely to find it interestin’, I’ve also put the finishin’ touches on me preliminary sketch of a typesetter for me book: “Yawnie’s Whole: the Complete Yawnie, for the Yawnie Enthusiast.” These be available in three chests, or what ye might be callin’ “Zip Arr-chives,” which I be uploadin’ to Mediafire as per usual.

Me latest revision of MLPTK be here…
http://www.mediafire.com/download/t93x0txsfvgp2pz/mlptk-2016-09-19.zip
… and be comprisin’ not much different from the last MLPTK, again as usual, except that I were fixin’ bugs. I report with most contrition that Polyfac be a failure: I be tryin’ to return me attention to the other tasks I failed to complete this year.

If ye prefer to be tastin’ th’ rainbow, a set of syntax-highlighted HTML documents illustratin’ the source code be here…
http://www.mediafire.com/download/o3cz1rghyp6j5h4/mlptk-src-hilite-2016-09-19.zip
… they scry as nearly as possible alike to me own development environment.

Would ye like me book? I be certain to update and revise it as time be passin’, but who knows if me accounts shan’t be commandeered in the interstice? If ye be at all interested, don’t hesitate: supplies be unlimited, but tempus fugit…
http://www.mediafire.com/download/xv3h8xdslbscwc9/mlptk-book-2016-09-19.zip
… and, someday, me literature be gone forever, as literature inevitably shall.

And there be little more to say about this revision, as I’ve prepared no new lectures since April.

In the meantime, have ye noticed how beautiful life can be sometimes? Quite apart from th’ hardship and pain, there be especial bounty of resources. If ye be readin’ this, then ye would be privileged to Internet access, which are a rare treasure: there be all sorts o’ literature & art to be found, plenty of amusin’ diversions, and certainly no shortage of comely wenches to descry.

Me meaning be: ye could probably spend yer whole lives havin’ not a thing but a netbook computer, occasional access to electrical power, and some sort o’ shelter to protect ye from the elements. A “sex tent,” if ye will: just be addin’ some wenches. Why, I can imagine that no few individuals upon this blasted globe could be livin’ their lives contented with a shelter and a wench — wenches of the world bein’ blessed not to be needin’ anywench else.

Childhood be another of those times. As I grew, I were witness to what some would be describin’ as the “Wild West” of the World Wide Web. Nearly every outlet of popular culture were findin’ its way into troves and hoardes shared worldwide by generous scoundrels (and belligerent litigious bilge rats) to an audience of hundreds of millions. The vast serpent of DHTML and jQuery had only just been sighted far afore, and the stars fated to portend swashbucklin’ adventure at every second of the compass.

There was, too, a massive population of reputable sailors upon the vast waters of cyberspace. I remember some of the finest: OverClocked ReMix, VGMusic. Angelfire, Tripod, and Geocities. Neopets. The Merchant Guild. 4chan. So many more motes be floatin’ in the eye of history that I cannot even recount. Ah, the world were bigger then, and me eyes wide in childlike wonder.

Well, and it were the best of times, but me swashbucklin’ days be sadly behind me. (Arr, insofar as I cannot swash without me bucks! Besides that, me galleon be in disrepair, and overhaul be veritably a tribulation. However, as usual, be sendin’ me no money, for I cannot guarantee that it shall ever arrive; nor could I be certain it would help if it did.) As it happened, although I were studyin’ me life’s work throughout me life, me attention were turnin’ too late to serious programmin’ (peradventure, alas!), and circumstances be such that I envision failure to accomplish writing the parts of me portfolio I’d intended to finish this year.

(Happily I were not askin’ for research grants, considerin’ me doldrums.)

I be in pain; and, in light of this, tried to pass along what few ideas I were able to sustain the concentration to write before I be entirely unable to do so. They be in me ephemerides, toward page 950.

The spring be another of those times when life be less painful than it’s usually. I tell ye there be nothing like the sensation of warm sunlight on yer skin for the first time in months. Which are even assumin’ ye survived th’ winter — in the frigid North, for example, ye might be a popsicle if ye aren’t careful.

And let’s be not forgettin’ lemons…

Ah, but me ramblin’ be more piteous than a scurvy dog.

Enjoy me work.

 

AVAST, MATEYS!

Here be a ninja update fer th’ new year, 2017.

Ever wanted t’ shred data? Here be a tip:

dd -if /dev/random -of /dev/sda

will shred your ENTIRE HARD DISK /dev/sda irreversibly.

The file system be destroyed the instant you hit enter. There be no confirmation.

Shred it all night long, then when ye wake in the mornin’ do this before work:

dd -if /dev/urandom -of /dev/sda

to drop a load on yer disk that be heavier’n fifteen spars on a dead man’s chest.

Seriously. This be how to erase yer disks so thoroughly even the C.I.A. shall never espy yer dirty secrets.

Sleep tight, mateys.

A Midsummer Report.

Here are some updates on my progress:

https://www.mediafire.com/?zcc0pq81u001k4w (or http://www.mediafire.com/download/zcc0pq81u001k4w/mlptk-2016aug12.zip )

^- This one contains a snapshot of my MLPTK directory as of last night shortly before I endured my nightly battle with pain that keeps me awake. It’s a couple’a megs (zipped) or about three megabytes (inflated). Download this if you only want the MLPTK software and reference materials.

 

https://www.mediafire.com/?3lxoqrocmmm5byc ( or http://www.mediafire.com/download/3lxoqrocmmm5byc/mlptk-report-2016-08-12.zip )

^- This one contains a tasty treat! I have rewritten my automatic typesetter for today’s report, and there are now available some syntax highlighted HTML documents that make the code very much easier to read. There are some cute PDFs, too, for printing. DocBook was a very convenient format to get started with, but I hope with future revisions I will graduate from the training wheels and learn to use LaTeX / PostScript. The report is about thirty megabytes (zipped) or fifty megabytes (inflated). Download this if you would like to preserve my work in “Dead Tree” format. (Yes, I’m pretty sure that all the PDFs with my name on them are actually my own work, thus the “Author” bit in the typesetter. I deleted all the PDFs that I identified as not being my own work. Yes, it will require over four hundred pages if you print it. No, I’m not done writing.)

 

I have been working on MLPTK, and other projects, but have nothing of any value to report. Sadly, I stalled-out on QL and everything, and I don’t think I can publish anything complete in 2016 as I had hoped.

However, I _have_ made a good run at finishing every part of QL that I set out to write last Christmas. Also, I have run a quick test on the Firefox bundled with a recent version of Lubuntu: ironically, the _horrendous QL speed bug_ has no perceptible effect on execution time in that version! (I’m still going to try and fix it, though, because my development machine is still on the elder version.)

Apart from crashing and burning with QL, I have begun a new C++ project called Sparkster (after the name of the titular protagonist of Rocket Knight Adventures) which will be a simple exercise in simulating kinetics; I still haven’t started YawniePong 2 because I need to begin a three dimensional rendering library for Javascript if I want to make it into Return to Thunderdome; and I have written a new module for MLPTK, based on Polynom, called Polyfac — although it is practically useless.

Since the last revision I have also written a few other modules, and fixed sundry bugs. See the history log for more details.

 

P.S. The header image easter-egg has also changed. Again.