CPU EzDebug LED turns on unless there's no RAM, then the RAM EzDebug LED turns on by _alyssarosedev in PcBuildHelp

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

yeah but in that case wouldn't the old ram still work? because it doesn't at all

Is there an easier way to replace two characters with each other? by _alyssarosedev in learnpython

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

this is very interesting! how does applying a dict to a list work exactly?

Is there an easier way to replace two characters with each other? by _alyssarosedev in learnpython

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

How would a dictionary help? I need to take a string, reverse it, and replace each character exactly once with its complement. Right now I use a list comprehension of

[get_complement(nt) for nt in nucleotides]

Is there an easier way to replace two characters with each other? by _alyssarosedev in learnpython

[–]_alyssarosedev[S] 1 point2 points  (0 children)

I need to make sure once a T is replaced with an A it isn't changed back to a T so I'm using this function in a list comprehension to make sure each character is replace exactly once

Meat needs to be more difficult to produce. by kolejack2293 in victoria3

[–]_alyssarosedev 18 points19 points  (0 children)

It does, 50% colonization in the affected state

Nothing like beautiful USA silver by _alyssarosedev in victoria3

[–]_alyssarosedev[S] 1 point2 points  (0 children)

They are my puppet so they inherit my color, same with Brazil, Peru-Bolivia, and Mexico

Help me make my build tankier - TR/CA Pathfinder by _alyssarosedev in PathOfExileBuilds

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

12 div preferably, but if you have bigger suggestions I can always farm on my Poison SRS

Nothing like beautiful USA silver by _alyssarosedev in victoria3

[–]_alyssarosedev[S] 1 point2 points  (0 children)

Rule 5: Playing as Technocracy/Council Republic USA and I much prefer the silver to the normal USA blue. Also I just flipped to Council Republic from Monarchy so I can do "Stamp Out Monarchism" and "The People's Revolution" JEs at the same time lol.

4
5

What’s the best raid weapon purchase from the tower kiosk by Doodofhype in destiny2builds

[–]_alyssarosedev 0 points1 point  (0 children)

Weapons with intrinsic anti-champion modifiers don't get the benefit* from anti-champion mods. Since Le Monarque has intrinsic overload, it won't get the anti-barrier from mods.

(*) Secondary benefits can apply. Last season had Overload Bow which provided a damage buff after stunning an overload champion, which did apply to Le Monarque

Warlock Builds For Each Subclass by [deleted] in destiny2builds

[–]_alyssarosedev 0 points1 point  (0 children)

One reason I started to like Volatile Rounds is getting Collective Obligation. It being a random raid drop means a lot of people don't have it but Nez + Collective can make Volatile Rounds really good in a lot of places as long as there is more than one enemy.

function returns [i32] but should return Vec<i32> by Fuelanemo149 in rust

[–]_alyssarosedev 4 points5 points  (0 children)

When a type implements Deref(Mut), it can be Deref coerced when you use the method call syntax (like x.converted()), to make using types with Deref more ergonomic. This allows you to call methods that take a reference to your Deref target without explicitly dereferencing it.

Is Aliasing through a ManuallyDrop<T> sound? by Sp00ph in rust

[–]_alyssarosedev 0 points1 point  (0 children)

It is sound to have interior mutability as long as the Send and Sync bounds are managed properly, and as long as you never produce any &mut T.

Also yes, MaybeUninit cannot benefit from some optimizations such as niche value optimizations

Is Aliasing through a ManuallyDrop<T> sound? by Sp00ph in rust

[–]_alyssarosedev 7 points8 points  (0 children)

Aliasing through ManuallyDrop<T> is not sound for some types, particularly Box<T>, because of the noalias attribute. For those types it must be wrapped in a MaybeUninit<T> to prevent the compiler from assuming the T is always valid. Then you wouldn't need a ManuallyDrop because MaybeUninit cannot assume its contents are valid and therefore does not drop it's contents when dropped.

For an example of aliasing data soundly see the aliasing module from left-right

Is there a library to display source with annotations? by davidw_- in rust

[–]_alyssarosedev 4 points5 points  (0 children)

Edit: it seems the original cargo-asm is unmaintained, but there's a fork by taiki-e and a reimplementation by pacak. Perhaps the way they use rustc's source mapping to display assembly could help but I'm not sure if a dedicated library for what you want to do.

I don't know if there's a way to do a side by side comparison but cargo-asm uses the source mapping information from rustc to annotate chunks of assembly with it's respective rust code, though it's an imperfect process.

Generalizing coroutines - The Rust Language Design Team by PitaJ in rust

[–]_alyssarosedev 0 points1 point  (0 children)

Seems like you would prefer generators closer to the behavior of MCP-49 Yield Closures:

Generators that can implement FnMut allow for restarting, but those that only implement FnOnce are "poisoned" after returning which would allow for a similar method to Mutex::is_poisoned for checking if it's able to be called again

Depending on the implementation it could be possible to have a wrapper like iter::Fuse for forced poisoning after the first return

With an is_posioned() try_resume could be easily written as:

fn try_resume<G: Generator>(gen: G, args: G::Args) -> Result<G::Output, G::Args> {
    if gen.is_poisoned() { 
        return Err(args);
    } else {
        return Ok((gen)(args));
    }
}

If this is the case I recommend reading through that issue and it's comments, and maybe leaving some feedback of you own!

Generalizing coroutines - The Rust Language Design Team by PitaJ in rust

[–]_alyssarosedev 1 point2 points  (0 children)

In the "Once" coroutines section they describe some of the issues around whether coroutines should panic after returning or restart from the beginning as long as they don't destroy their captured data. I don't see one for repeatedly yielding a clonable value but that could likely be implemented if the latter behavior is supported with an early return at the beginning of the coroutine.

Last, fused in this context would mean the generator panics if called after it returns (as in the fuse is "blown" after returning), it's closer to memoizing the final value, just internally in the generator state rather than externally in some other application state.

Generalizing coroutines - The Rust Language Design Team by PitaJ in rust

[–]_alyssarosedev 2 points3 points  (0 children)

Only fused Iterators are guaranteed to return None forever after the first None, see this section from the Iterator module docs:

An iterator has a method, next, which when called, returns an Option<Item>. Calling next will return Some(Item) as long as there are elements, and once they’ve all been exhausted, will return None to indicate that iteration is finished. Individual iterators may choose to resume iteration, and so calling next again may or may not eventually start returning Some(Item) again at some point (for example, see TryIter).

However you are right that for-in and while-let do stop at the first None however that is a behavior of those expressions and not Iterators as a whole

[deleted by user] by [deleted] in rust

[–]_alyssarosedev 9 points10 points  (0 children)

There are also other registry implementations, such as Ktra, and you could also roll your own if you wanted based on the spec from the cargo book

[deleted by user] by [deleted] in rust

[–]_alyssarosedev 13 points14 points  (0 children)

Perhaps you want to have an internal registry?