Skip to main content

All Questions

8 votes
2 answers
1k views

C# Linked List implementation

I am trying to learn C# and created this project to improve. I will be using C# professionally so a harsh critique is welcome. ...
Doruk's user avatar
  • 293
3 votes
0 answers
83 views

Implementation of damage calculation based on Final Fantasy 9

I am re-implementing the damage calculations for the game Final Fantasy 9, based on the documentation provided in the GameFaqs Battle Mechanics Guide. Currently, I have two main methods for performing ...
FlameHorizon's user avatar
1 vote
0 answers
165 views

Priority Queue implementation using a Heap [closed]

I'm working on a custom implementation of A-Star and so I had to also create a Priority Queue and so I had to create a Heap. I'm quite happy with my Heap but I'm a bit worried about my Priority Queue: ...
Caïn's user avatar
  • 111
1 vote
1 answer
68 views

Mapping various input values to a data accumulation class

This function takes inputs from multiple different controls on a form, and maps them to values in a data accumulation class. This code was written specifically to keep logic, data, and display ...
EvilPCDiva's user avatar
4 votes
0 answers
127 views

Securely generate Token for authentication

In my experience i had the need that some application (both desktop and web) can excange data to authenticate users (even if the data for authenticating users are not reacheable form desktop ...
Skary's user avatar
  • 248
1 vote
0 answers
253 views

What’s the correct usage of volatile keyword in this Concurrent dictionary implementation?

Can I get some guidance around the usage of volatile keyword and design of the existing concurrent dictionary implementation, please. Here are a few design ...
Dhruv Sawhney's user avatar
0 votes
1 answer
198 views

Linked List Implementation in C#

I wrote an implementation of the Linked list data structure. I mostly did this because it's the simplest collection data structure (at least the simplest to implement), and I wanted to practice ...
Tobi Alafin's user avatar
  • 1,796
1 vote
1 answer
97 views

A Tiny Image Tagger Implementation in C#

I am trying to implement a tiny image tagger with customized tag options in C#. The main window is as follows. The left block is a picture box MainPictureBox and ...
JimmyHu's user avatar
  • 5,392
5 votes
2 answers
181 views

Code Challenge: basic arithmic operations using only incrementation operator

Challenge Write a function that takes 2 integer operands left and right (both >= 0) and evaluates one of the following ...
dfhwze's user avatar
  • 13.9k
2 votes
1 answer
1k views

Simple, flexible, and thread-safe key/value memory cache

MemoryCache.cs ...
Shelby115's user avatar
  • 1,961
3 votes
2 answers
214 views

codekata: Binary search on an int array

I'm following Karate Chop kata for a binary search. I really wanted to avoid built in functionality within the language. I'm pretty new to C# so any recommendations is greatly appreciated. Spec: ...
Sean Kelly's user avatar
6 votes
2 answers
251 views

Compact command line argument parser : Revisited

This question is a follow up to my previous one which can be found here. The user dfhwze suggested me to look into compiler construction and recommended me to write a lexer and a parser that would ...
766F6964's user avatar
  • 901
2 votes
1 answer
500 views

Compact command line argument parser

So, I decided to write my own little command line argument parser for various other projects I work on. I am aware that there are many good command line parser libraries, but I did wrote my own anyway ...
766F6964's user avatar
  • 901
5 votes
1 answer
3k views

In-Memory database supporting transactions

I referred to the post here but it does not address the question that I have with regards to my implementation. I have a C# implementation of an in-memory database that I came up with during a recent ...
Sindhu's user avatar
  • 59
2 votes
2 answers
333 views

Generic Singly-Linked List implementation

I'm looking for some feedback regarding my implementation of a generic singly-linked list in C#. I'm also looking for some tips on how to implement other techniques such as using ...
THExLONExCUBAN's user avatar
3 votes
2 answers
708 views

Implement Immutable Collection in C#

I would like to define some constant sequences (of bytes, specifically) in my C# library/API. Both length and content should not vary, preferably by any means (barring reflection). To this end, a <...
nivk's user avatar
  • 235
9 votes
1 answer
783 views

Simple LinkedList

I guess this has been made a couple of times by now, but i wanted to take my chance on creating a simple generic linked list in c#. What do you think ? This is the main class. ...
Vlad Sandu's user avatar
2 votes
3 answers
199 views

Addition of 2 integers

I've implemented an algorithm found in a book. It adds 2 positive integers of equal size. How can it be improved? It is assumed that inputted data is always positive integers with an equal number of ...
gmail user's user avatar
3 votes
4 answers
4k views

Convert decimal to string

I wrote a C# program that converts decimal to string. It is not the best but it works. I'm looking for inputs from others on how ...
gmail user's user avatar
7 votes
2 answers
2k views

Class Matrix implementation

Following the 18.06 Linear algebra course, I was curious to reinvent the matrix class and basic functionality, like \$PA=LU \$ decomposition, Gauss elimination, finding inverse matrix etc. Any ...
pgs's user avatar
  • 922
11 votes
5 answers
6k views

Stopwatch class

I am learning C# and I have an exercise: Design a class called Stopwatch. The job of this class is to simulate a stopwatch. It should provide two methods: Start and Stop. We call the start ...
GohanP's user avatar
  • 213
3 votes
1 answer
661 views

C# basic dictionary (hash) implementation

I have implemented a very basic hash data structure with basic set/retrieve methods. A good example of use of this implementation would be a phone-book. I have used as underneath storage structure an ...
Joan Dimko's user avatar
2 votes
1 answer
369 views

StopWatch for users C#

I have tried to create a stopwatch and I have done but I don't know how to improve it, and I want the user control the stopwatch whether it (Start) or (Stop), I'll be thankful if you tell me what I ...
Eslam Ali's user avatar
8 votes
1 answer
5k views

Library, that finds the derivative of a function

I've written a small library, that provides a way to store mathematical expressions in a tree-like structure, and provides a method, that finds the first derivative of a function. I know, that there ...
Horváth Dávid's user avatar
16 votes
4 answers
2k views

String Queue implementation

Is the implementation clean enough & can be used in production? I tried to write clean & bug-free code. It looks good to me. I would appreciate any improvement suggestions. One question I ...
Pollob's user avatar
  • 163
5 votes
2 answers
23k views

LINQ and string.Split do it yourself practice

Problem Statement: Implement a sentence scanning functionality to parse the sentence and return a string to concatenate each word with its number of occurrences, sorted by the number of ...
Jianmin Chen's user avatar
  • 2,396
4 votes
0 answers
11k views

Logging into Database with ASP.NET Core

In the Startup.cs of my ASP.NET Core application I want to configure the LoggingFactory so that it logs into the database. ...
Palmi's user avatar
  • 141
1 vote
1 answer
92 views

Binary Search Optimization [closed]

Can anyone give me recommendations on how to improve my code? ...
nikolay's user avatar
  • 21
1 vote
2 answers
1k views

Optimizing a binary search algorithm

I have implemented a binary search algorithm in C#. Can anyone give me suggestions on improving its effectiveness? ...
Vasko Yanakiev's user avatar
7 votes
1 answer
872 views

Custom Big Integer class for Project Euler in C#

I'm trying to teach myself some programming and, working through the Project Euler problems, I've come across some instances where I've needed numbers that are larger than will fit into an int or long ...
Steelilack's user avatar
1 vote
2 answers
275 views

Singly linked list RemoveBefore() method

I am trying to implement a singly linked list. What is the most optimal way of implementing a RemoveBefore(ListNode) method? I have done this: Check if node being ...
Pradeepl's user avatar
  • 153
4 votes
3 answers
180 views

Constructor for a Time object

I am trying to write a constructor method that takes dd, hh, mm and ...
AliTeo's user avatar
  • 139
3 votes
1 answer
3k views

Generic Implementation of A Linked List in C#

Yesterday I posted my Generic List and received great feedback from it. I have taken the feedback to heart. Today I'm posting my take on the linked list in c#. LinkedList.cs ...
Nate's user avatar
  • 253
12 votes
2 answers
3k views

Implementation of a generic List

I have only been self teaching myself programming on and off for about 5 months. The purpose of me writing this class is to incorporate the knowledge that I have gathered since I started. ...
Nate's user avatar
  • 253
2 votes
1 answer
216 views

C# XML Config File

I'm trying to find a simple, clean and fast way to implement an XML config file in C# without any 3rd party tools. It also should replace this restricted ...
Smartis has left SO again's user avatar
22 votes
5 answers
12k views

Linked List in C#

I was searching for a implementation of a Linked List with the same power as a native List. I wanted functionality closer to a ...
fubo's user avatar
  • 365
4 votes
1 answer
1k views

Primitive Extensions - Replaces static primitive methods

I got annoyed having to do things like string.IsNullOrEmpty(myString) when it seemed as if myString.IsNullOrEmpty() would ...
Michael Brandon Morris's user avatar
5 votes
1 answer
2k views

VERY simple C# Set implementation

This is not meant to solve any insane real world problems. I just want to make sure my Set logic is right and the code looks okay. It feels weird implementing it with a ...
user avatar
12 votes
3 answers
15k views

Simple C# HashTable Implementation

Haven't put one of these together since college. How does this look overall? ...
user avatar
8 votes
1 answer
1k views

An extension to the StringBuilder

This is another pretty basic class I wrote for a library as I hate the way the default StringBuilder in .NET works. Essentially, I wanted to have the ...
Der Kommissar's user avatar
5 votes
2 answers
2k views

ArrayList implementation

Can someone help me optimize speed for my code? I tested it via stopwatch in milliseconds. I've implemented my own ArrayList and I would like to improve its speed ...
Nikusha Kalatozi's user avatar
2 votes
1 answer
5k views

A Dynamic CSV Serializer

I made a dynamic CSV serializer as a learning challenge a while back, I'm hoping to get my code picked apart so I can learn what I can do better. This is a bit long, so I wouldn't expect anyone to ...
Douglas Gaskell's user avatar
7 votes
2 answers
108 views

IPv4 struct: Round 2

Summary Original Question here. Updated GitHub link here I've taken an interest in lower level data structures and I implemented an 'Ip4Address` to get familiar with Explicit structure layout. It ...
RubberDuck's user avatar
  • 30.8k
7 votes
4 answers
387 views

IPv4 struct utilizing explicit layout

I was inspired by Processing a list to build an IP in String Format to reinvent the wheel a little bit and play around with explicit struct layouts. You see, an IP address is really made up of four,...
RubberDuck's user avatar
  • 30.8k
1 vote
1 answer
388 views

Dynamic CSV Formatter

I made a dynamic CSV formatter as a personal challenge after having to hardcode a behavior to convert some data to CSV earlier. You input any List that contains supported types as properties (all ...
Douglas Gaskell's user avatar
5 votes
2 answers
22k views

Converting a 12 hour time string to a 24 hour time string

Input - Standard input - HH:MM:SS[AM|PM] format. Examples: 12:00:00AM 12:00:00PM 01:00:10AM 01:00:10PM The program reads one line per instance. Output - military format (24 hour format): 00:00:00 ...
Anubhav's user avatar
  • 181
3 votes
1 answer
2k views

.NET MSSQL Wrapper

Back in late 2012, I wrote the following C# .NET MSSQL Wrapper, which offered the following operations: ExecuteScalar (for selecting single field from a row) ...
Latheesan's user avatar
  • 283
5 votes
1 answer
2k views

Converting IP Addresses to minimal binary formats

Once more, I come to you for assistance! I have written a significant bit of code that converts IP Addresses from strings to minimal byte-arrays. (So that you can store them in a binary format instead ...
Der Kommissar's user avatar
3 votes
2 answers
4k views

Windows Forms `ControlCollection` implementation

I've implemented my own version of the Control.ControlCollection class in System.Windows.Forms and obviously I want it reviewed. ...
Der Kommissar's user avatar
6 votes
2 answers
480 views

Simple Configuration Manager

below I have coded a simple configuration manager that loads config elements from a file straight into a dictionary, and also has a function for getting an element by its key in the dictionary. I just ...
Adam Barret's user avatar

15 30 50 per page