HNHacker News
TopNewBestAskShowJobs

cshokie

126 karma · joined September 1, 2019

submissionscomments
cshokie··on Inventions for battery reuse and recycling increase seven-fold in last decade
How do you deal with voltage balance when replacing one bad cell out of a whole battery? My understanding is that lithium ion battery cells need to be close to each other in voltage or else they suddenly rebalance when reconnected, and can burst into flames.
cshokie··on Windows quality update: Progress we've made since March
Notepad also understands line endings and text encodings now, instead of always writing as CRLF UTF-16. That eliminates a whole class of “save file in notepad, corrupting it” trouble.
cshokie··on The fight between doctors and insurance companies over 'downcoding'
Not so much anymore. The standard deduction for a married couple is now above 30k. It would take a large mortgage to pay that kind of interest in a single year. (Principle is not deductible; only interest)
cshokie··on Microsoft is open sourcing Windows 11's UI framework
The source is already available (albeit not buildable). See https://github.com/microsoft/microsoft-ui-xaml
cshokie··on Microsoft is open sourcing Windows 11's UI framework
WinRT is not the same thing as managed .NET code. There is no requirement that a UWP is .NET. There are many examples of unmanaged C++ UWPs, including the open source Windows Terminal.

WinRT is a mechanism to express APIs in a way that is amenable to cross-language usage. It is built on top of COM, and is not a replacement for COM.

cshokie··on The most famous carbon dioxide absorber
…based on a true story that was 55 years ago…
cshokie··on A tricky Commodore PET repair: tracking down 6 1/2 bad chips
I don’t personally have the time or inclination to do any retrocomputing, but I love seeing the repairs that people do for them. It’s interesting in a way I wouldn’t have expected. Thank you for sharing.
cshokie··on C++ is an absolute blast
If you haven’t already look up ‘if constexpr’ in cpp17 and newer. It lets you have compile time branches in a single function.
cshokie··on The two factions of C++
That’s similar to what vcpkg does under the covers. It clones the repo containing the dependency’s source code and then compiles it using the same compiler as the rest of your project. This avoids static libraries and ABI considerations while also avoiding having to copy/paste their entire source tree into your own.
cshokie··on You too can write a book
Same on an iPhone 15. Reader mode worked great, though.
cshokie··on Show HN: Resurrecting a dead Dune RTS game
I came here to also post about regfree COM. If you can get it to work that seems like the ideal solution.

See https://learn.microsoft.com/en-us/windows/win32/sbscs/creati...

“Activation contexts enable COM objects to be used without requiring that they be registered.”

cshokie··on FDA recalls defective iOS app that injured over 200 insulin pump users
I was personally affected by this, but it did not harm me. The battery drain was obnoxiously high (having to charge 2x a day instead of once every 2-3 days). I am always near a power plug so I was never in much danger of shutdown. However, I can easily imagine how others would be.

I ended up realizing something was odd with the app and tried uninstalling/reinstalling the app to fix it. Which did in fact fix it (at least temporarily).

cshokie··on You've just inherited a legacy C++ codebase, now what?
Not the OP, but I don’t think they meant that the build output is in a container. They meant that the thing you use to compile the code is in docker (and you just copy out the result). That would help ensure consistency of builds without having any effect on downstream users.
cshokie··on What it will take to unleash the potential of geothermal power? (2021)
Capacity is the most they can produce at any given time. Solar only produces power during the day. Geothermal produces power 24 hours a day, without any regard for day or night. Therefore for the same “capacity” geothermal will produce more power per day because it produces for more hours a day at the same rate.

(This does not account for any complications such as the cost of that capacity or whether geothermal has other downtime to consider.)

cshokie··on std::source_location doesn't work if you need strings to be types
That is some of it. The function names also include a lot of template specializations (thanks to a newer release of MSVC). Between lots of functions and very long names it adds up quickly. The function names are all unique so there are no savings from string pooling.
cshokie··on std::source_location doesn't work if you need strings to be types
For application development the real big problem is that std::source_location::function_nam() bloats binary size massively and cannot be selectively disabled. It is common to want file/line which can be shared per-file, or are small in size, respectively. But function name is unique per function and cannot fold. If you use source location a lot, such as for logging, this adds up really fast.

