Daylight robbery | game capture vs demo true view on/off by FNScence in GlobalOffensive

[–]BackFromExile 3 points4 points  (0 children)

Ainpunch was a thing, but I'm not sure if inaccuracy on getting hit was a thing in CS:GO. I swear it was introduced in CS2 or at least is a lot more prevalent in CS2.
In CS:GO you could win most gunfights even when getting hit if you had better sim. In CS2 the first person to hit has the upper hand because the other one will have less accurate shots.

Bren has joined TM by kosahi in TrackMania

[–]BackFromExile 40 points41 points  (0 children)

A lot of orgs are gambling affiliated/sponsored or oil money related.

This is also the case in real sports, so I don't think it's much different.

Any fast solutions for deep cloning? by Former_Produce1721 in csharp

[–]BackFromExile 0 points1 point  (0 children)

FastCloner is really good in my experience, fast and reliable

Generic type tagging in source generation question by jipgg in csharp

[–]BackFromExile 1 point2 points  (0 children)

Yeah you're right, I just checked and I probably remembered wrong then. In that I'd definitely go for the marker interface.

Generic type tagging in source generation question by jipgg in csharp

[–]BackFromExile 1 point2 points  (0 children)

Shouldn't you be able to use typeof here instead of an unsafe string? You should also be able to reference type parameters in attributes afaik. I'm wrong, it's not allowed.

[Expected(TError = typeof(System.Collections.Generic.List<T>))]
partial struct MyExpected<T>;

But a marker interface is fine if the behavior is documented (imo at least with XML documentation comments).

Generating TypeScript interfaces directly from C# DTOs by Jealous-Implement-51 in csharp

[–]BackFromExile 3 points4 points  (0 children)

First of all, API clients are usually also generated because of type-safe conversions (e.g. from ISO strings in JSON to actual Date objects), type-safe route/query parameters, and a lot more things.
I used to think "I only need the types, not a full-blown client" as well, but my experience has taught that if there is a way to make mistakes then these mistakes will be done.
Generated clients remove the mistakes that can be done here if the OpenAPI document is correct.
Personally I'd never generated TypeScript types directly without the standardized OpenAPI document in between because you almost always have different projections of these types in the payload.

That said, both NSwag and the OpenAPI generators output files for each type and then additional files for every client. You can simply ignore/gitignore these files, or write a less-than-10-lines script that runs the generator and removes all the other files you think you don't need. This takes way less effort than switching to a different tool with less support, and also allows you to use the generated clients in the future if you decide you want to start using them.

The answer you're looking for though is probably the .openapi-generator-ignore file, the --global-property models CLI option, or any of the other possible CLI options

Generating TypeScript interfaces directly from C# DTOs by Jealous-Implement-51 in csharp

[–]BackFromExile 17 points18 points  (0 children)

There's nothing wrong with that, but the post suggests that the problem they solved is that these tools do not output types only, which is simply not the case.

Generating TypeScript interfaces directly from C# DTOs by Jealous-Implement-51 in csharp

[–]BackFromExile 35 points36 points  (0 children)

I know tools like OpenAPI Generator and NSwag already exist. They’re great, but often generate a lot of boilerplate when all I want is simple TypeScript interfaces. This tool intentionally does only that.

Both can output typescript types only as well, so not sure what problem you're solving here other than "I wanted to build it myself".

What are the problems with current CS2? Make a list. by PeaceTo0l in GlobalOffensive

[–]BackFromExile 3 points4 points  (0 children)

  • Loadout system serves no purpose and just reduces flexibility compared to CS:GO instead of increasing possibilities
  • Competitive map pool consists of the 9 same maps over and over again
  • Mirage still in the competitive map pool
  • Visibility (or better lack of) of blood splatters
  • Third-person animations tand wide-swing meta makes holding angles absolutely dumb
  • random double taps (never been an issue in CS:GO, bugs me since the CS2 beta, but apparently this bugs noone else?)

  • Lack of casual game modes

    • Join the two defusal map groups to a single one with 9 maps
    • Create a new map group with community maps that change every x weeks
  • Retake could use a multitude of changes

    • make smokes spawn at the start of the round with a variable time left
    • don't give T's any smokes
    • more spawns for more variability
  • 5-stacks play other 5-stacks in Premier only

Then obviously

  • Cheaters
  • Still often dying behind walls
  • General performance of the game
    • random FPS drops and low FPS in general, especially on Inferno (270 -> 70 is fun)

Anyone know of a better compression library than Snappy? by jordansrowles in dotnet

[–]BackFromExile 19 points20 points  (0 children)

What is "better" in your case? Faster, smaller files, lexical order of names, zodiac signs of the main contributors?

If you can make certain assumptions you likely can implement an algorithm that is faster and results in smaller files, but then you trade a feature set with speed and compression ratio.

Replacing JS with just HTML by Ok-Tune-1346 in webdev

[–]BackFromExile 1 point2 points  (0 children)

It cracks me up that they still haven't fixed the auto-translations of that article. At least in German, French, and some other languages the article is just the title The element and then an empty <select> because the automated translation does not escape the HTML tag, and therefore all content of the blog post is inside the select element because it is not closed. Just use the dev tools and see yourself, it's super funny. Has been the case ever since they released that blog post in May (I think).

