<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2010-04-27:505737</id>
  <title>The Mandelbear's Musings</title>
  <subtitle>mdlbear</subtitle>
  <author>
    <name>mdlbear</name>
  </author>
  <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom"/>
  <updated>2022-07-25T00:43:19Z</updated>
  <dw:journal username="mdlbear" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1827538</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1827538.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1827538"/>
    <title>Done Since 2022-07-17</title>
    <published>2022-07-24T22:19:35Z</published>
    <updated>2022-07-25T00:43:19Z</updated>
    <category term="links"/>
    <category term="done"/>
    <category term="music"/>
    <category term="math"/>
    <dw:music>of the Spheres</dw:music>
    <dw:mood>calm?  or indescribable?</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">&lt;p&gt; I have been down at Rest Stop since last Sunday afternoon.  I'd been
    hoping to get in some practice time with m, but that didn't work out.  So
    I did a little guitar and singing practice on my own -- not nearly enough,
    but I'm trying to get my finger calluses back in shape.  Getting there,
    but feeling very discouraged over how little music I've done in the last
    few years.  So I've been filling in some of the time listening to &lt;a href="https://www.youtube.com/channel/UCGXb08jQ6v937ujkbHJIslg"&gt;Talis
    Kimberley on YouTube&lt;/a&gt;, and the rest of it hanging out in the 4th, 8th,
    and 24th dimensions.  Mostly the 8th, with the &lt;a href="https://en.wikipedia.org/wiki/Octonion"&gt;octonions&lt;/a&gt; and the &lt;a href="https://en.wikipedia.org/wiki/E8_lattice"&gt;E8 lattice&lt;/a&gt;, and the
    24th, with the &lt;a href="https://en.wikipedia.org/wiki/Leech_lattice"&gt;Leech lattice&lt;/a&gt;.

&lt;p&gt; The Leech Lattice has nothing at all to do with blood-sucking
    invertebrates (a category which also includes many politicians), but it is
    definitely a &lt;em&gt;time-&lt;/em&gt;sucker.  I was also going to say that the E8
    lattice has no connection to &lt;cite&gt;&lt;a href="https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension"&gt;The Adventures of Buckaroo Banzai Across the 8th Dimension&lt;/a&gt;&lt;/cite&gt;,
    but it turns out that &lt;a href="https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension#cite_ref-59"&gt;there is (a rather tenuous) one&lt;/a&gt;.  Which is absolutely mind-boggling.

&lt;p&gt; Some day I may write a post about why I find this stuff mind-bogglingly
    beautiful even though I don't know nearly enough about group theory,
    string theory, geometry, particle physics, elliptic curves, or modular
    forms to be able to follow the math.  You can get a lot of it from &lt;a href="https://math.ucr.edu/home/baez/numbers/24.pdf"&gt;this lecture&lt;/a&gt; by
    &lt;a href="https://en.wikipedia.org/wiki/John_C._Baez"&gt;John Baez&lt;/a&gt; (who
    happens to be Joan Baez's cousin).  Many of the bizarre mathematical
    connections come from the fact that if you add up the squares of the
    numbers from 1 to 24, you get a perfect square.  Which is why the Leech
    lattice is the best way to pack spheres in 24 dimensions.

&lt;p&gt; The Leech lattice is also related to the &lt;a href="https://en.wikipedia.org/wiki/Binary_Golay_code"&gt;Binary Golay
    code&lt;/a&gt;, which brings up all sorts of other connections because &lt;a href="https://en.wikipedia.org/wiki/Marcel_J._E._Golay"&gt;Marcel Golay&lt;/a&gt;
    also collaborated with my father on the &lt;a href="https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter"&gt;Savitzky–Golay filter&lt;/a&gt;, in an article that marked "&lt;a href="https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter#cite_note-analytchemsem-7"&gt;the dawn of the computer-controlled analytical instrument&lt;/a&gt;".  Dad
    would have been fascinated by all this.

&lt;p&gt; All of which has been incredibly addicting and has kept my mind (mostly)
    off my worries about the state of my health and the deplorable state of US
    politics.

&lt;p&gt; I'll leave you with last Sunday's quote of the day:
&lt;blockquote&gt;
c:  I should know where my checkbook is.&lt;br&gt;
me: Put it next to your towel.
&lt;/blockquote&gt;

&lt;p&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://mdlbear.dreamwidth.org/1827538.html#cutid1"&gt;Notes &amp; links, as usual&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;

&lt;p&gt; ETA: &lt;a href="https://www.bathsheba.com/crystal/e8/"&gt;Bathsheba Sculpture - E8&lt;/a&gt;  I might just need one of these.  only $60&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1827538" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1814782</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1814782.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1814782"/>
    <title>Thankful Thursday</title>
    <published>2022-04-21T20:58:48Z</published>
    <updated>2022-04-21T20:58:48Z</updated>
    <category term="wordpress"/>
    <category term="thanks"/>
    <category term="housework"/>
    <category term="math"/>
    <dw:mood>grateful</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">&lt;p&gt; Today I am grateful for...

&lt;ul&gt;
  &lt;li&gt; Cleaning supplies and equipment.  Dishwashers and washing machines, of
       course, but also bottle brushes, soap and other detergents, sponges,
       and kitchen sinks.  I'm one of those weird people who find washing
       dishes relaxing -- I think it's largely because of the soothing effect
       of warm water on my hands, although playing Tetris in the dishwasher
       is probably also a factor.
  &lt;li&gt; Regular polytopes, especially in four dimensions, where there are six
       of them.  (Cf. rabbit holes.)
  &lt;li&gt; The WordPress block editor (Gutenberg).  If you want to use WordPress,
       have minimal skills as a graphic designer, and prefer using Emacs and
       markup languages offline to any WYSI(approximately)WYG editor,
       Gutenberg is a good choice.  (I realize that most -- maybe almost all
       -- of my readers will disagree with me on this.  I don't want to start
       a flame war here; let's save that for the comments on the post I intend
       to write Real Soon Now (TM) about my workflow for &lt;a href="https://www.goingsideways.blog/"&gt;GoingSideways.blog/&lt;/a&gt;.)
  &lt;li&gt; Speaking of going sideways, knowing about &lt;a href="https://en.wikipedia.org/wiki/Carcinisation"&gt;carcinisation&lt;/a&gt;
       makes me very happy.
  &lt;li&gt; Finally getting to the head of the queue for a new battery for Molly
       (to replace the one that's being recalled because it tends to explode
       when overcharged).  It gets installed next week.  It will also have
       nearly 10% more capacity.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt; Still waiting for a replacement for my recalled CPAP, a flying car, and a
    sufficiently versatile, sane WordPress theme.&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1814782" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1741196</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1741196.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1741196"/>
    <title>Memoir: How I Came to Have an Erdős Number of Seven</title>
    <published>2020-10-12T19:11:06Z</published>
    <updated>2020-10-12T19:11:06Z</updated>
    <category term="1969"/>
    <category term="erdos-number"/>
    <category term="totient"/>
    <category term="math"/>
    <category term="river"/>
    <category term="memoir"/>
    <category term="computers"/>
    <category term="carleton"/>
    <dw:music>The Wild Rover</dw:music>
    <dw:mood>reflective</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>15</dw:reply-count>
    <content type="html">&lt;p&gt; I really need to write my memoirs, preferably before my memory
    deteriorates to the point where I can't.  (I am inspired by my mom, who
    published the third edition of hers last year.)  I have, however, given up
    on the idea of following the King of Hearts' advice to "begin at the
    beginning, [...] and go on till you come to the end: then stop".  (I note in
    passing that I &lt;em&gt;haven't&lt;/em&gt; come to the end yet.)  So I'm just going to
    dive in at whatever point seems interesting at the moment.  I'll tag these
    by year, so that anyone interested (possibly as many as two of you) can
    sort them out later.

