HN user

danvk

696 karma
Posts20
Comments96
View on HN
www.danvk.org 1y ago

After 20 years, the globally optimal Boggle board

danvk
78pts23
effectivetypescript.com 2y ago

What can TypeScript learn from Zig? What can Zig learn from TypeScript?

danvk
87pts24
effectivetypescript.com 2y ago

TypeScript and SQL: Six Ways to Bridge the Divide

danvk
2pts3
effectivetypescript.com 3y ago

What's TypeScript compiling? Use a treemap to find out

danvk
406pts140
effectivetypescript.com 5y ago

TypeScript splits the atom A first look at TS 4.1's new template literal types

danvk
3pts0
github.com 10y ago

Show HN: Visualize JavaScript code bloat through source maps

danvk
4pts0
github.com 10y ago

Show HN: Track JavaScript code bloat with GitHub statuses

danvk
3pts0
www.danvk.org 11y ago

Extracting text from an image using Ocropus

danvk
63pts10
github.com 11y ago

Show HN: jss, a jq-like CL tool for manipulating JSON files using CSS selectors

danvk
10pts1
chrome.google.com 11y ago

Show HN: A Chrome extension to add syntax highlighting to GitHub's split diff UI

danvk
4pts1
www.comparea.org 11y ago

Show HN: Comparea, a tool to compare the area of two geographic features

danvk
7pts1
www.danvk.org 13y ago

Nothing is ever so simple as it seems: Developing the OldSF Slideshow

danvk
2pts0
www.centauri-dreams.org 13y ago

Alpha Centauri and the New Astronomy

danvk
5pts2
www.danvk.org 13y ago

Which States should support the National Popular Vote Bill?

danvk
2pts0
www.nytimes.com 14y ago

Repurposed Spy Satellite May Explore Secrets of Dark Energy

danvk
2pts0
www.danvk.org 14y ago

Puzzle+: Crosswords in Google+ Hangouts

danvk
2pts1
danvk.org 14y ago

Arbitrary Precision Hex Dec in 65 lines of JS

danvk
3pts0
www.danvk.org 14y ago

What’s Going on with Twin Rates? (includes a visualization)

danvk
5pts0
userscripts.org 14y ago

Speedy Google Account Switcher

danvk
2pts0
www.nytimes.com 15y ago

House Panel Proposes Killing the James Webb Space Telescope

danvk
2pts0

(Author here) IIUC you're saying that 707133f-a should be at 5th Ave & 9th Street, not 5th Ave & Union Street? Can you say more about why? The text on the back of the first image says "Union St. Station, 5th Ave," which is how it winds up at there. On the other hand, the NYPL page[1] titles the image "Union St. - 18th St."

(I briefly got excited that there might be a street sign _in_ the photo, but if you zoom way in it says "DENTIST")

+1 to 1940s.nyc. Very different photos — those are were taken for tax assessment, the ones on OldNYC were taken to document the city as it changed. The photographer had an arrangement where he'd get tips from demolition crews, and go shoot buildings before they were gone forever.

[1] https://digitalcollections.nypl.org/items/5a5e06a0-c539-012f...

Yes. You can give pickType a type in TS. Something like pickType<B extends boolean>(b: B): B extends true ? string : number.

I’d love to read a post explaining how TS conditional types are or are not a form of dependent types. Or, I’d like to understand dependent types well enough to write that post.

It's open source, take a crack at it! Or file an issue requesting it.

This analysis doesn't make use of the Boggle dice. It assumes that any cell can be any letter. In practice, all high-scoring boards can be rolled with the Boggle dice. My code does assume the letters are A-Z, though, so the Ñ die in Spanish Boggle would require some code changes.

Finding the highest-scoring board with a 16- or 17-letter word is a fun, but very different problem. There are few enough "Hamiltonian paths" through the all the letters on a 4x4 Boggle board (~68,000) and few enough 16 letter words (~2,000) that you can enumerate all pairs in an hour or two.

Depending on wordlist and whether you want a 16 or 17 letter word, you get "charitablenesses", "supernaturalised" (British spelling), "quadricentennials" or "quartermistresses". These boards all score considerably lower than the REPLASTERING board. Full results here: https://github.com/danvk/hybrid-boggle/#highest-scoring-boar...

I hadn't realized until I did this "side quest" that most wordlists top out at 15 letter words. That makes sense for a Scrabble dictionary, but it's not great for Boggle.

There are simpler ways to calculate a bound that don’t involve trees. You can read about the sum and max bounds in the WIP paper: https://github.com/danvk/hybrid-boggle/blob/main/paper

There are some examples in these old posts:

- https://www.danvk.org/wp/2009-08-08/breaking-3x3-boggle/inde...

- https://www.danvk.org/wp/2009-08-11/a-few-more-boggle-exampl...

These bounds are pretty effective at finding the global max for 3x3 Boggle, but 4x4 is a lot bigger.

There is a mapping from Boggle optimization to ILP, but I’ve seen no evidence that this is an efficient way to solve it. I’ve been told that branch and cut is usually better than branch and bound, but I don’t know whether it’s applicable to Boggle.

“As far as I can tell, I’m the only person who is actually interested in this problem,” Vanderkam said.

For context, many people are interested in finding high-scoring Boggle boards, usually via simulated annealing, hillclimbing, or genetic algorithms. But so far as I can tell, I'm the only one interested in _proving_ that a particular board is best. Doing that was the new result here.

Sorry, but this doesn’t pass the smell test. The article mentions 200,000 random 4x4 boards/second on a single core on an M2. That’s a ~4GHz chip. So ~20,000 ops/board. There are 200,000 words in the dictionary. You can’t possibly do something for every word in the dictionary, it would be too slow.

It sounds like your Trie implementation had a bug or inefficiency.

I've had really good luck recently running OCR over a corpus of images using gpt-4o. The most important thing I realized was that non-fancy data prep is still important, even with fancy LLMs. Cropping my images to just the text (excluding any borders) and increasing the contrast of the image helped enormously. (I wrote about this in 2015 and this post still holds up well with GPT: https://www.danvk.org/2015/01/07/finding-blocks-of-text-in-a...).

I also found that giving GPT at most a few paragraphs at a time worked better than giving it whole pages. Shorter text = less chance to hallucinate.

Thanks for the pointer, I hadn't run across ts-runtime-checks before. It does do something similar to what I propose in the post. The difference is that ts-runtime-checks is opt-in. If you want a type validated at runtime, you have to write `Assert<T>`. What I'm proposing is that _all_ types be validated at runtime.

opt-in makes sense if you want these checks in production. The appeal of a "check everything" debug mode is that you wouldn't have to modify your TS at all to use it.