More Concentration

I recently recreated my Concentration game in Angular, to have a current example of what I can do (It’s worked). I’ve had some time to polish it, so I’ve just pushed up a new version.

I recently had to do a take-home coding challenge, and one of the things they mentioned was adherence to the Angular style guide. I figured it was best to re-read it before starting, and one of the things it mentioned was that computational code was better off in a service rather than a component. Well duh. I immediately realized that one of the things I’d done when I ported the jQuery version over to Angular was to carry over all the code to generate the puzzles and trilon data into the ConcentrationComponent. I’d even noticed that the component was bigger than I’d like it to be, and then shrugged and moved on. Of course, that code should be in a service.

Moving that code to a new PuzzleService meant that the ConcentrationComponent got a lot smaller. It also means that if I ever decide to move that code to the server, which it would need to be to have two players playing remotely, that the ConcentrationComponent is in much better shape to receive the data.

I was finishing up the service and the unit test changes needed, when I idly remembered that I’d intended to add the sound of the trilons spinning to the original game. I didn’t pursue it very far then, because I couldn’t find a clean sound sample. I decided to see if I could pull one off YouTube from the original show. There aren’t many episodes of the original show online, and the sound was not very clean, but I did find a copy of one of the syndicated shows with Jack Narz that I was able to get a clean clip from. A little online searching, and I figured out how to tie it into the game. Win!

Except, that you really can’t add sound to a web page without giving the user a way to turn it off, especially a sound like the sound of a trilon turning. This meant I had to add a user interface to control the sound. And then I got thinking…

I’ve always liked the basic design of the original game board, with light colored borders, and a central, darker rectangle with light colored numbers.

Original Concentration board

When the 1970’s syndicated version came out, the board got a garish new look:

Syndicated game board. Classic Concentration kept this color scheme, replacing the mechanical board with a computer generated one of 25 pieces

I just hated this look, and from the start, I decided my game would have a version of the original look.

And yet, since I was adding a preference for the sound, how hard would it be to add a preference to use this color scheme? Not very, it turns out, and with the power of Cascading Style Sheets (CSS), I could even have a cool transition between looks.

One thing I did pick up from the syndicated version was the colored puzzles. The original producer, Norm Blumenthal, refused to add color, as he felt it would make the puzzles too easy to guess, incurring displeasure from the network, which wanted to convert all its shows to color. He ended up compromising, making the puzzles pink on maroon. Personally, I think he was wrong — color can be used to misdirect as easily as it can give a puzzle away. When the show moved to Hollywood, the new producers had no compunctions about making the puzzles in color, and that’s how I’ve made my puzzles.

But then I got to thinking… CSS now has filters that can be used to alter the appearance of background images. If I combined a grayscale filter with an invert filter, maybe my color puzzles would look like the original Blumenthal style. I tried it, it’s not perfect, but it’s a decent approximation, so I added an option for that.

Adding options is good, but what’s the point of having options if you have to set them every time? (This is how “scope creep” happens, boys and girls). I added a LocalStorageService so that the user’s choices would be preserved, and a reset button to restore defaults.

There is also one more puzzle.

So what was intended to be an internal rewrite ended up being much bigger, adding the ability to play the sound of the trilons turning, and the ability to change how the puzzles and numbers look.

Take a look, and if you are so inclined, take a look at the source.

Damned Mice

I got a custom Corbin saddle for the FJR in August. Overall, it’s been comfortable, and lowers the riding position so that I feel safer with it, but I’ve also noticed my back hurts. This is not necessarily new, but I decided to put the stock seat back on, and check it out.

When I did, I found the under-seat area was filled with pink fiberglass insulation taken from an old roll that’s been in the garage for decades. Clearly, mice have found the bike.

Mouse nest

Worse, they’d found the insulation on the wiring harnesses tasty, and had stripped the insulation off.

Bare wires

So now, I have some free time, and the peak foliage season, and I don’t dare use the bike because the electrical system is likely to short out if the wires happen to touch.

About the only good thing about the situation is that I discovered it in the driveway instead of being stranded someplace. I’m enough of a believer in Murphy’s Law to know I’ve dodged a bullet, but the shop can’t even look at it for a couple of weeks, and who knows what they’ll find then. I’m hoping the wiring harness is orderable as a unit, and can simply be replaced completely.


