HNHacker News
TopNewBestAskShowJobs

hansvm

5,675 karma · joined December 22, 2019

submissionscomments
hansvm··on How to Implement an FPS Counter
For dynamic alpha, start by pretending the new incoming, windowed data doesn't exist. Look at your old data. How quickly do you want it to disappear? It'll have some formula like e^-(bt) for some constant b governing what proportion from 0 to 1 of that data still remains.

So...T seconds have elapsed since your last frame, and you have a new data point you'd like to incorporate into your EMA (and, for this problem, that data point is T itself). You keep e^-(bT) of the old data, 1 minus that of the new data, and you're done. Alpha is indeed 1-e^-(b * cur_spf) for some constant b, just like the AI said.

Which b do you choose though? I usually prefer to think of it in terms of half lives. Let H be your desired half life, and set 1-e^-(bH) equal to 1/2. You get b=log(2)/H. That's similar to the AI answer, but it rescales window_secs into a parameter you can actually start to reason about. The AI answer gives you a 1/e life instead, which is a less comfortable constant to mentally process.

That answer also naturally generalizes to other "time" axes or denominators. Suppose you want to EMA using discrete events rather than wall-clock time. Replace T in your dynamic alpha with the discrete count of events you haven't updated the EMA with yet (e.g., if something happens every time tick you would usually take T=1, but you can increase that based on a few skipped frames or whatever if you'd like).

As a fun fact, you can tailor this sort of stateless solution to have almost any decay property you'd like. Start with your favorite ODE satisfying a few properties, and this equation falls out as the step a discrete solver would take to approximate the ODE.

hansvm··on Refuse to let your doctor record you
If I paid all my doctors $1200/hr and doubled how much time they spend with or on me, that'd still pale in comparison to healthcare expenditures attributed to me between actual insurance payments and actual money leaving my bank account. Doctors being spread too thin is very much a separate issue.
hansvm··on UK Biobank leak: Health details of 500k people offered for sale on Alibaba
Not ordinarily, at least not anymore. They cancelled Project Beanstalk in the late 2010s, now relying on the legal system to extract perceived debts.
hansvm··on John Ternus to become Apple CEO
I mean, they're not bad, but they have spicy chargers, the corners are uncomfortably sharp, the keyboard often doesn't register, the LCD is prone to vertical bars and other issues even without physical damage and is extremely sensitive to bumps and other minor damage elsewhere on the laptop (not even the display itself), and so on.
hansvm··on The insider trading suspicions looming over Trump's presidency
Or we can use this camel's straw to finally draw a bit of inspiration from our French compatriots. The power these people wield is artificial, and we're capable of taking it away.
hansvm··on It's OK to compare floating-points for equality
That works well for sorting/bucketing/etc in a few places, but as a comparison it's prone to false negatives (your values are close and computed to not be close), so you're restricted to algorithms tolerant of that behavior.
hansvm··on It's OK to compare floating-points for equality
My normal issue with floating-point epsilon shenanigans is that they don't usually pass the sniff test, suggesting something fundamentally wrong with the problem framing or its solution.

It's a classic, so let's take vector normalization as an example. Topologically, you're ripping a hole in the space, and that's causing your issues. It manifests as NaN for length-zero vectors, weird precision issues too close to zero, etc, but no matter what you employ to try to fix it you're never going to have a good time squishing N-D space onto the surface of an N-D sphere if you need it to be continuous.

Some common subroutines where I see this:

1. You want to know the average direction of a bunch of objects and thus have to normalize each vector contributing to that average. Solution 1: That's not what you want almost ever. In any of the sciences, or anything loosely approximating the real world, you want to average the un-normalized vectors 99.999% of the time. Solution 2: Maybe you really do need directions for some reason (e.g., tracking where birds are looking in a game). Then don't rely on vectors for your in-band signaling. Explicitly track direction and magnitude separately and observe the magic of never having direction-related precision errors.

2. You're doing some sort of lighting normalization and need to compute something involving areas of potentially near-degenerate triangles, dividing by those values to weight contributions appropriately. Solution: Same as above, this is kind of like an average of averages problem. It can make fuzzy, intuitive sense, but you'll get better results if you do your summing and averaging in an un-normalized space. If you really do need surface normals, store those explicitly and separate from magnitude.

