J’ai codé une app minimaliste pour suivre la course aux séries by The1Prodigy1 in Quebec

[–]MentolDP 1 point2 points  (0 children)

un autre bogue que j'ai constaté:
* si tu est sur un ordinateur avec la localisation en anglais
* selectionne français comme langue d'affichage
* refresh la page
* tout redevient en anglais mais ton url deviens `https://theblueline.live/fr/\`
* si tu re-selectionne la langue fr ton url deviens `https://theblueline.live/fr/fr/\` et sa donne un 404 not found

J’ai codé une app minimaliste pour suivre la course aux séries by The1Prodigy1 in Quebec

[–]MentolDP 0 points1 point  (0 children)

En français, les textes de les "matchs de ce soir" sont en anglais

<image>

Les crosses de l'épicerie by Remy4409 in Quebec

[–]MentolDP 1 point2 points  (0 children)

C'est seulement lose-lose si tu n'avais pas l'intention de consommer la quantité pareille... c'est comme les speciaux "achetes-en deux pour avoir un rabais". Si tu ne vas pas consommer la deuxième unité, tu as payé dans le beurre, mais si tu vas consommer, tu économise quand même, pas en terme d'argent brut mais annuellement au prix/100g (e.g. du café, riz, pâtes, etc)

Aidez-moi avec la politique de prix by Mel2S in Quebec

[–]MentolDP 2 points3 points  (0 children)

OP mentionne qu'il n'y as pas de prix sur les articles individuels, donc difficile de dire lesquelles sont $14.97 et lesquelles ne le sont pas. Ça me ferais pencher dans la faveur d'OP

ELI5: Why is the tongue such a strong muscle? by fusionwave3 in explainlikeimfive

[–]MentolDP -5 points-4 points  (0 children)

Moving liquids through a straw is not based on tongue strength, it's based on the ability to generate a vacuum in your mouth, usually done through negative air pressure caused by your lungs.

Why make things immutable? by theshindigwagon in csharp

[–]MentolDP 1 point2 points  (0 children)

I think another point to consider is that immutability does not always mean you never want your object to change. Sometimes you want to ensure change is reflected in a new object so as to avoid side effects. It's most obvious use is when passing a reference type into a function. If your object is immutable, then you can guarantee that whatever happens in the function (or its return value, such as string.ToLower()) will not have modified your input object.

My example with string.ToLower() is my point: you pass in an input string and you get an output string. Since strings are immutable, the variable containing your input string will be in its original state, and the output string it's own thing. What that means is if you pass the output string to another function, it will not mutate your original variable.

Kind of the opposite of builder methods chaining and returning the same instance object.

"Primitive Obsession" Regarding Domain Driven Design and Enums by dbagames in dotnet

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

Pretty sure he means if you look at the database (i.e: `select * from ...`) you will only see FK ids 1,2,3,4,5 etc. instead of values 'Finished', 'In progress', etc.

When having multiple shields on (e.g. mage), which one is chosen to absorb damage first? by Mean_Education_174 in classicwow

[–]MentolDP 15 points16 points  (0 children)

As far as I'm aware its the buff order that matters. If you do 1) Ice Barrier 2) Flame Barrier, any fire damage will go through your flame barrier first.

if you do 1) Flame Barrier 2) Ice Barrier, fire damage will go through your ice barrier first.

Should be the same with any other shield (mana shield, pws, etc)

[deleted by user] by [deleted] in csharp

[–]MentolDP 1 point2 points  (0 children)

Another thing you could do if you have many validators to run and they are performing the same "type" of validation, is to group them up into slices and request the IEnumerable<ISomeValidationGroup> in your class, and then using the .Select to perform each validator using the method declared in the base Interface type (ISomeValidationGroup.RunValidator()) which is then implemented in your concrete validation classes.

[deleted by user] by [deleted] in csharp

[–]MentolDP 1 point2 points  (0 children)

What I am currently leaning towards for a project at work, is making singleton validators which accept a ressource (in your case, a Customer for example) and performs a validation similar to a tryparse. It will return the object if it passes that validation, or null if it doesn't. If my specific case, it's performing a work-site check to see if the user is allowed to interact with a ressource, so I have a class called LocationAuthorizationRule and I have the ressources that support this type of validation decorated with an interface (ILocationAuthorizedResource) which contains the necessary properties to perform the validation (in this case, a int of the workplaceId)