&lt;p&gt; This &lt;em&gt;particular&lt;/em&gt; point was suggested by somebody's mention of
    their Erdős number, so I suppose I ought to explain &lt;em&gt;that&lt;/em&gt; first.
    &lt;strong&gt;Content Warning:&lt;/strong&gt;  contains math, which you can safely
    skip over if you're math-phobic.  Deciding &lt;em&gt;which&lt;/em&gt; parts to skip is
    left as an exrcise for the reader.

&lt;p&gt; You have perhaps heard of the parlor game called "&lt;a href="https://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon"&gt;Six
    Degrees of Kevin Bacon&lt;/a&gt;", based on the concept of "&lt;a href="https://en.wikipedia.org/wiki/Six_degrees_of_separation"&gt;six
    degrees of separation&lt;/a&gt;".  The idea is to start with an actor, and
    figure out the shortest possible list of movies that links them with Kevin
    Bacon.  The length of that list is the actor's "Bacon number", with Bacon
    himself having the number zero, anyone who acted in a movie with him
    having the number one, and so on.  As far as I know I don't have a finite
    Bacon number, but it's not outside the realm of possibility if, as most
    people do, you include TV shows and so on.  I think I've been in at least
    one brief local TV news item.

&lt;p&gt; But sometime during my senior year at Carleton College, I co-authored a
    paper with one of my math professors, Ken Wegner, which gave me an &lt;a href="https://en.wikipedia.org/wiki/Erd%C5%91s_number#Variations"&gt;Erdős
    number&lt;/a&gt; of 7.  The paper, published in 1970 in The American
    Mathematical Monthly, was "&lt;a href="https://maa.tandfonline.com/doi/abs/10.1080/00029890.1970.11992471"&gt;Solutions of Φ(x)&amp;nbsp;=&amp;nbsp;n , Where Φ is Euler's Φ-Function&lt;/a&gt;"
    [Wegner, K., &amp; Savitzky, S. (1970), The American Mathematical Monthly,
    77(3), 287-287. doi:10.2307/2317715].

&lt;p&gt; So now I have three things to explain:  What is an Erdős number?  What is
    &lt;a href="https://en.wikipedia.org/wiki/Euler&amp;#39;s_totient_function"&gt;Euler's
    Φ function&lt;/a&gt;?  And finally, What was my contribution to the paper?

