News for hackers. Stuff that matters.

mitchellpkt

In my own experience with data science work:

On multiple occasions I’ve seen noticeable accumulated rounding error crop up by the end of a cumprod over very long timeseries of floats.

But in my cases it has just been a minor nuisance that I have to double check whether a mismatch came from float-related quirkiness or a code mistake.

I got into the habit of just using integers where applicable for cases that need to match down to the last bit, and numpy.isclose() for inherently floaty cases where it’s anticipated and reasonable.

Only speaking from my own experience, which doesn’t involve chaotic systems or anything like that. I’m curious to hear from people in other domains who may have more exciting stories.

Re:What are unrelated cost of switching to Linux you know? on Monday August 18, 2025 @03:17PM (#44944220)
Graphics drivers roulette

Will this update get me over 30 fps, or break my ability to boot into a GUI?

There's only one way to find out ;)

Excellent catch! I had to go back and take a second look, because I completely missed that the first time.
This is a really neat idea! I never thought about taking emissions into account when provisioning infrastructure. Only a small subset of my cloud workload is performance sensitive. For the majority of tasks (tests, background ETL processing, etc) I wouldn't even notice small latency increases.
Oh yeah totally agree, I was thinking of the king as separate from the pieces. If a lone king cannot move, that changes the dynamics considerably.
Interesting. Hmmm, I have to think this through. I believe that if the game followed normal chess rules, except for replacing the pieces with queens, then games where the captures are all even trades would result in draws, but if one side could come out ahead with K+Q vs K, then there would be the usual mate sequence.

HOWEVER the rule OP added that "a piece may only move if it is adjacent to another piece of either color" slightly complicates the endgame. My normal tendency would be to put the queen far away from the action to avoid blundering it, but here that would instantly deactivate it. It's kind of funny to picture the kings racing across the board to capture or reactivate the last inert queen.

I think one can still get the usual style of mate in this variant, you just have to walk the king and queen together, and pay extra attention to avoiding stalemate. For example, imagining white king on e1, black king on e3, black queen on d3. If white to move then Qb1# or Qe2#, fairly standard maneuvers (though if black to move that's a stalemate).

This is an interesting modification to the game, I'd play a few rounds...

I tried to find some way for white to force a win, but no obvious forcing sequences jumped out at me.

Like you said, "I don’t see one, but do not rule out one, either."

Python package management infrastructure and tooling works fine for me, and I use python frequently.

There is a relevant xkcd: https://xkcd.com/1987/

Re:Best Linux distro in 2025 for non-experts on Sunday March 30, 2025 @09:11PM (#43529606)
I use a few different distros on a routine basis. Out of those, Ubuntu would probably be the best fit - it generally works right out of the box, the UI is intuitive for day-to-day use, there's plenty of information online about how to install/use/troubleshoot it, and the App center has an open source alternative for anything and everything. Mint might also be a good fit - I had a very positive experience last time I used it, but that was a few years ago so I haven't tried the newer releases.
edit: nevermind, it's sage code not python code
Re:Email address validity checks suck on Monday January 20, 2025 @11:19AM (#42770110)
> I suspect what's happening is they've got some rule against the word "spectrum" or something

I've avoided this by using only the first few and/or last few letters of the service in the email tag (e.g. "HaNe" instead of "hackernews"). It's an easy filing system for me, doesn't trigger concerns about phishing, and makes for shorter handles.

Re:2024 Lichess Recap on Tuesday December 17, 2024 @11:56AM (#42442989)
This is awesome, I had no idea about my total move count and puzzle stats.

If you're already logged into Lichess, you can go straight to your own recap here:

https://lichess.org/recap

Re:ChatGPT's Prompt Rules Revealed on Saturday December 07, 2024 @11:02PM (#42354939)
Nice find! I was able to reproduce this.

https://chatgpt.com/share/675518bd-7044-800e-992a-c0b3c49b9b...

The response is extremely similar, though not quite verbatim.

Yep I found this approach works great.

I have a personally-owned domain name connected to my [paid] account with a smaller email provider.

The domain is managed at a large well-known registrar, I keep it paid up 3+ years in advance, and make sure to keep my contact information up to date.

If anything goes wrong with the email provider (including going out of business), I will just redirect from my DNS settings. If I get locked out of my domain for some reason, there are clear next steps for me to open a ticket with the registrar and move towards resolving the issue.

I got it all hooked up in an afternoon, many years ago, and it was completely set-it-and-forget-it, besides logging into the registrar occasionally to extend the domain ownership.

(continuous backups are another matter - mine aren't fully automated yet)

Re:Ask HN: What programming language should I learn? on Thursday August 29, 2024 @08:49PM (#41396808)
You might enjoy learning Lean, which is a functional programming language specifically for theorem proving. You can tackle interesting types of questions, and it is actively used in mathematics research.

Here's a neat walkthrough from Terence Tao, which might give you a sense of whether it's something that piques your interest: https://terrytao.wordpress.com/2023/12/05/a-slightly-longer-...

Re:Ask HN: Is active music cancelation possible? on Saturday July 27, 2024 @03:48PM (#41088865)
Back in 2018 I spent a week or two messing around with this idea, and produced a hacky proof-of-concept.[1] It's not intended for real-time or production use, I just made a prototype to see if it could be done.

The README explains the method: once the contaminating song is identified, it syncs up the recordings in time with a correlation analysis, adjusts for frequency-dependent gain effects, then subtracts the undesired content.

Warning: I'm not an audio engineer, the output sound quality is NOT good! This was just a toy project in my early days of learning to code. I assume there are much better ways to approach this that would yield significantly better results.

[1] https://github.com/mitchellpkt/tracksubtract

For personal correspondence, I've exclusively used Proton Mail for the last 7 years or so. I have been happy with it, no plans to change. I migrated from Gmail, and initially set up message forwarding so that I would still receive emails from old contacts. A few years ago I connected my personal domain with Proton so that I can send and receive from @mydomain.com - their setup wizard was quite helpful.

I've also used the calendar, drive, and VPN products. They all seem to work well in my experience of light day-to-day personal use. For the email and calendar products, I interact with both other Proton users and people using other providers (Google products, company-administered systems, etc) and it seems to integrate seamlessly. If you use Google docs/sheets/slides, it can be convenient to set up a Google account tied to your Proton Mail address, with no associated Gmail addresses.

Re:Ask HN: Who programs outdoors and how do you do? on Friday March 22, 2024 @11:37AM (#39791752)
In addition to what others have mentioned, I find it really helpful to temporarily switch my IDE to high-contrast light mode, when working outside in bright conditions. Otherwise I prefer dark mode.

A larger and/or high-contrast mouse cursor can be helpful too.

Re:Ask HN: I made a mistake, role is not a good fit on Friday February 09, 2024 @11:39AM (#39316717)
Politely mentioning that you don't want to work on holidays could be a great answer if they ask why you're looking to change companies. You could just say something like: "I'm looking for a job that allows me to spend holidays with my family." (and leave it at that)

It's a totally normal expectation, the explanation doesn't reflect poorly on you or your past employer, and it sounds like it is genuinely important to you.

If you want an answer from the model itself instead of search results, you can frame it like: "Without looking anything up, <original request>"

For example: (today, GPT-4)

> "Who won the physics Nobel prize in 2023?" --> uses Bing & provides citation link [0]

> "Without looking anything up, who won the physics Nobel prize in 2023?" --> does not use Bing [1]

I don't know this approach will work forever, but at time of writing it has been effective for me.

[0] https://chat.openai.com/share/e49bef80-55d1-4e85-b765-79933f...

[1] https://chat.openai.com/share/a65eab46-f0f2-4e1c-b530-1c1594...

Re:ChatGPT Isn't as Good at Coding as We Thought on Thursday August 17, 2023 @12:06PM (#37163844)
Note that at time of writing the “ask the code” plug-in does well with describing repo structure, but hallucinates file contents (I tested it on one of my own repos)
Re:Ask HN: Any freelancers here? I need burnout advice on Thursday August 03, 2023 @01:17PM (#36988782)
Just find one or two temp agencies in your area - they’ll probably get you placed into the type of gig you want quickly, and there will be no expectation for long term commitment. Can’t hurt to try.

At one point I had a 3 month break between research gigs, and just got a temp job moving boxes around a factory. Long hours and bad pay but it was a nice change of pace for a bit.

Re:Matrices and Graph on Saturday July 15, 2023 @01:29PM (#36739116)
Is the effect of measurement units eliminated by applying something like zero mean unit variance normalization prior to dimensionality reduction?
None. I’ve dealt with python2 in some personal projects, but professionally I write everything for in 3.8 style syntax and then run in 3.8 or 3.11 environment depending on the context.
I’d love to see the result, though I suppose there would not exist an exact FFT for an aperiodic tiling.
I don’t agree with their decision but I can hazard a guess at their reasoning.

While your business hasn’t changed, the regulatory and compliance landscape has become increasingly difficult, and at times hostile towards the cryptocurrencies sector and its participants.

Twilio is probably just worried that servicing your company could lead to them being categorized as facilitating cryptocurrency transactions, and thus subject to extensive financial regulation and complications that they’re not willing to deal with at this time.

For me, the biggest productivity boost is from work that is (1) boring or time consuming to do, but (2) easy to verify / QC. (3) Extra useful if it is something that can the code interpreter can unit test in place, and iterate the code until the test passes.

For example, I’ll show it some big nested json response, then ask: Please write a python helper function get_foo_and_bar(endpoint: str = “whatever”)->Dict[str, Any] that hits the endpoint with <parameters>, then pulls out the foo and bar, and converts bar to List[int]. Please write and run a test that verifies the retrieved values from the above response are foo=“baz” and bar=[6,9,2].

It might take it 2 or 3 tries to get right, but it will iterate on its own until it works. Same process as if I were writing but by hand, but the 2-3 iterations might take me a few minutes and only takes the model a few seconds.

Re:Cicada: Private on-chain voting using time-lock puzzles on Thursday July 06, 2023 @11:03AM (#36617097)
They’re fundamentally different since the standard definition of a VDF is strictly non-parallelizable and P/o/W is generally designed to be “embarrassingly parallel.”

It may seem like a minor subtlety but the resulting dynamics are dramatically different. For a VDF it doesn’t matter if you have 1 machine churning away or 1000 machines churning away, it will take you the same amount of time to finish the calculation.

Re:Proposing a Struct Syntax for Python on Wednesday June 14, 2023 @02:54PM (#36330806)
Could use a class, but access the value without ever instantiating it? Not sure if this fits the bill for what you want, or if the fact that it could theoretically be instantiated renders the approach non-suitable.

  class Config:
      root_directory: str = "/tmp"
      should_frobnicate: bool = False
  
  if __name__=="__main__":
      print(f"{Config.root_directory=}\n{Config.should_frobnicate=}")
When I was learning dvorak (more than a decade ago) I bought a cheap keyboard at a garage sale and rearranged the keys. An easier approach is just to get stickers.

I used that trainer keyboard for a summer, until my typing muscle memory was updated to dvorak.

Since then, I don't look at my keyboards while typing, so the fact that the keys are labeled for qwerty doesn't really matter.

Older »