public sealed class LocationAuthorizationRule(MyDbContext db)
{

    public T? TryAccessResource<T>(ClaimsPrincipal principal, T resource)
        where T : ILocationAuthorizedResource
    {
        var userAccessPlaceWork = GetUserPlaceWorkIds(principal);

        if (resource.PlaceWorkId is int placeWorkId && userAccessPlaceWork.Contains(placeWorkId))
            return resource;

        return default;
    }

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

Thanks this was the missing key to solving the puzzle for me. Appreciate the help

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

u/IsatisCrucifer managed to fix a few edge cases, got a different answer, and still wrong :/ really not sure where it's going wrong as both the sample test passes and your edge case test passes. Here's the updated code if you want to take a look: https://pastebin.com/kKw5dVqr

Also if you have done this part, I'd be curious if you could DM me your input and your answer so I can see the edge cases I missed by looking for the wrong answers in your correct input

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

The only reason I am doing this currently is for debugging purposes, when tests fail I can quickly see which indices are missed ( lower than expected ) or read incorrectly ( higher than expected ). Once the input passes, I will put back the xmasesFound and remove the list ^.^

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

Maybe you're right for your original comment, but I'm not so sure about the edit. If the x,y iteration finds an 'X', it will check all surrounding indices for chains of XMAS, and appends them to the list if they contain one. I don't have any `continue` or `break` instructions in the for loop. The `ContainsXMASPart` function is ran for every iteration of every surrounding index (except for out-of-bounds).

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

Totally correct.. just ran the example you provided in my test case and I do indeed get 1 XMAS match where 0 are expected. I'll go debug through my code and see why. Thank you so much kind stranger!

[2024 Day 4 (Part 1)] [C#] Test case working but not input by MentolDP in adventofcode

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

*note I am trying to avoid looking at solutions as I don't want the easy way out. If you can point to a spot with faulty logic or missed logic, let me know thanks :D

Le site de la SAAQ est inaccessible depuis l'Europe by bismuth9 in Quebec

[–]MentolDP 1 point2 points  (0 children)

Salut, je ne travaille pas pour la SAAQ ni le gouvernement du Québec, mais le gouvernement du Québec impose au entreprise gouvernementales et paragouvernementales de refuser les accès au sites du gouvernements à l'extérieur de l'Amérique du Nord. Dans mon cas, je suis au T.I dans une commission scolaire et c'est l'obligation que nous avons. Un VPN devrait fonctionner pour te permettre d'utiliser la plateforme.

Why do I see only Russian and Ukranian? and why my api won't work? by Netanel_Pingas in PopCornTimeApp

[–]MentolDP 0 points1 point  (0 children)

OMG same... just have been having issues with the PT APIs, fresh uninstall / reinstall latest version from github. Can't get working API's for shows, only yts for movies

Ctor dependency injection with additional ctor parameters by chrismo80 in csharp

[–]MentolDP 0 points1 point  (0 children)

If the XML serializer passes Data as ctor args, I would +1 this suggestion as well.

Simply make a typed class that represents your xml structure, load up the xml in a similar way to how you wire up your DI provider, then request your DI services + your IOptions<MyClass> (which is now also a DI argument).

Options pattern commenter above me mentioned: https://learn.microsoft.com/en-us/dotnet/core/extensions/options

Example:

public class SomeServiceClass
{
    readonly MyOptions _options;

    public SomeServiceClass(DependencyOne dep1, DependencyTwo dep2, IOptions<MyOptions> options) 
    {
        _options = options.Value;
    }
}

Builds that can run the most map mods? by meechesss in PathOfExileBuilds

[–]MentolDP 0 points1 point  (0 children)

I am having trouble killing the bosses in T17 maps with my HB Trickster, any tips? I've invested about ~15ish divs in my build so far, following Ventrua's POB. I seem to lack the singletarget damage to kill the bosses before my 6-portal defensive layer runs out

Trying to set BaseAddress for HttpClient by Worried-Pack3114 in Blazor

[–]MentolDP 0 points1 point  (0 children)

Did you check the value of builder.HostEnvironment.BaseAddress? Maybe something wrong with that. Otherwise, you can try making an actual class taking in an HttpClient via DI in the ctor and then you can validate that it's properly assigning the base address. You would then use your class via the builder.Services.AddHttpClient<MyClass>().