&lt;p&gt; &lt;strong&gt;&lt;a href="https://en.wikipedia.org/wiki/Erd%C5%91s_number#Variations"&gt;Erdős
    number&lt;/a&gt;:&lt;/strong&gt; As you might expect from the introduction about the
    Bacon Number, a mathematician's Erdős number is the smallest number of
    co-authored papers connecting them to &lt;a href="https://en.wikipedia.org/wiki/Paul_Erd%C5%91s"&gt;Paul Erdős&lt;/a&gt;
    (1913–1996), an amazingly prolific (at least 1,525 papers) 20th Century
    mathematician.  He spent the latter part of his life living out of a
    suitcase, visiting his over 500 collaborators (who thus acquired an Erdős
    number of 1.  The Erdős number was first defined in print in 1969, so
    about the time I was collaborating with Wegner on Euler's Φ function.

&lt;p&gt; &lt;strong&gt;&lt;a href="https://en.wikipedia.org/wiki/Euler&amp;#39;s_totient_function"&gt;Euler's Φ function&lt;/a&gt;,&lt;/strong&gt; Φ(n), also called the Totient function,
    is defined as the number of positive integers less or equal to n that are
    relatively prime to n; or in other words the numbers in the range
    1&amp;nbsp;≤&amp;nbsp;k&amp;nbsp;≤&amp;nbsp;n for which the &lt;a href="https://en.wikipedia.org/wiki/Greatest_common_divisor"&gt;greatest
    common divisor&lt;/a&gt; gcd(n,k)&amp;nbsp;=&amp;nbsp;1.  (You will also see it written
    in lower-case as "φ", or in Latin as "phi".)

&lt;p&gt; The totient function is pretty easy to compute, at least for sufficiently
    small numbers.  The inverse is rather less straightforward, and has been
    the subject of &lt;a href="https://math.stackexchange.com/search?q=inverse+totient+function"&gt;a
    considerable number&lt;/a&gt; of StackExchange queries.  (&lt;a href="https://math.stackexchange.com/questions/265397/inversion-of-the-euler-totient-function#265700"&gt;This answer&lt;/a&gt; includes a good set of links.)  I was thinking of
    including some detail about that, and was barely able to keep myself from
    falling down the usual rabbit-hole, which almost always ends up somewhere
    in group theory.  For example, φ(n) is the &lt;a href="https://en.wikipedia.org/wiki/Order_(group_theory)"&gt;order&lt;/a&gt; of &lt;a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n"&gt;the multiplicative group of integers modulo n&lt;/a&gt;.  See what I mean?

&lt;p&gt; &lt;strong&gt;My contribution&lt;/strong&gt; to the paper was not very closely related
    to the actual mathematics of the problem; what I did was write the
    computer program that computed and printed out the table of results.  That
    involved a hack.  A couple of hacks, actually.

&lt;p&gt; In 1969, Carleton College's computer lab contained an &lt;a href="https://en.wikipedia.org/wiki/IBM_1620"&gt;IBM 1620&lt;/a&gt; and a couple
    of keypunches.  The 1620 was fairly primitive even by 1960s standards; its
    memory consisted of 20,000 6-bit words, with a cycle time of 20
    microseconds.  Each word contained one BCD-coded decimal digit, a "flag"
    bit, and a parity check bit.  It did arithmetic digit-by-digit using
    &lt;em&gt;lookup tables&lt;/em&gt; for addition and multiplication.  It was not
    particularly fast -- about a million times slower than the CPU in your
    phone.  But it was a lot of fun.  Unlike a mainframe, it could sit in one
    corner of a classroom (if it was air-conditioned), it was (comparatively)
    inexpensive, and it could stand up to students actually &lt;em&gt;getting their
    hands on it.&lt;/em&gt;

&lt;p&gt; A lot of the fun came from the fact that the 1620's "operating system" was
    the human &lt;em&gt;operator&lt;/em&gt; sitting at the console, which consisted mainly
    of an electric typewriter and a row of buttons and four "sense switches"
    that the program could read.  If you wanted to run a program, you put a
    stack of punched cards into the reader and pushed the "load" button, which
    read a single 80-column card into the first 80 characters of memory, set
    the program counter to zero, and started running.  My program was written
    in FORTRAN.  Not even FORTRAN II.  Just FORTRAN.

&lt;p&gt; Computing the table that occupied most of the paper took about a week.

&lt;p&gt; Here's where it gets interesting, because obviously I wasn't the only
    student who wanted to use the 1620 that week.  So I wrote an operating
    system -- a foreground/background system with my program running in the
    background, with everyone else's jobs running in the "foreground".  That
    would have been easy except that the 1620 could only run one program at a
    time.  Think about that for a moment.

&lt;p&gt; My "operating system" consisted mainly of a message &lt;em&gt;written on the
    back of a Hollerith card&lt;/em&gt; that said something like: "Flip sense switch
    1 and wait for the program to punch out a deck of cards (about a minute).
    When you're done, put the deck in the reader and press LOAD."

&lt;p&gt; Every time the program went around its main loop, it checked Sense Switch
    1, and if it was set, it sent the contents of memory to the card punch.
    Dumping memory only took one instruction, but it wasn't something you
    could do from FORTRAN, so I put in a STOP statement (which FORTRAN
    &lt;em&gt;did&lt;/em&gt; have) and changed it to a dump instruction.  By scanning the
    program's object code (remember this is a &lt;em&gt;decimal&lt;/em&gt; machine; an
    instruction took up 12 columns on the card) and replacing the HALT
    instruction with DUMP.

&lt;p&gt; It worked.

&lt;pre&gt;    &lt;a href="https://mathscinet.ams.org/mathscinet/freeTools.html?version=2"&gt;MR: Collaboration Distance&lt;/a&gt;
     MR Erdos Number = 7
     S. R. Savitzky 	  coauthored with    Kenneth W. Wegner 		MR0260667
     Kenneth W. Wegner 	  coauthored with    Mark H. Ingraham 		MR1501805
     Mark H. Ingraham 	  coauthored with    Rudolph E. Langer 		MR1025350
     Rudolph E. Langer 	  coauthored with    Jacob David Tamarkin 	MR1501439
     Jacob David Tamarkin coauthored with    Einar Hille 	        MR1555331
     Einar Hille 	  coauthored with    Gábor Szegő 	        MR0008279
     Gábor Szegő 	  coauthored with    Paul Erdős 	        MR0006783
     &lt;a href="https://mathscinet.ams.org/mathscinet-getitem?mr=260667"&gt;MR0260667&lt;/a&gt; points to: K. W. Wegner and S. R. Savitzky, (1970)
     &lt;a href="https://www.jstor.org/stable/2317715?origin=crossref"&gt;Solutions of φ (x) = n, Where φ is Euler's φ-Function on JSTOR&lt;/a&gt;,
     The American Mathematical Monthly, 77(3), 287-287.
     DOI: &lt;a href="https://doi.org/10.1080/00029890.1970.11992471"&gt;10.1080/00029890.1970.11992471&lt;/a&gt;.
&lt;/pre&gt;

&lt;p&gt; There are two other numbers of interest:  the Shūsaku Number, measuring a
    Go player's distance from the famous 19th-Century Go player &lt;a href="https://en.wikipedia.org/wiki/Hon%27inb%C5%8D_Sh%C5%ABsaku"&gt;Hon'inbō Shūsaku&lt;/a&gt;, and the Sabbath Number, measuring a musician's
    distance from the band &lt;a href="https://en.wikipedia.org/wiki/Black_Sabbath"&gt;Black Sabbath&lt;/a&gt;.
    I'm pretty sure I have a Sabbath number through filkdom.  I
    &lt;em&gt;definitely&lt;/em&gt; have a Shūsaku number of 5 from having lived down the
    hall from &lt;a href="https://senseis.xmp.net/?JamesKerwin"&gt;Jim Kerwin&lt;/a&gt;,
    &lt;a href="https://senseis.xmp.net/?ShusakuNumber"&gt;Shūsaku Number 4&lt;/a&gt;, my
    sophomore and junior years at Carleton.  That's another story.

&lt;p&gt; And if I expect to write more journal entries about math, I'm going to
    have to extend my &lt;a href="https://gitlab.com/ssavitzky/MakeStuff/-/tree/master/blogging"&gt;posting software&lt;/a&gt; to allow entries written in LaTeX.  Hmm.

