Mr Speaker

mrspeaker's head in a monitor You find yourself at the entrance to the Hompage of Mr Speaker. In a darkened corner sits a trunk containing HTML5 games and some JavaScript tidbits. Next to it you spy a mastodon account. Exits are North, East, and .

A most useful function

Hot on the heels of my web colors rant, comes this amazing piece of Emacs Lisp I now have in my init file:

(defun web-color ()
  (interactive)
  (let ((cols '("AliceBlue" "AntiqueWhite" "Aqua" "Aquamarine"
     "Azure" "Beige" "Bisque" "Black" "BlanchedAlmond" "Blue"
     "BlueViolet" "Brown" "BurlyWood" "CadetBlue" "Chartreuse"
     "Chocolate" "Coral" "CornflowerBlue" "Cornsilk" "Crimson" "Cyan"
     "DarkBlue" "DarkCyan" "DarkGoldenRod" "DarkGray" "DarkGreen"
     "DarkKhaki" "DarkMagenta" "DarkOliveGreen" "Darkorange" "DarkOrchid"
     "DarkRed" "DarkSalmon" "DarkSeaGreen" "DarkSlateBlue" "DarkSlateGray"
     "DarkTurquoise" "DarkViolet" "DeepPink" "DeepSkyBlue" "DimGray"
     "DodgerBlue" "FireBrick" "FloralWhite" "ForestGreen" "Fuchsia"
     "Gainsboro" "GhostWhite" "Gold" "GoldenRod" "Gray" "Green"
     "GreenYellow" "HoneyDew" "HotPink" "IndianRed" "Indigo" "Ivory"
     "Khaki" "Lavender" "LavenderBlush" "LawnGreen" "LemonChiffon"
     "LightBlue" "LightCoral" "LightCyan" "LightGoldenRodYellow"
     "LightGray" "LightGreen" "LightPink" "LightSalmon" "LightSeaGreen"
     "LightSkyBlue" "LightSlateGray" "LightSteelBlue" "LightYellow" "Lime"
     "LimeGreen" "Linen" "Magenta" "Maroon" "MediumAquaMarine" "MediumBlue"
     "MediumOrchid" "MediumPurple" "MediumSeaGreen" "MediumSlateBlue"
     "MediumSpringGreen" "MediumTurquoise" "MediumVioletRed" "MidnightBlue"
     "MintCream" "MistyRose" "Moccasin" "NavajoWhite" "Navy" "OldLace"
     "Olive" "OliveDrab" "Orange" "OrangeRed" "Orchid" "PaleGoldenRod"
     "PaleGreen" "PaleTurquoise" "PaleVioletRed" "PapayaWhip" "PeachPuff"
     "Peru" "Pink" "Plum" "PowderBlue" "Purple" "Red" "RosyBrown" "RoyalBlue"
     "SaddleBrown" "Salmon" "SandyBrown" "SeaGreen" "SeaShell" "Sienna"
     "Silver" "SkyBlue" "SlateBlue" "SlateGray" "Snow" "SpringGreen"
     "SteelBlue" "Tan" "Teal" "Thistle" "Tomato" "Turquoise" "Violet"
     "Wheat" "White" "WhiteSmoke" "Yellow" "YellowGreen")))
    (insert (nth (random (length cols)) cols))))

Calling it with `M-x w-c` (from anywhere you care to type things) injects a random entry - so you get a wonderful rainbow of weird names, instead of forgetting them all every time and just choosing "lemonchiffon".

Debugging has never looked so good.

Olive vs OliveDrab

"Name as many of the web 'X11 color set' named colours as you can." should be the new fizz buzz. I think I'd do pretty good, but would always fall down on the "mediums" and "lights". "MediumPapayaWhip? LightRosyBrown?".

If it were in an interview situation, I could talk for hours about the faded glory of LemonChiffon, the unexpected practicality of PeachPuff, the eerie strangeness of Thistle, and the deep beauty of Orchid (way better than MediumOrchid, which I'm pretty sure is one of the mediums).

But I'd be praying they don't ask my opinion on Olive and OliveDrab.

Olive is way more drab than OliveDrab. It's drabber. There's no competition. If I showed you you'd 100% agree, but I categorically refuse to put the drabby drabby drabness that is "Olive" on this website. I JUST WON'T DO IT! OliveDrab should be renamed to OliveFestive or something, and I'm not moving until it had been changed in the CSS specification, and maybe even added to as as the honorary 17th named color in the HTML4 specification.

Well, nah, maybe it's not that good. And it is a bit drab I suppose. But drabber than Olive?!

Anyways, did I get the job?

Graybeard

Thanks to a decreased demand in shaving recently, I discovered several grey facial hairs. It's happening - I'm becoming a graybeard!

The timing is suspicious: I start using Emacs, I turn into a graybeard.

But did Emacs cause me to get grey hairs, or did the hairs coerce me into to using Emacs?

It Just Works ™

My favourite marketing phrase in all of computers is "It Just Works". It unwittingly represents nearly all of software engineering. It just works. Only just.

The absolute minimum.

(Side note: my favourite marketing phrase in sports and fashion is "Just Do It". If you have to do it, only just do it.)

JavaScript’s Numeric Separators

During a particularly-late night coding session, I accidentally discovered that JavaScript now has "numeric separators". What started as a simple test in my browser console: `dx=100+xo`, would be drailed by a typographical error that revealed a hidden secret…

`dx=100_`

As I depressed the underscore-instead-of-plus key, Firefox's auto-evaluator-thingy sprang into action and warned: "Uncaught SyntaxError: underscore can appear only between digits, not after the last digit in a number".

Despite my tiredness, and my usual tendency to not read error messages, it caught my eye… "an underscore can do what?" I murmered. Tentatively I added another digit to the assignment: `dx=100_0`. Hitting enter, console informed me that `dx` now had the value of 1000!

I tried some other values: 1_000_000, 1_1_1_1_1, 0xff_ff_ff… all worked - the underscores disappear and you're left with a regular ol' number! After a quick duck-duck-go I discovered that this fancy feature was called Numeric Separators and is currently in stage 3. Also, obviously, it's already implemented in Firefox (I'm on 78) - but I think Chrome too.

