Pheubel
Pheubel
CC#
Created by engineertdog on 12/15/2023 in #help
✅ Convert 3rd party Dictionary to usable variable
It's not gonna be the easiest thing around. If there was a page where you could stake out how the outputs can look, then you could have made a class with a similar structure, map the dictionary by looping over the key-value pairs of the dictionary (should be able to do that with a foreach iirc) and mapping each pair to a property of your class. But if there can be different results, then you can't really be sure you covered it all. If it isn't that important, you can just assume a single output and throw an exception when an unexpected key appears. Definitely not foolproof, but with low stakes you can just fiddle around until you are satisfied
4 replies
CC#
Created by yusuke on 10/3/2023 in #help
❔ ✅ Can I make this faster or should I start looking at load balancing? tell me your api speeds too
The curse of being stuck on old af dotnet. It is not great, you miss out on general runtime optimizations, evolved language syntax and security fixes. Your boss should take the initiative to allow upgrading the framework to more modern standards. In the end it will save money by being more performant, meaning nore requests before the need to expand; a wider ranger of programmers and better iteration speed due to the more modern syntax
225 replies
CC#
Created by peja on 9/22/2023 in #help
✅ perform a click on specific coordinates
If the game has a ban on automation, for example runescape, then asking here will not get you far. In general it is quite frowned upon here as you would be breaking the game's TOS
10 replies
CC#
Created by Slycex on 9/22/2023 in #help
✅ Unable to read beyond the end of the stream.
my guess is that when you are trying to read from the memory stream, you are actually past the data you want to read out. Have a look at the Position property of your memory stream. my guess is that if the position is at 0, then it will work fine.
https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream?view=net-7.0
5 replies
CC#
Created by oe on 12/4/2022 in #help
❔ Why can't I host my ASP.NET WebAPI on Ubuntu ?
I assume you already got yourself a URL.
19 replies
CC#
Created by Thinker on 11/1/2022 in #help
Best way to serialize a date without a year [Answered]
Maybe whatever you are using to serialize allows for custom converters, if so you could use that as an in between step to get the format you want. It might also be useful to create your own struct with one byte for the month and one byte for the day. You can then add a conversion step to the DateOnly. Just spitballing the first things that come to mind
7 replies
CC#
Created by LPeter1997 on 10/8/2022 in #help
A generic and efficient way to feed in text for a lexer or scanner
what i would do is instead of going over the source file again, go over it once and tokenize it and structure it in a tree immediately. then if you want to do multiple passes you can go to the tree instead and transform it
21 replies
CC#
Created by LPeter1997 on 10/8/2022 in #help
A generic and efficient way to feed in text for a lexer or scanner
is there any reason you could not use a reader?
21 replies
CC#
Created by LPeter1997 on 10/8/2022 in #help
A generic and efficient way to feed in text for a lexer or scanner
i did make some extra functions to make it a little bit easier to use, for example peek for a specific character and move the reader forwards if it matches
21 replies
CC#
Created by LPeter1997 on 10/8/2022 in #help
A generic and efficient way to feed in text for a lexer or scanner
so far it was pretty painless, you just need to know what you are doing.
21 replies
CC#
Created by LPeter1997 on 10/8/2022 in #help
A generic and efficient way to feed in text for a lexer or scanner
something i am doing is making use of a TextReader, it reads a stream of data going forwards only. there is a small problem with it tho, sometimes when you call Peek() on it, it will assume that there is nothing to look for anymore, even though if you were to call Read() it would return the next character. What i did was create a simple wrapper around it with a small internal buffer it can use to peek into.
21 replies
CC#
Created by Gladiator on 9/2/2022 in #help
Equals for structs [Answered]
it depends a bit. this article goes in depth about using it: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type but for just value holders you don't compare it is not that needed, if it is used for comparisons, then it makes sense to create an override that does it properly.
6 replies