Hacker Newsnew | past | comments | ask | show | jobs | submit | omegaham's commentslogin

Unopened, a jar of pasta sauce is good basically indefinitely, but as soon as you actually open the jar the clock starts ticking. We don't make enough pasta at a time to use a full jar, (and in fact will usually use a small fraction of the jar) so I write the date that I opened the jar on the lid to plan its use a little better. "Hey, better find a use for this sauce, it's going to go bad eventually."


Inversely, I've also seen promotions where the gallon is heavily featured in the ads, and they're selling the half gallon for full price. Neat, you're paying extra to get less milk!


Grade school for me - teachers would say "8.5x11" instead of "letter size" or even just "printer paper." I don't know why they did it, and I assume it's for the same reason that I say it too. It's probably what their teachers said to them!


Because that’s the size of the paper.


You can always play in tournaments to figure out where you rank compared to a larger population!


Indeed I much prefer a tournament format.


I don't know about his Spanish Scrabble performance, but when he won the French Scrabble championship, there were players who attempted the French equivalent of "play salirás and see if he notices," and Nigel challenged all of them.


I just flew through there, it's wonderful.


For me, its finest purpose is to be a buffer that I can paste formatted text into so that it can strip the formatting. There are many programs that do this natively, but there are many that don't or are really inconsistent about the hotkeys, and Notepad is always there.


Yep, I grew up in the woodsy part of Framingham up by Route 20. A whole bunch of those roads are outright dangerous. My parents groused about how dangerous it was, but mostly trusted me not to be stupid.


Good on your n=1 data, but pedestrian fatalities have been steadily increasing for the last decades.

Also, nothing to do with "being stupid", if there are cars going 60mph right next to where you're walking, it's the luck of the draw whether you get decapitated by a truck or not.


Carlisle, which makes it even more ridiculous :)


Note that in OCaml, you can't get too screwy with point-free programming because of the value restriction. It is possible to compose functions in a point-free manner, but those functions themselves have to have points if you want them to be generic. Standard example:

    let last xs = List.fold_left (fun x y -> Some y) None xs
This is of type

    last : 'a list -> 'a option = <fun>
Neat, `'a` is generic. Let's η-reduce out the `xs` and make the function point-free (ignoring the lambda):

    let last = List.fold_left (fun x y -> Some y) None
This doesn't work the way that we want:

    last : '_weak1 list -> '_weak1 option = <fun>
The moment that we call this weakly polymorphic function, its type is fixed and is no longer generic. In the toplevel:

    # last [1;2;3];;
    - : int option = Some 3
    # last['x';'y';'z'];;
    Error: This expression has type char but an expression was expected of type
             int
Haskell, of course, is totally happy to let you do point-free mania with Kleisli arrows and all of the rest of it.


You'll like the `std::ranges` library that's been somewhat implemented as of C++20 and is getting some more stuff in C++23. It's very Fun!

    #include <ranges>
    #include <numeric>
    #include <vector>
    #include <iostream>

    int main() {
        std::vector<int> vec = {1, 2, 3};

        // map, using `std::views::transform`. Implemented in C++20
        for(int elem : 
                std::views::transform(vec, [](int x) { return x + 1; })) {
            std::cout << elem << " "; // 2 3 4
        }
        std::cout << "\n";

        // `std::ranges::fold_left` will be available with C++23.
        // Until then, we're stuck using the <numeric> iterator version, which was
        // implemented in C++20.
        std::cout << std::accumulate(vec.begin(), vec.end(), 1, 
                                     [](int x, int y) { return x * y; }) 
                  << "\n"; // 6

        return 0;
    }
Building and running with the following:

    $ g++ --std=c++20 test.cpp
    $ ./a.out
    2 3 4
    6


There's a nicer way still:

    #include <algorithm>
    #include <functional>
    #include <iostream>
    #include <numeric>
    #include <ranges>
    #include <vector>

    int main() 
    {
        std::vector<int> vec{1, 2, 3, 4, 5};
        auto plus_one{[](const auto x) { return x + 1; }};
        std::ranges::for_each(vec | std::views::transform(plus_one), [](const auto x) {
            std::cout << x << " ";
        });
        std::cout << "\n";

        std::cout << std::accumulate(std::begin(vec), std::end(vec), 1, std::multiplies<>()) << "\n";

        return 0;
    }
https://godbolt.org/z/84ePjfPhf


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: