Tony Wang
Tony Wang
CC#
Created by Tony Wang on 6/10/2024 in #help
Application looking in wrong runtimes/{arch}/native directory
14 replies
CC#
Created by Tony Wang on 6/10/2024 in #help
Application looking in wrong runtimes/{arch}/native directory
Sounds good. It is a nuget package that I am using, that copies to ubuntu-x64. So unfortunatly I do not have control over it. I think there are other linux distros which have slightly different dependencies, which is why they use this approach to not overwrite the libraries when multiple nugets are included in C#. Do you have advice how to handle it? For now I can just copy from ubuntu-x64 to linux-x64 since I dont use any other nugets. But if I did, is there some flags I could use to control which one is overwritten?
14 replies
CC#
Created by Tony Wang on 6/10/2024 in #help
Application looking in wrong runtimes/{arch}/native directory
No I havent tried that yet. Thank you
14 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
Thanks again! Finally got it working
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
Or is there a convention, that the response uses the same compressions as the request and doing anything would be invalid?
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
I see, it is quite confusing, because the HttpListener parses the CharSet into HttpListenerRequest.ContentEncoding. So suppose I do want to set Content-Encoding to gzip with my HttpListener. How do I do that?
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
So HttpListenerRequest.ContentEncoding seems to be to be the same as ContentType charset, but HttpListenerResponse.ContentEncoding doesnt do anything it seems
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
So I finally got everything working. I just added: requestResponse.ContentType += ";charset=" + responseWrapper.Encoding?.HeaderName; But what confuses me is setting requestResponse.ContentEncoding doesnt seem to do anything
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
Unfortunatly it still doesnt work for me. ContentType.CharSet is also empty in the HttpResponseMessage for some reason. Is this something you cannot do with .net HttpListener?
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
So the encoding is automatically set in the string since that string contains byte information as well as encoding information in c#?
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
Oh thanks a lot! What is the content encoding header for?
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
For the request it works fine but for the response I don't know how to configure it correctly
20 replies
CC#
Created by Tony Wang on 5/13/2024 in #help
HttpListenerResponse
Yes that's what I mean
20 replies
CC#
Created by gwon8266 on 4/19/2024 in #help
I am trying to create List that can perform an action whenever I make a change to it.
Sounds reasonable to me
10 replies
CC#
Created by gwon8266 on 4/19/2024 in #help
I am trying to create List that can perform an action whenever I make a change to it.
can you be more specific about your items and what kind of changes you want to track?
10 replies
CC#
Created by gwon8266 on 4/19/2024 in #help
I am trying to create List that can perform an action whenever I make a change to it.
unfortunately there is no easy way to know whether some arbitrary item changed in an arbitrary way. But you can wrap your elements in a class that tell emit an event when some specific changes happen
10 replies
CC#
Created by Tony Wang on 4/19/2024 in #help
C# IEnumerable ToArray() Benchmark
That.... looks scary. I wish there was a way to guarantee no side effects in C# like in C++
48 replies
CC#
Created by Tony Wang on 4/19/2024 in #help
C# IEnumerable ToArray() Benchmark
In general this would be quite hard, but aren't there cases where this would be easy? Like for some return objects? For simple functions, its quite easy to guarantee that you return an unaliased object and this could be inferred automatically for simple cases like my example. For cases where you create an object using another method, you would need to know that the other method creates an unaliased object and so on. That wouldn't be cheap to track. But couldn't you manually provide a keyword at compile time just like const functions in c++?
48 replies
CC#
Created by Tony Wang on 4/19/2024 in #help
C# IEnumerable ToArray() Benchmark
I dont quite understand this, can you elaborate?
48 replies
CC#
Created by Tony Wang on 4/19/2024 in #help
C# IEnumerable ToArray() Benchmark
It would be great if functions could specify that they return an unaliased object, than the JIT would know
48 replies