QZ qz thoughts
a blog from Eli the Bearded

Long Silence Again


With no feedback from people reading, it's really hard for me to maintain motivation for writing. So I stop and write in places I do get feedback. That's been Net News (eg Usenet and Usenet like) forever and Mastodon-flavored Fediverse recently.

I created a Mastodon account perhaps four years ago, but due to the "no feedback" thing, and not knowing anyone else on the platform, it got little use until Musk started his Twitter purchase and then Twitter destruction. So Twitter link no-more on Contact section and Fediverse QAZ link instead.

I've also revamped the robots.txt file, because of other Internet "enshitification". Google is useless as a search engine now, time to drop their bot. At the same time, I added some more "SEO" related bots and the one "AI" bot I've noticed ("ChatGPT", which people tell me is phonetically the same the French phrase "Cat, I farted", « Chat, j'ai pété »).

Part of the prompt for robots.txt was a persistent highly personalized campaign from some Internet advertising company urging me to put ads on my site through their service. I suspect one of the "SEO" metrics company was how I came to this guy's attention. Better to just block those bozos. Web advertising is just a downhill spiral to the worst profit motives on the web.

Mini Monopoly


Years ago I found some miniaturized games for sale. I don't remember how many were available, but I got Scrabble, Mousetrap, Etch-a-Sketch, and Monopoly. The Scrabble set had a tiny bag for letters, but not a complete set of letters. Mousetrap did have the full rube-goldberg trap, but lacked other pieces. Etch-a-Sketch worked. Monopoly came with a couple of markers (metal, magnetic, to stick to metal board) and dice, but lacked money, property cards, houses and hotels, and the various draw cards. Those small games still appealed to my taste in shrunken versions of things, working or not.

Now I find out there's a new maker of miniaturized games, going by the name "World's Smallest". And they have a Monopoly, too.

World's Smallest edition on right, older mini version on left

Side-by-side the older gimmick version (dated 1998) and the new World's Smallest (dated 2020) version. The board is about 3" square (around 75mm) on both. The quarter helps provide scale.

World's Smallest edition packed for storage

All of the game components (including the board) fit inside the 3" × 1.75" × 0.5" case. The older edition had a pull out drawer instead of a folding box. The drawer has much smaller storage capacity.

It's playable in the most technical sense. There are all of the pieces to play the game, but there are many ways this falls short. The houses are not the same scale as the board, so you can't fit two on a property. The Chance and Community Chest cards are also much larger than one would expect given the indicated spots for the draw piles. This board is cardboard, and the markers are plastic: no magnets to hold them down. The money is very hard to manipulate with one's fingers. And many people would want a loupe to be able to read the property cards.

Playable or not, if I saw a smaller edition, I'd still be tempted.

A Protein Alphabet


Mark Howarth, having looked at a lot of protien visualizations, realized that there is enough diversity to easily create an alphabet of protein shapes.

This is all the more impressive since the proteins are all three dimensional shapes, and only look like letters from certain angles.

I used the 3-D visualizer at the protein database he links to create my own images of the Q (3SZV, Pseudomonas aeruginosa OccK3) and Z (4BTA, Peptide(pro-pro-gly)3 bound complex of N- terminal domain and peptide substrate binding domain of prolyl-4 hydroxylase (residues 1-244) type I) letters.

QZ protein images

And then made a QZ logo for the blog out of them. First new logo in a while, and currently the largest one in the collection (by file size). Very, very, few of more than one thousand QZ images in the logo collection are color, which makes having them small much easier.

Matched Pairs


In vi (and vim), there's a "motion" command, % that moves you to an enclosing symbol. In the previous sentence, with the cursor on the "v" of vim, using % will move the cursor to the "(", which is the start of the enclosed sequence. On that "(", the % motion moves to the matching ")".

Out of the box, vi knows the pairs "()", "[]", and "{}". You can change the pairs with the configuration variable matchpairs and people frequently do to add "<>" for XML or HTML work:

set matchpairs=(:),[:],{:},<,>

But there are a lot more, like quoting angles "«»" and smart quotes. And vim happily accepts UTF-8 characters for each half of a pair. So I could think up some Unicode pairs and stick them in there. Or I could look for all pairs that exist in Unicode.

Here's a stab at doing just that.

First off, we need the list of characters in Unicode. This is surprisingly easy to get. Unicode themselves provide an easy to parse list of characters in plain ASCII(!).

$ curl -sO http://www.unicode.org/Public/UNIDATA/UnicodeData.txt

The list is not fixed, new stuff gets added with each version of Unicode. Releases happen every 12 to 18 months. Refreshing that file is the major change needed to update my Unicode Toys for a new version.

So how about a quick script to find "LEFT" characters that have a matching "RIGHT" version?

#!/usr/bin/perl
# Read the UnicodeData.txt file to create a vim 
# matchpair list.
#
# May 2022 "Eli the Bearded"
use strict;
use warnings;

my $in = 'UnicodeData.txt';
my %found;
my %pool;
my %check;
my $id;
my $pid;
my $name;
my $count = 1; # first pair is the hardcoded one

# Tag characters are an obsolete invisible set of
# ASCII for hidden metadata. Modifiers and Combining
# should not be used on their own. Arabic are not
# left-to-right text, so I decided I don't need them.
# You may decide otherwise. The others, by inspection,
# don't have anything I'd want as a pair. (Some
# are part of of larger sets, like up/down/left/right
# quads, or parts of multicharacter pictures.) This
# still leaves some unlikely pairs including box drawing
# stuff. It's a quick list.
#
# These are checked with word boundaries, so CIRCLE
# will not skip CIRCLED.
my @skip = qw[ TAG MODIFIER COMBINING ARABIC IDEOGRAPH
	       ARROWHEAD ARROW
	       AFFIX CIRCLE HALF
	       UP UPWARDS
	       DOWN DOWNWARDS
	     ];
my $skip = join('|', @skip);
my $skip_re = qr/\b(?:$skip)\b/; # \b for boundary

# no boundary check, allow "leftfacing" and the like
my $keep_re = qr/(?:LEFT|RIGHT)/;

binmode(STDOUT, ':utf8');
open(STDIN, '<', $in) or die;

while(<>) {
  # keep code point and name only
  /^([^;]+);([^;]+);/ or next;
  $id = $1;
  $name = $2;

  # Stop checking if on skip list
  next if /$skip_re/;

  # if left or right, keep, but separately
  if (/$keep_re/) {
    if (/RIGHT/) {
      $check{$name} = $id;
    } else {
      $pool{$name} = $id;
    }
  }
}
close STDIN;

for $name (keys %check) {
  my $pair = $name;
  # %check has RIGHTs, see if there is a matching left
  $pair =~ s/RIGHT/LEFT/g;
  if (length( $pid = $pool{$pair} )) {
     $id = $check{$name};
     $found{$pid} = $id;

     # In .exrc or .vimrc " is used to begin a comment.
     # These three printf()s just document the pairs.
     printf(qq{" U+%s\t%c\t%s\n}, $pid, hex($pid), $pair);
     printf(qq{" U+%s\t%c\t%s\n}, $id, hex($id), $name);
     printf "\"\n";
     $count ++;
  }
}
print STDERR "Found $count pairs\n";

# Unfortunately < and > are not named with LEFT and RIGHT
# so hardcode that.
printf "set matchpairs=<:>";
for $id (sort { $a cmp $b } (keys %found)) {
  $pid = $found{$id};
  printf ",%c:%c", hex($id), hex($pid);
}
printf "\n";
__END__

Saved as matchmaker, with the Unicode data file in same directory, let's try it.

$ perl matchmaker >> .vimrc
Found 186 pairs
$ tail -1 .vimrc
set matchpairs=<:>,(:),[:],{:},«:»,֎:֍,܆:܇,࿖:࿕,࿘:࿗,𐡷:𐡸,𝄆:𝄇,𝅊:𝅌,𝅋:𝅍,👈:👉,🔍:🔎,🕃:🕄,🕻:🕽,🖉:✎,🖘:🖙,🖚:🖛,🖜:🖝,🗦:🗧,🗨:🗩,🗬:🗭,🗮:🗯,🙬:🙮,🤛:🤜,🫲:🫱,🭪:🭨,🭬:🭮,🭼:🭿,🭽:🭾,🮜:🮝,🮟:🮞,🮠:🮡,🮢:🮣,🮤:🮥,🯇:🯈,‘:’,“:”,‹:›,⁅:⁆,⁌:⁍,⁽:⁾,₍:₎,⇇:⇉,⊣:⊢,⋉:⋊,⋋:⋌,⌈:⌉,⌊:⌋,⌍:⌌,⌏:⌎,⌜:⌝,⌞:⌟,〈:〉,⌫:⌦,⍅:⍆,⎛:⎞,⎜:⎟,⎝:⎠,⎡:⎤,⎢:⎥,⎣:⎦,⎧:⎫,⎨:⎬,⎩:⎭,⎸:⎹,⏋:⎾,⏌:⎿,⏪:⏩,⏮:⏭,⏴:⏵,┤:├,┥:┝,┨:┠,┫:┣,╡:╞,╢:╟,╣:╠,╴:╶,╸:╺,▉:🮋,▊:🮊,▋:🮉,▍:🮈,▎:🮇,▏:▕,▖:▗,▘:▝,◀:▶,◁:▷,◂:▸,◃:▹,◄:►,◅:▻,◜:◝,◟:◞,◣:◢,◤:◥,◰:◳,◱:◲,◸:◹,◺:◿,☚:☛,☜:☞,⚟:⚞,⛦:⛥,❨:❩,❪:❫,❬:❭,❮:❯,❰:❱,❲:❳,❴:❵,⟅:⟆,⟕:⟖,⟞:⟝,⟢
 :⟣,⟤:⟥,⟦:⟧,⟨:⟩,⟪:⟫,⟬:⟭,⟮:⟯,⥼:⥽,⦃:⦄,⦅:⦆,⦇:⦈,⦉:⦊,⦋:⦌,⦍:⦐,⦏:⦎,⦑:⦒,⦗:⦘,⧘:⧙,⧚:⧛,⧼:⧽,⫍:⫎,⫥:⊫,⬱:⇶,⮄:⮆,⮐:⮑,⮒:⮓,⯇:⯈,⸂:⸃,⸄:⸅,⸉:⸊,⸌:⸍,⸜:⸝,⸠:⸡,⸦:⸧,⸨:⸩,⸶:⸷,⹑:⹐,⹕:⹖,⹗:⹘,⿸:⿹,〈:〉,《:》,「:」,『:』,【:】,〔:〕,〖:〗,〘:〙,〚:〛,꧁:꧂,﴾:﴿,︵:︶,︷:︸,︹:︺,︻:︼,︽:︾,︿:﹀,﹁:﹂,﹃:﹄,﹇:﹈,﹙:﹚,﹛:﹜,﹝:﹞,(:),[:],{:},⦅:⦆,「:」
$

There are a lot of good pairs in that. But some pairs might need to be switched for taste. (Looking at those hands.)