HackerTrans
TopNewTrendsCommentsPastAskShowJobs

SaddledBounding

no profile record

comments

SaddledBounding
·4 ปีที่แล้ว·discuss
The government didn't invalidate a legal contract; the contract is simply no longer legal. If your position is that the government should never make laws that contravene existing practices, then I have to disagree. In practice, that would mean the government could never make any laws, or could only make laws that have no practical effect, because everyone was already obeying them of their own accord.

Also note that in this particular case, "in 2011 they’d been told there was no issue with their gardens, and also that before 2017, they’d received no violations for their yard despite regular inspections", and note that the legal dispute between the couple and the HOA was settled outside of court; that is to say the parties came to an agreement outside of the formal legal system.
SaddledBounding
·4 ปีที่แล้ว·discuss
'e' ^ 'f' ^ 'g' == 0x40. Uh-oh.

Edit: I misread the post; my bad. The post effectively uses a bit vector to store the last N chars in a window, and the bit vector happens to fit in a single machine word. Also, XOR happens to be a good way to update the bit vector, because it turns out it's sufficient to store how many times each character appears in the window mod 2.

So to be clear, my "demonstration" above only works because the ASCII representations of e, f, and g are not linearly independent with respect to xor. However in the article, the representations of all of the characters are chosen to be a linearly independent set.
SaddledBounding
·4 ปีที่แล้ว·discuss
I do not believe it follows from "Much much more people die from processed foods/air pollution in the world than from motorway accidents" that nobody should care about speeding and motorway accidents. After all, far fewer people still are murdered, but the consensus seems to be that we care about murderers.
SaddledBounding
·4 ปีที่แล้ว·discuss
The higher your speed, the higher your speed differential with the road and guard rail. A car nudging another at 250 km/h can cause the other to violently roll over, while a car nudging another at 40 km/hr can't. Speed differential between cars is not the only factor in safety.
SaddledBounding
·4 ปีที่แล้ว·discuss
The title needs to be changed, because:

> This isn’t meant as a lens tutorial. Prerequisites are some basic knowledge of how to use Haskell, GHCI, and familiarity of the idea of lenses, if not the specifics.

With that out of the way, it's kind of disappointing that the article isn't a tutorial. As it is, it just lists the lens operators, gives you alternate, but still non-obvious names for them, and foists some exercises upon you. It could have easily given one short example for each operator without adding any significant tedium for those who already have an idea of what they do, and then it would have been a perfectly fine tutorial.

So here's some examples, (Hoogle has some nice examples too; thanks Hoogle):

    person = Person {_name = "Alice", _title = "Dr"}

    -- get field with magic lens
    person ^. title == "Dr"

    -- create new object with new field value
    person & name .~ "Bob"
        == person & (name .~ "Bob")
        == (name .~ "Bob") person
        == Person {_name = "Bob", _title = "Dr"}

    -- create new object with function applied to field value
    person & name %~ lowercase
        == (name %~ lowercase) person
        == Person {_name = "alice", _title = "Dr"}
SaddledBounding
·4 ปีที่แล้ว·discuss
utf-8 has an elegance that utf-16 lacks:

    utf-8 decode
      switch (std::countl_one(unit)) {
        case 0:
          /* one unit */
          break;
        case 2:
          /* two units */
          break;
        case 3:
          /* three units */
          break;
        case 4:
          /* four units */
          break;
        default:
          /* not code point boundary */
          break;
      }
SaddledBounding
·4 ปีที่แล้ว·discuss
It's because the grandparent comment has misconceptions about nutrition, including that animal products are necessary for a healthful diet and how much protein is required for a healthful diet.

The first misconception is contradicted by extensive analysis by health organizations such as [Academy of Nutrition and Dietetics][1]. Healthful vegan diets are no less healthful than healthful non-vegan diets.

The second misconception is about how much protein is needed in a healthful diet. Many people wildly overestimate how much protein a person needs, especially when strength training. It is not difficult to get sufficient protein within a given calorie budget while on a vegan diet, even without using protein supplements. For instance, tofu and seitan have protein to calorie ratios similar to meat, with seitan often having a higher protein to calorie ratio than most meats.

[1]: https://pubmed.ncbi.nlm.nih.gov/27886704/
SaddledBounding
·4 ปีที่แล้ว·discuss
I think a demo of the transpiler output for a short function would make a great addition to the readme.
SaddledBounding
·4 ปีที่แล้ว·discuss
You misunderstand me; I agree with you, which is why I think we should quiet down and not upset the sensibilities of the majority in the community. I understand why you would assume my comment is not in good faith, and I do not hold it against you, but this is not the community to air such concerns, as that violates the community guidelines.
SaddledBounding
·4 ปีที่แล้ว·discuss
The vast majority of people in the Hacker News community clearly take offense to your view. Perhaps you should take a moment to consider your own antisocial behavior and quietly not express your opinion. After all, we need to compromise and can't just say as we please.
SaddledBounding
·4 ปีที่แล้ว·discuss
> The proposed syntax is probably a consequence of a modern trend...

ML uses `name: type = value`. It came out over a decade before C++ and just one year after C.