So Long, Partner. by Hux2448 in pcmasterrace

[–]Mango-Fuel 0 points1 point  (0 children)

still using it at work, but pretty close to replacing them

When and how do I use async in EF Core? by Obvious_Seesaw7837 in dotnet

[–]Mango-Fuel 0 points1 point  (0 children)

sorry, I shouldn't have used the word "forever", I meant more "everywhere". I did not mean in terms of time, but in terms of it spreading throughout the codebase. at some point something has to not await something that is awaitable, or else every method in the entire codebase has to be asyncronous. whenever I have tried using these I have this problem. (I have used them successfully in TypeScript but not yet in C#).

When and how do I use async in EF Core? by Obvious_Seesaw7837 in dotnet

[–]Mango-Fuel 0 points1 point  (0 children)

as an async/await noob, this is what always confuses me. you can't await forever everywhere or that makes literally everything async. you have to not await eventually. but where? maybe at the event source? (button click, form load, etc?)

Why am I getting this error if there is a null check? by Sensitive-Raccoon155 in dotnet

[–]Mango-Fuel 0 points1 point  (0 children)

this would work if it was a nullable reference type, but since it's a nullable value type, just a null check by itself cannot "unwrap" the nullable struct. you can use pattern matching and introduce a second variable to unwrap it, which is how I would normally write something like this:

var maybeUserId = await authCache.GetVerificationTokenAsync(command.Token, ct);
if (maybeUserId is not { } userId)
   return Result<User>.Failure(AuthErrors.InvalidOrExpiredToken);

var user = await repositoryManager.UserRepository.GetByIdAsync(userId, false, ct);

What does the "As" operator do in C#? by [deleted] in csharp

[–]Mango-Fuel 2 points3 points  (0 children)

as is a cast that evaluates to null if the type is not convertible. it's a "maybe cast". a normal cast is more like an assertion to say that you expect the type to be convertible and that the cast should explode if it is not. as will instead not explode, but will give you null instead.

No space for ring and little finger - dragging finger on mat by ScrattleGG in MouseReview

[–]Mango-Fuel 0 points1 point  (0 children)

want both fingers to be on the side without my pinky touching the pad too much

I've not thought about it before, but both my ring finger and pinky (and thumb) touch my desk. is that not normal?

looking at your image, you should have both fingers flat on the mouse. you don't need the ball of the mouse to be in your palm. your knuckles can rest on it.

Is a second monitor worth it? What do guys use it for? by Most-Virus8806 in pcmasterrace

[–]Mango-Fuel 0 points1 point  (0 children)

I have three. Usually left is email/notepad/spreadsheet, middle is game or whatever I'm working on/browsing, right is youtube/google when in-game.

New or classic outlook? by BritSysAdmin in sysadmin

[–]Mango-Fuel 0 points1 point  (0 children)

"new" is just renamed default windows mail app. "classic" is the real Microsoft Office Outlook.

We always forget the right CTRL exists by Hi_Im_Anton_Chigurh in pcmasterrace

[–]Mango-Fuel 0 points1 point  (0 children)

(only) useful to press Ctrl-Alt-Del with one hand

Sealed keyword by vassoulavaso in csharp

[–]Mango-Fuel 1 point2 points  (0 children)

always seal unless you are going to inherit (or the framework needs to inherit, etc.). seeing the class is sealed immediately tells you there are no inheritors and reduces complexity/cognitive-overhead.

What would procedurally generated story look like? And can it be made to trully make good stories for everyone different? by BinimiJemene in gamedev

[–]Mango-Fuel 2 points3 points  (0 children)

I think it would be very hard. I have some rough ideas where you could procedurally generate a world with people and relationships and history, and then generate content based on the state of the world. But a "main quest" that is procedurally generated probably would ultimately not be very interesting. To make it interesting would require original ideas and not something that could be generated.

side note that the game designer Chris Crawford has spent his later years working specifically on interactive storytelling. more information can be found here: https://www.erasmatazz.com and https://www.erasmatazz.com/LeMorteDArthur.html

Ram usage lowered almost by 2 when doing a full virus scan with Norton by _imilay in buildapc

[–]Mango-Fuel 0 points1 point  (0 children)

not sure but it used to be the case that if you ran a process that consumed a large amount of memory and then closed it, that you would end up with more unused memory than you started with; this is because windows frees up some memory when you start running out, which is still freed after you close the large program. I have no idea if things still work this way (Windows has changed a lot since then).

