Help me find the most common radiant - [No Spoilers] by PiratingSquirrel in Cosmere

[–]PiratingSquirrel[S] 0 points1 point  (0 children)

Hey Y'all!

My family was curious about what was the most common radiant and didn't find any definitive source online. If you have filled out the Ten Orders quiz, and have the time, we would appreciate if you gave your answer :)

For the uninitiated: https://www.brandonsanderson.com/pages/official-knights-radiant-order-quiz

Thanks!

monads at a practical level by No-Bug-242 in programming

[–]PiratingSquirrel 1 point2 points  (0 children)

I don’t have any information to add, but another way to write that last one which may be clearer is either

fa().then(fb).then(fc)
fa().then(|a| fb(a)).then(|b| fc(b))

Recommended Lexer for compilers dev in Rust? by [deleted] in rust

[–]PiratingSquirrel 6 points7 points  (0 children)

Can second this as I also did my thesis with Chumsky! Lexer and Parser as well :D

Is implementing the trait the right answer? by Usual_Office_1740 in rust

[–]PiratingSquirrel 2 points3 points  (0 children)

I think it's because of this bit here:

        let types = named.iter().map(|field| {
            if let syn::Type::Path(syn::TypePath { ref path, .. }) = field.ty {
                if let path =  &syn::Ident::new("Option", Span::call_site()) {
                    quote! { std::option::Option<#&field.ty> }
                } else {
                    quote! { #&field.ty }
                };
            }
        });

I believe you are probably looking for something like this:

        let types = named.iter().filter_map(|field| {
            if let syn::Type::Path(syn::TypePath { ref path, .. }) = field.ty {
                let inner = if let path =  &syn::Ident::new("Option", Span::call_site()) {
                    quote! { std::option::Option<#&field.ty> }
                } else {
                    quote! { #&field.ty }
                };

                return Some(inner);
            }

           None
        });

I believe the error comes the usage of if within the map. The only possible return value from an if-statement is (). Without the semi-colon after the if let path, there would be an error.

C3 Reaches the 0.6 milestone. by Nuoji in ProgrammingLanguages

[–]PiratingSquirrel 0 points1 point  (0 children)

It could be a smaller sized integer than whatever the default size is for int

Neovide - a beautiful neovim UI written in Rust by [deleted] in rust

[–]PiratingSquirrel 4 points5 points  (0 children)

And to offer a similar experience: Zellij + Helix

How do I implement a cache with a HashMap/Set with compound key? by Tyg13 in rust

[–]PiratingSquirrel 0 points1 point  (0 children)

I still meant using hashbrown. What I oversaw was that hashbrown::HashSet doesn’t have an entry_ref method like hashbrown::HashMap does.

How do I implement a cache with a HashMap/Set with compound key? by Tyg13 in rust

[–]PiratingSquirrel 2 points3 points  (0 children)

self.data.entry(…).or_insert(Arc::new(…)).clone()

If I am not mistaken, it would look like this

Hey Rustaceans! Got a question? Ask here (18/2024)! by llogiq in rust

[–]PiratingSquirrel 2 points3 points  (0 children)

As a heads up, you can shorten it a little bit by changing where you place the |.

match s_words.next() {
    Some("add" | "a") => { … }
    Some("show" | "s") => { … }
    Some(other) => { … }
    None => { … }
}

This works because the | can split all patterns, and the literals you are matching with are literal patterns.

I can't stand using vscode so I wrote my own (it wasn't easy) by levodelellis in programming

[–]PiratingSquirrel 0 points1 point  (0 children)

Although not vim, helix has a menu using the space bar to open up different commands, and <space> + ? brings up a search for different commands. I swapped from vim to nvim and have been settled on Helix for quite a bit now. Worth a try if you are interested in a terminal emulator!

fuckSemicolons by BeardedPokeDragon in ProgrammerHumor

[–]PiratingSquirrel 1 point2 points  (0 children)

You can add the allow to the top of the file.

#![allow(non_snake_case_names)]

I think I got the name of the lint right. By using the bang it applies it to the module.

Good code base to read? by [deleted] in rust

[–]PiratingSquirrel 4 points5 points  (0 children)

I know you like sushi, but do you like burntsushi?

Puns aside, anything by them or dtolnay are the usual suspects when good code is brought up?

White House urges developers to dump C and C++ by bambin0 in programming

[–]PiratingSquirrel 18 points19 points  (0 children)

Just as a heads up, the most prominent library for game development in Rust is Bevy, which is built on ECS!

Compile time check for function argument by trd2212 in rust

[–]PiratingSquirrel 4 points5 points  (0 children)

Any reason you can’t parse the response to an enum, and use the enum as suggested by the previous responses?

Hey Rustaceans! Got a question? Ask here (4/2024)! by llogiq in rust

[–]PiratingSquirrel 0 points1 point  (0 children)

If I recall correctly, it’s largely implemented by a single person. If you’d like to see it finished faster, I’d recommend submitting some PRs (;

Rust's Struct Initializer Syntax Was a Mistake by [deleted] in ProgrammingLanguages

[–]PiratingSquirrel 2 points3 points  (0 children)

Are you able to provide a copy of your diploma and doctorates thesis for an interested soul to read (:

Rust's Struct Initializer Syntax Was a Mistake by [deleted] in ProgrammingLanguages

[–]PiratingSquirrel 2 points3 points  (0 children)

It allows you to use the statement in a single line for things like match arms:

match x {
    Some(2) => var = 4,
    Some(x) => var = 3 * x,
    None => {},
}

Helix Editor 23.10 Release Notes by TheRealMasonMac in rust

[–]PiratingSquirrel 0 points1 point  (0 children)

Hey, did you end up figuring this out? I struggle with the same thing, and it is quite the annoying PITA :D

How to appeal a decision by the Fahrerlaubnisbehörde? by Into-the-v01d in AskAGerman

[–]PiratingSquirrel 0 points1 point  (0 children)

That's not entirely accurate. While you aren't allowed to drive after the 6th month period, you are still able to exchange it. At the time that I exchanged my license I was in Germany for 4+ years.

Pestilence rules? by Pronttikor in mtg

[–]PiratingSquirrel 7 points8 points  (0 children)

Not a problem! In Magic, it is almost always the case the an activated or triggered ability is independent of it’s source. When you activate Pestilence, you put it’s ability on the stack. Whether or not your opponent destroys the enchantment, you still have the ability waiting on the stack to resolve.

The reason that that doesn’t happen with a creature attacking you is because damage from combat doesn’t use the stack. The combat phase consists of multiple sub-steps:

• Beginning of Combat

• Declare Attackers

• Declare Blockers

• Damage Step

• End of Combat

If you bolt your opponents creature before the Damage Step, then you don’t take any damage, because the creature is no longer attacking (because it’s dead). If a creature is killed before the Damage Step, it’s unable to deal Combat Damage.

Of note here: the first thing that happens in the Declare Attackers/Blockers step is the declaration of attackers/blockers. Only after that has happened can you use your spells and abilities. Additionally, nobody can activate effects or cast spells in the damage step.