Advent of Code is Back

December 1st, 2019

Christmas Tree

Just finished the Day 1 puzzle to Advent of Code for 2019. And as expected, it was funny, and fun to do. I've been playing with the LeetCode examples - just to stay sharp, and one of the things that Advent of Code provides that LeetCode doesn't is the data files. Sure, I get it... they test after you write the code, but if, like me, you don't choose one of their languages, then you're really out of luck.

Still... I'll keep doing these as long as the authors make them, because they are fun and keep my mind sharp. I am very grateful for these folks... 🙂

UPDATE: some days are going well - others are computationally very hard, and I clearly need to figure out how to solve those. I won't get them all in the first go, but I'll keep at it... 🙂

Fantastic Lighthearted Javascript Graphing Package

November 18th, 2019

Javascript

This morning I was reading the newsfeeds, and came across probably my favorite Javascript graphing package: Chart.xkcd. The idea is that it can be used to create those seemingly hand-drawn charts the the xkcd comic so often generates as part of their work. But this is easily put into React and other web frameworks, and put on web pages for that casual look that brings a completely different feel to the data being presented.

From the simple docs on the web page, it seems pretty straight-forward... you have to set up all the data for the graph, and then it just renders it. There are some nice mouse-over features as you dig a little deeper, but it's the casual nature of the presentation that really appeals to me:

Example of Chart

I don't have a project yet that's in need of this, but I can feel that there will be something coming soon that could really use this less-serious approach to data presentation. After all, not everything is a publication-ready presentation.

Google Fi and Regulated Utilities

November 15th, 2019

vote.jpg

This morning I saw an ad for Google Fi, and it got me to thinking about the relationships between AT&T, Verizon, regulations and tech companies, like Google, and my phone. I'm not saying I like the size of my phone bill - and this includes two kids and my Mom, but I at least understand why it is the size it is, and the way they are profiting from me. When I think about an unregulated tech company being a carrier, it makes the data collection even more invasive.

I'm not saying that the people working at Google have evil in their hearts, but power currupts, and the power some companies are collecting about each of us is really staggering, and I'm in the position to know just enough to be really concerned. The collection and matching of data made Finance really powerful - but that was all about tradable securities and related information. This is about individual people... and the aggregations that can be done now make it possible to really look at the individual within the crowd.

I just wonder if we're a cliche - allowing technology to outpace society - again. I think I'm all for spending a little more, to a regulated company, than pay less to an unregulated one - certainly for utilities that just need to work, and not be tracked.

Some Great Christmas Music

November 11th, 2019

Christmas Tree

Some will say I've started early, but I had to walk 30 min in a snowstorm this morning, so I felt like I deserved it. One of the albums on my Fun Christmas playlist is John Denver & The Muppets - A Christmas Together. It's just a bunch of fun Christmas songs, and I just love Christmastime...

Today is the very best day someone's having... and it's the very worst day someone's having... or both.

UPDATE: I picked up some Frank and Bing as well, and added them to the list. It's some good music, and Frank reminded me of Christmas Seals, and how a disease, once cured, means the charity formed to battle it, also dies.

Interesting Issues with iTunes Match

November 11th, 2019

Apple Computers

Last Thursday I realized that iTunes Match was something I had completely forgotten about - and with my newest iPhone, I was having issues with the syncing of playlists, and music... so I was talking to a friend and he reminded me of iTunes Match. I had thought that was just a part of Apple Music, and it is, but it's also a stand-alone service for $25/yr that will be to my Music what iCloud Sync is to my photos.

So I signed up, and it started syncing to iCloud... and I'd checked with my friends, and they said it'd take a while, so I let it run.

Four days later, we're at this morning, and it's still uploading - or so it says. I had my doubts, and the problem was that there wasn't a really simple way to restart the syncing, but I did find out that you could add the column iCloud Status to the table of songs, and almost all of mine were "Waiting"... that's not good... Quitting Music (no more iTunes) didn't help... so finally I rebooted my machine.

When everything was back up, and I looked at Music this time, all of a sudden things looked a lot better. Like nearly flawless. There were a few of my ripped CDs that didn't have the album artwork, but that was something I knew how to fix, and I started with the first album missing artwork.

Interestingly, when I updated the Artwork tab in the Info... settings, it didn't change in the Music app, so I tried another... same thing. Then I went back to the first and it had changed - so had the second. Ah... OK... Music is actively syncing the changes to iCloud and then representing that in the view I see. OK... I can deal with this... and I fixed the other albums.

