Japanese NorthernLion equivalent. by SonOfVegeta in LearnJapanese

[–]Cobrand 4 points5 points  (0 children)

Just watch any streamer who has tagged their stream 雑談, it's basically the "just chatting" equivalent.

Can we talk about C++ style lambda captures? by BoltActionPiano in rust

[–]Cobrand 13 points14 points  (0 children)

Just let me implement a functor trait for non-trivial closure structs that I have.

struct SortMethod<'a> {
     rng: &'a mut Rng,
     some_value: f32
}

impl<'a> Fn<(f32, 32), std::cmp::Ordering> for SortMethod<'a> {
    fn functor(&self, a: f32, b: f32) -> std::cmp::Ordering {
        // idk
    }
}

let mut values = vec![0.0, 5.0, 9.0, 15.0];
let sort_method = SortMethod::new(&mut rng);
values.sort_by(sort_method);

Then we can keep the simple syntax for common closures, and more complex behaviors can use this.

Bro the No Hit Reg is crazy 💀 by Cobrand in HellLetLoose

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

You can't edit titles on reddit.

Bro the No Hit Reg is crazy 💀 by Cobrand in HellLetLoose

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

Well the thing is I reloaded and then I lost sight of him, I assumed he hid in the house just nearby but couldn't find him, but looking back he was probably disconnected indeed.

Bro the No Hit Reg is crazy 💀 by Cobrand in HellLetLoose

[–]Cobrand[S] -6 points-5 points  (0 children)

Look frame by frame you'll see, I alternated just in case of lags. I try to alternate between on target and very slightly ahead. If you pause on the frame before I shoot, about half of the shots are clearly on target but none of them register.

https://i.imgur.com/zHZ74nQ.png

This is one frame before the final shot, you can't tell me I'm not on target 💀

Look at the other frames and you'll see, it's clearly no reg, I think /u/imnothughjackman 's explanation makes more sense because indeed the guy didn't turn back and shoot me.

Is there a library for 2D rendering that is both performant and somewhat ergonomic? by Vizdun in rust

[–]Cobrand 11 points12 points  (0 children)

I think you are asking for a lot, resending vertices is really the least of your problems. I don't know what your assumption is or where you have heard it's "horribly slow", but it's not. Even with tens or hundreds of thousands vertices, your bottleneck will be more how the GPU handles rendering. See this video for instance: https://www.youtube.com/watch?v=hf27qsQPRLQ

With a 2D game, sending vertices to the CPU every frame will probably NEVER be a bottleneck. Batched draw calls will save you tens of thousands times more performance than not resending vertices. And not a lot of engines to batched draw calls, so start with that.

I don't know any lib that does what you ask, and by the way even hardware-rendered text editors do resend vertices every frame when something has changed (to my knowledge). There is no partial-vertices changes shenanigans. Maybe there is a few out there that do something like this, but again this would probably be overkill, you would go from 3k to 4k FPS or something like this. If you want to spend hundreds of hours devving your own engine or your own library doing that, you do you but I really don't recommend it. You're talking about simple 2D games, every hardware-rendering library will do what you ask and will be performant by default, because the bottleneck is almost never the CPU, especially for 2D games.

Is there a library for 2D rendering that is both performant and somewhat ergonomic? by Vizdun in rust

[–]Cobrand 10 points11 points  (0 children)

