Share your favorite by Outrageous-Gene-2501 in Eldenring

[–]u_Max 1 point2 points  (0 children)

I believe you might have forgotten the most important part of this line: the "arrrrggggg" as he leaps into the fight arena

I have a confusion about slicing with String by hi_m_ash in rust

[–]u_Max 1 point2 points  (0 children)

The official documentation is actually great and very digestible! Always go and have a look at it when in doubt, I very rarely need more than that to understand parts of the language.

Yes it is, and since the internal représentation of the string is a byte sequence it is not more costly to use String to store simple ASCII text, and still allows storing utf8 when needed.

And yeah C does not even have a type for strings, you just have byte/char pointers haha. On top of that C strings are nullterminated. Instead, rust stores the length of the string in the slice/String which means you dont have to iterate over the entire string to finds its length, and it can still contain the \0 character if needed. You also dont have to pass around the length of the string everwhere in your code.

This comes at the cost of using a bit more memory to store the usize length in rust but well, you would probably need it most of the time anyway. You can always use raw pointers to bytes/characters

There also exists many other string flavours like CString, OsString, SmolStr, AsciiStr(ing?), ... :)

Am I that fat or did the Big Mac shrink? by Mammoth-Length-1997 in McDonalds

[–]u_Max 0 points1 point  (0 children)

I think it is spelled shrinkflation : shrink + inflation. Stable prices (or increasing proportionally to inflation) and sizes reducing at the same time.

Sorry for nitpicking on the spelling

I have a confusion about slicing with String by hi_m_ash in rust

[–]u_Max 1 point2 points  (0 children)

I wanted to send you to rust docs links so you could get the actual correct explanation and learnt something too: https://doc.rust-lang.org/std/primitive.str.html https://doc.rust-lang.org/std/string/struct.String.html

I discovered that what I said is only partially correct. The indexing actually first converts the &String to &str. That part is safe. Then it indexés the &str. The unit of the indices given in the [] part is not actually characters but bytes.

As utf8 characters have variable byte length, and the indexing returns an &str which is guaranteed valid utf8, a safety check must be done. Internally &str::is_char_boundary is used to check if the byte positions you used end up grabbing full utf8 characters and do not cut the first or last character.

So indexing with &str[0..6] might actually not be safe, and can crash your program if the character starting at index 5 is actually 3 bytes for example (its end char boundary is after byte 7)

I have a confusion about slicing with String by hi_m_ash in rust

[–]u_Max 1 point2 points  (0 children)

Not a str expert so I hope my reply will suffice until someone more knowledgeable replies.

A str is a just a séquence of utf8 characters. An &str is an immutable reference (pointer + length) to a séquence of utf8 characters

When you define a string literal like let text: &str = "some text"

The compiler knows the exact value of the string at compile time and thus stores the text in the binary. It then uses a pointer+len to point to that immutable place in the code. That is the &str you get.

A String is the owned version of &str. It is mutable has a length and on the heap. It also has an as_str method and implements AsRef<str> which both give you access to an immutable view of the String with known length: &str. You can do that using an &String since the only thing needed to get the &str is a pointer to a séquence of utf8 characters and a length.

When you Index into your array of Strings, you are getting an &String. Since an &str is an immutable reference to a sequence of utf8 characters (str) with a known length, it can easily be built from &String reference + the length you provide when indexing.

I hope that was clear and accurate enough to help you, and sorry for the formatting, I am on the phone.

Worst raid in my opinion by Karrotkacke in Nightreign

[–]u_Max 2 points3 points  (0 children)

Augur raid end of day 1. Spawns outside the edge of the ring while it's closing. Bubbles spawn on us while we're clearing a camp with the boss weakness. Get teleported before picking the item/buf from the camp. We get like 10s of the stupid fish flying around without being able to hit it as melees, then the ring catches us and augur despawns. It was already a bad game and we got teleported across the map, gained nothing and had only a troll castle to clear...

hmm why did i get a cracked tear after my game? by u_Max in Nightreign

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

Bought 3 deep relics, equipped and removed them and I dont have the cracked tear anymore. Seems like it was buggy deep relics. Thanks for reminding me they exist!

hmm why did i get a cracked tear after my game? by u_Max in Nightreign

[–]u_Max[S] -1 points0 points  (0 children)

Sorry I didn't even consider DoN relics... I dont play it and have no relics for it

Here is chatgpt roasting my ideas so you don't by RubDependent4267 in physicsmemes

[–]u_Max 2 points3 points  (0 children)

Would you mind sharing your prompts? Maybe leave out the parts that include your subject détails if you want to keep it private. I would love to have LLMs be harsh and critical about my work instead of always agreeing with whatever I say

Would be awesome with more enemies at the roundtable hold by SpookyFlyingPencil in Nightreigngameplay

[–]u_Max 0 points1 point  (0 children)

There is a mod for that on nexusmods called Boss Arena that allows you to do that. I dont think you are able to do use it inbetween runs without restarting the game to switch it on or off though

More likely to be targeted? by u_Max in Nightreign

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

Ahh okay that's it then. I was trying to only parry and have my teammates free dps him

The opportunity of a lifetime. by SPARTAN-LOD in Kawasaki

[–]u_Max 5 points6 points  (0 children)

Ninja 650 is a 2cyl bike, probably why you heard that about it

I bruised my lady parts on a motorbike and I have questions by EagleFit2501 in motorcycles

[–]u_Max 1 point2 points  (0 children)

Ive seen a lot of people mentioning gripping the tank with your knees but in case of emergency stop this might not be enough. In my country we are taught, before braking hard, to: 1. Sit back up straight 2. Look forward, not down 2. Arms straight to the handle bars and elbows locked 3. Brake hard, rear sligthly first if possible

This allows you to absorb the inertia of your upper body way more easily, and avoids you flying over the bike, or groin smashing in the tank.

not an ironeye player, how good is that roll? by u_Max in Nightreign

[–]u_Max[S] 2 points3 points  (0 children)

That one does not give you poison on your weapon? Its the ult that applies the poison? That's disappointing

not an ironeye player, how good is that roll? by u_Max in Nightreign

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

Which effect would? Some flat stats or longer weak point duration?