&lt;p class="colophon"&gt; &lt;em&gt;The Mandelbear&amp;apos;s Memoirs&lt;/em&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1741196" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1716593</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1716593.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1716593"/>
    <title>Done Since 2020-04-05</title>
    <published>2020-04-12T18:09:46Z</published>
    <updated>2020-04-12T18:09:46Z</updated>
    <category term="math"/>
    <category term="done"/>
    <category term="yuris-night"/>
    <category term="links"/>
    <dw:music>Fire In the Sky, for Yuri's Night</dw:music>
    <dw:mood>neutral</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>6</dw:reply-count>
    <content type="html">&lt;p&gt; It has now been a week and a half since anyone outside the household has
    come into the house; two and a half for all but Colleen's caregiver.  The
    isolation does not seem to have come with an increase in the amount I've
    been getting done.  Contrariwise.

&lt;p&gt; I got almost nothing done yesterday, for which I blame &lt;a href="https://apolloinrealtime.org/13/"&gt;Apollo 13 in Real Time&lt;/a&gt;.  And
    a lot of Friday disappeared into &lt;a href="http://philsci-archive.pitt.edu/5021/1/QM-realism_to_intuitionism.pdf"&gt;Quantum Mechanics: From Realism to Intuitionism&lt;/a&gt; (which I only
    skimmed; a full read would have taken a couple of weeks and at least two
    textbooks, which I'm not sure I have anymore).  See Friday's notes for my
    path to it via a couple of popularizations.  Or attempted popularizations
    -- it's easy to get something wrong when you don't really understand it.
    For a fascinating glimpse into intuitionist math, see &lt;a href="http://www.intuitionism.org/"&gt;Questions and Answers about
    Intuitionism&lt;/a&gt;.  Probably best to start with the &lt;a href="http://www.intuitionism.org/annotated.html"&gt;annotated
    version&lt;/a&gt;. Watch out for rabbit holes.

&lt;p&gt; &lt;em&gt;(as the bear emerges half an hour later from &lt;a href="https://en.wikipedia.org/wiki/Well-order"&gt;yet another rabbit
    hole&lt;/a&gt;)&lt;/em&gt; Maybe I ought to stop here.  (And do more work on my taxes?
    Maaaaaaaaaaaybe.)

&lt;p&gt; Does the news make more sense if you assume that the Trumpster is a
    manifestation of Nyarlathoep?  I just thought of that.  Maybe I should
    &lt;em&gt;stop&lt;/em&gt; thinking about th

&lt;p&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://mdlbear.dreamwidth.org/1716593.html#cutid1"&gt;Notes &amp; links, as usual&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1716593" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1639781</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1639781.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1639781"/>
    <title>Further Adventures in Hyperspace</title>
    <published>2018-10-23T00:11:06Z</published>
    <updated>2018-10-23T00:27:41Z</updated>
    <category term="strong-typing"/>
    <category term="hyperviewer"/>
    <category term="javascript"/>
    <category term="math"/>
    <category term="4-d"/>
    <category term="curmudgeon"/>
    <category term="programming"/>
    <dw:mood>didactic</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">&lt;p&gt;You may remember from &lt;a href="2018-10-08-adventures-in-hyperspace.md"&gt;my previous post about
Hyperviewer&lt;/a&gt; that I’d been plagued by
a mysterious bug.  The &lt;em&gt;second&lt;/em&gt; time the program tried to make a simplex (the
N-dimensional version of a triangle (N=2) or tetrahedron (N=3), a whole batch
of “ghost edges” appeared and the program (quite understandably) blew up.  I
didn’t realize it until somewhat later, but there were ghost &lt;em&gt;vertices&lt;/em&gt; as
well, and that was somewhat more fundamental.  Basically, &lt;code&gt;nVertices&lt;/code&gt;, the
field that holds the number of vertices in the polytope, was wildly wrong.&lt;/p&gt;

&lt;h2&gt;Chasing ghosts&lt;/h2&gt;

&lt;p&gt;Eventually I narrowed things down to someplace around here, which is where
things stood at the end of the previous post.&lt;/p&gt;

&lt;div class="language-javascript highlighter-coderay"&gt;&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="line-numbers"&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;&lt;/span&gt;        let vertices = [];
&lt;span class="line-numbers"&gt;&lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#777"&gt;/* something goes massively wrong, right here. */&lt;/span&gt;
&lt;span class="line-numbers"&gt;&lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#080;font-weight:bold"&gt;for&lt;/span&gt; (let i = &lt;span style="color:#00D"&gt;0&lt;/span&gt;; i &amp;lt; dim; ++i) {
&lt;span class="line-numbers"&gt;&lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;&lt;/span&gt;            vertices.push(&lt;span style="color:#080;font-weight:bold"&gt;new&lt;/span&gt; vector(dim).fill((j) =&amp;gt; i === j? &lt;span style="color:#60E"&gt;1.0&lt;/span&gt; : &lt;span style="color:#00D"&gt;0&lt;/span&gt;));
&lt;span class="line-numbers"&gt;&lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;&lt;/span&gt;        }
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I found this by throwing an error, with a big data dump, right in the middle
if &lt;code&gt;nVertices&lt;/code&gt; was wrong (it’s supposed to be &lt;code&gt;dim+&lt;/code&gt;), or if the length of the
list of vertices was different from &lt;code&gt;nVertices&lt;/code&gt;.&lt;/p&gt;

&lt;div class="language-javascript highlighter-coderay"&gt;&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="line-numbers"&gt; &lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;&lt;/span&gt;        let vertices = [];
&lt;span class="line-numbers"&gt; &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#777"&gt;/* something goes massively wrong, right here. */&lt;/span&gt;
&lt;span class="line-numbers"&gt; &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#080;font-weight:bold"&gt;if&lt;/span&gt; (&lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices !== (dim + &lt;span style="color:#00D"&gt;1&lt;/span&gt;) || &lt;span style="color:#950"&gt;this&lt;/span&gt;.nEdges !== ((dim + &lt;span style="color:#00D"&gt;1&lt;/span&gt;) * dim / &lt;span style="color:#00D"&gt;2&lt;/span&gt;) ||
&lt;span class="line-numbers"&gt; &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;&lt;/span&gt;            &lt;span style="color:#950"&gt;this&lt;/span&gt;.vertices.length !== &lt;span style="color:#00D"&gt;0&lt;/span&gt; || &lt;span style="color:#950"&gt;this&lt;/span&gt;.edges.length !== &lt;span style="color:#00D"&gt;0&lt;/span&gt; ) {
&lt;span class="line-numbers"&gt; &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;&lt;/span&gt;            &lt;span style="color:#080;font-weight:bold"&gt;throw&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;new&lt;/span&gt; Error(&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;nEdges = &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.nEdges + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; want &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; +  ((dim + &lt;span style="color:#00D"&gt;1&lt;/span&gt;) * dim / &lt;span style="color:#00D"&gt;2&lt;/span&gt;) +
&lt;span class="line-numbers"&gt; &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;; nVertices = &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; want &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + dim +
&lt;span class="line-numbers"&gt; &lt;a href="#n7" name="n7"&gt;7&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;; vertices.length = &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.vertices.length +
&lt;span class="line-numbers"&gt; &lt;a href="#n8" name="n8"&gt;8&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;span style="color:#D20"&gt; at this point in the initialization, where dim = &lt;/span&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;/span&gt; + dim +
&lt;span class="line-numbers"&gt; &lt;a href="#n9" name="n9"&gt;9&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; in &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.dimensions + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;span style="color:#D20"&gt;-D &lt;/span&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.name 
&lt;span class="line-numbers"&gt;&lt;strong&gt;&lt;a href="#n10" name="n10"&gt;10&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;                           );
&lt;span class="line-numbers"&gt;&lt;a href="#n11" name="n11"&gt;11&lt;/a&gt;&lt;/span&gt;        } 
&lt;span class="line-numbers"&gt;&lt;a href="#n12" name="n12"&gt;12&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#080;font-weight:bold"&gt;for&lt;/span&gt; (let i = &lt;span style="color:#00D"&gt;0&lt;/span&gt;; i &amp;lt; dim; ++i) {
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;It appeared that &lt;code&gt;nVertices&lt;/code&gt; was wildly wrong at that point.  If I’d looked
carefully and thought about what &lt;code&gt;nVertices&lt;/code&gt; actually &lt;em&gt;was&lt;/em&gt;, I would probably
have found the bug at that point.  Or even earlier.  Instead, what clinched it
was this:&lt;/p&gt;

