QZ qz thoughts
a blog from Eli the Bearded
Tag search results for blog Page 1 of 20

Banana bread


This is a very forgiving recipe that has a lot of room for slighlt wrong amounts, different sized bananas, and tolerance for coooking time. It's a bit of a slow cook but not tricky at all. We make this a couple of times a month, sometimes doubled recipe and freezing some.

Start off with

  • 1/2 cup vegetable oil
  • 1 cup sugar

Cream together. I use a stand mixer but whatever.

Add in and mix well:

  • 1 teaspoon baking soda
  • 1/2 teaspoon salt
  • 3 very ripe bananas

Next add and mix:

  • 2 cups flour (up to 1/2 cup whole wheat)
  • 1/2 cup chopped walnuts or chocolate chips

In our household, adults always use walnuts and kids always bake it with chocolate chips.

Pour into oiled/floured loaf pan. Or multiple pans. Or make muffins.

Bake 45 minutes to an hour at 350°F. Use the clean toothpick test. Smaller cooks faster, so cupcakes may be 30 minutes, big loaves closer to the hour mark.

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.

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.)