During my job search in 2014, I dusted off my old Concentration game, and polished it up, and came up with a nice version with spinning trilons. I wrote it in Javascript and jQuery, and it helped me get the appScatter job.

A couple of years ago, while I was interviewing for Andela, Tom offhandedly asked me if I had any code samples they could look at. I said it was old, but I’d send them the link to the Concentration game repo. When I looked at the repo, I cringed — front end development has changed a lot in the past couple of years, and the Javascript code was very old school. A promise is a promise, though, so I sent off the link to the repo, and asked them not to look at the syntax itself, but the code organization and program logic. I was really afraid I’d shot myself in the foot.

I, and the rest of my team were laid off at the beginning of September, and I was determined not to repeat the mistake, so I decided to re-implement the game in Angular, to demonstrate what I can do. Along the way, I also rectified the major issues with the original:

  • The original was not responsive, and not really playable on mobile. Although I planned to, I never did fix this on the original, because I never could figure out how to preserve the look of the scoreboard and figure out a place to put it. In this version, I solved it by making the scoreboards variable height, and stacking them vertically underneath the puzzle, on mobile.
  • The way the original code was organized, I could never solve what I called the “Double-wild” problem. It’s rare, but it’s possible to match the two Wild Cards with each other. On the show, this is handled by letting the player pick two more numbers for two more prizes. It’s rare, but I ran into this an annoying number of times with the original version, which treated the Wild Cards as just another prize. The new version now handles this during the number-click handler.
  • It’s also possible for a player to match the same prize twice via Wild Cards. On the show, this was handled by showing a checkmark next to the prize if two had been won; on the original version, I simply showed two copies of the prize in the scoreboard. The scoreboard now recognizes duplicates.
  • The original version did not recognize retina screens. The new version does; I’ve re-created the puzzles, and now there is a high res version of each puzzle. There are also two new puzzles.
  • There were no unit tests on the original, this version has complete coverage.
  • I also added an animation as prizes are added to the scoreboard that pleases me no end.

At first glance, the new version looks the same as its predecessor, but it’s very much changed. I did start with the original styles and basic HTML, but the code layout is very different. The original consists of one HTML file, one stylesheet, and one Javascript file. The new version has one main component, the ConcentrationComponent, which handles the work of randomizing the puzzles and prizes, handling clicks on numbers, and recognizing and handling matches.

I’ve offloaded other parts of the game to subcomponents, though. There is one component to handle entering the player names, or choosing to play single handed, another to lay out the solution form, a dedicated component for the trilons that comprise the game board, and a separate component for the scoreboard, which handles the complexities of showing the prizes won and dealing with Takes and Forfeits.

It’s been interesting comparing the differences in approaches between the two versions. A lot of the game board in the original was generated in code, via direct DOM (Document Object Model) accesses. In this version I created HTML templates, and let Angular deal with creating multiple trilons, or iterating over the set of prizes in the score board.

One problem I ran into when I pushed the game up to the website was that the links to the images didn’t work. The original is in a subfolder of the site. I was able to get the new game working by changing the base href of the html file, but the images still didn’t work. I’ll have to figure this out, but I decided to set up a subdomain, which is probably easier to remember anyway. You can find the game at Give it a whirl, and if you’re so inclined, take a look at the code.

Ten Years of

Ten years ago, I was sufficiently worried about my job that I decided I needed to have my own web site. I”‘m a developer, I should have a site”. About what, I really didn’t think much about; I figured I would post items about web development, but the main point was to have a site with my own design and my own CSS.

It took me a while to get going. I procrastinated for a while, and then it took me a while to settle on a hosting company. I didn’t trust any of the hosting reviews, as they were either complete raves, or complete rants. I ended up at DreamHost, and I have to say, I haven’t had any serious problems over the past 10 years.

Once I’d decided, it took me a couple more days to bring myself to pull the trigger, and I finally signed up and registered, and on August 11, 2011, which was a Thursday. I set up to be hosted, and set up the other two domains to redirect to The domains became live on the internet the next day with a parked site, and I spent Friday night playing with the features of the DreamHost control panel — configuring things, and setting up email addresses. (One thing I love about having my own domain is that I can set up multiple addresses I can control).