&lt;div class="language-javascript highlighter-coderay"&gt;&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="line-numbers"&gt; &lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#950"&gt;this&lt;/span&gt;.vertices = vertices;
&lt;span class="line-numbers"&gt; &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices = vertices.length;  &lt;span style="color:#777"&gt;// setting this to dim+1 FAILS:&lt;/span&gt;
&lt;span class="line-numbers"&gt; &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#777"&gt;// in other words, this.nVertices is getting changed between these two statements!&lt;/span&gt;
&lt;span class="line-numbers"&gt; &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#080;font-weight:bold"&gt;if&lt;/span&gt; (&lt;span style="color:#950"&gt;this&lt;/span&gt;.vertices.length !== &lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices || &lt;span style="color:#950"&gt;this&lt;/span&gt;.edges.length !== &lt;span style="color:#00D"&gt;0&lt;/span&gt;) {
&lt;span class="line-numbers"&gt; &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;&lt;/span&gt;            &lt;span style="color:#080;font-weight:bold"&gt;throw&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;new&lt;/span&gt; Error(&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;expect &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; verts, have &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.vertices.length +
&lt;span class="line-numbers"&gt; &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; in &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.dimensions + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;span style="color:#D20"&gt;-D &lt;/span&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.name +
&lt;span class="line-numbers"&gt; &lt;a href="#n7" name="n7"&gt;7&lt;/a&gt;&lt;/span&gt;                            &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;; want &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.nEdges + &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt; edges into &lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style="color:#950"&gt;this&lt;/span&gt;.edges.length
&lt;span class="line-numbers"&gt; &lt;a href="#n8" name="n8"&gt;8&lt;/a&gt;&lt;/span&gt;                           );
&lt;span class="line-numbers"&gt; &lt;a href="#n9" name="n9"&gt;9&lt;/a&gt;&lt;/span&gt;        }
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The code that creates the list of vertices produces the right number of
vertices.  If I set &lt;code&gt;nVertices&lt;/code&gt; equal to the length of that list, everything
was fine.&lt;/p&gt;

&lt;p&gt;If instead I set&lt;/p&gt;

&lt;div class="language-javascript highlighter-coderay"&gt;&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="line-numbers"&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;&lt;/span&gt;        &lt;span style="color:#950"&gt;this&lt;/span&gt;.nVertices = dim+&lt;span style="color:#00D"&gt;1&lt;/span&gt;;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;it was wrong.  Huh?  For example, in four dimensions, the number of vertices
is supposed to be five, and that was the length of the list.  When is &lt;code&gt;4+1&lt;/code&gt;
not equal to &lt;code&gt;5&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;At this point a light bulb went off, because it was clear that &lt;code&gt;dim+1&lt;/code&gt; was
coming out equal to 41.  In three dimensions it was 31.  When is &lt;code&gt;4+1&lt;/code&gt; not
equal to 5?  When it’s actually &lt;code&gt;"4"+1&lt;/code&gt;.  In other words, &lt;code&gt;dim&lt;/code&gt; was a string.
JavaScript “helpfully” converts a string to a number when you do anything
arithmetical to it, like multiply it by something or raise it to a power.  But
&lt;code&gt;+&lt;/code&gt; isn’t always an arithmetic operation!  In JavaScript (and many other
languages) it’s also used for &lt;em&gt;string concatenation&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;What went wrong, and a rant&lt;/h2&gt;

&lt;p&gt;The problem was that, the &lt;em&gt;second&lt;/em&gt; time I tried to create a simplex, the
number of dimensions was coming from the user interface.  From an &lt;code&gt;&amp;lt;input&lt;/code&gt;
element in a web form.  And every value that you get from a web form is a
string.  HTML knows nothing about numbers, and it has no way to know what
you’re going to do with the input you get.&lt;/p&gt;

