I play D&D. There are a thousand initiative trackers out there. Here’s one I invented recently.

First, each player picks a Meeple to be their character’s mini.

Four PCs on a wagon move over swampy terrain.
Four PCs on a wagon move over swampy terrain.

Quick, roll initiative! The players all roll, and so do the enemies. We grab a second meeple for each player, as well as second token for each enemy. This becomes the initiative tracker.

This is the initiative order. It’s currently the red meeple hero’s turn. Next up will be the blue meeple hero, then the black cube enemy, and so on.

HACK (noun)

  1. a rough cut, blow, or stroke. (the work was accomplished one hack at a time)
  2. a quick job that produces what is needed, but not well (this code is a hack, but it works!)

Hack-A-Day is challenge to make complete one new project, from scratch, every day in November 2023.

Last year (2022), I set myself the challenge to make a software project every day, and met it. I had a ton of fun, and make a lot of cool video games and projects I can show off. This year I’m inviting the rest of the world to join me!

I’m a programmer, so I’m doing a new computer programming project every day. But you can do any kind of project, whatever you pick is great.

READ MORE

I will post again nearer to November! Just giving blog readers an advance heads-up.

I wrote a small scheme interpreter in C.

I’ve been pondering simple input methods for microcontrollers. One obvious idea is, a keyboard! But for some reason, my USB keyboards use a staggering amount of power compared to my microcontrollers–1W of power for my mechanical keyboards, maybe 0.1W for the regular ones.

Let’s look inside a commercial keyboard, and see if we can hook up to it:

a photograph of the interior of a commercial keyboard. there is a PCB, with two layers of flexible conductor on top, all clamped down

Yikes. What’s going on? Well, let’s make our own little keyboard, and explore what’s going on. We’ll build it in three layers, or “index cards”:

The bottom layer has 6 vertical stripes. The top layer has 3 horizontal stripes. Each place they cross will be a “key” you can press.

In between them, we add a spacer layer (punched holes) so they keys are “up” by default, and you have to press them to make them connect.

This picture might help explain how they will go together:

Now we assemble:

The final keyboard has 6 x 3 = 18 “keys”. We write the hex digits plus a couple extra keys with marker.

If I attach alligator clips to the second horizontal screw terminal, and fourth vertical screw terminals, and wire a battery and buzzer with the terminals, I get a connection beep only when I press the key “A”:

Two terminals with alligator clips attached to row and column terminals, and a screwdriver pointing at the "A" key addressed.

In a real computer, we obviously can’t just move alligator clips around. Instead, we attach wires to all 9 posts–three outputs wires for the horizontal lines, and six inputs for the vertical lines. We output a signal on the first horizontal line, and see if we can read it from any of the six vertical lines inputs. Then we output a signal on the second horizontal line, and see if we can read it, and so on for the third. Assuming only one key is pressed (or none), we can identify the key. This “scanning” process could be done thousands of times a second, rapidly enough that it can’t miss our slowpoke human fingers.

Click to view interactive schematic (credit: Kragen)
Click to view interactive schematic (credit: Kragen)

And this is how most keyboards work. There are some special keys–Shift, Ctrl, Alt, etc might be on their very own line, since we want to detect key combos. And better keyboards can detect multiple keys being pressed at once (N-key rollover), which I think they do by having a completely separate wire to each key which multiple people tell me they do with a diode next to each key.

For the above project, I used:

  • Three index cards
  • A hole punch
  • Scissors
  • A ruler
  • A pen (NOT a pencil, since graphite is conductive)
  • 9 screws, 9 nuts, and 18 washes. I selected #6 American Wire Gauge, which is about 4mm thickness
  • Copper tape

Did this work perfectly? Definitely not.

  • On some keyboards I’ve made, you have to press quite hard.
  • My multimeter takes a while to register a press. I think a microcontroller would be better.
  • You have to attach the terminals carefully. I think what’s going on is that you can actually put the screw exactly through the center of the washer which is actually making contact with the strips, so that only the washer is attached, and the screw doesn’t rub against the washer.
  • It’s of course fairly easy to mis-align anything. This is pretty easy to fix with care. I used the “spacer” grid to draw the centerpoint of the printed letters.
  • The screw heads are a bit thick, so it’s hard to press the keys in the column/row next to the screws. A piece of backing cardboard might fix this.

This was my third attempt. Here’s the second, using aluminium foil. It worked at least as well, maybe better, but it was harder to make. I just taped the foil down, taking care not to cover the contact points. I am told the aluminium will gradually oxidize, making it non-conductive.

And here’s one using graphite from drawing hard with a #2 pencil.. Graphite, it turns out, works terribly, and I couldn’t read a signal halfway down the index card. Despite what people have told me, I’m not yet convinced you can make a conductive wire out of it.