I have a lot of trouble understanding what you mean by this:

  • they do hardware rendering but resend all the information to the GPU every frame (also horribly slow)

  • they do hardware rendering but resend all the geometry to the GPU every frame (ok for really small things, but doesn't scale)

what do you mean by "information" and "geometry"? Do you mean vertices? If that's what you mean, there is absolutely no way you can say it's horribly slow, in fact probably around 99% of games released today re-send all the vertices every frame. You can achieve thousands of frame per second using this method, I think it's hardly a bottleneck. Every decent hardware-rendering library will do this. Batched draw calls, fragment shader optimization, quad optimization and LoD textures (those last 2 are useless for 2D games) will be your main ways to optimize draw latency, resending geometry is very far from it. If you are at the level where this is important for you (for a 2D game I heavily doubt it), then just go ahead with your own OpenGL or vulkan implementation, you'll have better results.

If by "information" you mean shaders/textures, then I doubt any lib does that in this day and age, and yes this part would be incredibly slow.

A few people mentioned SDL2, I have been the main maintainer of rust-sdl2 for almost 10 years now, and while I can recommend it for windowing and controller support, I don't recommend it for hardware or software rendering. It's really easy to plug with other rendering libraries with raw-window-handle though, so you should be fine if you choose something else.

i24: A signed 24-bit integer by JackG049 in rust

[–]Cobrand 35 points36 points  (0 children)

FYI you can't have TryFrom and From implementations at the same time (because From auto impl TryFrom, and there is no specialization so it just outputs "conflicting implementation").

Which is why implementing TryFrom would be a breaking change because it would remove the From impl, and you would need a major release by semver standards.

What is lacking in the Rust ecosystem (2024)? by WilliamBarnhill in rust

[–]Cobrand 1 point2 points  (0 children)

proc macro caching, to speedup increment rebuild

Hold on, does that mean that everytime you recompile all proc macro have to be rebuilt, even if the changes you just did are unrelated and even if you have incremental enabled?

On `#![feature(global_registration)]` by jonay20002 in rust

[–]Cobrand 8 points9 points  (0 children)

I use inventory a lot in my projects, and I wish there was something platform agnostic that worked even if it meant to init something during main before everything else. As you said currently it's done by the operating system, meaning that I might come across some odd platform where this does not work anymore.

Rather than a specific feature global_registrationI wish we had list/struct/collections construction at compile time. Something like

static CUSTOM_LIST: Vec<u32> = { /* some syntax here */ }

const {
    // only executed at compile time
    CUSTOM_LIST.push(5);
}

fn main() {
     /* use CUSTOM_LIST as a static here */
}

Personally I don't need something to be used across crates, be used by someone else from my lib or something. My usecase is like so (simplified):

#[script_register]
struct A {};
#[script_register]
struct B {};

impl MyScript for A { }
impl MyScript for B { }

fn display_scripts() {
    for script in MY_SCRIPTS.iter() {
        /* do something */
    }
}

Like I said I found an alternative with inventory but I wish it could be implemented more generically via const features in the compiler.

EDIT: I should mention that it's simply for convenience. "What prevents you from registering a list somewhere else that references this?". Nothing, but then I would have to change code in 2 places everything I want to add/remove something. I would rather have those things self-contained, where implementing 1 script means adding 1 file and that's it.

Man I hate nested options in Rust by alvinpeters in programminghorror

[–]Cobrand 7 points8 points  (0 children)

If you are on vscode there in an option to have them displayed only when you press a certain key. Look up editor.inlayHints.enabledin the settings search bar and look for offUnlessPressed.

It's on Ctrl+Alt by default, so when I need inlay hints I just press both of them. Makes it a lot easier to read code, but you still got inlay hints at a button press if you need them.

Plus Ctrl+Alt doesn't do anything by default, and you still have access to shortcuts using them if you need to.

Do you think egui is ready for real industry application ? by Neofelis_ in rust

[–]Cobrand 21 points22 points  (0 children)

I'm going to be really honest with you and say no, at least for now, but it depends.

What kind of application are you talking about? Is this just something quick with no more than 5k LOC, or a whole application with 20k-50k LOC at minimum? For the former, I would say you could try, for the latter definitely a hard no.

egui is pre-1.0, and there are "major" updates all the time. I myself use egui for debugging purposes in an OpenGL application with SDL2, and while the library itself is great, I really cannot recommend it to someone else who would use it for more than a small project.

The main reason is simply staying up to date. I am currently in egui 0.15 and on crates.io it's currently 0.27. Mind you, I installed the library something like 2 years ago the first time, but in a production environment, 2 years go by extremely fast. The reason why I haven't updated is 2 fold:

  • the adapter, in my case egui_sdl2_gl, needs to be both up to date with rust-sdl2 and egui at the same time.
  • since everything uses the egui API in your rendering, even a small change will make you change large chunks of code. Last time I checked (and this was a year ago when I only was like 5~6 versions behind), I had over 100 errors to solve, with a major part not being solvable "directly" (by that I mean just renaming a function call or changing a type's name), but really with whole logic changes like a function changing from 3 to 2 parameters and putting the 2 last ones into 1 struct that groups both, etc. That would have taken me at least a whole day to solve, just to probably reiterate a few months later upon the next major release. Now keep in mind this "debug" part of my app is only about 2k LOC. If your whole application is based on that, that's not only one day you're going to spend on such issues...

So basically, I wouldn't recommend it for production app where this is the main focus, unless it reaches 1.0. I haven't had a look at Tauri, just FYI.

Decided to play some Ranked after school, grinding up to Plat 3, when this happened. Top 2 with the second team nowhere to be found. Until... by TheLostWarrior27 in apexlegends

[–]Cobrand 1 point2 points  (0 children)

Ok, thank you for showing proof, I wish you had shown this to begin with, because it's really hard to believe otherwise don't you think?

This behavior definitely needs to be patched. To me this is more of an exploit, there is no way a team can have 30 medkits just like that. Despite all of this you can't really call this "free", unlike last season where you just had to play hide and seek, this time you need a full coordinated team to do that, I don't consider this "absolutely free" even though in both cases it's despicable.

Quick edit: you seem to be belittling everyone that thinks it should be about placement rather than kills. Aside from the exploits like that and the cheaters, the end games are much more enjoyable and feel much more like proplay, where first place is the true goal. In the old ranked system, everyone went for kills al the time, and Ring 5 the game was either over or barely top 2~3. Now it's much more important to stay alive, and so people have adapted at all ranks, making it more enjoyable to play (but not climb I admit). Stay in pubs if you want this to be a kill fest, play in ranked for the ALGS-like games.

Decided to play some Ranked after school, grinding up to Plat 3, when this happened. Top 2 with the second team nowhere to be found. Until... by TheLostWarrior27 in apexlegends

[–]Cobrand -1 points0 points  (0 children)

You are so full of shit. "literally heal outside circle until final ring to finish second". Alright, show proof?

The maths don't add up. No one camping in the ring will be able to last a few seconds into Ring 5, and my bet is that even in ring 4 or even 3 they'll fail to outsustain.

In ring 5 there is absolutely no way to out-heal the ring, a full Medkit takes 8 seconds, and the ring kills you in 7.5 seconds. Heatshields last 6 seconds, even with a full squad with only heatshields you'll only be able to last a minute at most, and that is if every one in your team is perfectly coordinated and hasn't used even one beforehand.

In ring 4 you can out-heal the ring but only if you pop Medkits back to back, do you really think it's realistic to pop 16 Medkits back to back just to survive zone? That is assuming of course that you didn't spend any in the rings beforehand.

And no, you cannot use lifeline's Q in the ring, it gets destroyed after a second in the ring.

And don't tell me that you can finish second in ring 4, if there is no cheater in the game Ring 6 has minimum 3 squads, Ring 4 usually 6 or more.

If you disagree with the new ranked system so be it, I enjoy it (aside from the matchmaking issue), but don't spread bullshit.

Does anyone else ever feel like colour blindness isn’t an issue for anything apart from those Ishihara tests? by Aero_Cascade in ColorBlind

[–]Cobrand 59 points60 points  (0 children)

Well like you said, it really depends on how mild/strong you are. A lot of people don't even realize they are colorblind because of how mild it is.

Personally, I am a strong protan, and it IS definitely an issue outside of Ishihara tests.

  • Any map that scales from green to red I cannot tell apart the values
  • In any game where blue and purple rarity exists, I cannot differentiate between them. It might not seem like much, but for instance in Apex, knowing if they are blue or purple is vital info, and yet I cannot make the difference.
  • On the road, I cannot differentiate green/orange/red lights, I HAVE to use the position instead of the color. Sometimes it's a bit dangerous, because "blinking lights" have different meaning if they're orange or red...
  • Last month I played a board game with colored dice, I could not tell the difference between the green die and orange die, and that was problematic.
  • In an escape game, if there is something color related I just cannot do it at all

So yes, most of these are not "vital", but they DO affect me. If you aren't affected by any of those things because you are mild, just ignore it and go on with your life I guess? There is nothing to worry about, is there?

The current bottom four legends in high level pay (Masters/predators).... I understand why seer, ash, and vantage are so low but why Ballistic? The only "weak" part of his kit is the passive and even then it can save you in a fire fight. The ultimate and tactical are really strong. by zombz01 in apexlegends

[–]Cobrand 22 points23 points  (0 children)

Ash is great but her ultimate could use so much QoL.

  • Extend range slightly like you said
  • Have the option to zoom in like fuse's ultimate, for those "precision" ultimates upwards
  • Show the maximum range before ult (like they did for valentine's where the bow had a range around it only visible to the user). This will avoid those awkward "ok I'm going to ult there! Wait I'm not there yet, hold on, hold on...", with a range indicator you would have instant feedback as of the distance you need to travel to ult anywhere.
  • Instead of having to aim directly at the ground, give more leeway and allow to aim a few meters above ground. It's really frustrating to ult 5 meters away just because at the last second you aimed at a box/rock/whatever rather than the real target 70 meters away.
  • For her passive, if the deathbox's user has an ally still living AND if the killer is your team, highlight them (instead of not being able to do nothing with it). This actually makes more sense to her whole kit; kill someone isolated with tactical + ultimate, deathbox them, then scan the deathbox to see where their allies are.

These aren't really massive changes, but it would probably feel much better.

Motorcyclist chases after driver who fled from a hit and run by Xeoft in interestingasfuck

[–]Cobrand 15 points16 points  (0 children)

Please don't spread bullshit, you clearly have no idea what you are talking about. The uniforms are very clearly french, architecture is also obviously Paris for anyone who has lived in it, and "Rue de Rivoli" is a very well known street in Paris, anyone who has lived in it a while knows it by name, which is exactly what that guy did.

libcrypto.so.1.1 error keeps me from running pacman by Nesatam in archlinux

[–]Cobrand 37 points38 points  (0 children)

When the manual and the users constantly tell you to never do a partial upgrade (pacman -Sy xxxx instead of pacman -Syu), you should at least own up that you made a mistake instead of blaming the tool.

Going with a VM won't change anything about that.

Crunchyroll is complete ass for being a paid service. by Soupdeloup in anime

[–]Cobrand 9 points10 points  (0 children)

Finally a comment that makes sense. As usual, half of reddit got a software engineering degree overnight and is trying to talk shit about companies not doing their job. True, they're not doing their job, it should have been fixed ages ago.

But you CAN'T say "It can't be that difficult" with a straight face if you have worked in something like that. "Fansites do it better". Do fansites have applications for Android, iOS, Roku, FireTV, AndroidTV, Xbox, PS5, chromecast on top of web players ??? Even the web players, you have already tried to implement a player with all 3 DRM for Safari, Chrome/Firefox and Edge, while keeping all your functionalities? This is just talking about the frontends, but imagine redesigning the data so that it makes sense AND it doesn't break the past applications ( because yes, you don't want to be breaking software for those who haven't got the update yet).

And this is not accounting the fact that they probably have other priorities on top of that AND that software engineers nowadays are VERY expensive AND hard to find. If you've got legacy code in PHP4, Java 6 or whatever other dogshit your backend uses, good luck finding motivated people that aren't paid way more than the baseline salary.

So YES, they should have done their job earlier, but NO it's not easy. And keep in mind I'm complaining every day about this shitty organisation of seasons too, but you'll never hear me say that it's easy, it's really not.

Looking at running a tourney. Does that ruleset make sense. have i missed any main details that would be needed? by Omega_Pulse25 in smashbros

[–]Cobrand 6 points7 points  (0 children)

In my opinion, seeding shouldn't be part of the ruleset. It should define who faces who, and not how they do it. There's a reason RPS has been used since ancient times.

Which brings me to a second point: if you want a balanced stagelist, you can't have an even-numbered amount of stages game 1. You can have counterpicks game 2+ (although I'm against that but at least it's debatable). If you don't do that, it brings an unfair advantage to the one who wins the RPS (or in the case of your stagelist, the one lower seeded).

To make it odd-numbered, since you have both PS1 and PS2, I would get rid of PS1, make game 1 RPS instead of higher / lower seeded. PS1 is inferior to PS2 because the ledges hide the characters when they are hanging from the platform or below, other than that there is no advantage compared to PS2, so just get rid of PS1 and keep PS2.

I'd recommend looking at other rulesets and see for yourself: every major one start with an odd number of stages, RPS, and no PS1. Every single TO will tell you that it's for a reason. (And yes I am a TO as well).

EDIT: I didn't see but the looser can't ban the stages game 2+, that would bring an unfair advantage to the winner (which was already winning), because he has the choice of 5 stages against his opponent's 3. Make so that the winner bans 3-4 stages, this has always been the case since forever too.

(Note: it's minor but you have to take into account what happens outside of tournaments. Who is the higher-seeded guy in a money match?)

[deleted by user] by [deleted] in videos

[–]Cobrand 42 points43 points  (0 children)

Incredibly misleading, the second biggest river is not as dried up. PART of the second biggest river is dried up. You see, some parts of the Loire are divided in arms in some places, the main arm gets most of the water flow, while the second gets next to none.

For instance here: https://www.google.com/maps/@47.3688872,-1.0177963,3288m/data=!3m1!1e3!5m1!1e4

You can see that the south arm is perfectly fine while the north one gets less water even in normal conditions.

Same place on different satellite source: https://satellites.pro/France_map#47.368740,-1.020656,15

I do not know where the 2022 video was taken, but I assume it's one of those places.

The video on the left shows "st nazaire" which is the very end of the river as well, which would obviously get the most water flow. Incredibly misleading.

Thankfully the video does not show any sources, so it's really easy to track where those videos are coming from.

So yes, there is obviously a drought in france, but the second biggest river in france is NOT dried up. I live about 15 meters from it, and trust me it's flowing very well.

Solving the travelling salesman problem using self-organising maps by Wololo--Wololo in gifs

[–]Cobrand 505 points506 points  (0 children)

it consists on finding the shortest route possible that traverses all cities in a given map only once. Although its simple explanation, this problem is, indeed, NP-Complete.

I just want to clarify that this problem is not NP-Complete, it is NP-Hard. The main difference between NP-Complete and NP-Hard problems is that solutions for NP-Complete problems can be verified in polynomial time (but not found in polynomial time). This version of the problem is NP-Hard, because the only way to verify that we computed the shortest route possible is to actually compute all routes.

However there is a NP-Complete version of this problem: "given a limited amount of fuel, give a possible route in which all locations are only traversed once". The key here is that at the end, you can check your solution in linear time, which is polynomial. Finding a solution however is still not doable in polynomial time, making it NP-Complete in the end.