HNHacker News
TopNewBestAskShowJobs

patrickthebold

1,164 karma · joined December 2, 2015

submissionscomments
patrickthebold··on That's a Lot of YAML
What do you mean that JSON is not "streamable"?

There are things like https://www.baeldung.com/jackson-streaming-api but maybe there's more in you definition of "streamable" that JSON doesn't satisfy.

patrickthebold··on Bitcoin cold-wallet attack spreads to 4,500 addresses as losses near $89M
Unlikely. The digital signatures bitcoin uses are regarded as secure, (there could be attacks if we get quantum computers.) The issue here was the software didn't put in enough randomness when generating the keys, and so it was straight forward to search the small space of keys the wallet would generate.

It's not so different if you encrypted a file with a weak password and someone guessed it—you don't need stronger encryption, you need to pick a better password.

The proof of work part of bitcoin is really for "consensus", so everyone agrees which transactions happened in which order, this attack didn't affect that part at all.

patrickthebold··on Casio Moflin
Is that a reference to https://www.kohlerhealth.com/dekoda/?
patrickthebold··on JEP 540: Simple JSON API (Now in Incubator)
JSON String requires escaping of control characters. .toString() on a String is (hopefully) the identity.
patrickthebold··on Instructure pays ransom to Canvas hackers
So, maybe we could consider a "White Hat" ransomware group that takes the money and also leaks the data, so that long term no one bothers to pay which ultimately disincentivizes ransomware attacks?
patrickthebold··on Where did my taxes go?
Somewhat off topic, but I've always wanted to know _who_ gets my tax dollars more than what they were spent on. For example, a middle class salary to someone building bombs in Ohio is different than a wealthy investor who owns shares in some educational company that provides standardized tests to local public schools.
patrickthebold··on GitHub Stacked PRs
I'm not sure I follow your workflow exactly. If PR B is merged, then I'd expect PR A to already be merged (I'd normally branch off of A to make B.)

That said, after the squash merge of A and git fetch origin, you want something like git rebase --update-refs --onto origin/main A C (or whatever the tip of the chain of branches is)

The --update-refs will make sure pr B is in the right spot. Of course, you need to (force) push the updated branches. AFAICT the gh command line tool makes this a bit smoother.

patrickthebold··on Combinators
It helps if you click the link of the operator(s) under TinyAPL. For example Blackbird goes to https://tinyapl.rubenverg.com/docs/primitive/atop

Which seems to be function composition and some extra rules about if there's 1 or 2 arguments, so the 2 arguments go to G and F is applied as a single argument function. Anyway if you click on a few of these an look at the red text in the upper right it's fairly clear what it's doing.

patrickthebold··on Rob Pike’s Rules of Programming (1989)
Reminds me of this quote which I recently found and like:

> look, I'm sorry, but the rule is simple: if you made something 2x faster, you might have done something smart if you made something 100x faster, you definitely just stopped doing something stupid

https://x.com/rygorous/status/1271296834439282690

patrickthebold··on A case for Go as the best language for AI agents
Yes, I really wanted to post the comment and I (wrongly) thought this post got blocked by my procrastination setting. Apologies for the noise.
patrickthebold··on A case for Go as the best language for AI agents
I happen to just stumble across this article https://felixbarbalet.com/simple-made-inevitable-the-economi... extolling the virtues of Clojure. It specifically calls out Go for not being simple in the ways that matter for LLMs.

I've no idea myself, I just thought it was interesting for comparison.

patrickthebold··on Sabotaging Bitcoin
This is interesting to think about: For gold I'd say the demand is coming from both industries and from people who want it as a store of value. If it was only used as an industrial chemical, then surely the price would drop because there would be less demand.

Some bitcoin advocates will talk about how useful it is as a currency, and I wonder how much bitcoin is actually used for purposes other then to hope you can sell it to someone else for more than you paid.

patrickthebold··on When 1+1+1 Equals 1
I'd be good to give an example of where the 'only if' doesn't apply. If only to clear up the confusion.
patrickthebold··on The last-ever penny will be minted today in Philadelphia
of course 9.99...(repeating) is mathematically 10, so I have a hard time being against allowing that.
patrickthebold··on The last-ever penny will be minted today in Philadelphia
Half a quarter.
patrickthebold··on The last-ever penny will be minted today in Philadelphia
Is gas sold as a whole penny amounts in those locations? Where I am it's always something and 9/10ths of a cent.
patrickthebold··on How the cochlea computes (2024)
I think I might be missing something basic, but if you actually wanted to do a Fourier transform on the sound hitting your ear, wouldn't you need to wait your entire lifetime to compute it? It seems pretty clear that's not what is happening, since you can actually hear things as they happen.
patrickthebold··on New Mexico is first state in US to offer universal child care
I agree.

Ideally we could just increase the tax credits so it's large enough to cover the childcare expenses (and other necessities), and let the families decide what is best. And yes, some people are going to do a bad job taking care of their kids and spend the money on something else. But my understanding is that it generally works well to just give people money, rather than pay for specific things.

patrickthebold··on Amazon has mostly sat out the AI talent war
One thought I had recently: Their shareholders are probably mostly the same people. So why even compete?
patrickthebold··on Show HN: I was curious about spherical helix, ended up making this visualization
Just a thought: Make the velocity of the path constant. There should be some way to take a derivative an set it to a constant and solve for z. ( or really reparameterize the curve t' = f(t)) so the velocity is constant.

Actually, now that I think about it, choosing z = c * t is kind of both influencing how the path is parameterized as well as the path carved out on the sphere.

patrickthebold··on The Useless UseCallback
I happen to also have thought about this. Effects would listen to the global state and if needed do their side effect and update the state. As a type it's just State -> State, with an implicit side effect.

As an example: Say the user clicks a button to submit a form, clicking the button updates the local state to include something like `status: 'SUBMIT_REQUESTED'` then you make the request conditionally, and update the state to `status: 'IN_PROGRESS'`.

It might become a mess, but the point is to do no side effects based on any events, all effects happen conditionally based on the state. My hope is the forces you to actually track everything you should be tracking in your state object.

patrickthebold··on The Useless UseCallback
I've been toying with an idea of a pattern. I'm curious as to if it has a name. I'll write a blog post once I have an app using it. In the meantime, it's (roughly):

  - No Hooks.
  - Don't try to sync any state. E.g. keep a dom element as the source of truth but provide access to it globally, let's call this external state.
  - Keep all other state in one (root) immutable global object.
  - Make a tree of derived state coming from the root state and other globally available state. (These are like selectors and those computations should memoized similar to re-select)
  - Now imagine at any point in time you have another tree; the dom tree. If you try to make the state tree match to dom tree you get prop drilling. 
  - Instead, flip the dom tree upside down and the leaves get their data out of the memoized global state. 
  - Parent components never pass props to children, the rendered children are passed as props to the parent. 
You end up with a diamond with all state on the top and the root of the dom tree on the bottom.

One note, is that the tree is lazy as well as memoized, there's potentially many computations that don't actually need to be computed at all at any given time.

You need something like Rx to make an observable of the root state, some other tools to know when the external state changes. Some memoization library, and the react is left with just the dom diffing, but at that point you should swap out to a simpler alternative.

patrickthebold··on The death of partying in the USA
Reminds me of the Jonathan Richman classic: https://www.youtube.com/watch?v=Y6Pg9IGgQpY
patrickthebold··on Converting a Git repo from tabs to spaces (2016)
Is .git-blame-ignore-revs what you are looking for?
patrickthebold··on Numbering should start at zero (1982)
The reminds me of the pain I felt seeing how the blacktop was painted at the local elementary school:

They had a 6 x 6 grid with 26 letters, then the digits 1-9, then an extra X to fill in the space left over. :facepalm:

patrickthebold··on Harvard says tuition will be free for families making $200K or less
Source?
patrickthebold··on Ohm: A user-friendly parsing toolkit for JavaScript and TypeScript
In the past, I had always had a distaste for 'stringy' data, always preferring more structure (e.g objects). Once I learned about parsers, I realized you can still have structure in a string.
patrickthebold··on Does Your Code Pass the Turkey Test? (2008)
It depends on what you need to do. If you just need to say when something happened (e.g. some log event) then milliseconds since the epoch is fine. If want a user to schedule a reoccurring meeting at 8am on the first Thursday of every month, you can also keep a set of timestamps as milliseconds since the epoch, but you are going to need to do some work to figure out the right numbers correctly.
patrickthebold··on Contradictions in photography advice
Not gp, but as an example of what they mean: take a photo at 70mm then at 120mm. You can crop the first photo to be have the same composition as the second, but the resolution will be lower.
patrickthebold··on Effect of a giant meteorite impact on Paleoarchean environment and life
It's a poisson distribution.
Page 1 of 12Next →