One thing I couldn't figure out was why my iPhone didn't get all the album artwork for a single Christmas album. It tagged half of the songs with the artwork, but left the second half off. So I verified that the artwork was right on my laptop - and it was... then looked back to my iPhone - nope. Very odd.

But on the upside - making changes to a playlist on my iPhone does get updated on my laptop - so that's working... Now I just need to figure out how to get that artwork right on my iPhone...

But hey... at least it's not still saying it's syncing to the Cloud...

UPDATE: Fixed it! Here's what I had to do...

  • Remove the downloaded tracks on my laptop - this is a quick right-click on the title, and removing the downloads.
  • Select all tracks with bad album art - shift-click on all of them will do it, and they all should have the iCloud download icon next to them.
  • Add the Album Artwork in the Info panel - this is important to do while the tracks are only on iCloud.
  • Download the tracks - and all the places these tracks exist will be given the correct album artwork.

What a treat! This is just fantastic to get this working! 🙂

Profoundly Impactful People

November 5th, 2019

Path

This morning, as I was checking Facebook for news from the extended family and friends, I saw a post from a friend of my Uncle David's - that he had died yesterday. He had bone cancer, and was in a lot of pain, and had been battling cancer for many years, and yesterday he finally got the peace he so richly deserved.

Here he is with my cousin, Ann - his daughter:

Ann  Uncle David

I think of all the stories I have because of him. What a man. A minister and architect, he had the most amazing voice - it erupted from his very being. It was amazing. The ghost stories he'd tell to us when we were visiting were - to this day - the most terrifying memories I have. I sit and laugh now, but back when I was 9 it was no laughing matter when Uncle David would start to tell a story.

He was well-read, but then again, you weren't going to be hanging around my Aunt Jo without being smart... and the summers we spent in Vermont with them were just more fun than a kid from Tara Lane deserved to have.

I will miss him, but I am so glad he's not in pain... that's no good for anyone.

AirPods Pro Announced

October 28th, 2019

Apple Computers

Today Apple announced the new AirPods Pro, and they look really nice. Noise cancelling, and a Transparency feature to allow some level of noise in if you're in traffic or needing to listen to a little of what's going on around you. Nice feature, and clever - because that's something you might like to tune depending on your environment.

I've become a nut about wireless headphones, and so, of course, I ordered a set, and they should be at the house in a few days. Very nice. The stems of the AirPods Pro are shorter than the AirPods, and have a button on them. Nice. The specs indicate that they should last 4.5 hrs on a charge, and the case is good for 12 hrs. Very nice indeed.

Can't wait to try them out. Life can be fun. 🙂

UPDATE: they are small, light, snug fit, great sound, everything I was expecting from Apple. Just amazing!

Fun RESTful Paging with Bash and jq

October 22nd, 2019

Ubuntu Tux

I was pulling data from a RESTful API, and the returned data was paginated, as data like it often is, and I wanted to process it all in bash because I wanted to be able to share this with a large community. But how to really do that efficiently? I'm not worried about the time it takes to process data in bash, but just to make sure that we're not fetching the same data multiple times. What I came up with was pretty interesting.

First, let's set up the body of the RESTful call. Standard JSON, with the data in the payload as well as a nextLink key:

  {
    "events": [ { "dish": "Stevie is at Poppers!", "userId": "ralph" },
                { "dish": "Ralph is at Waffle House", "userId": "dorris" }
              ],
    "nextLink": "https://yoyo.com/api/rumors?page=4"
  }

where the events key is really holding the important data from the call, but because there was too much data to get in one (efficient) call, the service gave a complete link to hit to get the next page of data. Simple.

Now some APIs return a page number, or a placeholder value to pass to the same URL that generated this data, and this saves 100 bytes, but that's just a different way of getting the "next" page to the caller.

So... how to put all this in bash? Let's start with jq, and you can get it from Homebrew, with:

  $ brew install jq

and then we can look at the basic loop over all pages:

  # this is my YoYo API Token - you can get one too
  tok="111111111111111111111"
 
  # dump all the rumors into a file
  hit="https://yoyo.com/api/rumors"
  while [ "$hit" != "null" ]; do
    # make a temp file for the details of this page of the rumor group
    rumors=$(mktemp /tmp/yoyo.rumors.XXXXXXXX)
    # get the page, and possible next page URL...
    curl -s -X GET $hit \
       -H "accept: application/json" \
       -H "X-API-Token: $tok" > $rumors
    # write out as CSV, the data from this file
    for usr in `jq '.events[] | select(has("userId")) | .userId' $rumors`; do
      echo -e "$title,$usr"
    done
    # get the next URL to load from the service
    hit=`jq '.nextLink' $rumors | sed -e 's/^"//' -e 's/"$//'`
    # clean up the file as we don't need it any more
    rm $rumors
  done