A friend of mine, Kragen Javier Sitaker has been designing something he calls the zorzpad (see link below). I can never remember the name, so as a joke my version became the “zorch pad”. We live on opposite sides of the globe, but we’ve picked up the same or similar hardware, and have been having fun developing the hardware and software together.

The basic idea of the Zorchpad is to have one computer, indefinitely. It should keep working until you die. That means no battery that runs out, and no parts that go bad (and of course, no requirements to “phone home” for the latest update via wifi!). This is not your standard computer, and we’ve been trying a lot of experimental things. One of the main requirements is that everything be very low-power. He picked out the excellent apollo3 processor, which theoretically runs at around 1mW. In general, the zorchpad is made of closed-source hardware.

Since I’ve realized this will be a long project, I’m going to post it piece-by-piece as I make progress. Below is a demo of the display.

The graphics demo shows, in order:

  • a title screen
  • a flashing screen (to show graphics-mode framerate)
  • a demo of font rendering. we’re using the fixed-width font tamsyn.
  • a munching squares animation
  • a demo of how fast “text-mode” updates would be

We’re using a memory-in-pixel LCD. The only manufacturer is Sharp LCD. You have have seen these before in things like the Pebble watch–they’ve very low-power except when you’re updating. This particular screen is quite tiny–240x400px display (which is fine with me), but only 1.39×2.31 inches (35x59mm). The only bigger screen available in this technology is 67x89mm, a bit lower resolution, and out of stock. As soon as it’s in stock I plan to switch to it.

According to the datasheet, the screen consumes 0.05-0.25mW without an update, and perhaps 0.175-0.35mW updating once per second. We haven’t yet measured the real power consumption for any of the components.

The most obvious alternative is e-ink. E-ink has a muuuch slower refresh rate (maybe 1Hz if you hack it), and uses no power when not updating. Unfortunately it uses orders of magnitude more power for an update. Also, you can get much larger e-ink screens. The final zorchpad might have one, both or something else entirely! We’re in an experimentation phase.

Datasheets, a bill of materials, and all source code can be found in my zorchpad repo. Also check out Kragen’s zorzpad repo.

Infocom introduced (AFAIK) the concept of feelies:

[…] Imaginative props and extras tied to the game’s theme—provided copy protection against copyright infringement.[45] Some games were unsolvable without the extra content provided with the boxed game. And because of the cleverness and uniqueness of the feelies, users rarely felt like they were an intrusion or inconvenience, as was the case with most of the other copy-protection schemes of the time.[49] Feelies also provided the player with a physical aspect to the gameplay of their text adventures, giving another dimension of strategy to what would other-wise just be a text parser.

– Wikipedia (Infocom)

I love to give out feelies for my D&D campaigns. Here are some lil handout props I made:

I used a receipt printer, q-tips, tape, and orthodontic rubber bands.

As a programmer, one task I have to do often is estimate how a long a task will take. But as a programmer, most tasks I do have never been done before, and will never be done again, so estimating how long they will take is a little tricky. Here are some tips I’ve learned over the years.

Always use clock time.

Yes, there are interruptions. You need your coffee. You didn’t get around to it that day. You want to know those things in your estimate, too. Just use the time on the clock for when a task starts and ends.

This is especially important if you’re self-employed.

Write down how long you think a task will take. Afterwords, write down how long it took.

This simple step is the most important one. This gives you a clear idea of exactly what a task is and when it’s done. It also starts automatically training your brain.

You’ll start seeing patterns. You consistently underestimate how long everything will take. Conversations take longer than they feel. Exercise takes less time than it feels like. Fixing problems is highly variable. Doing something from scratch is easier to predict.

Play a game. Predict things as well as possible.

Don’t change how you do them. You win if you guess accurately.

Use as few units as possible.

Don’t use minutes, hours, days, weeks, and months. Personally, I try to use minutes and hours for everything. Of course, when I report to my boss, I convert to days, but in my own notes I estimate things in one unit.

Learn your multiplication factor.

How long will it take you to do a project? Well, last time you had a similarly-sized project, you thought it would take 2 hours, and it actually took 14 hours. Your multiplication factor is about 7x. So this time if it feels like a 3 hour task, plan for 21 hours.

Assume there’s only one multiplication factor for one kind of work (one kind of work like your entire job, not one type of task). You can have different ones for different time scales, though (minutes vs hours vs days vs weeks).

You can measure other peoples’ multiplication factor to figure out when they’ll actually be done with tasks, but I suggest doing it quietly and not mentioning it.

Credit: Folk, but credit to Joel on Software for the idea of estimating it for each team member

To estimate a long task, break it up into pieces, and add up the pieces.