I knew I wanted to use WordPress, and I knew I wanted to set up my own theme. On Saturday morning, I downloaded WordPress, and uploaded it to the site, and set it up. Then I signed into the WordPress admin for the site for the first time, played with some of the configuration options, and dashed off my first post.

It took me a couple of months to make it look the way I wanted it to look. It turned out I liked the big banner image at the top of the page, and it turned out it was easier to create a child theme of one of the existing themes than it was to build out my own theme from scratch. I settled on a font I like, and a color scheme I like, and deployed it New Years Eve of 2011, and haven’t really wanted to change it since. I know I probably should, but I still like the way it looks, and I occasionally still tinker with it; for example, at the beginning of this year, I made the theme responsive, and I have a set of Christmas overrides that I enable around the beginning of December.

In terms of content, it’s kind of become whatever I feel like talking about, when I have something to talk about, and have the time to write. I kind of lost interest in writing about web development a while ago — the last thing I got excited about was a post about AngularJS Promises that never came to fruition It’s mostly evolved to social commentary, like my last post, and photography.

I do like rereading my old stuff, and I do have my favorites. I discovered pretty early on that I liked chronicling my vacations, especially my trips to Bonaire. Blogging on vacation takes a little bit of discipline — I need to set aside time to quickly review the pictures I’ve taken during the day, pick a couple that I can color correct and edit easily, and then write up the day. By the end of the week, I find myself kind of bleary-eyed, posting after a day of diving and then going out for dinner, but I’ve found I really like these posts, and people tell me they like them too. Then, once I get back, I process all the pictures, and post photos from each day of the trip. It takes a lot of time, but I am so glad I did it — It’s fun on a cold winter’s day to look at past trips.

Of the personal posts, I think “Hard to Believe, But Not Hard to Believe“, about the 35th anniversary of my father’s death, is the first one that comes to mind. Not only is the subject matter important to me, but I think the writing is good too. There is a rhythm to it that I was striving for, and I think I achieved.

Of the social commentary — depending on my mood or positivity, I post them under either “Thoughts” or “Grumbles” (or both) — there are several that please me:

  • I Expect My Leaders to be Grownups, about the Supreme Court nomination, actually got a little bit of traction; I at-replied to Marco Arment on Twitter with a link to it, and he retweeted it to his 100,000 followers. I remember being nervous about posting it and tagging him on it, but I got an overwhelmingly positive response.
  • The two posts about the 2016 election, “How Did We Get Here” and “So Trump“. I think my analysis of how we got there is correct, and unfortunately, Trump turned out to be much worse than I anticipated, because he did not believe in the rule of law.
  • The posts about my Christmas Cards. I’ve long had a personal tradition of creating my own Christmas cards, and in 2013, I started writing about them. I still think both the 2013 card and the post about it was the best.
  • The Perfect Tree, about the quest for a perfect Christmas Tree

Of course, I don’t always succeed. It seemed for a while I was writing, but not quite making the point I wanted, or not writing with the kind of voice I want. I think my biggest recent whiff is the piece about the January 6 riot at the Capitol, “This is why you teach history” I think the post kind of meanders, and never fully makes the point I wanted, which is that an informed, well-taught electorate wouldn’t fall for the kind of candidate who would lead them to insurrection.

I never have been able to keep to a regular posting schedule. Up until Mum’s first stroke, I always aimed for at least one post a month, but it’s been hard to keep up with that. It’s easier when I’m doing stuff that gives me something to write about, like a vacation or trip to London. I’m noticeably more active in the summer, as I (used to) dive then, and take pictures. I’d like to get back to that, sometime, but I have very little time for myself now. But I do still like having my own website, and having a place of my own that I can post my pictures or say what I want, and have it be mine, not some social media platform, even if no one other than family is reading it. And so, I couldn’t let this tenth anniversary pass.

The Tyranny of the Stupid

I think the single most upsetting thing about the pandemic is the sheer amount of stupid running rampant in the country. This country, that once sent men to the moon six times and out-fought and out-manufactured the Axis powers in World War II, has fallen prey to nitwits and charlatans who won’t take the science of the situation seriously.

These folks are so adamant about asserting their personal freedoms that they forget that with freedom comes responsibility, including the responsibility to choose to do the right thing, both to protect themselves, and others. You may have the right to be stupid, but you shouldn’t choose to be, and your right to be stupid ends where it affects my freedoms.

