Fill faster

I’ve not done much work lately on my forked-from-QXW, written-in-C crossword filler, as getting that code up to snuff amounts to a rewrite. But one thing it has going for it is that it is very fast.

Meanwhile, I have my own written-from-scratch-in-python filler that I’m pretty happy with in terms of results and features, but which is no speed demon. And then I wanted to have this all work on my phone, so I re-implemented it in javascript. Yes, I’m writing a lot of code lately in this language that I do not care for.

Anyhow, down this rabbit hole I go, and one thing that is clear is that the interpreted language versions are not fast. Representative times to fill a grid:

cpython:    114 s
node js:    49 s
pypy:       26 s
C (qxw):    0.5 s

Amazing how much faster pypy is compared to CPython running the same code!

Well, I spent an afternoon optimizing the python and JS fillers, and got a decent speed-up:

pypy:       5 s
node js:    2 s (24x improvement)

Not bad, and in the realm of being usable for an online filler app. Much of the speedup came from avoiding common interpreted language constructs (like regex) that one would never go near in C.

I cobbled together enough of a web UI for this in order to fill this new puzzle on my phone while the 4 year old was having a long snooze in my lap. Guess what 20-Down we’ve been shopping for lately?

Garden Week 7

The garden is now jungle-like. There are real concerns that people have wandered into the garden and never returned, having lost their way out. I have a little bit of black spot on pretty much every tomato plant. My fault, I should have pruned the tomatoes more. I sprayed them with fungicide.

Even so, they have set fruit. I have a few per plant, maybe twenty in all.

Oh, I identified, and ate, the yellowish-green chili from last posting: the Hungarian wax pepper. Great sauteed in butter and spooned over salmon.

Garden update

My garden experiment continues, mostly successfully so far. Here are my notes for how it’s worked out, to remind myself what to do next year.

I built a 6′x4′ cedar box from 1″x6″ planks, all cut to nearly the right length by the helpful folks at the local home center. Some stainless steel decking screws and nearly a ton of VegMax(tm) dirt later, I had my raised bed set up.

While hardening off, the seedlings were getting watered about once every 1-2 days, with 4 cups of water per 10 seedlings. By May 28th I had them all planted out in the raised bed, staked, and mulched. At that time they looked like this:

I put a pair of tomato fertilizer spikes about 6 inches from each plant that same week. Since then I have been spraying with epsom salt every two weeks, and since last week I have started alternating that with fertilizer. The bugs are numerous but I’ve used insecticidal soap sparingly: so far, there doesn’t seem to be a ton of insect damage except on lower leaves. I haven’t pruned the tomato plants that much, just leaves that are obviously low and touching soil. As this has been a very wet spring so far, I’ve only had to water them once since planting (15 min on soaker hose).

One of my peppers (serrano? yellow cayenne?) has yielded fruit. I’m not sure what the final color is supposed to be, but I may pick it soon anyway to speed along some other buds on that plant. I also have a 1″ bell pepper on another plant. Part of the fun of using a mix of pepper seeds is that I have no idea which plants are going to produce what.

I lost one pepper seedling shortly after planting due to high winds snapping the stem in half.

The basil is doing fine, and much more prolific outdoors compared to my indoor plants.

My largest tomato plant got its first flowers yesterday. I’ve restaked some of them with 6′ spikes as they’ve outgrown the 2′ spikes already. One definite mistake I made was to plant the tomatoes with only 1′ spacing. I moved three of my smallest plants yesterday to containers so that at least one or two of the remaining garden plants will have the proper spacing. The others will fight it out, so we’ll see how that goes.

Wooden finish

I made a new crossword puzzle, theme is pretty basic/boring but it has the dubious distinction of being filled entirely by my own software (interactively with my input). Originally 57A was going to be a literal revealer for the other themers, but I couldn’t get a good fill around that gimmick so it got simplified.

Play in the mobile-friendly iframe below or chase this link for full screen:

That time I wrote a Go server

My crossword puzzle web app grew up somewhat: now it is (optionally) backed by a database.

How we ended up here: I started this project from a completely different, and still mostly unexplored, direction: I wanted to be able to construct crosswords while on the go, since I occasionally find myself with some downtime and no keyboard. Just having a grid to type into is really enough for that — paper grids will do in a pinch, but who wants to kill trees and carry around a pencil and paper all the time.

Once I had a grid component, as a test, I built out a puzzle-solving application using 100% client-side code. That is, the JS can parse the puzzle files, render UI, save state locally, handle all the interaction without talking to a web server other than for the initial download. Then, naturally, creeping featurism took over and it became my daily solving app for NYT puzzles.

Doing everything client-side is nice because you never need the internet. Having a database backend provides some upsides though: you can more easily track progress (“how fast am I solving puzzles?”), and you can sync state across multiple devices: start on the desktop and move to phone later. Once you have syncing, you can also do collaborative puzzle solving, which is nice as the wife and I like to do the Sundays together. So if you go to this site, you can upload a puzzle, copy and share the resulting URL (randomized hash-path id indicates the ‘solution in progress’), and do an actual “crosswords with friends” unlike the branded game of the same name which is only solo play. I reserve the right to delete any data or break this feature at any time: it mostly exists for my current fickle amusement.

While the frontend is being written in a language I mostly don’t care for and don’t really know that well (ReactJS), I decided I might as well try learning yet another language on the backend. My first golang foray and a worse-is-better development paradigm led to this terrible non-idiomatic code on my github (here is the JS frontend). PRs welcome.