I'm going to dig in and see what else is coming through the TC39 pipeline… there's probably 1_000_000 other things I've missed.

document.designMode?

You learn something new every day. Today I learned about insect reproductive systems, and also that document.designMode is a thing. Both seemed pretty interesting, but only the latter let's you make any text on any web site "editable".

Open up the dev console and type document.designMode="on", and marvel as you can type over any text on a page (you even get spellcheck in Firefox). Setting document.designMode="off" restores the page to a read-only mode more strongly sclerotized than a head or thorax. It's like contentEditable, but for everything.

I don't know how this feature managed to escape me for so many years: it was introduced a billion years ago in Internet Explorer, has been part of Firefox since (at least?) version 3, has full support pretty-much everywhere, and seems designed for singular purpose of pranking your office coworkers.

Just my luck to discover it right after offices stopped being a thing.

Blog-o-thon ahoy!

I hereby declare my intention to spam a whole tonne of blog posts in the near future.

I've made this declaration several times in the past - and never managed anything remotely close to "a tonne", but this time we find a confluence of important factors - contributing to a near-perfect storm.

A very-adequate storm.

  1. I just narrowly saved my beautiful domain name from certain extinction.
  2. I deleted my long-standing Twitter account - and now the words have no void into which to be sunk.
  3. I got addicted to Emacs, and therefore...
  4. I've automated creating and editing blog posts from within my text editor.

So expect a lot more quantity, a lot less quality, and a lot more grammar and spelling errors.

Mr Speaker lives!

Phewwwweeee.

You have no idea how close this URL came to not existing. Of ALL the URLs not existing! Sit back and let me tell you a tale of how I almost let mrspeaker.net - the cornerstone of the Mr Speaker (tm) Corporation - be erased from the existance.

The story begins not long after a certain global pandemic (yes, the one you're thinking of) did. The location: New. York. City. A once-vibrant metropolis, reduced to an avian paradise. No more car horns. No more loud-talkers in cafes.

It was a morning like any other.

I sipped on a coffee (supplies still high) and flipped through my emails - unwaware of the dance with doom that was about to unfold. Amongst the spam ("spam" is my name for all emails) there was one from my hosting provider. It said: "You gotta pay your bills but your credit card just expired. Update it if you want people to continue enjoying the delightful antics of your blog.".

"I'll do that" I said, taking another sip of coffee. "a bit later."

A bit later

It had been weeks since I'd ran out of coffee, and things had been grim. But a fresh supply arrived on my doorstep: and a glimmer of sunshine fell over the city. With a renewed spring in my step (not my actual step - I'd stopped moving entirely by then) I decided I had kept my web site down long enough, and my fans would be ravenous for its return. I decided to update my credit card details.

It was not to be so simple.

Consulting the chain of "you really ought to pay your bills" emails I noticed - buried in the middle of the stack - a single sentence that read: "mrspeaker.net is expiring today".

Today?! "Today" was like... weeks ago! How many weeks? Unsure.

An electric tingle-of-dread surged through me as I understood the implication: it wasn't just my site was down... I'd let my beloved, nearly 20 year-old domain be cast back into the global pool of crappy leftover - where it would no doubt be captured by a smelly domain-squatter. My life's work smashed and converted to a link farm. The least useful kind of farm!

Anyhoo

Don't worry, I got it back. Some quick action on my hosting provider's part pulled the domain name out of suspension with just moments to spare.

The End.

(P.S. If someone could ping me in 11.5 months time and remind me to renew my domain name I promise I'll read your email. Thanks.)

Word-processing Code

Notepad ->
HotDog Pro ->
HomeSite ->
TopStyle (a handful of months) ->
NetBeans ->
Notepad++ ->
Visual Studio ->
IntelliJ ->
TextMate ->
Sublime Text ->
Atom ->
VSCode (a handful of months) ->
Emacs.

After so much sampling, I'm 99.6% sure I'm done with this journey.

My conclusions from this 30+ year study: choose the editor that was initially released in the year you were born.

Good luck!