My COVID Timeline

  • 2022-08-03 Wednesday

    • Saw Ani Difranco at XL Live in Harrisburg

    • Didn’t think I stood so close to people, but no mask.

    • Show was great.

    • Helped a stumbly drunk guy find a seat, so he could stop bumping into people

  • 2022-08-04 Thursday

    • Had a work day

    • Ran ben around to sports practice

    • Helped with fixing the well pump at parents'

    • Got home at 12:30am or so

  • 2022-08-05 Friday

    • Woke with a sore throat and stuffy, not a big deal

    • Took a Covid test in the afternoon - negative

    • Went to Penn Cinema drive-in to see Goonies

      • Marie and Emily in the car

      • Doug, Sarah, Fizz, and Sarah in other cars

      • Rained and cut short

      • Took Marie home

  • 2022-08-06 Saturday

    • Woke with sore throat and whole-body soreness

    • Covid test again at emily’s suggestion: positive

    • Notified kids, movie friends, and parents

    • Tried online appointment, but no one available but receptionist

    • Ran to Penn State Health walk-in clinic, got Paxlovid RX

    • Sat around all night watching Love, Death + Robots

  • 2022-08-07 Sunday

    • Noon: Emily picks up Paxlovid and groceries and drops them off

    • Paxlovid day 1

    • Watched lots of Love, Death + Robots

  • 2022-08-08 Monday

    • Sore throat

    • Stuffiness

    • Aches

    • Paxlovid day 2

  • 2022-08-09 Tuesday

    • Terrible sore throat

    • Start trying throat spray

    • Stuffiness

    • 2 Ibuprofen every 4-6 hrs seems to manage throat pain

    • Paxlovid day 3

  • 2022-08-10 Wednesday

    • Terrible sore throat. Is this Strep?

    • Call nurse line at doc: this is fine.

    • Paxlovid day 4

  • 2022-08-11 Thursday

    • Slept fine!

    • Throat not bad!

    • Bad taste in mouth sometimes for past couple days: like bitter, old tea

      • Gargled full-strength white vinegar. emily then informed me it should be dilluted.

    • Paxlovid day 5, last day

    • Last dose, then went to bed pretty early: tired and cranky

  • 2022-08-12 Friday

    • Slept well

    • Feeling fine

    • Tested (slightly) positive today

    • Test expires today, so i’ll use them all over the next couple days

  • 2022-08-13 Saturday

    • Listening to "attack surface"

    • Finished 30 Days Lost in Space Arduino kit — pretty cool

    • Tested negative at 7pm or so.

  • 2022-08-14 Sunday

    • Finished "Attack Surface"

    • Finished Love Death + Robots

    • Tested negative again at 11am

  • 2022-08-15 Monday

    • Worked normally

    • First bike ride in over 2 weeks: 28 miles on Northwest River Trail


Podcast Addict

I’ve used BeyondPod for over 10 years, since my first Android phone, to download, organize, and play podcasts. For at least the past 4 years, maintenance and updates to the application have slowed to a crawl. I had paid a one-time fee for the application, so I guess I couldn’t think they owed me updates forever.

I would try to find a replacement every once in a while, but the other podcatchers always lacked some feature upon which I relied. Even Podcast Addict fell short the last time I tried it about 4 years ago, but it’s been getting lots of updates.

BeyondPod: The Good Parts That Kept Me Coming Back

  • SmartPlay allowed me to organize my 74 podcast feeds into 3 or 4 tiers. This allowed me to ensure the quick, timely podcasts were played first before the longer podcasts that could wait for days or weeks. I even managed to create one tier that played chronologically, which is opposite of all my other podcasts.

  • For each podcast, I could boost the volume, adjust speed, and have it only keep the latest so many episodes.

  • It had a button to skip the rest of a podcast to quickly get to the next one.

Downsides of BeyondPod

  • It liked to just stop playing and crash occasionally.

  • It was increasingly abandoned and unmaintained, so I didn’t trust it would continue to work when Android 13 hit my phone.

  • I could export my OPML file, but it went to a private filesystem that can no longer be accessed by file managers in newer versions of Android.

  • BeyondPod never updated to use the standard media controls and kept its old notification-based player.

  • There was a race-condition bug when skipping forward through the end of an episode: it would skip way into the next episode.

  • The catalog of podcasts has stopped working, so I could only add podcasts by URL, which is fine, but less convenient.