I’m not yet sure how I feel about Go. On the one hand, the “having types” and “lack of 2to3 transition disaster” features put it somewhat ahead of Python, and it is not as crusty as Java. On the other hand, those are fairly low bars and Go feels like a 90s language with a few minor changes. I haven’t spent enough time with it to get a feel either way about performance.

The ACPT online tournament, it turns out, uses a Java applet for the client, and it’s getting harder to find browsers that support that (I had to use an ESR Firefox release, which felt like going back in time 10 years even to this Debian-stable user). I am hoping that by next year they will have some similar kind of JS UI in place.

As far as the ACPT itself: it was a lot of fun. Out of the seven puzzles, I finished four with time to spare, my best time being just over ten minutes on puzzle number four. My worst puzzle was the first in which I completed only 50/76 answers. Overall I ended up (as of last time I checked) in 87th place out of 141, so, firmly on the left side of the curve. Oh well, plenty of room to improve.

Garden

Baby basil

Building on my success last year of managing to not kill a basil seedling, this summer I’ll try having a garden. To that end, I started in March with basil, rosemary, peppers, and tomato seeds. So far, some 24 plants, mostly tomatoes and peppers, have survived to the hardening-off stage and are ready to go in the ground in a couple weeks’ time.

On top of that, I have a few basil plants that will remain indoors, and a couple of very poor looking rosemary sprouts that may never reach adulthood. This represents quite a few levels up in my plant-tending acumen, as until now the only things I have been good at growing are dandelions in my lawn.

Plants

ACPT

The American Crossword Puzzle Tournament starts tomorrow. I’ve paid the entrance fee for the online “bragging rights only” track, so I’m looking forward to seeing some interesting puzzles and to get an idea of how my solving skills stack up. Considering that competitive solvers often finish well under five minutes on a Monday and my best is in the ten minute range, probably not that great, but we shall see.

I recently started a couple of the London Times cryptic crossword books; these are hard. As in NYT Saturdays are a cakewalk by comparison. Partly, because I’m not terribly knowledgeable of British geography and slang, partly because I haven’t learned to recognize the various clue forms, and partly because they are just tough. Example clue: [Notice boy going round vehicle after parking]. Answer: PLACARD. Because “PLACARD” is a notice, and in that word “LAD” (boy) is literally going around “CAR” (vehicle), which both come after “P” which you just have to know is an abbreviation of parking. So yeah, tricky.

Yeast!

Over the last few weeks I’ve been caring for a few billion microorganisms. And ate some of them.

Fig 1. My yeast making tons of bubbles overnight

Making a wild yeast starter turned out to be pretty easy. It took about ten days (in contrast to the five specified in the recipe I followed) for the colony to reach maturity in this winter kitchen, fed twice each day with equal parts flour and water, left at room temp overnight. Now, they are on a weekly maintenance schedule.

So far, I’ve used the starter in a hybrid (part commercial yeast) sourdough boule, two fully wild yeast loaves, pancakes, and, of course, pizza.

Compared to straight pizza dough, the sourdough version has a more complex taste, with basically the same texture. There is not much difference in the way the dough handles.

The wild yeast breads were both a little flatter than I’d have liked, owing to the less predictable rise; on the other hand they had a very nice sour taste. The hybrid dough is a nice compromise: less sour but airy crumb.

Pancakes of any stripe are always awesome.

State of the pizza

It has been a year since my last statement about home-made pizzas, so it may be a time to serve up (deliver?) an update. Here’s one from the most recent batch:

Ken Forkish’s straight-dough, low yeast, long-rise recipe continues to be my go-to, and there is little left to complain about. It has a great crumb and nicely developed taste, especially when the dough is a day or two old. I still do need some work on the technique side: getting an unbaked pizza off the peel — without using so much flour or cornmeal as to mar the taste — still eludes me. Thus, I have settled on using parchment paper for the first couple of minutes, then, after the crust firms up, lifting the pizza with tongs and yanking out the parchment paper before it incinerates in the 550 degree oven. This, it should be said, is a maneuver not without danger to one’s fingers.

Our grocery carries “pizza yeast” in addition to the normal stuff, so I decided to give this a try to see how it stacks up. Apparently, the packet consists of highly active yeast along with some conditioners that make a thirty minute dough handle like one with a longer rise. The resulting dough was as easily stretchable as advertised, but also had little to no strength. It was altogether too easy to tear a hole while trying to shape it into a round, but I persevered. Here is the side-by-side (pizza yeast on the right):

The resulting crust was rubbery and tasteless, so my advice is to not bother repeating this experiment.

I am considering branching out into a wild-yeast version next, depending on whether I can manage to get a viable starter going.

React reaction

An embarrassing admission to make: I wrote something in javascript.[1]

Actually, I wrote it in React, because I still think of javascript as that awful language that works differently in every browser, and so, you know, to stay relevant, I decided to learn the framework that web developers everywhere have already cast into yesterday’s wastebin for the new shiny. This, pretty much.[2]

Anyway, I replaced the third-party crossword app on my website with my own NIH version and made it somewhat responsive [3] so that it works on my phone. Also there are two new-ish puzzles since the last time I posted, dated 2016-11-25 and 2016-12-30. Each of them has its own set of problems, but I think I am at least learning where I need to improve.

To this neophyte, my impression is that using React (and ES6) is much nicer than that terrible language that they compile down to. On the other hand, the pattern of moving state up the object hierarchy away from an object’s view feels backwards and not very OO-like. Perhaps if I also used Flux then I might get enlightened on this point, but that is for another day.

[1] Here’s a nickel, kid. Buy yourself a real language.
[2] The day that my relevance depends on knowing the latest JS framework is the day that I will take up a completely different career.
[3] Anything worth doing is worth doing somewhat.