Do this if your task takes 2 days or more. Because of the multiplication factor, carefully budget time for added tasks, things you forgot, problems, etc. Or you can skip it. Just consistently pick one.

Credit: Joel on Software, including FogBugz which did this as a statistical method displayed with Gantt Charts.

Train your credible intervals.

Some tasks are more variable. Saying “something will take 1 hour” is vague. Saying “something will almost certainly take between 30 minutes and 4 hours” is more precise. How big should that range be? That’s called a credible interval.

Train your credible intervals. I trained mine using bug fixing, something which happens several times a day, is hard to predict, and you have little control over (you can’t “call it done” early). Customer calls could be another great candidate.

I trained on bugfixes using 50%, 90%, and 99% intervals. There are specific mathematical scoring rules, but basically if something is in your 50% interval more than half the time, narrow it; if your interval is correct less than half the time, widen it.

Credit: Eliezer Yudkowsky (personal website, no longer up)

Contents:

First-aid kit contents, 1x large red bag
Left pocket, survival:
Compass, Small Magnetic
String
Magnesium rod (under compartment) - Use with knife if lighters run out
Misc fasteners and bags (in bag)
Water purification kit. Good for about 3 person-years.
Work gloves

Right pocket, convenience:
    Baby Powder - Prevents chafing. Also consider moleskin.
    Earplugs
    Floss
    Face mask - For smoke or disease.
    Glasses, spare, for Zachary
    Lighter
    Nail clippers
    Petroleum Jelly - Chapped lips, protect wounds, help light tinder.
    Razor
    Sleeping mask
    Toothbrush
    Toothpaste

Center compartment:
    (right) Band-aids/plasters, various sizes - Use to cover small cuts
    (right) Gauze and medicine directions
    (bottom pocket) Grill lighter
    (back) covid-19 test

    Thermometer, mouth
    Tweezers

    Alocane-brand Lidocaine burn relief gel
    Triple Antibiotic Ointment (may not work) - contains bacitracin,
        neomycin, polymyxin. Prefer washing using sanitation bag.
    Hydrocorozone cream - treats itch and rash

    Cotton swabs (in bag) - Clean wound
    Gauze (in moleskin) - Wrap to stop bleeding, or use to clean a wound
    Gauze (loose)
    Moleskin - Patch blisters or prevent them from forming
    Liquid Skin - Superglue. Disinfect small cuts, then brush on to close.
    Q-tips - Clean wound

    Sanitation bag (see below)
    Medicine box (see back)
    Vitamins box (see back)

    Sanitation bag (in center compartment):
        Water - Clean wounds. Slightly soapy. Refill and add campsuds and
            povodone iodine to replenish.
        Campsuds - Concentrated soap.
        Povidone iodine - Use with water to create a sterile cleaning fluid.
            Doesn't work to sanitize water (need 15min+80 drops/gal)
-------------------------
    Medicine box (in center compartment):
        Acetaminophen, 500mg, x20 - Longer white pill labeled 5500.
            Non-NSAID pain medication. Does not reduce fever, only reduces pain
            Use for people on certain medications or for headache.
        Caffine, 200mg, x10 - Medium ycircular yellow pill labeled 44 226.
            Take half with taurine to stay awake. Caffine impairs judgement
        Calcium carbonate, 0.5g, x5 - Pastel colored large circular pills.
            Antacid. Use for heartburn.
        Ibuprofen, 200mg, x30 - Small circular red pill labeled I-2.
            NSAID anti-inflammatory. Use to reduce fever or inflammation.
            Low fevers fight diseases, don't remove them.
        Loratadine, 10mg, x30 - Small oval white pill labeled L612.
            Used to minor allergic reactions.
        Melatonin, 3mg, x10 - Small unlabeled white pill.
            Natural sleep aid. Take 1 to sleep somewhere noisy. Groggy after.
        Peptobismol, x16 - Larger pink circular pill in plastic labeled RH 046.
            Use for diarrhea or stomach upset. Recommended dose is 2.
        Pseudoephedrine HCl, 120mg extended release, x2. One per day.
        Pseudoephedrine Hcl, 30mg - One every 2-4 hours as needed.
            Use for stuffy nose. Stimulant.
        Taurine, 500mg, x5 - Medium white gel capsules. See caffine.

        Razor blade, x1
        Activated charcoal - Black powder.
            In case of poisoning, immediately induce vomiting.
            Then eat activated charcoal.
        Bentonite clay - Grey powder. Do not use.

    Vitamins box (in center compartment):
        Mulivitamin, x20 - Large green pill labeled 1.
            Take one every other day only if vitamin deficient.
            Contains enough: Vit A, Vit C, Vit D, Vit E, Vit K, B1, B2,
             Magnesium, Zinc, Selenium, Copper, Manganese, Chromium
             Bayer One a Day Men's Pro Edge
        Vit D, 5000 IU, x25 - Small yellow gel beads.
            Take one every 2-3 days if sick or missing sunlight.
        Zinc, 50mg, x20 - Medium white unlabeled circular pill.
            Take half a pill per day to resist getting COVID-19 or for diarrhea
        Folate, 400mcg, x20 - Small-medium white gel capsule.
            Take one every other day if missing vegetables in diet.
        Vitamin C, powder
            Take small amounts if missing fruit from diet to prevent scurvy.

        For diarrhea, oral rehydration solution. If not available, use water.
          0.5tsp salt               6tsp sugar
          0.25tsp potassium salt    1L/quart water
        Potassium chloride, powder - ORS
        Iodized table salt, powder - ORS or dehydration.

        Atorvastatin, 40mg, x50 - Medium white oblong pill labeled ATV40.
            Prescription: Take one pill daily to reduce cholesterol.

