SaddledBounding
SaddledBounding on Hacker News
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.
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.
> 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, give you alternate, but still non-obvious names for them, and foists some exercises upon you. It could have easily give 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"} 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;
}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.
ML uses `name: type = value`. It came out over a decade before C++ and just one year after C.