on haystacks

October 9, 2019 @ 13:10

Go doesn't have a built-in function for finding an object in a list. I found this in some code at work:

// Checks whether an element exists in a slice of integers
func contains(haystack []int, needle int) bool {
 for _, n := range haystack {
  if needle == n {
   return true
  }
 }
 return false
}

I'm quite amused.

Testing Hugo

August 23, 2019 @ 22:56

Right so, does this work?

I'm using Hugo now. It's been... a bit of work. But the whole thing renders in 1.4 seconds, as opposed to the old Jekyll site which took 22.

While I was at this, I did some more moderninzing.

Little changes:

  • Post timestamps changed
  • Posts are now using the HTML <article> element, complete with the <header>, <main>, and <footer> sections.
  • Navigation bar uses the HTML <nav> element
  • Tag list now uses <ul> and <li>
  • I've changed to using the CSS ::after pseudo-element to put the bracketry around the menu items and the items in tag lists. Why? It sure makes the HTML look cleaner.
  • Many pages which used files ending in .html no longer do, I guess this is what Hugo calls "pretty" URLs. Sure, why not.

Bug fixes:

  • The first month in the archive sections is not duplicated like the Jekyll site did
  • The main image in the gallery isn't pushed up into the menu

To do still:

  • Make the gallery's filmstrip scroll to keep the current selection visible - good idea Rachyl!

New Year's Mead

May 5, 2019 @ 17:45

In September, Rachyl and I made some mead:

10lb Wegman's clover honey
3lb Northern brewer basswood honey
1lb bee folks Butterbean honey
3 gal water
1 packet Lavin D47 yeast

Original gravity was 29.8 brix. The weird honey bill is mostly because it's what we had around, and could get really quickly. Same for the yeast - never used it before, we just went to the local shop and asked for whatever they had. My preference is usually Wyeast 4632.

Today we tested (and tasted!) it, 17 brix. So about 11.45% ABV. Not bad! I think it's a little on the sweet side for me, I tend to like them a little drier, but it's very drinkable, and so we'll be bottling it soon, with plenty of time before Rosh Hashana.

Note that I have not figured you my refractometer's wort correction factor, so my measurements can only be assumed to be "pretty close"

NYP to WAS: a commuter's guide

October 19, 2018 @ 18:59

So you're heading on a trip from NYC to Washington D.C. via train? Great! Here are some guidelines.

While in New York

  • When walking down the street on your way to Penn Station, (ostensibly pulling your rolling luggage behind you), don't forget to make random direction changes and stops - you don't want the people behind you to know where you're headed.
  • If you are traveling with companions, feel free to walk side-by-side - the streets are often wide enough for several people to stroll casually.
  • You may have noticed that your rolling luggage can be used to ensure a sufficient amount of space between you and other pedestrians. Don't hesitate to enhance this effect.
  • While standing at the edge of a curb, waiting to cross a street, you may notice people crossing the street perpendicular to you, coming towards you in their attempts to achieve the safety of the curb. Pay these people no mind - they'll certainly go around you.

At Penn Station and On the Train

  • If you're riding Amtrak's Northeast Regional train, the quiet car is the second from the back. Definitely sit in this car. Be sure to ignore the signs posted at the doors and at several locations hanging from the ceiling reminding you that it is, in fact, the quiet car.
  • The train may not be sold out, so don't forget to take up two seats. When someone asks you to move, assuming (almost certainly correctly) that you have not actually paid for two, make sure that you let them know just how inconvenient they have just made things for you. But don't use words.
  • When one of the other passengers on the quiet car reminds you that it is, in fact, the quiet car, comment to your friend, "Oh, I'm sure that doesn't apply to us."
  • The quiet car does not allow mobile phone usage - should you need to accept an incoming call, answer the call, and inform the caller that they will need to wait a moment while you step into the next car. Be sure to do this with a clear, loud voice - some areas of the Northeast Corridor have poor cellphone coverage, and you wouldn't want your caller to misunderstand you.
  • When getting ready to leave, make sure you stand in the aisle and talk loudly with your companion. I mean, everyone else is getting off at your stop, right?
  • Also while you're standing there having this conversation, be sure to ignore other passengers who want to retrieve their belongings from the overhead so they too can pack up in anticipation of debarkation.

In Washington, D.C.

Now that you've arrived at Washington Union Station, there are a few more guidelines:

  • Escalators have enough room for you to stand beside your rolling luggage. You may notice people who appear to be in a hurry trying to pass on your left - similar to the train seating issue above, be sure to properly convey how much of an inconvenience this is.
  • When you arrive at the top of the stairs or escalator, you will have to extend the handle of your wheeled luggage. The best place to perform task this is immediately at the top of the stairs. Don't worry, everyone else will be happy to wait for you to finish.

Yes, all of these things have happened, most of them today.

command-line search language

August 10, 2018 @ 09:22

At work, I've built a command-line client program for a number of microservices, which mostly do CRUD operations. I am looking to add search capabilities, but this is not as easy a task as I'd thought.