Enter Podcast Addict

  • Podcast Addict can play at even faster speeds, though I’ve not taken advantage of these speeds: I’m still listening at 2-3x speeds.

  • For each podcast feed, I can set custom volume boost, speed, and auto cleanup by age or count of episodes.

  • When an episode is finished, it automatically moves it to a Recycle Bin or 24 hours, so I can go find it again if I want to refer to it again, or completed it by accident. In BeyondPod, I had to "delete played" occasionally for myself to give myself time to review and recover what’s been played.

  • I can assign a numeric priority to the podcasts and sort by it, so I can easily ensure my favorite podcasts play before others when they’re available just like BeyondPod’s SmartPlay, but even more conveniently.

  • "Smart Priorities" automatically increments a podcasts priority when I manually click an episode to play before others. In practice, this moved things around more than I wanted, so I disabled it and fine-tuned the priorities by hand as I saw them slightly out of order.

  • I can see artwork for each episode. I didn’t even know there was per-episode artwork.

  • I also never knew chapters were a thing in podcasts. Now I can see chapters for the couple podcasts that provide them.

  • Skip silence works well, but it’s super-weird for story podcasts, since it eliminates all hints of punctation.

  • These latest features are working really well, so I’m excited everytime I get to see the software in action. I expect to see even more features showing up in the frequent releases of Podcast Addict.

  • There’s a Getting Started guide which intuitively walked me through the things I’d likely want to configure, and I immediately recognized all the features I wanted. I was confident Podcast Addict would work for me, so I set it up completely, and signed up to pay the annual subscription fee to help make sure they keep updating it.

I made the transition, and I love Podcast Addict. Listening to podcasts is easily my #1 pastime, so it’s important that I found the perfect software.

Updates

  • 2022-09-23: Player→Settings→Controls→Skip Outro=95% let’s me hit the forward skip button in the last 5% of a podcast and finishes the whole episode instead of skipping only 20 seconds as it usually would. This saves a couple taps to get past the last bit of credits or closing music.


WiFi Drops Again

I had previously flailed around trying to fix occasional WiFi drops on my Pop_OS(Ubuntu) laptop. The intermittency made it hard to know if I really fixed it or not, and it turns out I hadn’t.

I installed Arch Linux on another computer here on my desk. While it sat around idle, I found it one day having lost its internet connection just like the Pop_OS machine does!

Now I knew this problem with the network connection wasn’t isolated to one machine. To recap:

  • the wired connection is fine

  • the Mac on the wireless network is fine

  • the mobile devices are fine

  • the 2 linux machines drop their connections every couple days

I started the search again for a solution with more information. I found some hints about power-saving options in NetworkManager.

On the Pop_OS machine, there’s a configuration file, /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf, that I changed to disable powersaving:

[connection]
# 0: default, 1: leave untouched, 2: disable, 3: enable
wifi.powersave = 2

I had to add a file to the Arch machine in the same location to hold this configuration. Now these machines have been maintaining their connections for days.


Design First, Measure Second

My objects repository is full of OpenSCAD code. At the top of each file you’ll find a collection of variables in the code: the measurements of the model.

We don’t need to get bogged down with those exact values to start modeling, but we know that we’ll want to identify certain parameters to size our models. We can start banging together some shapes (with union and difference), and any time we’re tempted to guess at a measurement and plug it into the code, we want to first see if we can give it a name (a variable name, that is) and use that instead and define a rough value for that variable at the top of the file. Next we can think about that value and decide if it’s related to any other values we already have. Often, one value should be calculated relative to other values: overall_width = inside_width + 2 * side_thickness. Once a measurement is defined in terms of other values it’ll automatically update as we start providing more precise measurements.

By starting with some guessed values and later plugging in real measurements, we prove that our parametric model is being correctly calculated from the measurements. We should be able to use this code time and time again to generate variations on the model based on new measurements. Our SCAD model with all the parameters at the top is ready to upload to Thingiverse and the Customizer can let users easily provide their own measurements to generate new models from our code.


CX to Gravel

2015 Redline Conquest Elite

I bought my first new bicycle in December of 2020. I had been using my previous bike much more through 2020, so I figured I had proven I’d use an upgraded bike. Ben and I had been aggressively researching gravel bikes for a while, but any bike had been hard to find in stock.

