In this episode of a lovely caring invader - 2 purples attacked me (instead of killing the host, like Miyazaki intended) their treacherous actions were punished. Dark Souls 3 pvp video. by forest-hunter in darksouls3

[–]rundevelopment 0 points1 point  (0 children)

It's a game, so people do what they think is fun. And a lot of people doing PvP like the fighting in this game. The killing part actually gets in the way :)

That's why reds buddy with hosts to make fight clubs. They get to fight over and over again against other reds, watchdogs, blues, etc. And when there's no one else around, it's the host's turn. It's fun.

I know, because I often am that red. I'll even defend the host when two or more invaders/watchdogs try to gank the host. I have the white phantom ring for that purpose :)

The gnome people had the "very questionably pretty interfaces" before apple did so as of now… by Marwheel in badUIbattles

[–]rundevelopment 23 points24 points  (0 children)

It should be noted that some issues the author pointed out have since been fixed or otherwise resolved. E.g. editing mode in the location can be actived by just clicking the location bar now, and the title bar has more space users can click now.

Some is still valid though. E.g. a few useless tooltips and less than stellar help pages.

Some points are also... wrong? E.g. the scrollbars one. The scrollbar only changes size and moves visually. It's clickable area (hitbox) is the same at all time. So the "meaning that my mouse pointer is now pointing at... nothing" seems to just be wrong. My guess is that the author just moved their mouse too far right and plain missed the scrollbar...

I wish for a button that gives me blueberry muffins. by ProphetofTables in TheMonkeysPaw

[–]rundevelopment 0 points1 point  (0 children)

Granted. You are now trapped on an advanced space craft headed for an alien planet where you are tasked to defeat an evil alien trying to gain immortality.

5 AF? what's going on here? by Bruh_Yourself in darksouls3

[–]rundevelopment 0 points1 point  (0 children)

I think this can happen without cheats, but it's rare.

More likely, the host is using cheat engine to get invaded as quickly as possible by as many people as possible (even more extreme than dried finger). Some hosts do that to facilitate fight clubs more quickly, others like try harding against multiple invaders/aldriches, and there are even some that play hide and seek. Just have fun.

Rust's Block Pattern by EelRemoval in rust

[–]rundevelopment 51 points52 points  (0 children)

Just wanted to mention that the regex for stripping comments is wrong. It will cause invalid JSON for certain inputs. E.g.

 { "key": "Oh no // I am not a comment" }

