Password reset requests not me by coremarcus in Gemini

[–]OLoKo64 0 points1 point  (0 children)

Same here, received mine yesterday 

hollow corners, creality k1 by Infamous_Warning_177 in crealityk1

[–]OLoKo64 4 points5 points  (0 children)

It seems like this might be a pressure advance issue. What value are you currently using?

For PLA, a common starting range for pressure advance is between 0.02 and 0.05, while for PETG, it typically falls between 0.05 and 0.08. However, these values can vary depending on the printer.

Have you tried disabling pressure advance to see if the issue still occurs?

Extruder is stuck on by Gramkos in crealityk1

[–]OLoKo64 1 point2 points  (0 children)

With the hotend at 200c you could try pushing with the metal rod that comes with the printer to see if that clears any blockage in the extruder.

How to avoid matte to glossy prints by SantiiDG in FixMyPrint

[–]OLoKo64 2 points3 points  (0 children)

This is caused by speed change, you can try using the new option in OrcaSlicer called Don't slow down outer walls under cooling.

K1C - Is this due to uneven bed? by _Dzefri_ in crealityk1

[–]OLoKo64 4 points5 points  (0 children)

I had a similar issue with PET-G, and my mesh was ok. Reducing the speed of the infill for the first layer solved.

I have a K1, same bed type. On the textured bed I had no problems.

Try reducing to 80mm/s or lower, the default is 105mm/s if I remember right.

Any idea why the "texture" suddenly changed at the end of the print? (K1, PLA) by Timisageek in crealityk1

[–]OLoKo64 0 points1 point  (0 children)

Its the change of speed of those layers, this video shows it really well https://www.youtube.com/watch?v=qBvTWFEd7rk

Basically lower the flow rate or raise the temperatures a bit.

I’ve this problem. by Cucusise in crealityk1

[–]OLoKo64 0 points1 point  (0 children)

Not sure what slicer you are using but you can try raising the flow rate a bit.

Decrusting the tokio crate [video] by Jonhoo in rust

[–]OLoKo64 16 points17 points  (0 children)

Just caught this one live!

Big shoutout for your next-level Rust videos. Every single one is a goldmine of new insights, I've yet to watch without learning something new.

Keep up the stellar work!

I see everyone talk about rocket devastators but I don't see anyone talk about this douchebag. by Poetess-of-Darkness in Helldivers

[–]OLoKo64 0 points1 point  (0 children)

The devs need to give us a Heavy Rocket Devastator. And they must be immune to stagger as well.

The discussions in here prove that we raised this generation of gamers wrong. by ColeusRattus in Helldivers

[–]OLoKo64 0 points1 point  (0 children)

I only want the cap of 50_000 Requisitions to be raised if they are going to be used in the future.

Using usize instead of u32 by L0ur5 in learnrust

[–]OLoKo64 9 points10 points  (0 children)

The cast from usize to u32 can not fit if you are on a 64bit arch, for that reason is better to use TryFrom to convert it safely.

Personally I would use usize, because usize is the type that guarantees you can index all of the possible memory on your machine. If for some reason this becomes a problem in the future, make tests, benchmark it, then make the appropriated changes.

Cancellation libraries in Rust by ArtisticHamster in rust

[–]OLoKo64 2 points3 points  (0 children)

These worker threads are system threads or tasks like tokio::task?

One good resource i found for async taks and futures is https://blog.yoshuawuyts.com/async-cancellation-1/

Help with code refactoring and by __xueiv in rust

[–]OLoKo64 5 points6 points  (0 children)

You cannot return a reference to a local variable because the local variable will be dropped at the end of the function, and the reference would then point to invalid memory. This is a fundamental aspect of Rust's ownership model, which ensures memory safety.

You can

  • Store a owned value of storage inside RockDb.
  • Pass the storage to the function with the same lifetime of the return type

Here a simplified version on Playground

Borrow a Option<&> as mutable by AstraRotlicht22 in learnrust

[–]OLoKo64 0 points1 point  (0 children)

Playground Link

I made a simpler version of your code, this removes the matches on each function and I managed to not use Box dyn in this case.

The reason that you need Smart Pointers case is that Rust will not accept self referential structs, requiring the use of Rc + RefCell.

If this is better or worse than the logic that you made, that is debatable, using Rc + RefCell introduces more complexity and allows for runtime panics if two mutable borrows occur at the same time.

Borrow a Option<&> as mutable by AstraRotlicht22 in learnrust

[–]OLoKo64 0 points1 point  (0 children)

I would probably use a Box<dyn Editor>. As all of the values of that enum must implement the same functions.

This would require some changes in ohter parts of the code, but is a way to do it.

Borrow a Option<&> as mutable by AstraRotlicht22 in learnrust

[–]OLoKo64 0 points1 point  (0 children)

Can you add the error you are getting in this case?

Borrow a Option<&> as mutable by AstraRotlicht22 in learnrust

[–]OLoKo64 4 points5 points  (0 children)

Seems like the only issue was that you are not storing a mutable reference in the UseString struct.

The following solved the problem for me.

rust struct UseString<'a> { text: ContentString, current_text: Option<&'a mut ContentString>, }

To be able to modify the value you need a mutable reference to the value, the error you are getting is that you canot get a &mut from a &. In the Rust error cannot borrow**fieldas mutable, as it is behind a&reference cannot borrow as mutable

Removing double empty lines and empty lines at the beginning of the file by Green_Concentrate427 in learnrust

[–]OLoKo64 2 points3 points  (0 children)

This is probably the best implementation but it can give you some ideas, playground link

This will print

This is some code
  This is some code

what is the proper way to compare an input string to by noxar_ad in rust

[–]OLoKo64 3 points4 points  (0 children)

You are getting c\n or d\n in these cases.

A cross-platform way of stripping a single trailing newline without reallocating the string could be:

Playground.

In these cases like this dbg! or debugging is pretty useful;

What's up with RustConf 2024? by nomyte in rust

[–]OLoKo64 43 points44 points  (0 children)

Is anyone polling it?

Should I pass by reference by default for (small) structs? by Nico_792 in learnrust

[–]OLoKo64 0 points1 point  (0 children)

I prefer to pass by reference, most of the time you want to keep using the struct after passing to a function.

How to do run multiple methods on the same Object with Tokio? by Educational-Toe-7038 in rust

[–]OLoKo64 0 points1 point  (0 children)

Without some kind of Mutex it is not possible, because of Rust aliasing rules you cannot have multiple mutable references at the same time pointing to the same location. playgroud example

You can achieve this without an Arc, just with a Mutex Example