We found a used cyclocross bike, the Redline Conquest Elite, that looked enough like a gravel bike. It luckily was a good size for me, a small. The drop handlebars were exciting and different for me.

Over the year I’ve had the bike, I’ve added lots of parts and swapped others. I made the carbon fiber bike heavier but it met my needs and made it look more like a gravel bike:

  • I replaced the stem to shorten it a bit.

  • I switched to a suspension seat post.

  • I added a top-tube bag, a tool bag behind the saddle, a phone mount, a bright headlight, and a clamp-on rack in the back.

  • It came with 35mm CX tires, so I purchased other gravel tires from Vittoria in the same size. The new tires were smoother, but clearance seemed a bit tighter. I’ve very recently swapped to a narrower 31mm rear tire to have better clearance for mud.

  • The original groupset on my bike was built for a stronger road rider: 36T/46T chain rings paired with an 11-28 cassette. I needed a little more help climbing, but I liked the speed of the faster gears. I first replaced the 36T ring with a 34T, and then I found an 11-34 cassette. This goes about as slow as I need to go up a hill, but retains those high, fast gears for me.

I know the bike’s not really a gravel bike, but I think I have myself convinced enough that it’ll work for me, and I don’t need to shop for the next bike. I’ve already ridden over 200 miles in the first 2 months of this year and 1100+ miles in 2021. I’m feeling pretty strong with this current configuration.


Google Can't Reach SmartThings

My Google Assistant on my phone has been refusing to turn on and off the 2 devices I have on smart plugs: "Can’t reach SmartThings."

I found an article about the Google Home doing the same thing. Fortunately, the advice there worked: go into Assistant’s settings → Devices → Add Devices. Upon clicking on the SmartThings entry that was already there, it gave me the option to re-link. Once I authorized access, I could again ask Google to control those devices.


Wireless Drops on Pop OS 20.10 and Later

Upon the release of Pop OS 20.10, my System76 laptop and my Arris router started having some disagreements. The laptop would drop connection every couple hours and not reconnect itself. I’d see the little question mark in the WIFI indicator, and I needed to manually turn WIFI off and back on to restore the connection.

I found mentions of this behavior in Ubuntu and in Pop OS forums, and supposedly newer NetworkManager from Gnome would fix it, so I suffered and waited for the beta of Pop OS 21.04 to be available. That didn’t fix it, so I started digging around some more in System76’s page for Troubleshooting Wireless.

I picked my way through the tips and applied some of them. Disabling band steering in the router finally seems to have fixed the problem. I’ve kept my WIFI connection up and running for days now. I didn’t need to name the 5GHz and 2.4GHz networks differently.


No Suspend on Desktop Server

I have a desktop server running Debian Unstable in the house, and I occasionally reboot it without logging back into the local desktop session. If I don’t login, I’d later find the machine mysteriously inaccessible — asleep. It’s set to never sleep, but that’s when I’m logged in.

To disable sleep in the GDM3 Greeter, I edited the /etc/apt/greeter.dconf-defaults, found the "Automatic suspend"/[org/gnome/settings-daemon/plugins/power] section and followed the comments to add:

sleep-inactive-ac-timeout=0

Now the machine will act a little more like it’s a server.


It's the 12-Volt

The Symptoms

It’s the 12 volt

In the BMW i3 Worldwide Group on Facebook, there are a few recurring jokes, and one of the most popular is the 12-volt battery causing every little weird issue. One could wonder why it has a 12-volt battery at all, since the 400-some-volt battery should be able to power the accessories. Additionally, BMW cars have a complicated charging system that requires registration when the battery is replaced, so it’s easy to understand why one might put off dealing with it. The dealers can charge crazy amounts of money for replacement.

My 2014 i3 has an occasional annoyance I attribute possibly to that little 12-volt battery: sometimes forgetting its presets and bluetooth pairing. The more obvious warning is that the battery has discharged while sitting, and while it’s not clear on the screen, it means the 12-volt battery. Mine did it for a couple cold days, so I figured I was due to replace the battery, but the warning stopped, so I thought I might have had some more time.

Over the weekend, I got to see the spectacular (and expected) failure of the car due to the 12-volt battery going very low. I opened the back hatch, stowed all my worldly possessions in the back, closed it, and then the alarm started whistling, and I could not get anything unlocked or stopped by the key fob. The alarm stopped on its own, but I still couldn’t get into the car, and I could see the taillights lowly blinking, so it seemed to be the dreaded 12-volt battery.

