News for hackers. Stuff that matters.

henshao

Re:Reflections on 1,000 Days of Math on Saturday September 26, 2026 @03:41PM (#49859842)
I have a 2 tier-ed personal response to this question.

For "basic math" up to high school algebra and such, having an intuitive understanding of this lets me quickly do back of the envelope math anytime I hear something that sounds off, or something matches a "pattern" of a type of math I've done before.

Two concrete examples of this are:

  - doing drop rate calculations in games (probability)..i.e. I've killed 500 of these, and it is interesting to note that I should've gotten this drop 93% of the time. I'm mathematically unlucky. 

  - trying to calculate how much it is worth to me to drive at 80mph vs 55mph to get to work, and the relationship between gas prices and my willingness to drive fast (algebra, physics, etc)
For more advanced math, I personally find my high level understanding of the topics enough to appreciate how much goes into everyday things. The algorithms that govern our understanding of radio signals, information theory to pack bits into a given bandwidth and frequency, algorithms and math to ensure what was transitted is what is received, and how hundreds people can be using it at once and still get their data where it needs to go. The amount of math that goes into this all makes me appreciate the beauty of it all.
I think in 2026 it's hard to make a video look this "bad" without it being a clear aesthetic choice, so not sure you could find this video in another setting.
Re:Code Reviews: A Success Story on Wednesday January 15, 2025 @11:06PM (#42721052)
I have trouble with code reviews because I can't run the code from the review GUI, so I usually look at the tests run in CI or pull and run it myself, if possible. Is this not a problem other people have? Is this a tooling problem?

By putting breakpoints in the code, and seeing what the changed lines do, I can compare the output line by line with my mental model of what should be happening, and this thoroughly helps me verify the changes.

Re:Unit Testing Numerical Routines on Sunday November 17, 2024 @11:02AM (#42164858)
For coordinate transforms specifically, I also like to run through the whole chain of available, implemented transforms and back again - asserting I have the same coordinate at the end. One method might be wrong, but they "can't" all be wrong.
Re:JSON for Classic C++ on Wednesday November 13, 2024 @11:22PM (#42133150)
Really interesting that nlohmann isn't fully compliant. What cases are these?

It seems to me though that if you're encountering the edges of json where nlohmann or simple parsing doesn't work properly, a binary format might be better. And if you're trying to serialize so much data that speed actually becomes an issue, then again, binary format might be what you really want.

The killer feature of nlohmann are the the NLOHMANN_DEFINE_TYPE_INTRUSIVE or NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE macros that handle all of the ??? -> json -> ??? steps for you. That alone make it my default go to unless the above reasons force me to go another direction.

I'm going to assume you have about as many years of experience as me based on your profile, but if you're going to argue that maintaining this script - for the sole convenience of deleting a branch out from underneath you - is worth it, then there's nothing more I can do to help you.
Hey. I think my point is that writing and maintaining 900 lines of code is an option, and another option is to figure out how to not write and rely on 900 lines of code. I looked through git-more-restore a bit and I think you're trying to reverse permission changes in your working branch back to what's on HEAD.

I think a way to do this is to not let git track that in the first place, with some variation of:

    git config core.fileMode false
via: https://stackoverflow.com/questions/1580596/how-do-i-make-gi...

or

https://stackoverflow.com/questions/2517339/how-to-restore-t...

Just for anyone else following along..you're right. Here it is.

    git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
Thanks for keeping me honest. I just read the first line of the stackoverflow, but the one liner is still in the comments. I just tested it.

https://stackoverflow.com/questions/7726949/remove-tracking-...

    git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
Yeah I am just finding it hard to believe that there are so many people who don't.

Maybe we are 10x engineers w.r.t. git aliases. Congratulations

These should be aliases in your git config.

    git config --global alias.<cmd> <cmd>
I'm really trying to understand, and not to be too negative. I get coming up with a solution to a problem, and finding it neat locally. But before posting to HN, one might realize that these solutions that git provides existing tools for is better than maintaining this.

I'm also confused by all the comments just blindly commenting in the affirmative or providing suggestions. Are we all bots?

"git delete gone branches" is a one liner that you can google. first stack overflow result gives you the answer:

    git remote prune origin
Why would you use this 50 line script to do the same?
This was my first thought as well. This might be an indictment of how obscure/confusing some git invocations are...hence the alias to human readable names.

It is kind of interesting that there is much interest, work and maintenance on these over-complications...There seems to be a related repo - git-extras - that does the same as this repo, and has 17k stars.

As someone of asian descent, I find it interesting how so many of these comments have such a stereotypical software engineer's "why don't they just XYZ" statement and its pretty eye opening.

I know I'm guilty of this at times too, but this example is really funny to me, and I guess I'll try rein in my assumptions that people are irrational in the future.

Re: on Monday March 13, 2023 @10:24PM (#35146555)
To hop on this tagline train...open to any critiques.

"Share any link with ads and tracking removed."

Rationale:

Sharing = most important verb/subject. Followed by the subject (links)

Ads and tracking - people know what ads are, they might know what tracking implies. trackers may be more abstract.

Clutter - removed this word. What does clutter mean in this context?

Re:Quitting the Rat Race on Monday January 16, 2023 @06:57PM (#34407248)
I had the same thought about the twitter link. I also find that many people decide to disconnect from the "rat race" and explore the mountains and be one with the earth...often after you're already set up from your racing days that you can afford to adventure off like that.

But yes, good for him. I also like the mountains.

Re:The quiet cost of family caregiving on Thursday September 08, 2022 @12:38AM (#32761230)
https://www.sensorscall.com/#HowItWorks

Plug in "night light" smart devices that detect pattern of life and deviations from it, reporting to a connected smart phone.

I like it.

Re:I should have loved biology on Sunday July 10, 2022 @08:50AM (#32044246)
Associate professor of medical physics & molecular imaging

In their profile

This seems like the right thread to ask.

I love the idea of tools like these to be able to easily and programmatically draw diagrams, but eventually it gets thrown into a powerpoint, where then it is locked behind some tool and arcane DSL that only I know. So when my boss who doesn't care about the tools inevitable wants to move the arrow up an inch or make the box green instead of blue, I have to go back to do it. Meaning I give up on using these tools so I don't end up a fulltime diagram engineer.

Anyone know of a tool that is close to inkscape/graphviz, but has an "export back to powerpoint" feature?

Re:New(ish) command line tools on Wednesday April 13, 2022 @04:44PM (#31020016)
Thanks for the grep tip!

Unfortunately I've not put in the effort to learn awk past printing the n-th column of ls (my typical use) - the extra syntax required to properly 'quote' and {} things puts me off.

Re:New(ish) command line tools on Tuesday April 12, 2022 @08:59PM (#31010050)
Just posting this without trying it out...grep -nH gives you line numbers and full filepath context, and as another commenter said, -ve allows you to string multiple excludes, so grep -inH <search> -ve not_this -ve nor_this -ve nor_that.
Re:Player of Games on Wednesday December 08, 2021 @09:44AM (#29485265)
I think splendor gets more interesting if your opponents are also trying to be strategic. You can see what color chips they are picking up, which lets you know what they are aiming for, which influences what card you want to aim for or reserve. Mid game, you can see what colors other people are missing and try to corner colors to give you room to breath and pick up cards. You can also see the set of colors people are holding to see which of the 4 final bonus point cards are being fought over.

I like the game for what it is. I'd say, surprisingly strategic.

I don't know about you, but for my tests on a curve where I might not be able to answer all the questions, doing the quick skim to answer the low hanging fruit before getting to the harder problems is a good way to make sure you don't run out of time and lose out.
back of envelope:

450k man hours = 225 people full time, 1 year @ ~ 70k a year = 15m

They added 34 more suites * 2 people * $1000 per person per cruise week = 78000 more per trip

~200 trips to pay back the cost - not sure what the utilization of cruise ships is usually, but if they do 40 packed cruises a year, they're at a ~5 year ROI.

I guess I forgot the cost of the new section itself, but I'm going to guess all in, < 10 years ROI?

What kind of reoccurring microsoft expenses would an organization be able to shed? Can't really cut back on costs for word and excel/office suite. If your data is in Azure already, it would cost even more probably to move it all off and administer it yourself. Seems like they're pretty well locked in.
Re:A New Accent Is Developing in Southwest Kansas on Tuesday June 19, 2018 @01:46PM (#17348752)
It might change your results if this were done based on drive times instead. I noticed because Chatham seems to be furthest from Boston radially, but Provincetown is definitely further by car.
Re:The Mac Pro Lives on Tuesday April 04, 2017 @12:14PM (#14034250)
Don't browsers generally use more RAM when more is available? I only have 12 GB on my laptop and I've never really noticed anything. It's not like I'm using all 50 tabs and 20 applications at once, and the split second that it takes to reload the app state/data into RAM if it got bumped doesn't bother me.
Re:New GM Cruise Self-Driving Video Shows More Mastery of SF Roads on Wednesday February 08, 2017 @05:15PM (#13602704)
They included an annotation that says that it was a "scheduled stop".
Re:Microsoft, Rebooted, Emerges as a Tech Leader on Friday December 16, 2016 @11:53AM (#13194613)
Is it just me, or is the usual "copy title, paste into google search" not working this time? I can't manage to find the google search result for this article, even after trying many combinations of google filters/date filters.

They've caught on?

Older »