&lt;p&gt;So the fix was simple (and you can see it &lt;a href="https://github.com/ssavitzky/hyperviewer/commit/8bef087648d403a9ba432058fc4641e582b27250"&gt;here on
GitHub&lt;/a&gt;:
convert the value from a string to a number right off before trying to use it
as a number of dimensions.  But… But…  But cubes and octohedrons were
&lt;em&gt;right!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That’s because the number of vertices in a N-cube is &lt;code&gt;2**N&lt;/code&gt;, and in an
N-orthoplex (octohedron in three dimensions) it’s &lt;code&gt;N*2&lt;/code&gt; (and multiplication is
always an arithmetic operator in JavaScript).  And it worked when I
was creating the simplex’s vertices because it was being compared against in a
&lt;code&gt;for&lt;/code&gt; loop.  And so on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If I’d been using a strongly-typed language, the compiler would have found
this two weeks ago.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two main ways of dealing with data in a programming language, called
“strong typing” and “dynamic typing”.  In a strongly-typed language, both
values and variables (the boxes you put values into) have types (like “string”
or “integer”), and the types have to match.  You can’t put a string into a
variable with a type of integer.  Java is like that (mostly).&lt;/p&gt;

&lt;p&gt;Some people find this burdensome, and they prefer dynamically-typed languages
like JavaScript.  In JavaScript, &lt;em&gt;values&lt;/em&gt; have types, but variables don’t.
It’s called “dynamic” typing because a variable can hold anything, and its
type is that of the last thing that was put into it.&lt;/p&gt;

&lt;p&gt;You can write code very quickly in a language where you don’t have to declare
your variables and make sure they’re the right type for the kind of values you
want to put into them.  You can also shoot yourself in the foot much more
easily.&lt;/p&gt;

&lt;p&gt;There are a couple of strongly-typed variants on JavaScript, for example
CoffeeScript and TypeScript, and a type-checker called “Flow”.  I’m going to
try one of those next.&lt;/p&gt;

&lt;h2&gt;There was one more problem with simplexes&lt;/h2&gt;

&lt;p&gt;(simplices?) … but that was purely geometrical, and just because I was
trying to do all the geometry in my head instead of on paper, and wasn’t
thinking things through.&lt;/p&gt;

&lt;p&gt;If you’re in N dimensions, you can create an N-1 dimensional simplex by simply
connecting the points with coordinates like &lt;code&gt;[1,0,0]&lt;/code&gt;, &lt;code&gt;[0,1,0]&lt;/code&gt;, and
&lt;code&gt;[0,0,1]&lt;/code&gt; (in three dimensions – it’s pretty easy to see that that gives you
an equilateral triangle).  Moreover, all the vertices are on the unit sphere,
which is where we want them.  The last vertex is a bit of a problem.&lt;/p&gt;

&lt;p&gt;A fair amount of googling around (or DuckDuckGoing around, in my case) will
eventually turn up &lt;a href="mathoverflow.net/questions/38724/coordinates-of-vertices-of-regular-simplex"&gt;this answer on
mathoverflow.net&lt;/a&gt;,
which says that in N dimensions, the last vertex has to be at &lt;code&gt;[x,...,x]&lt;/code&gt;
where &lt;code&gt;x=-1/(1+sqrt(1+N))&lt;/code&gt;.  Cool!  And it works.  Except that it’s not
centered – that last vertex is a lot closer to the origin than the others.
It took me longer than it should have to get this right, but the center of the
simplex is its “center of mass”, which is simply the average of all the
vertices.  So that’s at &lt;code&gt;y=(1+x)/(N+1)&lt;/code&gt; because there are N+1 vertices.  Now
we just have to subtract y from all the coordinates to shift it over until the
center is at the origin.&lt;/p&gt;

&lt;p&gt;Then of course we have to scale it so that all the vertices are back on the
unit sphere.  You can find the code &lt;a href="https://github.com/ssavitzky/hyperviewer/blob/794f406d8de7af4dd55ded5f21d46237bf76a5bd/src/polytopes.js#L128-L140"&gt;here, on
GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;Another fine post from &lt;a href="https://computer-curmudgeon.com"&gt;The Computer Curmudgeon&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1639781" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1638548</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1638548.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1638548"/>
    <title>Adventures in Hyperspace (and Javascript)</title>
    <published>2018-10-09T04:01:55Z</published>
    <updated>2018-10-09T15:13:54Z</updated>
    <category term="programming"/>
    <category term="curmudgeon"/>
    <category term="4-d"/>
    <category term="math"/>
    <category term="javascript"/>
    <category term="hyperviewer"/>
    <category term="development"/>
    <dw:mood>didactic</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">&lt;p&gt; (This will be something of an experiment.  The original was written in
    markdown and posted on &lt;a href="https://computer-curmudgeon.com/2018/10/08/adventures-in-hyperspace.html"&gt;Computer-Curmudgeon.com&lt;/a&gt;.  We'll see whether the process made a hash
    of it.  I may have to do some cleaning up.

&lt;p&gt;This post is about &lt;a href="http://github.com/ssavitzky/hyperviewer"&gt;Hyperviewer&lt;/a&gt;, an update of a &lt;a href="https://github.com/ssavitzky/ncube/"&gt;very old demo program of mine&lt;/a&gt; from 1988 that displays wireframe objects rotating in hyperspace. (Actually, anywhere between four and six dimensions.) Since this is 2018, I naturally decided to write it in JavaScript, using &lt;a href="https://infernojs.org/"&gt;Inferno&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG"&gt;SVG&lt;/a&gt;, and put it on the web. It was a learning experience, in more ways than one.&lt;/p&gt;

&lt;h2&gt;Getting started&lt;/h2&gt;
&lt;p&gt;I had been doing a little work with &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;, which is pretty good an very popular, and had recently read about &lt;a href="https://infernojs.org/"&gt;Inferno&lt;/a&gt;, which is a lighter-weight, faster framework that's almost completely interchangeable with React. Sounded good, especially since I wanted high performance for something that's going to be doing thousands of floating-point matrix multiplies per second. (A hypercube in N dimensions has 2^N vertices, and a rotation matrix has N^2 entries -- do the math). (It turns out I really didn't have to worry -- Moore's Law over three decades gives a speedup by a factor of a million, give or take a few orders of magnitude, so even using an partially-interpreted language speed isn't a problem. Perhaps I'm showing my age.)&lt;/p&gt;
&lt;p&gt;To keep things simple -- and make it possible to eventually save pictures -- I decided to use SVG: the web standard for &lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG"&gt;Scalable Vector Graphics&lt;/a&gt;, rather than trying to draw them out using an HTML5 &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API"&gt;Canvas&lt;/a&gt; tag. It's a perfect match for something that's nothing but a bunch of vectors. SVG is XML-based, and you can simply drop it into the middle of an HTML page. SVG is also &lt;em&gt;really&lt;/em&gt; easy to generate using the new JSX format, which is basically XML tags embedded in a JavaScript file.&lt;/p&gt;
&lt;p&gt;Modern JavaScript uses a program called a &amp;quot;transpiler&amp;quot; -- the most common one is &lt;a href="https://babeljs.io/"&gt;Babel&lt;/a&gt; -- that compiles shiny new JavaScript constructs (and even some new languages like TypeScript and CoffeeScript, which I want to learn soon) into the kind of plain old JavaScript that almost any browser can understand. (There are still some people using Microsoft Exploiter from the turn of the &lt;del&gt;century&lt;/del&gt; &lt;em&gt;millennium&lt;/em&gt;; if you're reading this blog it's safe for me to assume that you aren't one of them.)&lt;/p&gt;
&lt;p&gt;Anyway, let's get started:&lt;/p&gt;
&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://mdlbear.dreamwidth.org/1638548.html#cutid1"&gt;cut tag added to protect your sanity&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;
&lt;p&gt; (Not too bad of a formatting job, though of course the color didn't come through.  Cut tag added because it's over 2000 words.)




&lt;p&gt; &lt;em&gt;Another fine post from
    &lt;a href="https://mdlbear.dreamwidth.org/tag/curmudgeon"&gt;The Computer Curmudgeon&lt;/a&gt;.
&lt;br /&gt; Cross-posted on &lt;a href="https://computer-curmudgeon.com/2018/10/08/adventures-in-hyperspace.html"&gt;computer-curmudgeon.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1638548" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1596993</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1596993.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1596993"/>
    <title>Done this week (20170611Su - 18Sa)</title>
    <published>2017-06-18T20:47:46Z</published>
    <updated>2017-06-18T20:47:46Z</updated>
    <category term="cars"/>
    <category term="links"/>
    <category term="psych"/>
    <category term="done"/>
    <category term="math"/>
    <dw:mood>ok?</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>13</dw:reply-count>
    <content type="html">&lt;p&gt; The only major news is that we have a firm date for when the previous
    owner of our house gets all his stuff moved out:  June 30th.  That's
    about three weeks sooner than the original worst-case plan, so Colleen and
    I will have the entire month to get moved in, rather than a week.  Yay!

&lt;p&gt; I don't seem to have done much this week.  I did get the car charged, and
    deposited a bunch of checks (including some old enough that I'm not sure
    they're still good -- I need to get a lot better at that).  Mostly I sat
    around the apartment exploring an assortment of math topics on Wikipedia
    and YouTube.

&lt;p&gt; It turns out that, thanks to &lt;a href="http://www.ams.org/mathscinet-getitem?mr=260667"&gt;a paper I wrote
    back at Carleton with one of my math professors,&lt;/a&gt; it can &lt;a href="http://www.ams.org/mathscinet/collaborationDistance.html"&gt;easily&lt;/a&gt;
    be determined that my &lt;a href="https://en.wikipedia.org/wiki/Erd%C5%91s_number"&gt;Erdős number&lt;/a&gt;
    is officially 7.  Unofficially, if one includes patents as well as actual
    math papers, it's 4.  That still probably exceeds the number of people
    reading this who knew what an Erdős number is before reading this.  The
    official value almost certainly does.

&lt;p&gt; I did some actual programming yesterday (which I made more progress on
    today), aimed at bringing my song formatting and typesetting into the
    21&lt;sup&gt;st&lt;/sup&gt; Century.  Mostly that means switching from postscript
    files to PDFs everywhere, upgrading to LaTeX2e, and simplifying the build
    process.  There are still a few formatting issues that need to be dealt
    with; I will be having some fun this week refactoring my horrible old
    style files into classes.

&lt;p&gt; There was some discussion in comments elsewidth about finding a therapist;
    I did a little link chasing.  Not going to do anything about it until
    after we move.

&lt;p&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://mdlbear.dreamwidth.org/1596993.html#cutid1"&gt;Notes &amp; links, as usual&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1596993" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1596418</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1596418.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1596418"/>
    <title>Done last week (20170528Su - 0603Sa)</title>
    <published>2017-06-04T17:54:36Z</published>
    <updated>2017-06-04T17:54:36Z</updated>
    <category term="colleen"/>
    <category term="links"/>
    <category term="math"/>
    <category term="cs"/>
    <category term="health"/>
    <category term="house"/>
    <category term="done"/>
    <dw:mood>ok?</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>13</dw:reply-count>
    <content type="html">&lt;p&gt; I'm &lt;em&gt;really&lt;/em&gt; glad we got Colleen's medicare coverage straightened
    out (or mostly -- her Part D (drug) coverage is not fully functional yet,
    nor is her supplemental policy).  Because she went in to Shoreline Clinic
    for lab work on Tuesday after her visit to the SSA office, and Wednesday
    we got a call telling her to go to the ER and get IV fluids, because her
    creatinine level was high.  That's related to kidney function, and in this
    case indicated a problem with her catheter.

&lt;p&gt; So she spent the rest of the week in Northwest Hospital; she was
    discharged Friday.  And Medicare covers it.  I spent much of the week
    doing medicare-related paperwork; being retired may be relaxing once you
    get to actually do it -- &lt;em&gt;retiring&lt;/em&gt; sure isn't.  I'm still not done
    with Colleen's.

&lt;p&gt; Meanwhile, I've been reading.  I finished &lt;cite&gt;Counterexamples in
    Analysis&lt;/cite&gt;, which is a really fun read.  It had been used as the
    textbook for Advanced Calculus up until the year I went to Carleton, so
    there were enough copies lying around for me to get intrigued by such
    perverse creatures as "a space-filling curve that's almost everywhere
    almost nowhere".  In the process, supplementing it with Wikipedia dives,
    I've finally gotten a little more comfortable with ring theory.

&lt;p&gt; Last night, between &lt;a href="https://www.youtube.com/watch?v=vzjbRhYjELo"&gt;John Baez on the number 24&lt;/a&gt; on YouTube and a bit of digging on
    Wikipedia, I also started getting the hang of the &lt;a href="https://en.wikipedia.org/wiki/Monster_group"&gt;Monster Group&lt;/a&gt; and
    &lt;a href="https://en.wikipedia.org/wiki/E8_%28mathematics%29"&gt;E8&lt;/a&gt;.
    They turn out to be related to the &lt;a href="https://en.wikipedia.org/wiki/Binary_Golay_code"&gt;Binary Golay
    code&lt;/a&gt;, a 24-bit error-correcting code invented by Marcel Golay, who I
    knew of because he'd collaborated with my father on the &lt;a href="https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter"&gt;Savitzky–Golay filter&lt;/a&gt;!

&lt;p&gt; I've also been reading &lt;cite&gt;&lt;a href="http://pages.cs.wisc.edu/~remzi/OSTEP/#book-chapters"&gt;Operating
    Systems: Three Easy Pieces&lt;/a&gt;&lt;/cite&gt; - it's mostly review for me, but
    it's a good presentation and there are a few good nuggets in there.
    &lt;cite&gt;&lt;a href="http://www.thecodelesscode.com/contents"&gt;The Codeless
    Code&lt;/a&gt;&lt;/cite&gt;, a collection of software-development koans, is also worth
    of note, and of everything I've mentioned here is probably of the most
    interest to people casually interested in the sociology of software
    development.  Or possibly Zen Buddhism.

&lt;p&gt; I've also been looking around &lt;a href="http://www-cs-faculty.stanford.edu/~knuth/"&gt;Don Knuth's home
    page&lt;/a&gt; -- Don was my favorite professor at Stanford -- which eventually
    led me back to &lt;a href="https://www.youtube.com/watch?v=mPn2AdMH7UQ"&gt;Surreal Numbers&lt;/a&gt;.  I see that I don't have a good set of links for those.

&lt;p&gt;&lt;span class="cut-wrapper"&gt;&lt;span style="display: none;" id="span-cuttag___1" class="cuttag"&gt;&lt;/span&gt;&lt;b class="cut-open"&gt;(&amp;nbsp;&lt;/b&gt;&lt;b class="cut-text"&gt;&lt;a href="https://mdlbear.dreamwidth.org/1596418.html#cutid1"&gt;Notes &amp; links, as usual&lt;/a&gt;&lt;/b&gt;&lt;b class="cut-close"&gt;&amp;nbsp;)&lt;/b&gt;&lt;/span&gt;&lt;div style="display: none;" id="div-cuttag___1" aria-live="assertive"&gt;&lt;/div&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1596418" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1531725</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1531725.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1531725"/>
    <title>Poem:  Shifts</title>
    <published>2014-10-19T05:36:42Z</published>
    <updated>2014-10-19T16:06:18Z</updated>
    <category term="poem"/>
    <category term="math"/>
    <category term="computers"/>
    <category term="meta"/>
    <dw:security>public</dw:security>
    <dw:reply-count>5</dw:reply-count>
    <content type="html">&lt;pre&gt;
There's that moment when everything changes,
But really it's just you,
Seeing things differently.

When you realize that the solid bench you're sitting on
Is mostly empty space between particles.
When you learn that even the particles
Aren't really particles, and that light isn't entirely waves either.

When you see the way special relativity views velocity
As simple rotation in four-space, 
And you study general relativity and realize
That it's geometry all the way down.

When you suddenly get recursion,
Reading the Algol 60 Report, with its crystalline prose
And elegantly compact rules.
When Goedel blows the top of your head off,
And you understand that some things simply can't be proved.
When you see how elegantly Turing applies the same trick.

When you realize that a little of the Unknowable
Isn't part of the Unknown anymore,
Because now you know why you can't know it.
&lt;/pre&gt;
&lt;p&gt; First published in a comment in the &lt;a href="http://crowdfunding.dreamwidth.org/233006.html"&gt;October 2014
    Crowdfunding Creative Jam&lt;/a&gt;, on the theme "Paradigm Shifting Without a
    Clutch."
&lt;/p&gt;
&lt;p&gt; This is entirely autobiographical, though the sequence has been messed
    with a little to give artistic verisimilitude to an otherwise bald and
    unconvincing narrative. 
&lt;/p&gt;
&lt;p&gt; Mirrored from &lt;a href="http://steve.savitzky.net/Lit/Poetry/2014/1018-shifts.html"&gt;steve.savitzky.net&lt;/a&gt;.  My poetry there is in really rough shape;
    hopefully I'll get a little work done on it soon.
&lt;/p&gt;
&lt;p&gt; Also adopted by &lt;span style='white-space: nowrap;'&gt;&lt;a href='https://ysabetwordsmith.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://ysabetwordsmith.dreamwidth.org/'&gt;&lt;b&gt;ysabetwordsmith&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; as part of her &lt;a href="http://ysabetwordsmith.dreamwidth.org/1752525.html"&gt;Schrodinger's Heroes&lt;/a&gt;
    series, which makes it unintentionally canonical fanfic for an imaginary TV
    show.  Talk about shifting without a clutch!  At least it has synchromesh.  Or was
    that synchrotron?
&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1531725" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1383508</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1383508.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1383508"/>
    <title>Songs for Saturday: The Gauss Christmath Special</title>
    <published>2011-09-24T17:01:22Z</published>
    <updated>2011-09-24T17:01:22Z</updated>
    <category term="music"/>
    <category term="math"/>
    <category term="s4s"/>
    <category term="geekery"/>
    <dw:mood>amused, geeky</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">&lt;p&gt; Just a quickie today, since I'm traveling and away from my usual posting
    client, but this is way too good to leave on the shelf until it becomes
    seasonal.  If you love mathematics, or are a fan of &lt;a href="http://xkcd.com/"&gt;xkcd&lt;/a&gt;, you &lt;em&gt;really&lt;/em&gt; need to go over
    to YouTube and watch/listen to &lt;a href="http://www.youtube.com/watch?v=sxnX5_LbBDU"&gt;The Gauss Christmath
    Special&lt;/a&gt; by the amazingly wacko &lt;a href="http://www.youtube.com/user/Vihart"&gt;Vi Hart&lt;/a&gt;.  Then go check
    out &lt;a href="http://www.youtube.com/watch?v=3a9wWRxYSko"&gt;Pachelbel&amp;apos;s Music Box Canon in D&lt;/a&gt;.  I could go on.  And on.
&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1383508" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