Possibilites

Let's call this client program boxer, because that's what it's actually named.

So using boxer, one can query a service to return an item in a database. Let's call this a thingy (not what it's really called). Getting a thingy is simple:

boxer get thingy [thing name]

And if we want a list of thingies:

boxer list thingies

With me so far? This is easy stuff. But what if we want to filter that list of thingies? Maybe it looks like this:

boxer list thingies where name = 'monkey'
boxer list thingies where name = 'goat' and version = 1

That's a little SQL-like. Or maybe it looks like this:

boxer list thingies --name 'monkey'
boxer list thingies --name 'goat' --version 1

But then the client program would have to know the structure of the data at the time it builds the argument parser - this is either really difficult, or involves querying the API for information. Probably not worth doing.

Or if there isn't a whole lot of data, the list call could return everything as JSON, and we could filter it using jq:

boxer list thingies | jq '.|(select(.name=="monkey"))'

This of course gets messy, and when you have a LOT of data, it's expensive to fetch ALL of it each time you only want a subset. Better to do the filtering at the back-end.

Common searches

Some things I figure people will commonly search for:

  • string 'like' or pattern in a string
  • item with an integer field max, as in "the thingy with the highest version"
  • item with the most recent date

Prior Art

I've been searching for any sort of "standard" for doing this, but so far I've come up empty. Lots of programs do this kind of thing, but it seems that everyone just re-invents the wheel each time, and there's no consistency.

So I'd be interested in ideas here :)

Taxi Maintenance Again

July 10, 2018 @ 00:02

So I've been meaning to replace the old battery-backed RAM in my Taxi pinball machine for a while, and so when I had nothing better to do on Sunday, I started poking around to figure out what I needed.

Got that ordered, and since I was on a roll, I replaced a bunch of bulbs that were out.

And then I started testing the power supply power...

At this point I was making a day of it.

We've been here before

I the process of figuring out what I've got, I realized that Williams actually labeled all of the circuit boards with a serial number, and the model number of the game it was intended for (or at least, came from).

Taxi is #553.

However, my main board is labeled 567 - Jokerz!. So is the power supply board. But the "auxilliary power board" is labeled 568 - Earthshaker.

All of this means that my machine has been through an extensive refurb before.

I checked IPSND too - nobody else registered the serial numbers.

And here too

Today, I started investigating why the "spin-out" launcher ramp wasn't working as well as it used to. I think it's because the launcher makes contact too high on the ball, but I haven't really finished the investigation yet.

One suggestion was to make sure the switch that registers a rotation around the spin-out bowl is just barely resistant, so it doesn't slow the ball down... and while taking the assembly out, I found a major part of the issue is a crack in the plastic.

But then, when I took the entire assembly out, I found more evidence of a previous refurb - someone "fixed" this by applying metal duct tape to the underside of the spinner, to keep the cracked chunk in place.

Curiouser and curiouser.

To Do List

So here's the next few steps:

Replace RAM with NVRAM

Who wants their high scores to disappear when shutting the machine off? Who wants to have to setup all the system settings ever time you turn the machine on?

Or more importantly, who wants leaky AA batteries ruining your main board?

Full details #1

Replace TIP-42 transistors in lighting matrix

I've already had issues with circuitry overheating - I bought the machine with serious damage to the interconnect board (J6 of course), so this task seems pretty simple and good for longevity.

You replace all the TIP-42 transistors and their 27-ohm current limiting resistors with much cooler MOSFETs (I ordered the IRF9530).

Full details #2

Replace power supply ZR2 and ZR4 with 91V diodes

The display takes 100V normally, but if you replace the 1N4764A zener diodes in the power supply with 1N4763A, it then runs at 91V, and it'll last a lot longer.

Easy stuff.

Full details #3

Replace capacitors in power supply

Caps get old. I used to repair engine control units in DSM cars, because when caps get old, they leak. $23, no brainer.

Also I think my big 18,000 mfd filtering capacitor is going.

Replace single bulb to right of "CAB" lanes

Unfortunately, I'll have to remove the express lanes to get to this one.

Finish fixing "spin-out" issues

I'm not sure if this is a level issue, or the playfield has sagged a bit, or if the appears-misaligned launcher is the issue - it could just be I need a new spin-out assembly.

What I have already done

Since I'm typing this up, here's what I've already done over the past over 15 years (I bought it in about 2002), roughly in order:

  • Rewired incorrectly wired flipper
  • Replaced flipper coils, switches, EoS switches
  • Replaced burned out GI connector (J6), jumped blown-off solder traces
  • Cleaned corroded battery residue
  • Replaced balls
  • Replaced entire left flipper assembly
  • Replaced launcher sleeve and spring
  • Replaced not-original Lola ROM with proper Marylin ROM
  • Replaced many, many bulbs
  • Replaced all rubbers
  • Replaced broken plastics:
    • Marylin "lights carry passengers"
    • Both slingshot
    • Side "lights carry passengers"
  • Properly secure knocker assembly
[RSS]