"The algorithm uses exactly the same terminology and is presented in bottom-up form. (If you prefer top-down design, please read the rest of this section backwards.)"
what's your favourite way to simplify your life with git? mostly interested in slightly unusual tricks to reduce the number of git features you're using, like:
never using the stash, just creating temporary branches instead
deleting your main branch so that you can never accidentally commit to it
@b0rk Never let git put itself in a state where you need to finish resolving an undefined amount of conflicts before you can do anything else (like, being interrupted by a coworker who needs you to make a trivial change!).
Instead, create a new branch and cherry pick one by one, to stay stateless all the way through. That way, no problem stopping in the middle and continuing later
@b0rk kind of? But big merges have the same problem...
And the same solution. If you really want to merge your branch, you can solve all the conflicts by cherry picking on a new branch, and then merge that conflictless branch.
What's the highest false positive rate you consider acceptable for a test that's checked into production code? Unacceptable means you think the test should be fixed or removed.
If you'd like to do something for me for my birthday, would you please reply to this with—or by other means send me— something with colors you liked? Like an image or a video or a link. Music would also be acceptable if it gives you a strong synesthesiac association with color.
If this request confuses you, here are some examples of images with colors I found striking [Artists: Laurie Barmore, Vian Borchert, Erica Aurahack]. But your reply can be whatever colors you like.
I have a Python script in which I have an assert. The assert is always true; that's why I'm asserting it. The assert is a canary in case I change a constant in one place without changing code that depends on it having that value.
Python 3 gives me a warning that the assertion is always true. That's annoying. Can I turn the warning off?
/path/toplevel.py:10: SyntaxWarning: assertion is always true, perhaps remove parentheses?
assert(VID_V_ACTIVE == 144, "constant different from expected")
@mcc levels in warning message quality:
level 0: no warning
level 1: "assertion is always true, perhaps remove parentheses?"
level 2: "assertion is always true because it considers your parentheses as a tuple, because assert is not a function and don't need parentheses."
level galaxy brain: make assert use function call syntax
I wouldn't really have expected that creating a directory with 600,000 directories in it would be that big a problem in 2023! This is just files! I thought we'd figured out files.
Something I have gradually learned with Computers is most types of technology really don't improve over time, they improve until they hit an "oh, good enough" point and then they just stop there, and never improve again, even if improvements are possible and someone thinks of them they won't get adopted
@mcc "average person stores 500 files per directory" factoid actually just statistical error. files mcc, who lives in cave & stores over 600,000 files in the same directory, is an outlier and should not have been counted
@b0rk
git is free software, an asset to Humanity that will still exist in 10 (or 100) years and be free for everyone.
GitHub/GitLab are companies that get bought and sold, and are driven by the need to make money for shareholders. Once everyone is locked in, companies eventually turn bad.
Maybe I've been disappointed by companies too many times in my life, but who can say for sure if in ten years GitHub will still be free? Or even still exist?
I'm getting used to VS Code. I'm writing C# at the moment.
When I type "Package.Subpkg.Subpkg2." vscode helpfully gives an autocomplete popup showing a little scrollable list of all the symbols that are exported by Subpkg2.
Is there a way to just like, browse that list? Like get a expandable list of packages and subpackages and symbols? Can I get it to display the types? Can I get it to display documentation? Does C# in VSCode otherwise have a documentation viewer of any type?
@mcc ok so, as someone who has used VS for many years for C#, let me tell you, I have no idea how anyone can tolerate ever using vscode for C#, unless they've never tried VS in which case, they don't know what they're missing, so obviously it's fine.
VS is an IDE, vscode is... I dunno, a text editor with plugins?
But well, I have to admit, at least vscode runs on linux
I am pleased to announce the release of Part 1 of my new video series in which I attempt to convince you that lazy evaluation is good, actually. (Yes, I said I would make this six months ago, and yes, there’s probably a joke to be made there.) https://www.youtube.com/watch?v=fSqE-HSh_NU
@lexi_lambda GHC happily "optimizing" my code into unpredictable nonsense, just because it managed to "prove" that it's "bad"...
This is "undefined behavior"-levels of bad. C compilers are watching approvingly.
And the pun works, too! In Haskell, undefined behavior is simply the regular behavior of undefined :)
@lexi_lambda This seems to mean that bottoms should be avoided at all cost, rather than treated as something that prints an error and exit.
Is a Haskell compiler allowed to compile `print ([0..10^99]:error "out of numbers lol") into a program that dies instantly?
@lexi_lambda I should have added a smiley, I'm not actually losing my mind over it :)
In non-lazy languages, I try as much as I can to throw exceptions when preconditions are not met, even if they're not caught and kill the program. But for diagnosing the problem from the message, it's crucial that I get the preconditions tested in the order I expect.
@lexi_lambda How then can I ensure always getting first the message about the Nothing? If I understand well, seq won't help because the demand for x is still there. It's error itself that can not work, because it's a bottom and bottoms are fundamentally unordered, at least outside of IO.
What can I do then, implement myError using unsafePerformIO to print the message and to call terminateProcess on getCurrentPid, then return some meaningless but non-bottom value?
@lexi_lambda I only want an error function that dies and outputs what the problem is reliably.
Reliably, as in, some errors should take precedence over other errors.
@lexi_lambda It often happens to me that the order matters a lot when reporting errors. Here's an example.
A function that solves some specific kind of second degree equation for the trajectory of a thrown explosive banana and finds where it intersects with the ground.
I add some precondition checks that fail with errors messages (often expressed in terms of the domain), like "gravity goes upwards" or "the discriminant is zero" or "invalid ground height: " ++ h.
@lexi_lambda If GHC decides to evaluate the calculations before the preconditions, instead of my helpful messages I'll get some technical generic unhelpful message like "divide by zero" (where?).
This is bad! I don't care if all errors are "equally significant" in theory! My debugging code is right here in practice. Please use it!
@lexi_lambda Oh... Yes, I am confusing, and confused by, these two scenarios...
To me, your addMaybe example looked entirely equivalent to:
addMaybe' a b =
case b of
| Nothing -> error "addMaybe: nothing to add"
| Just y -> x + y
So what you're saying is, contrarily to addMaybe, addMaybe' forces GHC to fail deterministically on "addMaybe: nothing to add" when b is Nothing, even if x is bottom?