Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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 ...
Ollhak's user avatar
  • 91
-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&...
Filipe's user avatar
  • 20
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, ...
Anton Christiansen's user avatar
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....
user3262353's user avatar
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 ...
DeeCeptor's user avatar
  • 167
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 ...
Dazai_V's user avatar
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, ...
Umberto Gotti's user avatar
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 ...
NoOne's user avatar
  • 13
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 ...
MoussMad's user avatar
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 ...
Marcel's user avatar
  • 1,080
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 ...
user8512043's user avatar
  • 1,111
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 ...
Iku's user avatar
  • 87
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 ...
konrad's user avatar
  • 29
-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 ...
Makar's user avatar
  • 21
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 ...
Jule's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
357