Last year, because we were stupid, we let let the pandemic get out of hand. Because the stupid would not refrain from gathering, and refused to wear masks, the virus spread further than it should have.

Last Thanksgiving and Christmas, because people were too stupid and too selfish to give up the gratification of holiday fun, the virus spiked, and people died. Needlessly.

Now we have vaccines that are highly effective, free, and widely available. And yet people still won’t take them. Because people are stupid, the virus is spiking again, and people are dying again. And for no good reason. While the vaccines are not completely risk-free, the odds of having a problem are exceedingly low. Millions of doses have been given out; the number of people who have had serious complications from the virus is around a couple hundred,

Because people are stupid, COVID restrictions will be coming back, even for those of us who have been vaccinated. Because people are stupid, there is more COVID around, and the odds of vaccinated people getting a breakthrough infection are higher. It won’t send us to the hospital or kill us like it would an unvaccinated person, but it’s still needlessly unpleasant. And of course, it can kill the unvaccinated. But because people are stupid, mask mandates will be coming back for sure, and if that doesn’t work, authorities will have to decide whether to implement further restrictions to protect people who are too stupid to protect themselves.

Because people are stupid, medical people, who have been dealing with crushing workloads and the emotional burden of dealing with comforting dying people, are dealing with a new load, this time, more or less self-inflicted,

Because people are stupid, we are having get used to there being a spike in cases in the two weeks following each holiday.

I’m not asking for the government to require vaccines. But I wish people would freely choose to do the smart thing.

Brown Paper Bags

I had to go grocery shopping in a different supermarket than I usually do the other night. For the first time in a long time, my groceries were in brown paper bags rather than plastic, and it took me back to my childhood.

Growing up, I was a big fan of both Lost In Space, and to a lesser extent, Star Trek. (Until it went into syndication, Star Trek was normally on too late for me). Inspired by these TV shows, we used to play “Space Ship”, where we would pretend to be on a futuristic space ship. Of course, a space ship needs control panels, and I would create them, drawing them on, you guessed it, brown paper grocery bags.

Grocery bags had the advantage of being free, were fairly large and, when folded, were relatively stiff. I did several iterations of control panels, as the panels would mysteriously disappear after a while. My panels were heavily inspired by Lost In Space — I distinctly remember drawing the panels of blinking lights — in reality, displays from a Burroughs B205 computer that 20th Century Fox was able to get ahold of — but as time went on, I started to use my own imagination and try to figure out what kind of functions I would want to control — environment for one, navigation for another and came up with UIs for them. I can’t say they were good UIs, but in a way, they helped foster in my interest in user interfaces.

Looking back, I also think it was a wonderful form of unstructured play, on several counts. First, of course, was the creative aspect of creating the control panels. While derived from what I saw on TV, I improvised on what I saw. There was a fair amount of lettering on them, and I think I tried to use something that looked like it belonged on a control panel, rather than simple printing, which helped foster my interest in typography.

Then there were the “Space ship” sessions themselves. I would typically be playing with my sister or sisters, and a couple of kids from the neighborhood. Totally unstructured, totally undirected, we made the rules ourselves, and as long as we didn’t fight with each other or get too loud, my mother really didn’t interfere, aside from sending the neighbors home when it was time.

It bothers me to see how structured the lives of kids are nowadays. They’re involved in many more activities that I was, and I assume at least some of them are fun, but they’re all scheduled, and they’re mostly directed by adults. They don’t get to have unstructured time in many cases, and when they do, some of them don’t know what to do with it. I think kids need to have unstructured, undirected time to create their own games.

They could do worse than grabbing some crayons, some recycled brown paper bags, and creating their own worlds to play in.

Island of Misfit Toys

It dawned on me yesterday that I’ve become an Island of Misfit Toys, at least as far as cameras are concerned. I now have custody of a bunch of expensive cameras that need repairs costing more than the cameras are worth, but because the camera was originally an expensive item, I can’t bring myself to throw them out.

