Readit News logoReadit News
cooljoseph commented on Useful patterns for building HTML tools   simonwillison.net/2025/De... · Posted by u/simonw
cooljoseph · 3 months ago
I've done something similar for a couple tools.

I tend to make them as Python servers which serve plain html/js/css with web components. I know this is a bit more complicated than just having a single html file with inline js and css, but the tools I made were a bit too complicated for the LLMs to get just right, and separating out the logic into separate js files as web components made it easy for me to fix the logic myself. I also deliberately prompted the LLMs to avoid React because adding I didn't want to need a build step.

The only one I actually still use is the TODO app I made: https://github.com/cooljoseph1/todo-app It stores everything in a JSON file, and you can have multiple TODO lists at once by specifying that JSON file when you launch it.

cooljoseph commented on Show HN: I invented a new generative model and got accepted to ICLR   discrete-distribution-net... · Posted by u/diyer22
cooljoseph · 5 months ago
This sounds somewhat like a normalizing flow from a discrete space to a continuous space. I think there's a way you can rewrite your DDN layer as a normalizing flow which avoids the whole split and prune method.

1. Replace the DDN layer with a flow between images and a latent variable. During training, compute in the direction image -> latent. During inference, compute in the direction latent -> image. 2. For your discrete options 1, ..., k, have trainable latent variables z_1, ..., z_k. This is a "code book".

Training looks like the following: Start with an image and run a flow from the image to the latent space (with conditioning, etc.). Find the closest option z_i, and compute the L2 loss between z_i and your flowed latent variable. Additionally, add a loss corresponding to the log determinant of the Jacobian of the flow. This second loss is the way a normalizing flow avoids mode collapse. Finally, I think you should divide the resulting gradient by the softmax of the negative L2 losses for all the latent variables. This gradient division is done for the same reason as dividing the gradient when training a mixture-of-experts model.

During inference, choose any latent variable z_i and flow from that to a generated image.

cooljoseph commented on How many dimensions is this?   lcamtuf.substack.com/p/ho... · Posted by u/robin_reala
jerf · 6 months ago
This is one of the reasons whenever the topic of math curricula comes up on HN I've tended to argue to remove some things. The system is full up at the moment and you can't really add anything without removing some things. But I can't even get HN readers to agree that some things should be removed, let alone normal people. Everyone wants to add but no one is willing to remove anything, no matter how useless it is for all purposes practical, mathematical, scientific, and every other purpose. With the curriculum highly centralized and standardized, change to what is taught has proved to be on the scale of multiple decades if not centuries, and not in a good way.

Changes to how The Holy Curriculum is taught can occur on decades, but what has changed hardly at all, despite the fact that frankly the curriculum was audibly creaking when I was doing it in the 1980s... at least, if you tried to hear the creaking. Even then it was obvious that what we were being taught had been frozen circa 1930 or 1940 and needed updating for a number of reasons. It's even more out of step with the world now, in every way, but here we are.

cooljoseph · 6 months ago
> The system is full up at the moment and you can't really add anything without removing some things.

Middle school seems rather un-full to me. Right now students start learning about fractions in 4th grade. They don't move on to algebra until 9th grade. What is there in the middle? Not much, in my experience.

Maybe instead of having a giant no-math gap during middle school, they could move everything down and free up some space later on.

cooljoseph commented on Waymo granted permit to begin testing in New York City   cnbc.com/2025/08/22/waymo... · Posted by u/achristmascarl
MisterMower · 7 months ago
Surveys?

“Yes I’ve been in an accident on my bike Mr. Poll Taker.”

“What? Of course it was the other guy’s fault!”

cooljoseph · 7 months ago
No, surveys like where researchers show up to hospitals and look at the police reports for the injured cyclists.

Sorry if I wasn't clear in my wording. By "survey" I was trying to point to the specific kind of research methodology where you survey people about what has happened in the past instead of trying to control variables like in a typical experiment.

I wasn't talking about random internet polls or self-reported blame analyses, but actual research papers.

cooljoseph commented on Waymo granted permit to begin testing in New York City   cnbc.com/2025/08/22/waymo... · Posted by u/achristmascarl
stronglikedan · 7 months ago
I just wish every cyclist would re-learn that they're bound by the same traffics laws as every driver on the road. I'd bet accidents are more often than not mostly their fault.
cooljoseph · 7 months ago
> I'd bet accidents are more often than not mostly their fault.

That's actually not true. Most surveys I've seen show that drivers are at fault ~80% of the time.

cooljoseph commented on The metre originated in the French Revolution   abc.net.au/news/science/2... · Posted by u/Tomte
Xmd5a · 10 months ago
The meter wasn't invented during the French Revolution, it evolved from ancient measurement systems based on the golden ratio.

Traditional body measurements (thumb, palm, span, foot, cubit) follow a Fibonacci-like progression where each unit ≈ φ times the previous one. If we consider the Egyptian cubit as π/6 meters (which matches historical measurements), here's a possible insight:

