dneaves

joined 1 year ago
[–] dneaves@lemmy.world 2 points 1 week ago

Unfortunately, "sauron [command]" still won't see the Jia Tan backdoor obscured in the shadows, nor the_ring.yml that you're piping to /dev/null

[–] dneaves@lemmy.world 201 points 1 month ago (7 children)

Imagine being so disliked that it becomes the goal of elderly voters to live long enough to vote against you, nevermind that it's a former president

[–] dneaves@lemmy.world 1 points 4 months ago* (last edited 4 months ago)

There is some way to get things going on startup on Steamdeck, even in Steam-mode (Big Picture mode? Not-desktop mode?). I had to do it for Syncthing, I just don't remember exactly what I did. I probably made a service file if I had to take a guess, but I think an "@reboot" cron job might work too

[–] dneaves@lemmy.world 4 points 4 months ago (2 children)

I say there are four categories:

  • "standalones": anything that is only described as itself. Separation just results in smaller versions of itself.
  • sandwiches: organized or layered arrangements of foods. Can typically be separated into it's composing parts.
  • salads: tossed or jumbled arrangements of foods. Could be separated into its parts, albeit cumbersome.
  • sauces: perfectly combined or blended arrangements of foods. Can no longer be separated into its composing parts, but differs from a standalone because it was still composed of other foods, and can still be identified or described as all of the parts.
[–] dneaves@lemmy.world 21 points 5 months ago (1 children)

/s is bloat, say it like you mean it!

[–] dneaves@lemmy.world 12 points 5 months ago

For a while I had an Asus laptop, and no matter what, it seemed to not want to work properly with systemd-based distros. It would hang on-boot about 95+% of the time, I'd hard shut-off, restart, repeat.

On a whim, I tried Void Linux (runit) on it. And for whatever reason, it worked.

[–] dneaves@lemmy.world 11 points 7 months ago* (last edited 7 months ago) (1 children)

Elm

In short, it's ruined my expectations of languages. It's a functional language, like the style of Haskell, and transpiles to html or js (its meant for web). There's very little that it allows for going wrong, and for things that could fail, it either tells you to port that out to JS and bring it back when you're done, or you have to handle a Result type or Maybe type.

It sounds strict, yes, but not having to deal with issues later is so nice.

[–] dneaves@lemmy.world 2 points 9 months ago

Hello world should look something like this: print("Hello, World"!)

You don't need the annotation line in Haskell-esque languages, most of the time. Without the annotation, this is Hello World in Haskell:

main = print "Hello, World!"

And when you need more complexity, it can still be far simpler than Unison (or Haskell)

import qualified Data.List as List
import Data.Function ((&))

processNumbers numbers =
    let
        isEven n = mod n 2 == 0
    in
    numbers
        & List.filter isEven
        & List.map (^2)

main =
    processNumbers [1, 2, 3, 4, 5, 6]
        & print
[–] dneaves@lemmy.world 3 points 9 months ago

i starts at 0, checks if i is less than n (the first time it will be, no matter what), prints a "#", then increments i by 1 and loops

[–] dneaves@lemmy.world 11 points 9 months ago (2 children)

Why does the for loop repeat after it exits to print a new line? If it exits the loop, shouldn't it be done with it?

There's the new line after the for loop to make sure that the next recursion starts on a fresh line. Otherwise the next recursion would print on the same line, right where it left off, and you'd just have a line of "#"'s. The for loop itself is just for printing "#"'s.

Why is n incremented and not i as stated with i++?

I think this is a confusion with the recursion. Look at the line with draw(n - 1); this happens before any printing of hashes happens, and only continues after its done. And it calls itself as long as it's not less than or equal to 0. To psuedo-code the order of operations here:

draw 3 {
    draw 2 {
        draw 1 {
            draw 0 {};
            print "#" * 1;
        };
        print "#" * 2;
    };
    print "#" *3;
};

so n is never incremented as you think, it just calls decremented versions of the draw function before the current one finishes. The i's are purely involved in the for loop, which only prints hashes. Does that make sense?

[–] dneaves@lemmy.world 7 points 9 months ago* (last edited 9 months ago) (2 children)

Although, i would agree with it not necessarily being "friendly", since its a drastically different syntax than many beginners would be used to, the brackets and parenthesis here are not what you think they are.

Unison is a language in the style of Haskell, F#, Purescript, Elm, etc. So that first line is actually type annotations.

In Haskell, this would just be helloWorld :: IO () , meaning a function named "helloWorld" with no arguments and produces what is essentally a potentially-unsafe IO action with a Void return (the empty parenthesis () ).

Here in Unison they call the bracket part "abilities" or something. Its saying the same thing as Haskell, but being more explicit in saying it can raise an exception.

view more: next ›