3. You're doing some sort of ML voodoo to try to get better empirical results via some vague appeal to vanishing gradients or whatever. Solution: The core property you want is a somewhat strange constraint on your layer's Jacobian matrix, and outside of like two papers nobody is willing to put up with the code complexity or runtime costs, even when they recognize it as the right thing to do. Everything you're doing is a hack anyway, so make your normalization term x/(|x|+eps) with eps > 0 rather than equal to zero like normal. Choose eps much smaller than most of the vectors you're normalizing this way and much bigger than zero. Something like 1e-3, 1e-20, and 1e-150 should be fine for f16, f32, and f64. You don't have to tune because it's a pretty weak constraint on the model, and it's able to learn around it.

hansvm··on Coq theorem prover is now called Rocq
standup> My coq experiments are promising, but it feels a little harder than it should be, and I'm worried it'll be too slow to deliver without some training and long practice sessions.
hansvm··on Anna's Archive loses $322M Spotify piracy case without a fight
Sure, why not? Current US music revenue is $6/mo per US taxpayer. For less than half the cost of Spotify you could 5x the income going to musicians if you skipped the middleman and magically just paid them directly. That doesn't seem like a bad deal.
hansvm··on Open Source Isn't Dead. Cal.com Just Learned the Wrong Lesson
I don't really know, but I have a story which might prompt some conversation about it.

At $WORK we had a system which, if you traced its logic, could not possibly experience the bug we were seeing in production. This was a userspace control module for an FPGA driver connected to some machinery you really don't want to fuck around with, and the bug had wasted something like three staff+ engineer-years by the time I got there.

Recognizing that the bug was impossible in the userspace code if the system worked as intended end-to-end, the engineers started diving into verilog and driver code, trying to find the issue. People were suspecting miscompilations and all kinds of fun things.

Eventually, for unrelated reasons, I decided to clean up the userspace code (deleting and refactoring things unlocks additional deletion and refactoring opportunities, and all said and done I deleted 80% of the project so that I had a better foundation for some features I had to add).

For one of those improvements, my observation was just that if I had to write the driver code to support the concurrency we were abusing I'd be swearing up a storm and trying to find any way I could to solve a simpler problem instead.

Long story short, I still don't know what the driver bug was, but the actual authors must've felt the same way, since when I opted for userspace code with simpler concurrency demands the bug disappeared.

Tying it back to AI and hacking, the white box approach here literally didn't work, and the black box approach easily illuminated that something was probably fucky. Given that AI can de-minify and otherwise spot patterns from fairly limited data, I wouldn't be shocked if black-box hacking were (at least sometimes) more token-efficient than white-box.

hansvm··on Spain to expand internet blocks to tennis, golf, movies broadcasting times
Yes and no. Storage should cost in the ballpark of $200M/yr or less. Transcoding, networking, and delivery should be similar. Let's round up to $10B/yr just for fun.

YT makes $40B/yr (revenue IIRC) across its 3B customers, or $1.11/mo. $16/mo seems high by comparison. It's very high with reasonable costs of $0.28/mo. Nearly every other industry on the planet is jealous of margins like that.

A normal counter-argument here is that they should be allowed to reap those profits till competition forces them to do otherwise. That's a little at odds with our normal view toward monopolies, especially when the monopoly engages in anti-competitive acts to preserve that edge, but whatever; now you're at least having a real debate about real facts and things you care about.

Another is that YT's expenses in practice are way higher than that because they need to hire a bunch of ML people or whatever to extract even more ad money out of you, and that's a point I disagree with pretty firmly. I'm not sure why my subscription needs to subsidize a company's other predatory tendencies.

hansvm··on US appeals court declares 158-year-old home distilling ban unconstitutional
Yes, but distillation involves heat, and I'm curious if possibly the sugar reacts with anything to cause different aromatics or something, or perhaps fermentations stopping at higher sugar concentrations have a better aromatic profile for distillation even when the raw material is sub-par.
hansvm··on A new spam policy for “back button hijacking”
And lazy unload, so you can't find it even if you've already scrolled through the whole thing.
hansvm··on A new spam policy for “back button hijacking”
On qutebrowser I type 2H instead of H, and it doesn't go to the most recent history item at all. Mostly though, no, spammy websites still do this, and browser's haven't fixed it.
hansvm··on US appeals court declares 158-year-old home distilling ban unconstitutional
On the other side, why should one crazed/corrupt judge in some state which has nothing to do with me be able to infringe on my freedoms and make my life worse? Worse, why is it possible to jurisdiction shop for the single bad actor and impose your will on the entire country?