The alarm went again and later the horn while I worked. Nothing inside the car would respond either. This was the failure about which the group warned: it can’t do anything, and you’ll need it dragged onto a rollback! The car charges the 12-volt battery when running, but without the 12-volt battery, the car can’t get any of its smarts going to even power up the car. They’ve managed to engineer a problem of old cars into the new.

The Familiar Fix

I learned to pry off the cover to use the mechanical key and to manually pop the hood. I figured I may as well try to get it power with one of those Lithium Ion jump-starter packs I had on hand. (I carry it in the car, so I can still be helpful when others need a start.) I pulled the velcro covers and removed the allen and star screws from the bin and removed the bin, so I could mostly get to the battery. I could just barely fit the little battery clamps in place on the battery terminals. I turned on the battery pack, the car clicked, and everything came back to life. I knew I couldn’t drive with that battery pack there, so I let it charge for 10-15 minutes, turned it off, and found the car still functioned, so I removed the battery pack, and hit the road to drop the car at my local independent shop to have the battery replaced.

A jump-starter did turn out to be useful with the i3, and it saved me a tow for a problem that shouldn’t be so catastrophic.


Java Joyless

Mr Haki has a Java Joy article about transforming a stream of strings into a map using functional Java. I’m having a bit of trouble embracing it enthusiastically, since each example is 81 lines of Java code and a pointy pile of type declarations!

I dashed out the same functionality in 4 lines of Clojure, and I can understand it a whole lot easier. I’m not even sure this is the fewest forms, but it’s still nicer.

  (->>
    ["language" "clojure" "username" "john"]
    (partition 2)
    (reduce (fn [m [k v]] (assoc m k v)) {}))
  ;; => {"language" "clojure", "username" "john"}

Update 2021-04-14: It can be done in one line of Clojure.

  (apply hash-map ["language" "clojure" "username" "john"])
  ;; => {"language" "clojure", "username" "john"}

Written with Clojure 1.10.2.


Fixes for Overtone and SuperCollider on PopOS 20.10

I took the update to PopOS 20.10, and my Overtone setup stopped working. When I’d try to boot up the internal SuperCollider server from Emacs or from the leiningen repl on my music projects which all (:require [overtone.live :refer :all]), get an error in native libraries. I could also try to start the server with (boot-internal-server) or (boot-external-server), but it gives the same error.

