HNHacker News
TopNewBestAskShowJobs

shadedtriangle

102 karma · joined October 16, 2017

submissionscomments
shadedtriangle··on There's a new "Google Jail" for independent wikis
This happened to my website about learning c++. I was posting new articles daily for a while there and traffic was slowly but steadily rising. Then one day traffic from search went straight to zero and never recovered. The whole project was designed to be Google searched first and not read like a book so that really killed my motivation back then.
shadedtriangle··on The moral panic over data centres is foolish
Keep trying to educate them how? By your own admission data centers:

* use a lot of water to build one

* the power is a problem

* the noise is an issue

* the power is coming from non-green sources

* the government could “easily” fix all this with regulations

shadedtriangle··on California farmers to destroy 420k peach trees following Del Monte bankruptcy
I know this is naive but I wonder why the CCPA, together with the Department of Agriculture, chose not to purchase the peach canning facilities that Del Monte Foods was running. I suppose that it's more risk for the farmers in a world where canned peach sales are declining. I can't imagine it's easy to just clear cut a ton of trees though. 9 million sounds like nothing when it will take years for whatever new crop they plant to fruit.
shadedtriangle··on Five Companies Produce Nearly 25 Percent of All Plastic Waste Worldwide
Yes, the city of Seattle instituted a sweetened beverage tax in 2017 and there was a study with results published in 2023.

https://www.seattle.gov/sweetened-beverage-tax-community-adv...

shadedtriangle··on C++20 Idioms for Parameter Packs
I feel like this article is missing one of the most useful idioms of parameter packs which is when you want to accept a variety of parameter types to a non-template function. You can stuff a parameter pack into an array/vector of unions/variants which is quite useful! For example it's the way to implement std::format which is based off Python's string.format().

  using FormatArg = variant<int, float, string>;
  string FormatArgs(const char* fmt, const vector<FormatArg> &args);
  
  template <typename... Args>
  string Format(const char* fmt, Args&&... args) {
    vector<FormatArg> expanded_args = {args...};
    return FormatArgs(fmt, expanded_args);
  }

  int main() {
    cout << Format("Hello {} pi {}", "world", 3.14f);
  }
https://godbolt.org/z/v5zo99aGe
shadedtriangle··on Mtn Dew Raid Q&A [pdf]
J, K, and L are keyboard shortcuts for "skip back 10s", "toggle pause", and "skip forward 10s". Left and right arrow keys do the same skipping. On mobile a double tap on either side of the screen again skips forward/back. A double tap with two fingers skips a chapter. Makes hopping around in a video a breeze.
shadedtriangle··on $1 Unistroke Recognizer
It's because the algorithm is easy to implement and efficient in terms of compute usage to match a gesture. It's a "cheap and easy" recognizer, a $1 recognizer. The name has spawned a whole host of similarly named papers which you can see on their "impact" page https://depts.washington.edu/acelab/proj/dollar/impact.html.
shadedtriangle··on The James Webb Space Telescope is finding too many early galaxies
We can see it and it’s called the Cosmic Microwave Background https://en.m.wikipedia.org/wiki/Cosmic_microwave_background. It’s not t=0.0000001 though as the time before the cosmic microwave background the universe was opaque to photons, you wouldn’t be able to see anything.
shadedtriangle··on Tether Withdrawals Top $10B
> All you need for a stable stablecoin is to save every dollar put in to it.

That’s the issue right there. How does Tether save its dollars? We can see it in their transparency report[1]. Whether you believe them or not it’s not just cash in a bank account.

* 0.41% Non-U.S. Treasury Bills

* 55.53% U.S. Treasury Bills

* 0.15% Reverse Repurchase Agreements

* 5.81% Cash & Bank Deposits

* 9.63% Money Market Funds

* 28.47% Commercial Paper and Certificates of Deposit

How much of that is liquid and directly convertible to dollars 1:1 in he next 24 hours? Not 100%.

What happens when they start selling billions in Treasury Bills and Commercial Paper to fund redemptions? The market price of those assets will drop.

What if the value of those assets is already below 1:1 because of recent market events?

What if they’re not being as transparent as they say they are?

> As long as they never spend anything from the reserve, this can't fail no matter how unpopular the currency is.

This can easily fail many different ways.

[1]: https://tether.to/en/transparency/#reports

shadedtriangle··on Multiple assignment and tuple unpacking improve Python code readability (2018)
This is probably my most used C++17 feature too:

    for (auto& [key, value] : persons)
The nested bindings are neat. Don’t think you can do that in c++ yet.
shadedtriangle··on Show HN: C++ by Example – A new website for learning C++
Thank you! Yes I do intend to cover build systems, libraries, static vs dynamic binaries. All of these are an important part of working with C++ often overlooked.
shadedtriangle··on Show HN: C++ by Example
Thanks!
shadedtriangle··on C++ Coroutines Do Not Spark Joy
I think the nice language is in there, but it’s buried within the backwards compatibility as you mentioned.

I’ve started putting together https://cppbyexample.com as a way for newcomers to learn because pointing them to a reference or outdated examples isn’t helping anyone.

shadedtriangle··on Show HN: C++ by Example
Thanks for the feedback. The site is still young and smart pointers are definitely on the list of things to discuss. I’ve bumped their priority.