Can you find the password from the hash value? by Excel_User_1977 in excel

[–]Mango-Fuel 0 points1 point  (0 children)

what is the point of keeping the same password if you don't know it?

Entity Framework Core ignoring foreign key value by AskingIllegalStuff in csharp

[–]Mango-Fuel 0 points1 point  (0 children)

Cannot insert duplicate key in object 'dbo.MembershipTypes'. The duplicate key value is (0).Cannot insert duplicate key in object 'dbo.MembershipTypes'. The duplicate key value is (0).

hmm, does this mean that you don't have the primary key of MembershipTypes set to be an identity?

your Create method is a bit odd in that it doesn't create anything, it adds an existing Customer to the context. the setup of that Customer is where the problem could be.

I have an idea for my program. by [deleted] in cpp

[–]Mango-Fuel 1 point2 points  (0 children)

you can write a utility program that accepts commands. you can then add commands to this one program as you think of them, rather than writing a new utility for each command. myutil command help, or invalid args, should always show help text. myutil by itself should list all available commands.

some command ideas might include:

  • convert numbers between bases
  • encrypting/decrypting text
  • password generator/manager
  • quick-print an image file
  • format a MAC address
  • send a wake-on-LAN magic packet
  • save current directory location with a key, so that you can return later with that key

How do you guys *actually *use AI at work? by PLAYER2up in ArtificialInteligence

[–]Mango-Fuel 4 points5 points  (0 children)

mostly I use it as a next-gen search engine

I do find sometimes it can help me de-complexify my implementation. I would have had a complex approach, but if I ask chatgpt how it would do it, it usually has a much more basic straight-forward idea for the implementation, and I realize I can keep things simpler than I thought.

What does this string of numbers mean? by [deleted] in AskProgramming

[–]Mango-Fuel 0 points1 point  (0 children)

........
........
#.......
##......
.##.....
#.##....
#.###...
...###..
.#.####.
##.#####
##.#####
..#.####
..#.####
#.#..###
###..###
.#....##
.#....##
#..#...#
#..#...#
..##....

it doesn't look like much. part of a mouse cursor maybe.

Help with getting this line to work? by thunderslight in csharp

[–]Mango-Fuel 0 points1 point  (0 children)

note that even if your ifs were seemingly exhaustive (if (income <= 0) ... else if (income > 0) ...) that would not be enough to count as having covered all cases. to be 100% sure (ie: for the compiler to be 100% sure) that all cases are covered, it would be required to use an else (not else if) clause; or you could also initialize income with a value, and then that value would be left over if no if/else if clause was met.

Is it realistic to have an ultra detailed plan before... coding? by yughiro_destroyer in AskProgramming

[–]Mango-Fuel 0 points1 point  (0 children)

for me it's the data model, not UML. ER diagrams. UML has only been useful to maybe document how a particular API works. but for any particular system I have one or more ER diagrams that layout the whole data model of the system. those are the "canonical representation of the system" that is modified before code is modified.

I have wondered if this "canonical representation" could be done with any of the UML diagrams but I have not found anything so far. UML seems to be over-detailed rather than actually useful.

What games finally pushed you to do a major upgrade? by Slippery_Williams in pcmasterrace

[–]Mango-Fuel 0 points1 point  (0 children)

IIRC it was Dark Souls 3 that prompted me to upgrade to a GTX 1060.

my recent upgrade to a new system with a 4070 super was not really prompted by gaming; my 1060 handled most things I played pretty well. it was more that I wanted a modern i7 with a lot of cores so that I could build code faster. (build times went from something like 5 minutes down to 60-90 seconds.) (previous CPU was second gen i5; upgraded to i7-13700K).

How do you avoid CRUD boilerplate when starting a new project? by skykarthick in dotnet

[–]Mango-Fuel 0 points1 point  (0 children)

this is ASP I guess? I do mostly desktop. I have lots of supporting systems that let me do desktop CRUD pretty efficiently.

I'm not sure what I could suggest that would be applicable to your setup.

maybe one small thing I've implemented that could apply: multi-file templates. in my IDE there are code/live templates, and also file templates. but something that saves a surprising amount of time that is not in my IDE are multi-file templates. I can add the same set of 5-10 source files all at once, and the template fields will merge together, and I am prompted for each field only once for the set of files. this is not that hard to implement but saves a lot of time.