Here’s what happened in 2022 for me!

Move

I moved from California to Ohio. I wanted to be with my friends. Also, my old place caught on fire (twice). The new place is cheap, but underground. The first order of business was installing lots of lights, and replacing my moldy old mattress.

My dad kindly lent me a car until mine showed up in September. There was lots of DMV paperwork. Not the best, but Ohio is much cheaper and easier than California in this regard. I also got health insurance, which cost almost as much as my rent.

Happily I already knew many people where I was moving, and I also started attending several meetups from meetup.com. I got to spend Thanksgiving and Christmas with friends and family this year. I also sent out Christmas cards for the first time.

Games

I started two D&D games in 2022. One ended before session 1, the other exploded after two months. I had a nice time playing as a player in “Index Card RPG”, though. I ran a session of lexicon, which went pretty well. We quit before getting to the letter Z, but that’s a design flaw in Lexicon–it’s way too long.

I participated in the 2022 April Fools Puzzle Contest, on #ircpuzzles. I came in 7th.

This and that

A little travel. I went to Missouri to visit friends. I got to go to my friends’ wedding in Boston.

I read “The Art of Computer Programming” volumes 1 and 2. Donald Knuth sent me a check for finding a 0x1.2 bugs.

I got a snakebite lip piercing.

I made a first-aid kit, which I’m realizing I didn’t write up. My thinking was that it’s bad to give medical advice when you don’t know anything about medicine.

I made a new blast furnace with my sister, which we never used (old one).

I made an e-ink laptop.

Software

In November, I did Hack-a-Day, a project I conceived to do a new computer project every day of the month that I could show off to others. As part of it, I learned web sockets, webRTC, unity3D, game programming. In all, there were around 30 projects–click the link to see them all.

  • I made huge improvements to qr-backup. Its basically “done” for the CLI version.
  • I wrote youtube-autodl, a program to automatically download a feed of youtube videos and sort them into folders.
  • I wrote a video linter for my personal video collection.
  • I wrote a screenshotter, which takes one screenshot a minute of my laptop (encrypted) and archives them indefinitely.
  • I re-wrote is rick and morty out.com for Season 6.
  • I wrote record-shell and installed it on my computers. It records all shell sessions, etc including ssh sessions.
  • I wrote Doodle RPG, which I was quite proud of. It ran for a good while and tapered off. It supports mobile!
  • I did a couple late hack-a-day followups: a bug reporter and hack-a-spring (unfinished).
  • Worked on beggar-my-neighbor solver.

Habits

I was exercising daily. I kind lapsed after my ankle surgery, oops.

I stopped doing my daily morning log at some point, and didn’t fix it within 2022.

I tried an experiment with “no-computer” sundays. This was super productive one time, and less so the next. It led to the e-ink laptop, because writing a short story by hand was really painful.

I started limiting myself to one youtube video per day. That went great and I’ve kept it up.

Every year I have a checklist of things to do. I did them. Two of the more well-known are my storage cost survey and my media longevity test.

I sorted my scans into folders. I decided not to do the whole process (transcribe the handwritten documents, etc) for the thousands of scans, because it wouldn’t be worth the time. I’ll wait and see what I can do with AI in a few years, maybe.

Writing

You can read most of what I wrote here! On a blog! Of particular interest might be my new index page.

I also wrote a short story, Earth II. It’s not online because it’s bad.

I had to remove library.za3k.com because of DMCAs.

The April Fools Puzzle Contest is over. Congrats to the winners.

I wrote up solutions for 2019, 2020, 2021, 2022, and 2023 (2023 not yet live).

Spoiler tags are available, so you see clues and incremental hints, if you missed the original contest and want to play one.