You're not wrong, but (like most issues in a 350M-person country) it's complicated. The system is tailored to some expected level/type of corruption and bad actors. If you expect that the government is basically fine and that out of 50M people per region surely somebody will file suit if the issue is important then the current system makes a lot of sense. You get judges with more knowledge and awareness of your local issues, anything important still gets addressed, and you're resilient to some degree of random bad judges and bad actors. If those expectations are out of whack then you get worse outcomes.

In reality, the world is complicated enough that even boiling down the lists of judges and whatnot to that simple of a description is misleading at best. Neither solution is anywhere near optimal by itself. So...what next?

hansvm··on US appeals court declares 158-year-old home distilling ban unconstitutional
I'm not sure if it extends to box wines or Spanish wines, but my main complaint of bottom-shelf wines in the US is that they're pure sugar/acid/alcohol with almost no extra flavors and pretty bad distributions of the main components (especially being far too sweet). A small pattern I'm noticing in your description is the presence of sugar in the distillation inputs. Assume I know nothing about distillation; is that relevant?
hansvm··on US appeals court declares 158-year-old home distilling ban unconstitutional
Small-scale distillation is fine. Ten bottles of wine have 500mg of methanol, which is mostly fine for most people even if it all ends up in the same shot -- which it won't; it'll be split between 1-2 750ml bottles even if you do absolutely nothing to remove it from the ethanol.
hansvm··on Pijul a FOSS distributed version control system
Last I tried to run Pijul (IIRC, 2.5yrs ago), there were major, seemingly unresolvable crashes for the simplest of operations on Mac and Linux. Has it gotten better?
hansvm··on One neat trick to end extreme poverty
None of these stats (including the person you're replying to) are directly comparable.

- Median net worth is $193k, of which $185k is in their home. Suppose a $10k emergency crops up. Well...you're fucked. If you're lucky you can take out a loan against the accrued value relatively quickly, but otherwise you're taking a 10% haircut having to sell quickly, another 10% in transaction fees, and another $10k in the sudden move/storage/renting/loss-of-work/etc situation you found yourself in liquidating your home to cover an extortionist colonoscopy+lawyer pricing or something. You're _fine_, but when minor road bumps can cause $45k setbacks ($55k if we count the $10k expense this depended on) you're not not living paycheck to paycheck.

- You can't compare the median savings to the median net worth. They're not the same person, and the cross-terms can take almost any distribution.

- The 54% stat is based on self-reported vibes and is pretty blatantly wrong. The median household also has $5200 in unavoidable (without delinquency, losing your home, etc) expenses, which doesn't jive very well with $8k in savings somehow lasting 3 months (assuming the cross terms I complained about aren't too terribly distributed). You would expect 2+ paychecks of stability (which, incidentally, is also the usual prompt for "paycheck-to-paycheck" stability -- not whether it takes one paycheck to be screwed but two), but then you're hosed.

And so on.

You're _right_; the median US household won't go broke missing a paycheck; but 2-3 paychecks is enough to cause major problems at the 50th percentile, give or take friends and family stepping in to soften the blow.

hansvm··on One neat trick to end extreme poverty
I know a number of people who view basically any kind of aid as morally wrong, ultimately leading to the downfall of the people you're trying to help. Even with their own kids, once they're 18 they're on their own -- no help with college, no inheritance, no etc. They really believe that handouts create a situation worse than whatever ill they're solving.

Mind you, they still think poverty is bad, but they'd object to something like paying for basic infrastructure and be happy to create the modern-day equivalent of CCC camps to pay the poor people to build that infrastructure. That sort of thing.

hansvm··on One neat trick to end extreme poverty
How does that work mechanically? If I have a home to rent out, why don't I reduce prices to $19k to guarantee zero occupancy-related losses, and why doesn't somebody else out-compete me?
hansvm··on Filing the corners off my MacBooks
It happens new too, and it's not the DC side of things. The AC -> DC component has some AC leakage, and the default of bad two-prong charging blocks basically guarantees you'll have issues.

