wiki
The description wiki for a collection of hyperlinked documents that anyone can edit was coined by Ward Cunningham in 1995 when he created the first one. The concept was inspired by HyperCard stacks. When creating the WikiWikiWeb, which is still online at https://wiki.c2.com/, he named it after the Wiki Wiki Shuttle at Honolulu International Airport and the Hawaiian word for “quick”, wikiwiki. The Hawaiian word is a reduplication of “wiki”, a Hawaiian verb meaning “speed up”, which likely descends from Proto-Polynesian “witi”.
One feature of the WikiWikiWeb that often surprises people now is that words are hyperlinks if and only if they are a single CamelCase word. Each CamelCase word automatically linked to either an article with its title or an option to create that article if it didn’t exist.
The most notable [citation needed] wiki today, Wikipedia, was established in 2001 using what was then called a WikiWikiClone, UseModWiki for Usenet moderation coordination. It was not until later in 2001 that UseModWiki added support for what is now standard [[wikilink syntax]]; Wikipedia itself retained many CamelCase links well into the early 2000s as it transitioned over.
kraken
The word kraken to describe a giant squid was invented by Norwegian bishop Erik Pontoppidan in 1753. It’s based on the Norwegian dialectal “krake”, meaning sea monster, itself based on Old Norse “kraki”, literally “something twisted”. (The reconstructed Proto-Germanic root it’s likely derived from, “krankaz”, is also the likely source of e.g. English “crank”.)
But wait, you might ask. How is it that this Norwegian word first attested in the 1700s is used to describe a beast from Greek mythology? The 1981 film Clash of the Titans, a Greek epic, is the source of this connection. It includes both a kraken and the still-memed-today line “Release the kraken!” despite kraken having no prior relation to Greek mythology.
The less exciting middle part includes the Norwegian word making it into English through misattribution to Carl Linnaeus’s famous 1735 taxonomy and becoming a well-known English term by the time of Alfred Tennyson’s 1830 poem The Kraken. The less exciting end part includes the hockey team the Seattle Kraken, est’d 2018.
Constrained programming, part 2
The second letter in “etaoin shrdlu” is t. Some Ruby method names and keywords that contain the letter t include return, #match, true, #split, #to_i, next, #empty?, #length, and #select. I write this here so I don’t have to figure out how to talk around those explicitly forbidden words.
Of the above, I couldn’t figure out how to get around #to_i without implementing it myself.
Day 2 | Ruby | Avoiding glyph before ‘u’
def as_number(word) if word == "100" 100 elsif word.size == 1 word.ord - 48 else (word.ord - 48) * 10 + word.chars[1].ord - 48 end end # Problem 1 games = IO.readlines('02').map(&:chop) ids = games.map do |game| draws = game.scan /(\d+) ([bgr])/ invalid = draws.keep_if do |draw| num = as_number(draw[0]) color = draw[1] (num > 12 && color == 'r') || (num > 13 && color == 'g') || (num > 14 && color == 'b') end invalid.size == 0 ? as_number(game.scan(/Game (\d+)/)[0][0]) : 0 end p ids.sum # Problem 2 powers = games.map do |game| cubes = {"r" => 0, "b" => 0, "g" => 0} game.scan(/(\d+) ([bgr])/) do |draw| num = as_number(draw[0]) color = draw[1] cubes[color] = num if cubes[color] < num end cubes.values.reduce(&:*) end p powers.sum
Constrained programming
I’ve enjoyed constrained writing (e.g. Oulipo) for a long time and am going to be trying to practice constrained programming in Advent of Code for as long as I can maintain interest this year. In particular, my plan is to go through each day as a lipogram of the nth-most-frequent letter in English. For the first twelve, even though English letter frequency is slightly different than ETAOIN SHRDLU, I’ll use that iconic order.
So my day 1 solution will not include the letter ‘e’, day 2 will not include the letter ‘t’, and so on. I’m excited to try this out. Here’s day 1:
Day 1 | Ruby | Avoiding fifth glyph
# part 1 digits = inputs.map { |input| input.gsub(/\D/, '')} calibrations = digits.map { |digit| digit.chars.first.to_i * 10 + digit.chars.last.to_i } p calibrations.sum # part 2 glyph_to_avoid = "d".succ @trigrams = {"two" => 2, "six" => 6} @trigrams["onz".gsub(/z/, glyph_to_avoid)] = 1 @quadragrams = {"four" => 4} @quadragrams["fivz".gsub(/z/, glyph_to_avoid)] = 5 @quadragrams["ninz".gsub(/z/, glyph_to_avoid)] = 9 @quintagrams = {} @quintagrams["thrzz".gsub(/z/, glyph_to_avoid)] = 3 @quintagrams["szvzn".gsub(/z/, glyph_to_avoid)] = 7 @quintagrams["zight".gsub(/z/, glyph_to_avoid)] = 8 calibrations = inputs.map { |input| first_digit = nil (0..input.chars.count - 1).map { |idx| first_digit = input[idx].to_i if !first_digit && /\d/ =~ input[idx] tri = input[idx-2, 3] if idx >= 2 first_digit = @trigrams[tri] if !first_digit && tri && @trigrams[tri] quad = input[idx-3, 4] if idx >= 3 first_digit = @quadragrams[quad] if !first_digit && quad && @quadragrams[quad] quint = input[idx-4, 5] if idx >= 4 first_digit = @quintagrams[quint] if !first_digit && quint && @quintagrams[quint] } last_digit = nil (1..input.chars.count).map { |idx| last_digit = input[-idx].to_i if !last_digit && /\d/ =~ input[-idx] tri = input[-idx, 3] if idx >= 2 last_digit = @trigrams[tri] if !last_digit && tri && @trigrams[tri] quad = input[-idx, 4] if idx >= 3 last_digit = @quadragrams[quad] if !last_digit && quad && @quadragrams[quad] quint = input[-idx, 5] if idx >= 4 last_digit = @quintagrams[quint] if !last_digit && quint && @quintagrams[quint] } first_digit * 10 + last_digit } p calibrations.sum
Not using control flow words was tough to work around. I initially had ‘x’ for a proxy glyph until I got to ‘six’.
rizz
The quality rizz was popularized by streamer Kai Cenat on Twitch and later YouTube in the summer of 2021. To us olds, Kai is probably most well-known for accidentally starting a riot in Union Square, NYC earlier this August. It’s thought to be a phonetic clipping of charisma. The word’s usage took off on TikTok in mid-2022, giving rise to incredible explainers like this one from Defector: https://defector.com/livvy-rizzing-up-baby-gronk-explained
The KnowYourMeme history of the term has more detail for the curious: https://knowyourmeme.com/memes/rizz-unspoken-rizz