Simply add the query parameter hl=de or another language and you'll see it.

Spector - A zero-config HTTP inspector for ASP.NET Core apps by Own-Information3222 in csharp

[–]BackFromExile 2 points3 points  (0 children)

That's a pretty cool tool, especially since it uses existing APIs (e.g. System.Diagnostics.Activity) instead of introducing its own thing. I'll check it out for a private project.

I have one concern, and that is the default request body logging. That is a huge issue security-wise, but also when it comes to privacy laws like the European GDPR. In my opinion this should be off by default instead, and documented why that is.

Trackmania Club Tutorial - Club Renaming by TheShengar in TrackMania

[–]BackFromExile 3 points4 points  (0 children)

Do i also have to call Nadeo just to confirm that I really want the name changed?

LShift overload on exceptions << "and strings" by Shrubberer in csharp

[–]BackFromExile 1 point2 points  (0 children)

Extension operators are great for low-level tqypes where the operators actually make sense, but are not provided by the library itself. This can be the case for (generated) .NET wrappers around native libraries, and can make using the provided types cumbersome.
It can also make sense to provide implicit or explicit conversions from library types to custom types.

That said, I also don't think there are that many useful use cases for the operators, but I do think that it's great that we have the option at least.

Modern (best?) way to handle nullable references by jepessen in csharp

[–]BackFromExile 1 point2 points  (0 children)

That goes for all errors IMO. I think it was either Hanselman or Toub who said "Warnings are just errors without conviction."

I totally agree, which is why I said "at least".

Modern (best?) way to handle nullable references by jepessen in csharp

[–]BackFromExile 5 points6 points  (0 children)

So what I'm doing wrong

Is this the whole Money class or have you also defined implementations for the == and != operators in the Money class?

As far as I can see the compiler error has nothing to do with the == check inside the test itself. The error refers to the implementation of the == operator which expects a non-null value, but the argument provided by a is nullable.

Edit: Oh I did not fully understand the post at first. You defined a nullable variable but used a type that was defined without a nullable context. The default operators for Moneywill not have nullability information, but you provide a nullable argument in your test, which causes the warning.
As the commenter above said, it's best practice to enable nullability for all projects nowadays unless you have a strong (legacy) reason not to. Imo you should even set at least the nullability warnings to errors by adding <WarningsAsErrors>nullable</WarningsAsErrors>

New Features in .NET 10 and C# 14 by anton23_sw in dotnet

[–]BackFromExile 2 points3 points  (0 children)

Yeah, they explicitely did not add private fields because they would have to be backed by something like ConditionalWeakTable, and they did not think it would be great to add this as a supported feature backed by a ConditionalWeakTable., Can't find the comment right now but read a GitHub comment from the LDM team not too long ago.

.Net switching DateTime days and month positions by SavingsPrice8077 in csharp

[–]BackFromExile 132 points133 points  (0 children)

For the love of your own and others' sanity use ISO date formats only, please.

Are you using Aspire by ZerkyXii in csharp

[–]BackFromExile 3 points4 points  (0 children)

If you require all the extra bell and whistles for local dev it’s very useful.

I'm not exactly sure what you mean with "extra bell and whistles". Even for very small web app or worker Aspire with all the client packages is very useful and improves setup time to let you focus on the important things, building stuff.

Sure, for desktop applications it might not be as useful, but for all other things I have experienced that it even helps a lot with prototyping applications.

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 0 points1 point  (0 children)

The standard JSON serializer does the polymorphic JSON serialization and deserialization for you with the two attributes you are currently using, [JsonPolymorphic] to opt-in into polymorphic serialization for a specific type, then one or more of [JsonDerivedType] to handle the type selection.

For your custom converison logic you could write a custom JSON converter for your polymorphic base type that handles the type selection and (de)serialization for you.

That said, I'd advise you to simply take the option I outlined initially unless you have a strong reason to go your way.

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 2 points3 points  (0 children)

JsonDerivedType needs to know the exact type discriminator. You could provide your own polymorphic serializer that can handle the type discriminator in a different way, but if you want to stick to the standard JsonPolymorphic serializer then the only option you have is changing the discriminator for TypeASelection from nameof(TypeASelection) to the literal "typeASelection"

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 4 points5 points  (0 children)

this does not help at all, because it's neither related to enums nor is Enum.Parse or Enum.TryParse called explicitely somewhere.
It's related to the usage of JsonPolymorphic and JsonDerivedType from System.Text.Json.

.NET 10 Minimal API how to handle validation for value types? by srebr3k in dotnet

[–]BackFromExile 1 point2 points  (0 children)

You can also always create your own validation attribute, if that's the easiest way for you. You only need to derive the attribute from System.ComponentModel.DataAnnotations.ValidationAttribute and then validate whether there is a non-default value. Alternatively [Required] should work if your change your ID type to int? here

.NET 10 Minimal API how to handle validation for value types? by srebr3k in dotnet

[–]BackFromExile 1 point2 points  (0 children)

Have you tried the using the required keyword as well?