I normally "fix" it by using a USB-C charging brick and cord from a better company (somehow they're all fine even ungrounded), but the factory default is bad.

hansvm··on Filing the corners off my MacBooks
People come in all sorts of different shapes, sizes, and configurations. I don't have any pressure on the sharp edges in my normal day-to-day, and I'm having a little trouble figuring out how I'd contort myself to change that, so that particular issue is fine.

The glare is annoying. I would like to work outside more often.

Mind you, I don't really like the poor isolation and floating ground causing a tingling sensation when you touch it while charging, the lid hinge doesn't quite have enough internal resistance, the keys get stuck way too easily, etc. The sharp-corners build defect is fine for me though.

hansvm··on Meta removes ads for social media addiction litigation
Aha, how clever. We aren't discussing whether they can be forced to display messaging; we're discussing whether they're going to later get slapped down for blocking that messaging.

I get that the distinction matters a bit from time to time (court cases keep blurring the line in the US though), but:

1. With all the other shit that makes it through the filter, this was pretty clearly a targeted, strategic takedown rather than some sort of broad "we don't allow bad ads on the platform." Allowing "all ads" isn't the thing being argued; it's allowing "this ad."

2. The non-offensive idea of "abusers shouldn't be allowed to deceive and gaslight their victims" is pretty strongly in favor of this being a bad move on Meta's part if it was an intentional act. Maybe it shakes out fine for them legally in this particular instance, but the fact that as a society we routinely require companies and individuals to behave with more appearance of moral standing than this suggests that blocking this particular ad is over the line, and it's neither naive nor utopianistic to think so. Even if it's legally in the light-grey, it's an abuse of power worth talking about, and hopefully it inspires more people to leave their platform.

hansvm··on Meta removes ads for social media addiction litigation
Companies have to inform affected individuals of data breaches, especially when HIPAA gets involved. Brokers have to inform clients of transaction errors. Auto manufacturers have to inform owners of recalls. Retirement funds have to inform plan participants of lawsuits involving those funds.

You don't even have to invoke the idea that Meta is big enough to be regulated as a public utility for this to have broad precedent in favor of forcing a malicious actor to inform its victims that they might be entitled to a small fraction of their losses in compensation.

hansvm··on Employers use your personal data to figure out the lowest salary you'll accept
They're still maybe right. In CA, it's pretty common for the best plan you can buy as an individual to be half as good as whatever your employer offers and to cost twice as much as the combined employee+employer contribution.

How does ICHRA fix that? What's this "contracting with certain networks" you're referring to?

hansvm··on Advice to young people, the lies I tell myself (2024)
Cold applying works reasonably well IME, but you have to be able to nail the interviews for it to make sense. I'm great at what I do, I only apply to jobs which should be a good fit, and I still only get interviews 1-2% of the time. I then get offers 95% of the time, which keeps the process manageable.

I've gotten 3/4 of my tech jobs through cold applying though [0], and been offered many, many more. I know it's possible.

Ok that note, I love my current job, and I would've never found anything like it through my network. Cold applying was a literal game-changer in that regard.

[0] One was through Google Foo Bar, and one was through Codefights (now Codesignal or something), so those were slightly more tailored than cold applying.

hansvm··on Principles and Gear
I had chronic pain in various parts of my feet for years from fairly tame activities (biking 20mi/day, hiking 10-20mi Saturday and Sunday, etc). I'd been fairly conscientious about "good" shoes that fit well, and it didn't make a difference. My in-laws had me go to a running shop, and the founder studied my gait for a bit and picked out shoes which would help. A month or two later, all the pain finally disappeared, and I haven't had issues in years.

That's just an n=1 anecdote, but years of pain followed by years of non-pain with a single, obvious intervention in between seems like a reasonably strong signal.

Assuming I'm not reading too much into my experience, if you're feeling fine I think your strategy probably works, and my only concern might be long-term damage you're not recognizing immediately. Other people will be more knowledgeable as to how you'd test that, but if you're comfortable and not injuring yourself then I don't think you're missing out on anything.

hansvm··on Android Developer Verification
That sounds a lot like my experience as an Apple Developer too, with the added bonus (unclear from your description if you experienced this too) that they took my money before the verification process was finished and wouldn't refund it once their AI couldn't connect my face to my ID and wouldn't let me connect with a real person (the first dozen times were on them, but after that it was maybe my fault for including a middle finger in the photographs).

Is there a way around this shitocracy?

hansvm··on Philly courts will ban all smart eyeglasses starting next week
> not every day

Yep

> can take your PTO

You can, but if salaried you usually shouldn't, ignoring any particularly malicious employers and social contracts around the outskirts of the law.

> No obligation to pay hourly employees, tips, etc

Yeah, if you're not salaried you're screwed. PTO might cover a few days, but if you have a month-long trial and need money for rent then my understanding of the law is that serving as a juror will make you homeless unless the courtroom is willing to extend some compassion for your hardship.

← PreviousPage 9 of 34Next →