@phairupegiont@mastodon.social avatar

phairupegiont

@phairupegiont@mastodon.social

This profile is from a federated server and may be incomplete. Browse more on the original instance.

pervognsen, to random
@pervognsen@mastodon.social avatar

"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.)"

phairupegiont,
@phairupegiont@mastodon.social avatar

@pervognsen @regehr "what origin or analogy", do you mean, besides the "< or >" meaning it has for numbers?

mcc, to random
@mcc@mastodon.social avatar

Sometimes Discord beeps just because it is happy

phairupegiont,
@phairupegiont@mastodon.social avatar

@mcc when someone writes something, then decides to immediately delete it

mcc, to random
@mcc@mastodon.social avatar

Tonight my wireless keyboard is having a problem where it seems to be duplicating certain keypresses

phairupegiont,
@phairupegiont@mastodon.social avatar

@mcc the only case in which only one of the answers should use automatic fuzzy correction

b0rk, (edited ) to random
@b0rk@jvns.ca avatar

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
phairupegiont,
@phairupegiont@mastodon.social avatar

@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

phairupegiont,
@phairupegiont@mastodon.social avatar

@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.

danluu, (edited ) to random
@danluu@mastodon.social avatar

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.

phairupegiont,
@phairupegiont@mastodon.social avatar

@danluu depends on whether your CI shows the number of times each test fails in a row.

mcc, to random
@mcc@mastodon.social avatar

Today is my birthday!

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.

Abstract art by Vian Borchert
Abstract art by Vian Borchert

phairupegiont,
@phairupegiont@mastodon.social avatar
mcc, to random
@mcc@mastodon.social avatar

If I was in the area of Paris around June 15 do I know any Mastodon people in France who would want to meet up and do high fives

phairupegiont,
@phairupegiont@mastodon.social avatar

@mcc yes

mcc, to random
@mcc@mastodon.social avatar

I don't like these new icons as much as the old ones. The shapes of the left two icons are too similar :(

phairupegiont,
@phairupegiont@mastodon.social avatar

@mcc Don't Make Me Blink

mcc, to random
@mcc@mastodon.social avatar

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")

phairupegiont,
@phairupegiont@mastodon.social avatar

@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

mcc, to random
@mcc@mastodon.social avatar

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

phairupegiont,
@phairupegiont@mastodon.social avatar

@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

Migueldeicaza, to random
@Migueldeicaza@mastodon.social avatar

My talk on “Swift Godot: Fixing the Multi-million dollar mistake” has been posted: https://streaming.media.ccc.de/godotcon2023/relive/57866

phairupegiont,
@phairupegiont@mastodon.social avatar

@Migueldeicaza Interesting talk!
When you said that Apple does open source better than Microsoft, it made me curious. Can you be more specific?

b0rk, (edited ) to random
@b0rk@jvns.ca avatar

been thinking about this very common git workflow and how git doesn't do much to help you ensure that if you're using this workflow:

a) you never commit to your local main branch directly
b) you regularly pull from origin/main to keep your local main branch up to date

you just need to be careful

branch protection on github/gitlab helps with this, but I don't think there's much in git itself

phairupegiont,
@phairupegiont@mastodon.social avatar

@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?

mcc, to random
@mcc@mastodon.social avatar

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?

phairupegiont,
@phairupegiont@mastodon.social avatar

@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

lexi_lambda, to random

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

phairupegiont,
@phairupegiont@mastodon.social avatar

@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 :)

phairupegiont,
@phairupegiont@mastodon.social avatar

@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?

phairupegiont,
@phairupegiont@mastodon.social avatar

@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.

phairupegiont,
@phairupegiont@mastodon.social avatar

@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?

phairupegiont,
@phairupegiont@mastodon.social avatar

@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.

phairupegiont,
@phairupegiont@mastodon.social avatar

@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.

phairupegiont,
@phairupegiont@mastodon.social avatar

@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!

phairupegiont,
@phairupegiont@mastodon.social avatar

@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?

phairupegiont,
@phairupegiont@mastodon.social avatar

@lexi_lambda

Ok, so GHC is only allowed to mess up the evaluation order when an argument is bottom?
Phew, this is a relief... My fears are allayed.

Unless... The argument being bottom could come from a more complex expression, that would still get evaluated before the guard? Is that possible?

phairupegiont,
@phairupegiont@mastodon.social avatar

@lexi_lambda I wanted to talk about that last part, too.

The problem is, if you model the error as a value, you have to modify the types.

Then, adding new sanity checks stops being like sprinkling a lightweight pinch of salt anywhere on your code without regard for the type system.

error excels at being that salt.

phairupegiont,
@phairupegiont@mastodon.social avatar

@lexi_lambda Well, yes, I guess a lazy language should take every optimization opportunity. :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • rosin
  • thenastyranch
  • mdbf
  • DreamBathrooms
  • everett
  • magazineikmin
  • GTA5RPClips
  • Youngstown
  • cisconetworking
  • ethstaker
  • slotface
  • ngwrru68w68
  • kavyap
  • provamag3
  • cubers
  • InstantRegret
  • Durango
  • osvaldo12
  • modclub
  • tester
  • Leos
  • khanakhh
  • normalnudes
  • tacticalgear
  • megavids
  • anitta
  • lostlight
  • All magazines