Draw a circle with diameter 1 meter. Remove 1/6 of the perimeter (π/6), subtract the diameter (1), and you get ≈1.618 – essentially φ. This geometric construction lets you build an entire measurement system using just a stick and basic geometry. Once you have any two consecutive units, you can generate the entire sequence by addition (palm + span = foot) or subtraction (span – palm = thumb's breadth).

In the pre-metric French system, a span was exactly 20cm. When you scale 0.2 × φ² you get π/6 with 4-digit precision. But here's what's interesting: using our geometric approximation φ ≈ 5π/6 – 1, the equation 0.2 × φ² = π/6 works out *exactly*. The "approximation error" in φ perfectly cancels out due to φ² = φ + 1, making 0.2 × (5π/6 - 1 + 1) = π/6.

Here's another "coincidence": Multiple 17th-century scientists (Mersenne, Huygens, Wilkins) proposed defining a universal unit as the length of a pendulum with a half-period of 1 second. Tito Livio Burattini, inspired by his travels in Egypt, formalized this in his "Misura Universale" (1675), measuring this pendulum length at 0.9939 meters - essentially our modern meter.

The "revolutionary" meter system was really just formalizing measurement relationships that builders had been using for millennia. The French didn't invent it - they just gave ancient φ-based measurements a decimal makeover.

cooljoseph · 10 months ago
It is possible to construct φ exactly with a straight-edge and compass. Would the approximation of 5π/6 - 1 be used because it's easier to calculate quickly?
cooljoseph commented on Ask HN: What kind of whiteboard does not use dry erase markers?    · Posted by u/dandrew5
everyone · a year ago
Also it's actually gypsum. Same material plaster and plasterboard is made from.
cooljoseph · a year ago
Are you sure about that? According to Wikipedia both gypsum and calcite are used. Apparently, gypsum is used for colored chalk, and calcite is used for white chalk:

> Chalk sticks are produced in white and in various colours, especially for use with blackboards. White chalk sticks are made mainly from calcium carbonate derived from mineral chalk or limestone, while coloured chalk sticks are made from calcium sulphate in its dihydrate form, CaSO4·2H2O, derived from gypsum.[6][7] Chalk sticks containing calcium carbonate typically contain 40–60% of CaCO3 (calcite).

https://en.wikipedia.org/wiki/Blackboard#Chalk_sticks

Wikipedia cites the following articles:

[6] "How chalk is made – material, making, used, processing, procedure, product, industry". madehow.com. Retrieved February 17, 2021.

[7] Corazza, M.; Zauli, S.; Pagnoni, A.; Virgili, A. (2012). "Allergic contact dermatitis caused by metals in blackboard chalk: a case report". Acta Dermato-Venereologica. 92 (4): 436–437. doi:10.2340/00015555-1296. PMID 22367154.

The first of these seems more relevant... I'm not quite sure what the second citation adds.

cooljoseph commented on Yes, it ‘looks like a duck,’ but carriers like the new USPS mail truck   nytimes.com/2024/11/26/us... · Posted by u/vincentchau
whalesalad · a year ago
Interesting that the front windshield only has about 50-60% usable space. On the top this makes sense, as the black coating acts as a sun shade. On the bottom... there goes all the visibility gained by having the low hood. wtf?

The upfitter AUX switches appear to be Ford, same for the AC controls.

cooljoseph · a year ago
The camera is positioned so that the side window is visible through the front windshield. I think the "black coating" you are seeing is just the interior of the van, and that the entire front windshield is usable.
cooljoseph commented on A near impossible literacy test Louisiana used to suppress the black vote   openculture.com/2024/10/t... · Posted by u/rcarmo
neongreen · a year ago
Btw — how hard are these problems nowadays? Back then, 8 top Soviet students solved only half of them in a month — has anyone tried giving them to students now?
cooljoseph · a year ago
They seem a lot easier than USAMO problems, or even Putnam problems. I suspect that top students nowadays could easily solve them all in a day.
cooljoseph commented on Hy 1.0 – Lisp dialect for Python   github.com/hylang/hy/disc... · Posted by u/Kodiologist
cooljoseph · a year ago
I was having some difficulty figuring out how Hy actually is translated to Python (and wasn't even sure if it was compiled or interpreted). Eventually I found on Wikipedia the following: > Hy is a dialect of the Lisp programming language designed to interact with Python by translating s-expressions into Python's abstract syntax tree (AST).

Also, looking at the code on Github suggests this compiler is written in Python (see https://github.com/hylang/hy/blob/master/hy/compiler.py).

I kind of wish this was made more clear on the main website. Perhaps, instead of introducing Hy as "a Lisp dialect that's embedded in Python", introduce it as "a Lisp dialect that compiles to Python's AST". The words "embedded in Python" don't make it very clear just how it's embedded into Python. The various ways you can embed a Lisp look very different and have very different tradeoffs.

For example, off the top of my head, I could "embed" a Lisp by writing an interpreter (in C if I care about performance) and letting it be called from Python, perhaps passing in a Python list instead of a string to make it more "native". Or I could "embed" a Lisp by compiling to Python bytecode. Or I could "embed" a Lisp by translating it directly to Python source code. Etc.

Regardless, interesting project!

u/cooljoseph

KarmaCake day88September 6, 2023View Original