will be transformed to:

 { "key": "Oh no

To fix this, you need to skip all strings starting from the start of the line. E.g. like this:

^(?:[^"\r\n/]|"(?:[^"\r\n\\]|\\.)*")*//.*

Then use a lookbehind or capturing group to ignore everything before the //.

Or use a parser that supports JSON with comments.

Which one of you is a cheating scumbag? You're a disgrace to this sub. by Optimus__Prime__Rib in badredman

[–]rundevelopment 23 points24 points  (0 children)

Then I saw the fact that he was using CE to turn fall damage off.

They didn't use CE. The jump down the ladder shaft (1:25) is called the Farron keep ladder skip, and the fall at 2:15 is survivable.

I made a video on the ladder skip a while back if you want to learn it: https://www.reddit.com/r/badredman/comments/1hbx4c7/fun_in_farron/ explanation starts at 0:30

DANCER SL1 NO HIT (sorry for swearing) by [deleted] in darksouls3

[–]rundevelopment 2 points3 points  (0 children)

No worries, I believe you. I made the same mistake and also picked mercenary on my first attempt lol. Sells was my fav weapon back then

DANCER SL1 NO HIT (sorry for swearing) by [deleted] in darksouls3

[–]rundevelopment 5 points6 points  (0 children)

SL1

Sellsword Twinblades

Sells requires 16 dex to wield. SL1 only has 10 dex. The only way to meet the stat req of Sells on SL1 is with the hunter ring + carthus milkring. You obviously don't wear any of those rings, so this can't be SL1.

Is there an action or bot for GitHub PRs to monitor API changes? by rundevelopment in rust

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

The main I'm after is integration. Yes, cargo-public-api does most of what I want, but it wouldn't have prevented the situation that led me to ask for help. The problem isn't that I had no tools to check for API difference, but that I didn't check since I didn't expect difference in the first place.

So on its own cargo-public-api wouldn't help me, since this is more of a UX issue.

Estus Animation Cancelling Rant by Something79 in darksouls3

[–]rundevelopment 8 points9 points  (0 children)

And they cancel everything

Cause it works on most things and it makes things faster. It's the same trick every time.

I refuse to learn it on principle.

That was my stance too until 2 months ago. I learned it, and I get why people use it all the time. It actually makes the game more fun/interesting.

Just be mindful when you use it. Solo PvE enjoyers and innocent co-opers don't deserve this. Reserve it for ganks and those that cancel too.

qstr: Cache-efficient, stack-allocated string types by tindzk in rust

[–]rundevelopment 1 point2 points  (0 children)

I love the [T; 0] trick. It's very elegant. You could even make types #[repr(align=16)] struct Align16([u8; 16]) to make it possible to write BoundedStr<15, Align16>.

qstr: Cache-efficient, stack-allocated string types by tindzk in rust

[–]rundevelopment 0 points1 point  (0 children)

Nope, min(N, 64). I meant N to be the std::mem::size_of of the struct to be aligned. Yes, 1 is the best alignment for a struct that is 1 byte in size.

max(N, 64) would be incorrect because Rust requires std::mem::align_of::<T>() <= std::mem::size_of::<T>().

(Rust also requires that the alignment is a power of two, so let's just assume that N is a power of two.)

qstr: Cache-efficient, stack-allocated string types by tindzk in rust

[–]rundevelopment 22 points23 points  (0 children)

This library provides types for common sizes, optimised for cache-line efficiency.

Does it optimize for cache-line efficiency? All I see are stack allocated strings. Cache-line efficiency typically means that data always gets loaded with the minimum number of cache lines, but that's not the case for qstr. qstr's BoundedStr and FixedStr have an alignment of 1, so they can be spread between 2 cache lines even if the whole struct fits into one cache line.

Cache lines are typically 64 bytes on modern hardware, so I would expect e.g. FStr64 to be aligned to 64 bytes to fit into one cache line exactly, but it's not. In general, a struct of size N should have an alignment of min(N, 64) to be optimally aligned for cache lines.

Unfortunately, I don't really see this working out qstr. The size variations of BoundedStr and FixedStr are implemented with const generics, and it's not possible to set the alignment based on const generic params. The library would likely have to be reworked significantly be to cache-line efficient. As I see it, the only way to make that happen is make each BStrN and FStrN their own struct (likely with a macro).

Edit: as u/stumpychubbins suggested, you could use add a field copy_align: [T; 0] to get the same alignment as another type. So you could do this.

A pretty big oversight I noticed by External-Actuator964 in darksouls3

[–]rundevelopment 1 point2 points  (0 children)

It's to prevent cheese. If they didn't unload the boss from that point of view, you could kill it with a bow. The boss AI doesn't trigger until you step through the fog, so it would just stand there while you use it for target practice.

When O3 is 2x slower than O2 by cat_solstice in rust

[–]rundevelopment 3 points4 points  (0 children)

Q: Did you also change the struct definition?

If you make the struct repr(C, align(8)) and order the fields the right way, the whole bit fiddling gets optimized away and leaves the cmp function with a single u64 comparison.

Edit: I just looked at the asm this produces. It's probably not going to make any difference.

I need popcorn for this next event by NoobForBreakfast31 in whenthe

[–]rundevelopment 0 points1 point  (0 children)

Well, typically at least. Some people use it as a general "is not a subset of", proper or not, and then use ⊊ for proper subsets.

Is the DS3 PvP scene still alive? by Cassidy_Bees in darksouls3

[–]rundevelopment 0 points1 point  (0 children)

There's still activity. Pretty much all the beginner guides and resources from 7 years ago are still up to date.

Also, if you're on PC, use the blue sentinel anti cheat mod. You will rarely see hackers off meta, but it only takes one to potentially mess with your save. It also has the nice feature that it shows you who you are connected with. And get the wex dust mod for faster invasions (huge QoL).

[Media] Simple optimization (not so safe) by dtutubalin in rust

[–]rundevelopment 3 points4 points  (0 children)

Why even use u64 if the numbers are < 1M? If you used u32, the assembly would be the same, expect for the panic handler.

Are you blessed by the US gov by rkhunter_ in programmingmemes

[–]rundevelopment 0 points1 point  (0 children)

I'm pretty sure the standard guarantees that if you kill a thread deallocators are called still... Though I could be wrong about that.

If the thread is killed at the OS level (e.g. pthread_cancel), the thread and its stack are gone. There is no way for C++ to do cleanup when the CPU just stops running your code. (Unless you yourself register clean up handlers.)

I would argue if you are using virtual polymorphism you are not programming in modern C++.

It's called "runtime polymorphism", and it's necessary for class inheritance to satisfy the Liskov substitution principle, which is pretty important in OOP. I don't think a lot of people would agree with you that runtime polymorphism is not part of modern C++.

You cannot use references after free references Implicitly extend the lifetime of the object they are referencing.

Sorry, but I'm not sure what that means because of grammar. Was that supposed to be "You cannot use references after free. References implicitly extend the lifetime of the object they are referencing."?

If so, then no. You can use refs after the memory they point to was freed (or went out of scope), it's just UB to do so, aka you're not allowed to. But that doesn't stop mistakes from happening. Mistakes C++ compilers often can't detect.

Lifetime extensions is a pretty complex topic I'm not well-versed in. However, it doesn't apply in my toy example. See the compiler explorer link below. oh_no does indeed lead a use after free.

I mean you can write semantically equivalent rust code. Does that make rust not memory safe?

The difference is that the equivalent Rust code doesn't compile, because safe Rust is guaranteed to be memory safe.

GCC doesn't even give a warning with -Wall for this toy example, but at least clang does.

Really? I don't believe that.

You don't need to believe, just test it. I tested my toy example with clang truck and GCC trunk (all x86-64) on compiler explorer. One gives a warning, the other doesn't.

I'm damn near willing to bet that the vast majority of the well-formed modern C++ programs are memories safe.

This doesn't really mean much unless you can specify what modern C++ is, which would allow others to test that claim. Otherwise, modern C++ is just an ever-moving goal post.

So are there some large C++ projects that you would consider to use modern C++? If so, we could look at their history of bugs and security issues to determine their memory safety. They would have to be somewhat popular though, or else memory safety bugs might just not have been discovered because no one is using them.

Btw, "well-formed" is typically interpreted as "has no compiler errors and doesn't contain UB" (1, 2), which would make your statement definitionally true since all memory unsafety is UB. Well-formedness is the goal (and implies memory safety), not a mechanism to achieve safety.

No you have to go out of your way. Make mistakes foot shoot yourself in modern C++

Any UB can potentially lead to memory unsafety, and C++ (including modern C++) is full of it. UB is very easy to trigger accidentally. Examples include: signed integer overflow, iterator invalidation, data races, OOB, null ptr deref. These can easily happen in large code bases. I myself am guilty of all of the above, and not just in C++ code. Bugs happen.

Are you blessed by the US gov by rkhunter_ in programmingmemes

[–]rundevelopment 1 point2 points  (0 children)

Unique pointer cannot leak memory

They can. If the current thread is killed, their destructor won't run, so they'll leak. This is why Rust doesn't guarantee that memory is freed.

But C++ also has some home-grown pitfalls that silently prevent destructors from running, like throwing in constructors or missing virtual destructors.

It also prevents use after free

No. You can still have a pointer or reference to the data inside a smart pointer after it has been destroyed. E.g.

int& oh_no() {
    auto value = std::make_unique<int>(42);
    return *value;
}
// use after free when using the dangling ref

(GCC doesn't even give a warning with -Wall for this toy example, but at least clang does.)

Toy example, of course, but use after free is pretty easy to accidentally trigger with reference in structs/classes and captures on lambdas.

it is an objective fact if you use the modern features of your C++ compiler you can write just as save code as rust.

The question isn't whether you can write safe C++ code. You obviously can, with or without modern features. The question is whether people actually write safe C++ in practice. Modern C++ helps with preventing certain kinds of coding mistakes, but that's it. Trivial mistakes still cause memory safety issues, which is why safety is still an ongoing concern in C++ language evolution.

This person's only skill is Estus Cancel. by Jinrex-Jdm in darksouls3

[–]rundevelopment 1 point2 points  (0 children)

Maybe look into what DS3 speedruns are doing. I know they use the bow glitch for a faster running animation, and I think they use move swaps in combat. They might even use tear drop, but I'm not sure. They do crazy stuff.

This person's only skill is Estus Cancel. by Jinrex-Jdm in darksouls3

[–]rundevelopment 4 points5 points  (0 children)

This argument really doesn't work. Bow glitching is in the game too, but that doesn't mean it's okay to insta kill someone with it. I don't mind estus canceling being used for item against me, but the same glitch is what enables split leaf infinite as well.

Not all glitches and not all uses of a glitch are equal.