It first started with the Canon S70 point and shoot. I started underwater photography with a series of Canon Powershot S60s that were either flooded or stolen; when the last one was stolen in Bonaire, I decided to buy an S70 off eBay, as it used the same housing as the S60. It was satisfactory for a couple of years, and then developed focus problems, so I set it aside, and replaced it with a Canon G12 underwater. The housing and camera are sitting in a drawer somewhere. It just doesn’t feel right to just toss an expensive camera like that.

My first digital SLR was a Nikon D80. I got it because I’d become accustomed to digital photography but was bumping up against the limits of the point-and-shoot S60. I used that camera with considerable happiness for about 10 years, until it stopped working in Leicester Square during my first trip to London. I tried a variety of things to reset it, but it eventually became clear that it needed about $200 worth of repairs. This didn’t make sense to me on a 10 year old body, so I got a new Nikon D7500. The D80 is still sitting in a corner somewhere. It just doesn’t feel right to toss a camera that could be repaired, and would be a cheap way for someone to get into Nikon DSLRs

Yesterday, I’d taken my inline skates out of the closet to install a new brake pad, and realized I should clean it up before putting the skates back. I found an old portable typewriter, which mostly worked, but needed a new ribbon, and had some sticky keys. I also found my original pair of rollerblades, plus my motorcycle tank bag, the mounting straps for which were still on the Katana when I sold it. Those went into the trash.

I also found Dad’s old folding Zeiss Ikon folding rangefinder camera. It’s a medium format camera that folds up flat. Dad was really proud of it. I noticed when I tried using it that the shutter was stuck open. It just doesn’t seem right to toss a camera like this, that a camera collector might want.

Hanging from hooks along the sides of the closet are a pair of Polaroid cameras. One was for the type of film pack that you peel apart, one is a first generation SX-70 that I think my Uncle John gave to my father. Dad loved both cameras, and I remember being fascinated by the SX-70, a folding SLR camera whose pictures developed right before your eyes. I don’t know if these cameras still work; I don’t have any film for them. It doesn’t seem right to just toss them, though.

And finally, I found my old camera bag on the bottom of the closet. I had a complete Pentax K-mount system before I started using digital. My first was a Pentax K-1000 which I got as a college graduation present. All manual, but with a built in light meter, it was a big step up over Dad’s rangefinder 35mm camera – interchangeable lenses, and the ability to measure the exposure, rather than guess at it. The camera came with 50mm and a 135mm telephoto which was great for portraits, and a flash, so I was no longer dependent on having to shoot existing light, and I later expanded my system to include 28-85mm and 70-210mm zoom lenses. Once I had the lenses, I shifted to an LX body which had auto exposure, depth of field preview and a lot of other niceties.

When I looked at them yesterday, I found that the mirror on the K-1000 was locked up. I was surprised. It’s an all mechanical camera, and built like a tank. It was also a stripped down model, so it was a great camera to learn the nuts and bolts of photography with. I was reading that last night that jarring the camera might free the lens, but if that doesn’t work, I don’t know what to do. It’s obsolete, but such a great learning camera, I’d rather not toss it.

The 28-85 zoom lens still seems to be working, but I noticed a while back that the Sigma 70-210 zoom seems to have leaked lubricant all over the barrel.

At least the LX seems to be working at least to an extent. The batteries are dead at the moment, but I suspect that they could be replaced. The shutter is manual though, and it does work through its upper range. But will I ever use film when I’ve grown so accustomed to digital? And I’ve had to repair it once because the focus had shifted — does it need repairs again? It seems a sin just to toss it though.

The trouble is that none of these are junky cameras. They all are, or were, high quality prosumer quality cameras, that all happen to be out of order. With the exception of the Powershot S70, they could probably all be repaired, or serve as a source of parts, or be of interest to a collector, but getting rid of them is a fair amount of work, either to sell them, or have them repaired. Tossing them seems wrong somehow, and so they sit, my personal island of misfit cameras.

This is Why You Teach History

Back when we could get together, one of the things we would do as a family is play a game called “Salad Bowl”. It’s a group game; each person writes the names of 10 people, real or fictional, living or dead, onto slips of paper, folds them up, and drops them into a salad bowl. Then you divide into teams. Each round, one person from each team draws slips from the bowl, and try to provide clues to their teammates so they can guess each name. The team that’s able to guess the most names wins. If you know who the person is, it’s a lot easier to give clues than if you don’t. Part of the strategy of the game is picking names that your teammates will know, but will stump your opponents.

