All Questions
5,347
questions
1
vote
2
answers
74
views
Fast integer sqrt using Math.Sqrt
I'm trying to calculate the square root of integer values. It doesn't need to be very accurate, but it should be fast and deterministic across platforms. I'm using this for a RTS game with lockstep ...
-3
votes
1
answer
77
views
Create a recursion function to respond with a different object [closed]
I'm a receiving the following data from a HTTP request to get all menus available:
[
{
"ID": "2",
"Name": "Home",
"ParentID": "1&...
0
votes
0
answers
61
views
Lock Free Queue, any problems with this
QueryWorker is a Class and QueryWorker.Next is a QueryWorker Field.
This will Enqueue the Writer and put it last in line.
Returns true if you are the first in line.
Do you see any problems with this, ...
0
votes
1
answer
80
views
Algorithm to extract overlapping range
Have an array of Pressures (hundreds) initialized like this:
class Pressure
{
public double Low;
public double Hi;
};
Pressure[] PressuresA = new[] {
new Pressure { Low = 10.5, Hi = 16....
0
votes
0
answers
56
views
C#, sorting coordinates into continuous line
I have the following coordinates for a line OR potentially non-convex polygon:
Rules:
each coordinate is at MOST 1 x or 1 y distance away
the coordinates WILL form a line with two end coordinates OR ...
0
votes
0
answers
46
views
Is there an algorithm for placing text objects without overlap?
I have a set of drawn round polygons (Testpoints) and I would like to label each Testpoint with its coressponding name. The location of the Testpoints and its' coressponding name are stored in an ...
0
votes
0
answers
65
views
How to retrieve the Signature hash algorithm friendly name using c# BouncyCastle 2.4.0?
I am trying to sign a file with the private key and the hash algorithm read from a certificate and I cannot find a way to do it programmatically:
public byte[] SignFile(string filePath, ...
1
vote
0
answers
38
views
Depth-First Search for Optimal Route Not Returning Expected Results in C#
I'm working on a program to find an optimal travel route starting and ending at the same city. The goal is to find the best route with the best goodness rating of the visited cities. My data is read ...
1
vote
0
answers
40
views
Post-Processing Maze to Eulerian Issues in 2D DFS Maze Generator
I am working on a C# program that generates a maze using a DFS algorithm. The maze generation works correctly, but I'm struggling with the post-processing methods to turn the generated maze into an ...
1
vote
1
answer
65
views
Detect 2d collision Circle to Rectangle (with angle) and vice versa
Hi i'm trying to detect when two objects connect , either a circle or rectangle. I can't figure it out how to do it. Most examples/tutorials online are really math heavy Or doesn't use the Angle for ...
2
votes
3
answers
131
views
Out of Memory For List of Strings
I am trying a problem in LeetCode and it seems almost done. This is what I have done so far: Fiddle and problem link - 30. Substring with Concatenation of All Words. Following is the code snippet that ...
0
votes
1
answer
69
views
How to sort an array of strings with different length properly
I have a question about sorting with C#. I want to implement a function to sort an array of strings such as ["AA", "A", "Z", "ZZZ"] alphabetically without any ...
1
vote
3
answers
117
views
How many Integers in the range [0-n] contain at least one 9 in their decimal representation?
Is there a universal formula for how you could work this out?
This is a part of a coding problem I'm attempting to solve and simple solutions like going through each integer and checking if it ...
-1
votes
1
answer
88
views
How to get last third character out from string without knowing it's length?
I have a string in format of
123*7?8
Where, the symbol ? means it can have any digit in its place. And the symbol * means that any number with a maximum length of 3 characters or nothing can stand in ...
1
vote
2
answers
62
views
Draw ellipse in 2D array
I'm trying to draw an ellipse to a 2D array. I have x and y as top left start position and bottom right x and y as end position.
I'm trying to draw an ellipse fitting exactly that rectangle space.
The ...