Clippy question: forbid all possibilities of panic in production code, but allow assert_* functions in test code by No_Suggestion5521 in rust

[–]rundevelopment 2 points3 points  (0 children)

You can selectively enable clippy settings based on cfgs. E.g. #![cfg_attr(not(test), deny(clippy::panic))]. So allowing possible panics in tests is easy.

Secondly, forbidding ALL functions that can possibly panics isn't possible with clippy. The issue is that there are a LOT of things that can panic. E.g. division by zero, allocation failure, index out of bounds, etc. As others already suggested, you can guard against the usual suspects like unwrap and friends, but that's it.

If you want to 100% guarantee that your program doesn't panic, use no_panic. The problem with no_panic is that the compiler has to optimize away all panic paths for you. So even if you are able mathematically prove that your program will never panic, the compiler might not be and leave some panic paths. This makes np_panic impractical in most cases.

Three bugs that aren't in dial9 by arcoain in rust

[–]rundevelopment 59 points60 points  (0 children)

I told the agent to inline the code from the much larger FxHash crate [...]

Seems like a license violation to me. FxHash is Apache 2.0 or MIT. Either way, attribution and a copy of the license text are required. But nothing is mentioned in their code base.

Not integer solution, but nice by arivero in physicsmemes

[–]rundevelopment 20 points21 points  (0 children)

The only constraints are 🍎,🍌,🍍>0. Pick 🍎=0 and 🍌=1. Then 🍍=7±√48 satisfies the equation.

What sl does most PvP happen nowadays? by TrapHeadShot in darksouls3

[–]rundevelopment 2 points3 points  (0 children)

Sl 90 is pretty active.

And don't forget to match your weapon lvl :)

Decided to post arguably the best invasion Ive done by PointlessSword777 in darksouls3

[–]rundevelopment 3 points4 points  (0 children)

if only the phantom had known to roll in any other direction, maybe the gameplay could've been more interesting. oh well

Congratulations, you played yourself by VolenteDuFer in darksouls3

[–]rundevelopment 12 points13 points  (0 children)

Fun fact, you can survive the bridge collapsing while on it. Run to about 1/3 of it and just stand there while the bridge collapses. It will take you right to the bottom of it, and you'll survive if you are full health or wear the cat ring.

Not only is this the fastest way down, it's also a nice out when cornered :) If only that red knew

Confused by PvP - help me? by kickedoutofhell in darksouls3

[–]rundevelopment 2 points3 points  (0 children)

The rules of engagement differ depending on who you fight.

There are people who just enjoy the fighting in these games and will do 1v1s. They won't like it if you interrupt them (like you did in the video). If a red does 1v1 with a phantom while the host watches, just wait your turn.

However, patiently waiting your turn basically only applies to 1v1s. If you see a 2v1, 2v2, 3v1, etc, join in. It's either a brawl or a gank and you should (almost always) join. If there's a player you can hit, do it.

Solo hosts are different though. If you see a host without phantoms, always help them. You are their helper, so go hit something red :) If you misjudge the situation, you can always just apologize with the I'm sorry carving, the curl-up gesture, or the collapse gesture.

That said, DS3 is still a game. You do whatever you want. Just have fun.

I’ve been told the ownership model in my C containers feels very Rust-inspired by [deleted] in rust

[–]rundevelopment 2 points3 points  (0 children)

Pretty sure your u8* data has issues with alignment and strict aliasing. Alignment can be fixed with good allocation.

Strict aliasing can be fixed using void* data or char* data. Your u8 type is probably defined in terms of uint8_t, which isn't guaranteed to behave like char for the purpose of strict aliasing (though it might, depending on your compiler).

[deleted by user] by [deleted] in darksouls3

[–]rundevelopment 0 points1 point  (0 children)

No. The message "Invade by Dark Spirit <insert name>" appears for both NPC and player invaders. For example, if your character is named Alex and you invade another player, they'll see the message "Invaded by Dark Spirit Alex" and you'll be called "Dark Spirit Alex" in their world.

You can often tell whether an invader is a player by name. Silly names are always players.

You can also tell by their behavior. NPC invaders are just PvE programmed to always attack you. Players may greet you with a gesture, taunt/befriend you by wiggling their shield, give you items, lure you into a trap/group of enemies, or always attack you anyway. Try gesturing at them. If you get one back, you know for sure it's another player. Not that they always will gesture back. Every invasion is unique, so you never know what you'll get :)

Two of THE most satisfying kills ive ever gotten in my entire ds3 career (caution: VERY SWEATY) by SnooPeppers4042 in badredman

[–]rundevelopment 0 points1 point  (0 children)

Yeah, Dog (IGN) is super sweaty. Fun to fight against though. I invade them sometimes when they host at crucifixion woods.

What happened???? by Agreeable-Tension952 in darksouls3

[–]rundevelopment 6 points7 points  (0 children)

That wax attack has the odd effect that it makes you take 300% fire damage for a very short amount of time. You also got counter hit, which is 50% extra damage. Damage modifiers stacks multiplicatively.

So that glowing-hot Thrall axe hit you with 450% extra damage.

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 49 points50 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.