We were playing a few years back, and I decided to throw “George III” into the bowl. I frankly figured it would be a gimme – who doesn’t know the British king the American colonies rebelled against during the American Revolution?

My nephew, that’s who. At that point, he was a high school senior, and had no idea who George III, and wound up using my brother’s middle name as a clue. Apparently they teach social studies at his school, not history.

History does repeat itself. It repeats itself because we’re human, and human nature doesn’t change. And this is why I was leery of Donald Trump even in 2016. in “How Did We Get Here“, I wrote, “Trump really worries me. I do see the parallels to the rise of Nazism in Germany in his campaign.” The demonization of an outside group, in this case, Muslims and immigrants, the creation of a cult of personality, the appeal to nationalism; these are all parts of the Nazi playbook.

Right after the 2016 election, I was hopeful that Trump would tone things down, and recognize the rule of law. He didn’t. He doubled down on the incendiary rhetoric.

And finally, came the 2020 election. I don’t think everyone who voted against him disagreed with his more mainstream positions. I think there were a fair number of conservative people, like John McCain’s widow, who held their noses and voted against Trump, because they perceived that he was a threat to our democracy. If you had learned about the rise of the Nazis in 1930s Germany, it was pretty easy to see the parallels.

And so it proved to be. He continued to spout lies about the election, and I think a fair part of the populace, disarmed by a lack of historical knowledge, bought them. If you didn’t have the historical grounding to see through it, if your only grounding in civics is social media, it was easy to be duped. And this is how the assault on the Capitol happened.

I don’t know how this will play out. The night of the riot, there was clearly a sense of norms having been breached. Twitter has cut Trump off, as have other social media outlets. There were a lot of everyday people in postwar Germany who had to live with the fact that they had been casual Nazis, and were horrified once they saw what they ultimate conclusion of that was. I hope that’s what happens here – that the scales fall from the eyes of the Trump supporters, and they see what a petty, narcissistic, possibly even delusional man he is. But I’m not confident. We had a really close shave this time. Will our institutions withstand the next assault on them?

It’s up to us.

The Christmas That Isn’t

It’s Christmastime… but it isn’t. Not with COVID it isn’t.

Normally we would have a big family get-together Christmas Eve. Not this year. Last year, we weren’t able to, with Mum in rehab for her strokes. I was really hoping at the beginning of the year that we could have our get-together again this year. Nope. We’re going to have to content ourselves with video calls this year. Hopefully, we’ll be able to do it in 2021.

We’ve gone up to Rockport most years for the past several years, to shop the stores on Bearskin Neck, and see the decorations. Mum was very fond of the Christmas pageant, because it was a re-enactment of the Nativity. Even if we wanted to take the risk, it’s just not feasible this year.

I’ve gone Christmas shopping every year since I was in college. This year, I ordered a couple of things off Amazon, and that was it. (To be fair, most of this is due to the fact that none of the nephews and nieces are little anymore, and most of my siblings agreed long ago not to do packages.

I wasn’t sure I even wanted to do a tree this year. I’m frankly not feeling it much this year, and I was concerned about laying out the living room — Mum now spends most of the day in her chair in the living room, and whatever I did, I would need to ensure that there was room for the chair and room for her to maneuver with the walker.

Most years, I like to make an occasion of putting up the tree, but not this year. I was also aware that I’d be doing most of the work of putting it up and taking it down. In the end, Mum wanted one, and I realized I did too, so I picked up a relatively narrow tree.

As it happened, there was a gash in the bark about 4 inches from the bottom. We had this a couple of years ago, and ended up with a tree that dried out pretty rapidly, so this year, I made a new cut above the gash, and cut off the lower branches. This had the benefit of making the tree smaller overall — both narrower, and shorter. I was able to use two fewer strings of lights. This meant I was able to skip the older LED lights I’ve been using for the past couple of years. My first set of LED lights were too blue for my taste; eventually, I found a couple of strings of warmer colored LED lights that I like much better. With only the warm LEDs and one string of mini-incandescent lights, this year’s tree is much more pleasing to me. And I was able to fit the angel on the top easily for the first time this year.

Christmas tree and Mum
Christmas tree and Mum

Even though it’s smaller, it’s still a pretty nice tree. And there’s still room for Mum next to it.