In this example, the $title variable is something that's not defined, but would presumably be defined in the script before we get to the loop. Whatever the point of the gathering the data really is.

What I enjoyed about this is that we can get the data from the service with a simple curl command, and then process it with jq and the flexibility with jq is really quite impressive. In just a few lines, I was able to make a script that fetched a lot of data from a service, extract what I needed into a CSV for processing in a spreadsheet, and it didn't take all that long. Winner. 🙂

Very Exciting New Smart Lock

October 17th, 2019

Machine Learning

This morning, I read about Level Lock and it is exactly what I've been hoping to see in a smart lock for my home. It's just the guts of the deadbolt. The facade - even the keys are your old keys - and the guts are smart. Very.

The basic functionality is similar to many of the others - HomeKit aware, with the ability to lock/unlock remotely, and give people "keys" for times of day, etc. It's all pretty standard. But the fact that it in no way effects your ability to use the same key as before, but adds the smart lock features - well... that's what sold me.

So I put my name on the waiting list for early 2020, and we'll see if it ships. 🙂

Auto-Scrolling not Working on Adium on macOS 10.15

October 10th, 2019

Adium.jpg

With the upgrade to macOS 10.15 Catalina, I noticed that Adium is not functioning as it should. Specifically, that the chat windows are not auto-scrolling to the bottom on new input to the window. I'm guessing this is something related to the way the internals of Adium, and macOS are updating the contents of the window, but it's also well known that Adium hasn't had the best support in the last few years, so it might not get fixed.

Thankfully, the Forums are still alive, and this was posted recently:

Running version 1.5.10.4 Adium on MacOs Catalina version 10.15.

Previously, in Chats when the list of text boxes was scrolled to the bottom, any additional messages, either typed by user or received from other users, was added to the bottom and the list was scrolled up to reveal it. After upgrading to Catalina yesterday, this autoscrolling behavior has stopped working. When user types a message and hits return, the new message is hidden. Likewise, messages from other users are not revealed by scrolling up. So one has to constantly manually scroll up to see the message thread.

No respondants with ideas - yet, but I have hope that the few that have access to the code can at least make the code available - if not fix the bug, and then we can get back to our lives. But if not, I found InstantBird which seems to have been somewhat abandoned several years ago, but it might offer some utility if Adium is never getting fixed.

I did look for Adium on GitHub and just googling it... but it seems to be a bit difficult to find... Hmmm...

UPDATE: At least I have a few more links... the page for Getting Adium Source is live, and describes how to get the code, and there's a page about Getting the Newest Adium Source as well. In the discussion about this, there's even a note that there exists a BitBucket repo for Adium, where PRs are welcomed.

On the bad news front, the code isn't even close to Xcode 11 ready:

I was going to take a crack at it. I'm fairly good at Objective-C. However, I can't even get Adium to compile with the newest Xcode. What a mess. File encoding issues galore.

So it seems like this may not be an easy fix, but I'll keep looking, and if I get some time, Maybe I'll dive in.

UPDATE: We have a solution... it's in the Javascript for the rendering of the window, and it's in two places:

  • /Applications/Adium.app/Contents/Resources/Template.html
  • ~/Library/Application Support/Adium 2.0/Message Styles/
    Colloquy.AdiumMessageStyle/template.html

where both might have to change these functions:

  // Auto-scroll to bottom.  Use nearBottom to determine if a scrollToBottom
  // is desired.
  function nearBottom() {
    //return ( document.body.scrollTop >= ( document.body.offsetHeight - 
    //                                      ( window.innerHeight * 1.2 ) ) );
    return 1;
  }
  function scrollToBottom() {
    window.scrollTo(0, document.body.scrollHeight);
    //document.body.scrollTop = document.body.offsetHeight;
  }

If you just fix the one in the app bundle, that's not enough, but you have to fix him. And then you need to fix the one in the Message Style as that's the one that's actually used. Once both are updated to working code, a restart of the app gets the scrolling back into action! 🙂