All Questions
Tagged with c# reinventing-the-wheel
71
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.
...
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 ...
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: ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
2
votes
1
answer
1k
views
Simple, flexible, and thread-safe key/value memory cache
MemoryCache.cs
...
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: ...
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 ...
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 ...
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 ...
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 ...
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 <...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
1
vote
1
answer
92
views
Binary Search Optimization [closed]
Can anyone give me recommendations on how to improve my code?
...
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?
...
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 ...
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 ...
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 ...
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
...
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.
...
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 ...
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 ...
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 ...
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 ...
12
votes
3
answers
15k
views
Simple C# HashTable Implementation
Haven't put one of these together since college. How does this look overall?
...
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 ...
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 ...
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 ...
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 ...
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,...
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 ...
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 ...
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)
...
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 ...
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.
...
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 ...