We are seeing binary sizes increase by 30-50% just from enabling source location, even if we don’t want function_name. Sadly this means we need to turn it back off again and go back to __FILE__ and __LINE__.

cshokie··on SciPy builds for Python 3.12 on Windows are a minor miracle
Out of curiosity is it a “Windows is objectively difficult” problem, or a “Windows is not Linux and I know Linux best” problem?

I’ve only begun using it so my expertise is limited, but I think vcpkg aims to help with some of these difficulties by shipping code as source and then running make on dependencies so they are guaranteed ABI compatible because the same compiler builds everything.

cshokie··on Just how constexpr is C++20’s std:string?
const std::string foo = “.dot file”;

in C++ cannot change after construction, but is not compile time constant. This means that it has to run some code and allocate some memory at runtime.

In contrast constexpr is fully compile time and ends up in the read only portion of the binary. No code code execution or allocations necessary.

cshokie··on The Development of the M1 Garand and Its Implications
This was a guest post, not written by Bret. The intro describes the author.
cshokie··on Just how constexpr is C++20’s std:string?
Hard-coding a relative file path seems like an obvious example. For example a config file with settings. The file will always have the same name so heap allocations and mutability are not needed.
cshokie··on The Downsides of C++ Coroutines
This article hits on a number of interesting points. There is a lot of complexity to be aware of when using C++ coroutines. And a number of “normal” practices become dangerous in them, such as pass by reference.

That said, I think they are still very much worth it. Older asynchronous programming libraries in C++ are so verbose and so much worse than coroutines that it’s an obvious choice to use coroutines.

Also, there is another hazard that the author does not mention in this article: RAII lock wrappers. Holding a lock across suspension points is super dangerous. At best it wastes performance to leave it locked when blocked. At worst it can create deadlocks or corrupt the lock if it is released on a different thread than it was acquired.

cshokie··on A supercapacitor made from cement
Two feet seems very thick for a foundation. That’s probably thick enough to be an airport runway.
cshokie··on VirtualBox 7.0.10 download links have disappeared
VirtualBox 7 came out almost exactly one year after the initial release of Windows 11. The bypass of the Secure Boot requirement was needed for quite a while.

October 2022 https://www.virtualbox.org/wiki/Changelog-7.0

October 2021 https://en.m.wikipedia.org/wiki/Windows_11

cshokie··on VirtualBox 7.0.10 download links have disappeared
Compatibility with Windows seems a lot better in 7 compared to 6, both as host and as guest. They also seem to have added a number of features such as secure boot. It seems that there was quite a time gap between 6 and 7 so a whole lot of changes built up.

Whether those things matter to you, or not, is in the eye of the beholder.

cshokie··on Handles are the better pointers (2018)
The C++ standard library smart pointers (e.g. unique_ptr) have optional template parameters for the allocator and destruction method. It seems like the standard C++ smart pointer types could still be used with handles. All you need is the right typedef.
cshokie··on GCP automatically lowered our quota, caused an incident, and refused to upgrade
Or your business competes with Amazon and you don’t want to pay a competitor in order to compete with them.
cshokie··on Sleep habits may have long-term benefits
(Not OP)

I would call it the no booze hangover. Sometimes the symptoms would be like a mild hangover. You wake up with a headache, still tired, and a little bit of a “what happened last night?” vibe.

Except that “what happened last night” was drink plenty of water and go to bed at a reasonable hour.

cshokie··on Twitter's API is down?
The word “droid” is trademarked by Lucasfilm
cshokie··on The Fable of the Dragon-Tyrant (2005)
These questions were explored somewhat in the Scythe trilogy[0]. Natural death was conquered so some people are tasked with going around and enforcing unnatural death. I enjoyed reading it and thinking over some of the implications.

[0] https://www.goodreads.com/book/show/28954189-scythe

cshokie··on What’s in a PR statement: LastPass breach explained
I don’t see an issues tab so I can’t open a bug report. There are two redundant checkboxes for MacOS (differing by capitalization).
Page 1 of 3Next →