zxa4fd
zxa4fd
CC#
Created by zxa4fd on 4/19/2024 in #help
Can someone explain why these nested `using` is different from the ordinary one?
How is this:
using(resource1)
using(resource2)
{
// Code here
}
using(resource1)
using(resource2)
{
// Code here
}
different from:
using(resource1)
{
using(resource2)
{
// Code here
}
}
using(resource1)
{
using(resource2)
{
// Code here
}
}
11 replies
CC#
Created by zxa4fd on 10/18/2023 in #help
✅ Can anyone give example code of using an Immutable Data Structure for Concurrency?
Can anyone give an example that shows how using these types are thread safe?
40 replies
CC#
Created by zxa4fd on 7/15/2023 in #help
❔ How to deploy asp.net sites to Docker IIS?
Before we used to deploy sites via the IIS folder. But how can we we deploy to IIS in Docker? I'm not sure where to find the directory to copy the asp.net files to
41 replies
CC#
Created by zxa4fd on 11/5/2022 in #help
When should we use immutable data structures?
When should we use immutable data structures?
3 replies
CC#
Created by zxa4fd on 10/26/2022 in #help
How does this delegate work?
Given this delegate:
public delegate (T Value, int Seed) Generator<T>(int seed)
public delegate (T Value, int Seed) Generator<T>(int seed)
How this function return a Generator delegate?
public static Generator<int> NextInt = (seed) =>
{
seed ^= seed >> 13;
seed ^= seed << 18;
int result = seed & 0x7fffffff;
return (result, result);
};
public static Generator<int> NextInt = (seed) =>
{
seed ^= seed >> 13;
seed ^= seed << 18;
int result = seed & 0x7fffffff;
return (result, result);
};
10 replies
CC#
Created by zxa4fd on 10/12/2022 in #help
How to filter list so that if there are objects with same values in fields? [Answered]
Is there a way to filter objects so that objects with same field values are not duplicated in a list? ```cs var a = new Person(){Name="john", Age=22}; var b = new Person(){Name="john", Age=22}; var myList = new List<Person>(){a,b}; // what LINQ code to put here so that there are no duplicates?
9 replies
CC#
Created by zxa4fd on 8/28/2022 in #help
How does `internal` work in this code? [Answered]
public class BaseClass
{
// Only accessible within the same assembly.
internal static int x = 0;
}
public class BaseClass
{
// Only accessible within the same assembly.
internal static int x = 0;
}
9 replies