PracticalPotato
PracticalPotato
CC#
Created by Gergő on 5/31/2023 in #help
❔ .net web api thread pool size
Sure, if you want to think of it that way. I was talking about creating a thread pool. When you create a thread pool, you could create a pool with size 0. It just wouldn't do anything.
114 replies
CC#
Created by Gergő on 5/31/2023 in #help
❔ .net web api thread pool size
well you could have a thread pool of 0. you just wouldn't be using threads. you could have a thread pool of 1. but at that point you wouldn't need a pool. etc etc.
114 replies
CC#
Created by Gergő on 5/31/2023 in #help
❔ .net web api thread pool size
the only real limit is the capacity of whatever hardware you’re using to process those threads. (i.e. if your hardware chokes on trying to process too much at once and all the threads slow down) which usually isn’t an issue, but if it is, you generally just use benchmarks to figure out what the acceptable limit is.
114 replies
CC#
Created by Gergő on 5/31/2023 in #help
❔ .net web api thread pool size
threads aren’t processes, so there isnt really an upper limit on how many threads you can use.
114 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
I wanted to be able to select a "type" and then my program will try each registry key, and when it's found, open the .exe
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
The "type" is the name of a program that has many different versions. The path is a path to a registry key in the Windows uninstall registry. I'm using this registry key in order to find the location where the program is installed. Then, I use the name of the executable to start the program. the json structure that I posted originally was just what made the most sense to me.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
honestly, all of these seem plausible, depending on use case. the only thing that seems constant is that if I don't know how many values I will have, I should shove it into a dictionary.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
I seem to have nerd sniped the C# community.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
I’m practically iterating through the dictionary under each type so whatever works works. so
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
i need all of the keyvalue pairs so I guess I could make them tuples if I really wanted to shrugs
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
but it doesn’t really seem to reduce the complexity by much
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
I guess i could flip it so that i have a file as a key and an array of paths as the value
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
each path is associated with one file, though the same file may have multiple paths.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
I’m actually on my phone by now, tbh. I got a working solution a while ago.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
the paths can have different filenames associated with each path.
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
string filePath = /* */;
using var fs = File.OpenRead(filePath);
var dict = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(fs); // this?
string filePath = /* */;
using var fs = File.OpenRead(filePath);
var dict = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(fs); // this?
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
well, I am still doing it in one call as a dictionary of dictionaries, right?
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
what’s the benefit of using an array of objects over a dictionary of objects
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
how tf is it besides the point when your solution doesn’t contain the information that I need?
150 replies
CC#
Created by PracticalPotato on 5/23/2023 in #help
❔ Reading from a JSON file
how does that support a more complex structure? an array of strings is simpler and doesn’t have as much information.
150 replies