--> Booting internal SuperCollider server...
Cannot read socket fd = 107 err = Success
CheckRes error
Could not read result type = 22
Client name = Overtone conflits with another running client
Cannot connect to the server
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
could not initialize audio.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5eec0e9ba7, pid=30517, tid=30605
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (15.0.1+9) (build 15.0.1+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (15.0.1+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libscsynth.so.1+0x63ba7]  World_WaitForQuit+0x7
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/john/workspace/music/hs_err_pid30517.log
--> Connecting to internal SuperCollider server...
[thread 30576 also had an error]
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Since it can no longer start the server internally from within Overtone, I start the server manually. I wrapped a script around the start up, so I can set the environment variables for configuring jack and starting up the synth:

#!/bin/sh

# automatically connect up jack ports
export SC_JACK_DEFAULT_INPUTS="system:capture_1,system:capture_2"
export SC_JACK_DEFAULT_OUTPUTS="system:playback_1,system:playback_2"

scsynth -u 57110

To get Overtone going again, I disabled the automatic boot of the server within Overtone by switching all the requires in each file from overtone.live to overtone.core, and I connect to that external server from my REPL manually with (connect-external-server) before doing anything else.

Finally, Overtone was consistently failing to find my MIDI keyboard. When things were working well enough a couple months ago, it still had required a little dance of killing off jackd and restarting Overtone, since something had been tying up the MIDI interface. This workaround was no longer adequate, since scsynth and jackd needed to already be started. I disabled MIDI connection in jackd by removing the -Xseq option from my ~/.jackdrc.

I’m back in business, and it’s probably more robust with these manual steps now. I think I’m also seeing some other odd little things working with the external server that didn’t previously, like using (mouse-x) for reading mouse positions into the synth values. The built-in piano synth is also working where it hadn’t previously.

Update 2021-02-13: I had lost the ability to send desktop audio (pulseaudio) through to the Jack Sink with this setup, so I figured out to start qjackctl before my supercollider.sh. That gets the Jack Sink available again to pulseaudio and the desktop sound menu.


Escape with Spacemacs in Tmux

I’ve occasionally been using a SSH session from my Pixel phones for years to login to my servers and write Clojure code in Emacs. I’d often run into an issue where I find myself having a weird time switching between NORMAL and INSERT modes when I’d hit ESCAPE quickly and try to move the cursor.

Googling my random problems is a favorite pastime, and I’ve finally stumbled upon an article about tmux and vim escape key. I learned that it’s probably been tmux sporadically eating my ESCAPE key, so I’ve tried disabling the built-in delay by adding to my .tmux.conf:

set -g -s escape-time 0

Taxes

A recent New York Times article exposes that Donald Trump paid no income taxes for 10 of 15 years . To some, that sounds like neglecting a duty to the public and the nation that makes so much possible for us. To just as many, that sounds like an ad for the next big tax preparation service they need to hire. Read the article, and you’ll see it’s a complicated shell game of write-offs, profits, losses, and fees shuffled around from year to year, even to past years as tax laws changed.

Will this change anyone’s view of anything? No.

Do I benefit from public spending? Absolutely.

Do I pay for it in taxes? Of course.

Do I like the way some tax dollars are spent? No, so maybe I should want to reduce it, but really we need to fix the way it’s spent.

Do I take deductions I can find? Yes, I pay a tax professional to tell me what to deduct and how I can save money. Why is this not simpler? Why is it so hard to know what we really owe? Why is there an entire industry built around avoiding our responsibility to pay taxes? Tax laws are changed and complicated to sweeten the deal for some lawmaker who’s signing, or in some cases, the complication or loopholes are often unintended consequences that were supposed to help someone else in need.

I’ll not sing anthems or salute a flag, but I’ll pay taxes and vote for people who spend the money to provide more stability for people.

As the shells continue to shuffle the margins will tighten, so I really hope we get him out of office before his debts come due and he’s selling off our futures.


Listening to Music

My Music Library

I have a good bit of music I had acquired and ripped in the late 90s and had purchased from Amazon later. That all lives in a directory on my big computer. I never play anything from there, and it just sits there for safe keeping.

I continued to purchase DRM-free MP3 files from Amazon Music, and I eventually embraced their "free" streaming with Amazon Prime. I could add available music to my collection for free, and then stream it along with the stuff I bought, so it’s nice and blended. This allowed me to easily toss a new album or artist into rotation, and if I really want, I might purchase it to keep.

The Prime streaming service had some limitations with some music I wanted to sample being unavailable, and sometimes, I’d notice some of the free music disappeared from my collection. I decided to pay the little bit for the Unlimited Music plan, and that made almost everything available. I notice very few cases of music becoming unavailable, so now I don’t bother buying downloadable MP3s except in rare cases where I want to be able to use a song on another device outside the Amazon Music client.

Music Discovery

I don’t really use the stations at all on Amazon Music. I don’t feel the need to hear large numbers of new songs all the time, so I have a smaller curated list of podcasts and DJs where I discover new music to add to my collection at Amazon:

Alternatives

I had uploaded all my music to Google Play Music years ago, but there had always been news of the service’s eventual demise. It’s finally migrated recently over to YouTube Music, and they seem to have reintroduced the ability to upload my own music. I’ve paid for YouTube Premium, so I have YouTube Music as well, and this could be a nice alternative. I have a few albums uploaded there which I can’t find on Amazon. I don’t think I can buy music there, though, and I’ve already purchased a good bit of (DRM-free) music on Amazon.


Templates and Snippets in Emacs

I was only trying to write that last article, but it took me days to finally do it. I had so much work to do before I got there.

I had come to appreciate Emacs automatically inserting the boilerplate namespace declarations in new Clojure files, and I really thought I needed such convenience for my blog posts written in AsciiDoc in JBake. I dove down a 20-tab-deep, yak-shaving hole to get it done. [1]

I had to figure out the right search terms and names for what Emacs was doing for me. I finally found yatemplate which seems similar to yasnippets. Spacemacs has the templates layer for integrating yatemplate support, so I added that layer and created a template for my adoc files in my .emacs.d directory. My simple case worked, but I recognized that I’ll want that template on all my machines, so having a local copy of it wouldn’t cut it. I needed a way to check-in and version more Emacs/Spacemacs files than just my ~/.spacemacs files I was previously distributing.

I learned yasnippets would default to looking in ~/.spacemacs.d/ if the configuration was in there, so I had to move my ~/.spacemacs file over to ~/.spacemacs.d/init.el. To have the templates layer source templates from the .spacemacs.d directory, it required an extra bit of configuration when introducing it to the dotspacemacs-configuration-layers:

  (templates :variables templates-private-directory "~/.spacemacs.d/templates")

At this point, I could now commit my .spacemacs.d directory with the regular configuration file and the supporting templates and snippets. All those files will be cloned to all my workstations.

I was almost ready to write that article, but yasnippet and yatemplate have this fancy templating language. I’m sure that can make my article-creation even smarter! I read a bit more and found a couple cool elisp functions for automatically filling in the date and building a title from the file name. With the final enhancements to my adoc template, I could write the article, if I could only remember what I was trying to do in the first place. I hope to at least remember how to use these snippets and templates for future work.


1. I often measure task complexity in the number of tabs I end up having opened.

ADVi3++ 4

I had a bit of downtime with my Monoprice Maker Select Plus 3D printer, so I decided it was time to upgrade the custom firmware, ADVi3++ 3.0.x, to the newer 4.0.6.

I’ve done the upgrade previously to get the 3.x firmware in the first place, so I knew I needed to upgrade in 2 steps: the LCD via a microSD card and the main board via Cura over USB.

I dug through the manuals and directions a bit, and decided I could copy the contents of the raw zip onto a formatted SD card instead of writing the img file to the raw SD device with dd. That fit on a handy 2GiB card. I took the couple screws out of the front panel, inserted the micro SD card, powered it up, and watched the LCD display all the new images it was loading. When it’s done, I turned it off, and replaced the screws.

Then I could easily connect the printer to the Linux laptop via USB, and upload the custom firmware hex file from Cura’s Manage Printers screen. I did need to take a moment to add my user to the dialout group to get access to the USB ports for serial communication to the printer.

Upon reboot, the printer wiped out the old incompatible settings, and I rebooted it again to see the new startup screen and version numbers. I ran through some tunings: PID and extruder, and kicked off a test print that went fine.

I currently have the thermal protection enabled, and I’m hoping it’s not too sensitive, and I can keep it turned on. I expect this upgrade will hold for a long time until I see 5.0 available, and it’s had some time to settle.


RSS for News

We can find ourselves thinking, "Where did we used to get our news before Twitter and Facebook?" I know where I got news: Google Reader, but Google shut it down, and eventually gave us a taste of aggregated news in Google Assistant on our phones, but it never really allows us to consciously control it.

Social media’s a bit of a mess and mostly getting worse, so you might want an alternative. Google Reader was based on RSS and Atom news feeds from all your favorite websites, and those still exist.

I still read my carefully curated news feeds using Feedly as a successor to Google Reader. I have hundreds of different news feeds aggregated into this one place (kind of like Facebook and Twitter), but it’s a much more controlled stream of news about which I care. Anyone can create an account at Feedly and get started by searching for a handful of sites you’d like to read regularly. Over time, you can extend and finely tune your feed of news.

If Feedly isn’t quite your style, you can find other news readers, and allow yourself to stay informed without necessarily needing to scroll through all the noise of Facebook and Twitter.


Clojure Core Logic for a Puzzle

Lock Puzzle

I saw a puzzle pop up on Facebook a couple weeks ago, and it looked like a fun exercise for core.logic, since the puzzle simply requires keeping track of some constraints and reconciling them to one answer.

I had previously tinkered with the core.logic primer and I referred back to it to complete this little puzzle. I had originally coded some more complete rules about exclusion of some values which could have been implied by the puzzle, but I found they could be dropped and still get down to one answer. I started from the entire problem space of all digits and added the constraints to watch and verify each constraint’s effects.

(ns scratch.2020-05
  (:require [clojure.core.logic :as l]))

(l/run* [a b c]
  ;; all digits 0-9
  (l/membero a (range 10))
  (l/membero b (range 10))
  (l/membero c (range 10))
  ;; 6 8 2 one digit is right and in its right place
  (l/conde
    [(l/== a 6)]
    [(l/== b 8)]
    [(l/== c 2)])
  ;; 6 1 4 one digit is right but in the wrong place
  (l/conde
    [(l/membero a [1 4])]
    [(l/membero b [6 4])]
    [(l/membero c [6 1])])
  ;; 206 2 digits are right, but both are in the wrong place
  (l/conde
    [(l/membero a [0 6])
      (l/membero b [2 6])
      (l/membero c (remove #{2 0 6} (range 10)))]
    [(l/membero a [0 6])
      (l/membero c [2 0])
      (l/membero b (remove #{2 0 6} (range 10)))]
    [(l/membero b [2 6])
      (l/membero c [2 0])
      (l/membero a (remove #{2 0 6} (range 10)))]
      )
  ;; 3 8 0 one digit is right but in the wrong place
  (l/conde
    [(l/membero a [8 0])]
    [(l/membero b [3 0])]
    [(l/membero c [3 8])])
  ;; 7 3 8 all the digits are wrong
  (l/membero a (remove #{7 3 8} (range 10)))
  (l/membero b (remove #{7 3 8} (range 10)))
  (l/membero c (remove #{7 3 8} (range 10))))
;; => ([0 4 2])

Past Phones

Over the years, I’ve chosen my mobile devices pretty carefully. I’ve usually chosen them for connectivity options, Java capabilities, and eventually the quickest Android updates.

  • Ericsson S868 This was my first device in about 1999: futuristic GSM on a small start-up network in Lancaster.

  • Ericsson 289LX After my old phone carrier let all their cool features (email to SMS) fall into disrepair, I jumped to an older TDMA network on AT&T, but it worked.

  • Siemens S46 This was my second phone on AT&T. This one had a couple colors and a better WAP browser, so I started coding WAP mobile sites for it.

  • SonyEricsson T68i A friend gave me this tiny phone with an attachable camera accessory. This was my first phone with Bluetooth data tethering.

  • SonyEricsson T616 Now I had an integrated camera and Java, and I think I likely started coding for J2ME apps and games with the T616.

  • SonyEricsson T637 This was just an update to the T616.

  • SonyEricsson S710 This device had an odd form factor of a large screen and hidden keypad that made it more of a camera that had a phone feature.

  • SonyEricsson W810 I returned to the tiny, featureful candy-bar phone with this one. Java capabilities and connectivity remained my most important concerns. I was really stretching these little feature phones to do as much as possible, and I believed they continued to have a future. This device was a "Walkman"-branded device, so it had a bit of storage and decent audio capabilities. I think I also flashed a new firmware onto this device to get full email support.

  • Nokia E71 I jumped to a smartphone with Symbian OS with the full keyboard and internet capabiliites. I never coded any S60 apps for this, but it continued to run Java apps well.

  • Samsung Nexus S I finally jumped to Android and a touchscreen, and I had every intention of jumping right to coding Android apps. (Spoiler: With all these Android devices, I never started.) I really stretched this device to a point where I barely had enough memory to run GPS navigation (Waze) and podcasts (BeyondPod) or music at the same time. I loaded lots of 3rd party Android ROMs on here.

  • LG Nexus 4 I continued to chase clean Google Android devices. This devices brought NFC and wireless charging that didn’t work as well as it should.

  • Huawei Nexus 6P This phone was huge, and I never went back to smaller phones, but it lost wireless charging. It lasted long enough for me to need to replace the built-in battery. I started coding some mobile JavaScript for this device.

  • Google Pixel XL The 6P’s battery died again, and the latest phones (Pixel 3) were being released in 6 months, so I bought a refurbished Pixel XL to tide me over, but it proved to be an excellent phone, so I hung onto it until it no longer got updates.

  • Google Pixel 3 XL I wanted something newer that would get Android 11, so I bought this device refurbished. I had to buy some headphone adapters, but I’ve been enjoying having good wireless charging. I finally got started with some ClojureScript for mobile web apps on this device.


Reagent Front End

For the past couple days, I’ve started playing with Reagent to do a bit of React programming. I used the Reagent-frontend template for leiningen to get my start. Within a day or two, I had managed to string together a useful little toy application. It only took me a couple hours to get my next toy application put together. Each application is a mere single-page application for doing a single, simple task on a mobile device. It’s a lot of fun, and this opens the door for quickly implementing any toy I want.


Older posts are available in the archive.