Tagged Questions
C# is a multi-paradigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
1
vote
0answers
10 views
Custom log4net raising applicatoin level events in c#
Use Case: I have a form application in which I log events to a file/database and have a need to also raise those events to the application itself (for display purposes). Think old school updating ...
4
votes
2answers
266 views
2
votes
1answer
32 views
Poker Hand classifer part 3: Deck Object and 7 Card Hand
Part 1: Beginnings of a Poker hand classifier
Part 2: Beginnings of a Poker hand classifier part 2
I'm a beginner programmer, working on learning c# and object orientation and have been working on a ...
4
votes
2answers
1k views
0
votes
1answer
30 views
Normalized ecommerce data model
So there's not much here to "normalize" the database (really only the OrderItems class and maybe the Table Meta class as well) but I'm relatively happy with it.
My only concern is the repeated "Name" ...
3
votes
2answers
219 views
Adjusting dates in an array based on a start date
I have a data structure like this which holds start/end dates:
...
-1
votes
0answers
30 views
Interface inheritance / segregation (or not) vs generic interface [on hold]
I am working on an inventory system for a game. The Inventory contains Items. Some of these items can perform an action when they are clicked (HealthPotion adds ...
2
votes
0answers
52 views
Hackerrank: Sherlock and anagram
Problem statement
Given a string \$S\$, find the number of "unordered anagrammatic pairs" of substrings.
Input Format
First line contains \$T\$, the number of testcases. Each testcase ...
0
votes
0answers
37 views
how to create generic class structure [on hold]
I have a requirement where user selects a ReportType from a dropdown and hits download button.Based on his type chosen, the system should generate a report. Right now i have only report type that is ...
7
votes
3answers
78 views
Leetcode 56: Merge Intervals
Problem statement
Given a collection of intervals, merge all overlapping intervals.
For example:
Given \$[1,3],[2,6],[8,10],[15,18]\$,
return \$[1,6],[8,10],[15,18]\$.
My ...
3
votes
2answers
67 views
3
votes
0answers
25 views
OAuth 2.0 implicit flow implementation
I have been implementing the OAuth 2.0 implicit flow to secure the API I use in an Angular SAP. Please, could you review my code? I am sure there is a lot of stuff to improve in it.
I have separated ...
3
votes
2answers
87 views
Basic generic priority queue using an unsorted list
I am aware that there are other ways of implementing a priority queue e.g. using a sorted array/list. Would appreciate some comments on my implementation of a basic priority queue supporting three ...
5
votes
1answer
51 views
Event system in Unity RPG game
I'm making event system for my RPG game, and I want to know what I can do better, because I think that there are a lot things that can be better. Note that this code is still not completed but it ...
5
votes
2answers
116 views
Find K biggest numbers in the array
I was trying to implement method number 2, from this article.
Method 2 (Use temporary array) K largest elements from arr[0..n-1]
Store the first k elements in a temporary array temp[0..k-1]....
7
votes
0answers
48 views
Hackerrank - value of friendship (II)
Problem statement
You're researching friendships between groups \$n\$ of new college students where each student is distinctly numbered from \$1\$ to \$n\$. At the beginning of the semester, no ...
6
votes
2answers
407 views
Reading large amount of player properties from CSV
I have written a class with a function that reads out the CSV from the webpage and creates an object with it.
The class seems too big - it seems very unoptimized, prone to mistakes and it's not very ...
2
votes
1answer
75 views
DFS algorithm + unit test
Please comment on my DFS implementation and test, I would like to get comments about algorithm correctness.
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data ...
-5
votes
0answers
26 views
Optimise async functions with nested callbacks while using retry pattern [on hold]
I am currently reading some really annoying code. It's basically some weird asynchronous functions with nested lambda/callbacks, and there are some retry pattern involved too. Although I can ...
5
votes
1answer
42 views
Filtering ASP.NET membership roles without the default attributes
I am building an application, and I needed an attribute similar to AuthorizeAttribute, supporting Roles but not using the ...
3
votes
2answers
52 views
Validation Extension method performance
I'm writing a simple set/framework of extension methods for argument/parameter validation. What I'm mostly concerned about, ATM is the performance, against the simpliest boilerplate
...
3
votes
1answer
44 views
Find the biggest rectangle in a bar graph
Find the largest rectangle area on a bar graph. Example: if you had a graph of 1,4,5,3,3,5 the answer would be 15 (3x5) which is formed by the rectangle that is 3 high and spans from position 2 (1 ...
1
vote
1answer
30 views
MVVM Navigation WPF
Currently, I'm trying to learn every aspect of the MVVM design pattern.
So basically I've written a little WPF App where I'm trying to understand Navigation in MVVM, the app has one MainView wich ...
3
votes
1answer
55 views
One time key for authentication
In a recent project I was to create a web service that would be consumed by another application. One of the requirements was to have a key in the service that authenticated the request as valid. But ...
5
votes
2answers
87 views
Using generic types for a custom mapper
I have a method which takes a certain generic object, which basically orders these objects based on a list of tags. Because I want to use this method for multiple objects, I have created a class which ...
6
votes
3answers
80 views
Determine Groups and Children In Collection
I am currently looking into improving code efficiency while working with a flat string collection in C#. The strings in this collection can be considered a "group" or a "child".
The problem is that ...
-4
votes
0answers
28 views
Passing Variables Over User Controls [on hold]
I am creating a program that uses 2 Usercontrols and 1 Form. Usercontrol 1 carries variables over to Usercontrol 2.
UserControl1:
...
2
votes
2answers
47 views
Locating people by roleId
Basically, I'm trying to find all active people with a roleId of 3 (analyst id). But I want to exclude ids that were created as test analysts, i.e. "130", "252", ...
2
votes
2answers
244 views
Processing lots of JSON objects
I want to process a ton of JSON objects as quickly as possible.
I've done my best to make the processing as concise and efficient as I can.
How can I make it more efficient?
...
3
votes
1answer
49 views
Loop through Excel files and copy correct range in a separate file
Intro: Today I have decided to make an Excel automation task with C#. This is probably the first time I am doing something like this, thus the problems are plenty.
The task: Pretty much, the idea is ...
5
votes
3answers
1k views
Combining .txt files
A guy at the company I work for needed a small application that would combine multiple text files into one, larger text file.
I wrote a console application for this. it seems pretty efficient, but I ...
0
votes
0answers
30 views
Not sure if this code is optimise for deadlock [on hold]
I am new to HTTPClient and Async/Await programing. I want this code to be review. I dont think this code is optimised for exception or deadlock
...
13
votes
7answers
997 views
Binary Heap where a comparison delegate is used
I currently have a Generic Implementation of a BinaryHeap. It must be able to maintain it's integrity with elements that may or may not implement ...
6
votes
2answers
65 views
Sending a Torrent magnet link using the Deluge JSON API
I have built this script that sends a magnet link to the client. As I never ever had any proper programming lessons I would want to ask you if this approach is good, if I am missing something, There ...
4
votes
0answers
47 views
Checkers Board Editor
I created a board editor for my Checkers game. This allows the user to create any board position and copy the FEN string representing that board, which can then be used to create a game from that ...
1
vote
1answer
59 views
Winforms tools for selection of items using ComboBox - binding datasource
This is mi UserControl containing ComboBox and few buttons for selecting and manipulating collection of items which implement simple interface IHasHeader (just ...
3
votes
2answers
85 views
Submitting a form
I am using ASP.NET core entity framework. I am using an input submit button to call a method that has a variable attached to it. I am wondering if there is a way to improve my code.
Here is my ...
9
votes
5answers
1k views
Beginnings of a Poker hand classifier part 2
Part 1 - Beginnings of a Poker hand classifier
I'm a beginner programmer I've been working on a poker hand classifier to improve my object orientation and programming skills, I've improved and ...
5
votes
1answer
166 views
Hackerank - value of friendship
Problem statement
You're researching friendships between groups \$n\$ of new college students where each student is distinctly numbered from \$1\$ to \$n\$. At the beginning of the semester, no ...
3
votes
1answer
80 views
KMP algorithm searching from the right
The generic version of extension method is aimed to work like String.LastIndexOf which can search t from the last position of <...
6
votes
1answer
48 views
View-model for a WPF UserControl that validates regular expressions
I've created a small User Control library in WPF that contains a few GUI widgets that allow users to enter regular expressions. The widgets provide visual feedback when the user has entered an invalid ...
2
votes
1answer
35 views
Website to Track Project's Progress
This ASP.NET MVC website is for my professor to track my progress on my Checkers app. This is the first time I have build an ASP.NET website entirely on my own, and I would like a review to make sure ...
2
votes
1answer
119 views
Count the number of times a particular number appears in a sorted array of integers
I had an interview question awhile back that went more or less as follows:
You have a sorted array of integers representing the ages of every person living on earth. There's a single entry in the ...
6
votes
3answers
400 views
From a list of lists to a single object
Long story short a user can have things in common with another user, but I don't what to show more than 4 main categories in common, only the first 4, the priority is the order in which the lists are ...
5
votes
1answer
72 views
Single-thread worker in multi-thread webservice
There is standalone WCF webservice, which is providing methods to interact with legacy ERP system.
This system exposes an API, which allow programmer to interact with it.
The problem is that, for ...
-5
votes
0answers
35 views
Can't get NavMeshAgent in script [closed]
there is no access to NavMeshAGent component, but script and component are located on the same object.
0
votes
1answer
37 views
Fire Scheduling with Triggers in CMMS
I worked on cmms project .
I have some scheduling , esch of schedule have some triggers (e.g,. Bymeter , byActivity ,ByPeriod).
I wrote some methods to generate workOrder for each Schedule if ...
135
votes
4answers
21k views
Dijkstra path finding in C# is 15x slower than C++ version
I'm implementing Dijkstra's algorithm with a priority queue for a game I'm developing in Unity with C#. I was a bit disappointed with the performance, so I decided to port the code to C++ and see if ...
2
votes
1answer
70 views
Storing and accessing 3D struct array efficiently
I have a structure, and have come up with 3 different 3D arrays to store it in. The thing is, optimization is not my specialty and I need advice from someone who knows their stuff regarding best ways ...
5
votes
1answer
92 views
Multiple doubts about Repository pattern
I have implemented the Repository pattern in my Web APi 2 + Entity Framework 6.1 + Angular 1.4 SPA site. The application allows management of a martial arts club. One of its functionalities is to ...