C# is a multi-paradigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
2
votes
0answers
4 views
Drag and drop single files on different targets for different purposes
I have three text fields (DevExpress ButtonEdits set to read only) on a Windows Forms app. They look like this:
They're used by dragging and dropping a single ...
2
votes
1answer
12 views
Simple Google ReCaptcha validation
Linked:
Google reCAPTCHA Validator: Iteration II
I have also created a simple Google Recaptcha Validation class to handle verification.
I used some code from CodingFusion's post Google New ...
6
votes
5answers
213 views
Return Nth Weekday of Month
My goal is to obtain the nth weekday of a given month. Parameters are a date from a given month and the nth weekday I'm trying to obtain. It returns the Nth Weekday of the month if it exist and ...
4
votes
2answers
28 views
Google reCAPTCHA Validator: Iteration II
This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator
This adds support for error messages, so that you can ...
1
vote
1answer
38 views
Retrieving Assembly without DLL
Here is my code to retrieve a class from a different solution (both solutions are in the same folder) using an XML file:
...
3
votes
0answers
25 views
Tool to Add Access Modifiers to Code
Working on VSDiagnostics, I implemented a tool that adds the default access modifiers to C# code. An example use would be starting with this:
...
3
votes
1answer
28 views
Google reCAPTCHA Validator
This entire class came out of a chat discussion, and I'm curious on how it looks. (This is like literally 30 minutes of development time.)
The idea is to allow very easy, quick implementations of ...
-5
votes
0answers
34 views
Need a little support for enemies [on hold]
I'm trying to make a simple console application game in c# where you're a red dot killing blue dots and i cant find or figure out how i should make the enemies or the attacks. here's my code.
...
4
votes
2answers
61 views
Scheduled adjustable payments
Short Description:
I'm working on a "small" project for our finance department. The problem I'm having is managing this large function (at the bottom). It's so large because I'm having troubles ...
-3
votes
0answers
18 views
AES 128 - C# vs Oracle [on hold]
Im trying to encode a string with C# and getting the same result while encoding in Oracle select. Using AES 128 / Pad Zeros / CBC
I cannot get the same results, and I have been working on this and ...
2
votes
1answer
22 views
ActionGroupContext to know an id of the current context
My services(or services that depend on services) need to know about a current action group id. To add an extra optional parameter to each service for the id was an idea but in my current environment ...
-1
votes
1answer
86 views
Performance comparision of SQL queries versus LINQ in Visual Studio 2012
I am new to VS 2012 and need to use it with SQL Server. I need to get data from a table in SQL Server 2012 with 500 rows and 15 columns and process the data in it and update another table. All this ...
-3
votes
0answers
39 views
Get Max occurence of element in Linq [on hold]
I have 2 classes; for this example I will name them A and B. A is a list and every A element has a list of B element. B element have a type. I want to get a B element by occurrence of it in my list of ...
5
votes
1answer
256 views
Multithreaded client server socket
I have created this library mostly for a learning experience with sockets and threading.
For this review, focus on socket/threading. Let me know if I properly implemented both. If you want to comment ...
-3
votes
0answers
31 views
Dijkstra from closest node to me, to the closest node to the player [on hold]
I have written this code that does what the title suggests, I've never written a path-finding algorithm, so I don't know if my code is correct, so before testing it I'd like to correct the things that ...
-5
votes
0answers
30 views
I want to see why my program keeps running the first line of code [on hold]
When I compile my code in the de-buggger its fine but my issue the user is not able too move past the first console.writeline statements
...
5
votes
4answers
169 views
Find the common element in two int arrays
I am preparing for a interview for a junior level c# position. I take two arrays and find the common int between both of them. Let me know if you have any feedback.
...
4
votes
3answers
165 views
Most common occurrence of an int in an array
I am prepping for a junior level interview in C#. I am hoping I can get some feedback on how to improve my code to print the most common occurrence of an int in an ...
-3
votes
1answer
87 views
Console-based Rock-Paper-Scissors game
I just began my C# debut and was just wondering if this Rock-Paper-Scissor console app is good and flexible.
...
5
votes
1answer
50 views
Generating 3D voxel terrain with Perlin Noise
I've created this simple 3D voxel terrain generator using Perlin Noise. I have a few concerns about it though.
Is there any way to make it more performant? It currently takes ~1.5 seconds to ...
4
votes
2answers
45 views
Asynchronously accepting multiple client connections without impacting main thread
I am implementing a multi-player game in C# and having seen all sorts of projects, from indie developers all the way to large studios struggle to patch networking into existing products in the past, ...
-1
votes
1answer
114 views
+50
Service receiving and sending messages – multiple protocol versions
I need to design and implement a service (C#, .Net 4.5+) which receives messages, converts the messages to BLL models and passes them to the BLL.
Long story:
The service will receive messages ...
3
votes
2answers
56 views
Cookie repository for self-hosted web service
I use this in a self hosted web service, so I am not using a ton of libraries. I wanted a simple yet easy-to-use cookie repository. The reason the repository is static is that I wanted the ability to ...
6
votes
4answers
439 views
Fast evaluation of Euclidean distance with sparse data
I am working on a KNN implementation for sparse datasets (that I apply to text analysis). My points are represented by a Dictionary<string, double>, each key ...
1
vote
0answers
36 views
Listing users in Azure Active Directory
The code below is the Index Action from a User Controllers. Basically this code returns a list of users from Azure Active Directory using Azure Authentication Library (ADAL).
However I need to show ...
4
votes
1answer
78 views
Obtaining different weather forecasts from the Environment Canada website
Here is the code I use to get the different weather forecasts from the Environment Canada website:
...
4
votes
1answer
94 views
Inserting customer care database analysis detail records
I have written this linq-to-sql query to insert a bunch of customer care database analysis detail records:
...
3
votes
1answer
60 views
Integration testing with in-memory databases strategy
I have an .mdf DB file and I want to use this DB for integration testing.
In every test I should:
Create a copy of an .mdf file.
Attach DB to an .mdf copy file
Do testing
Detach DB copy
Delete DB ...
5
votes
3answers
606 views
Function that adds two integer strings
I wrote this method that adds two integers in the form of strings together. This way I can add large integers without overflowing.
How efficient is the code that I wrote? I am by no means a great ...
5
votes
2answers
431 views
Injecting JavaScript to website for ordering products
I am a newbie at programming and I helped my dad with making this program which orders multiple products to a website from a table of Excel.
It involves 3 processes:
Passing orders from Excel to ...
4
votes
2answers
52 views
Calculating German common holidays
I wrote a simple dll which is able to calculate all common holidays, but, I would like to optimize the code in readability and flexibility.
Federal state
...
6
votes
2answers
110 views
CommandBars, Buttons and Commands: Take 2
Following-up on CommandBars, Buttons and Commands: Cleanup is on the menu, I decided to try a more ambitious approach, as suggested in Nikita's answer. It works, but there are a number of "gotchas" ...
-2
votes
0answers
25 views
Implementing caching with double-checked locking [closed]
I want to implement caching for a method of my class that gets data from a web service. I made my class static and have an Initialize method which can be used to set some common parameters that will ...
0
votes
2answers
85 views
Refactor C# unsafe method [closed]
I have the following two unsafe methods that I would like to refactor:
...
2
votes
1answer
64 views
Return IEnumerable<KeyValuePair> from a private method; use Dictionary or anon. type?
Is it okay to return IEnumerable<KeyValuePair<string, string>> from a private method instead of returning a read-only dictionary? This allows for ...
4
votes
1answer
47 views
WPF DateTimePicker user control
I've created a UserControl that should act as a control inside a Window:
XAML:
...
-1
votes
0answers
23 views
SMS-Gateway with Java(Android) or C# on mobile phone [closed]
I got the task to program an app for android or windows phone which receives incoming SMS and creates a new email with the same content of the SMS and then sends this email to some specified ...
4
votes
1answer
81 views
Properties for Earth class
I am creating instance of the same object to populate its properties twice. I need to give this object to another developer who just don't need constructor at all, as he is sending me object through ...
8
votes
6answers
1k views
Sorting a list of first names from a text file
I applied for a job as a C#/.NET Junior Developer, and had a test to do::
Using names.txt (right click and 'Save Link/Target As...'), a 46K text
file containing over five-thousand first names, ...
5
votes
1answer
87 views
Robot arm manipulation library
I have created a DLL library that controls an robotic arm. Could you tell me if my design is correct? The robot communicates over serial port. The code works but I would like to receive a feedback ...
3
votes
1answer
50 views
Versioning documents in Couchbase
I've just converted a class for versioning Couchbase documents from Java to C#, but I'm not 100% familiar with the Couchbase API so would like some feedback.
The original class can be found here.
...
2
votes
2answers
71 views
Sharepoint Authentication Helpers
I'm working on a rather large SharePoint project that's going to contain helper classes for a variety of item levels (sites, webs, lists, items, etc').
When writing code I'm expecting that the same ...
3
votes
1answer
68 views
Implementation of a VertexBufferObject class
I have been working a simple 2D Game using C# language with OpenTK (OpenGL wrapper/binding for .NET). It uses a lot of sprites.
Since it uses lot of sprites, I think it's important to make everything ...
13
votes
2answers
111 views
CommandBars, Buttons and Commands: Cleanup is on the menu
One of the biggest pain point in the entire rubberduck code base, is the way commandbar menus and menu items are created and wired up - something needs to be done to straighten that up, and while I ...
2
votes
1answer
28 views
Cross-Database Query Without Casting to List
I am trying to do a cross-database query without having to enumerate the variable t.
...
0
votes
0answers
32 views
MongoDB repository, dynamic objects, Razor Templates
I am writing a repository for MongoDB and are looking for some review at its current state. I am looking for ways to improve it without adding complexity.
Should I be using a Singelton pattern for ...
3
votes
0answers
96 views
Populate tree from 3 different data sources and show its content
The task is to build a WinForm app which populates a tree from 3 different data sources and shows its content.
1 ComboBox at top - to choose datasource. (File ...
4
votes
3answers
95 views
Unit tests for a simple composite
I do a lot of unit testing(tdd) and would like some comments about my style. Here is a simple example from a composite.
Is there anything I could improve?
...
6
votes
2answers
126 views
Color structure with single field for multiple properties
This struct is used a lot throughout my programme. This struct is responsible for only things regarding colour, not anything else.
I'm largely concerned of the ...
3
votes
1answer
24 views
Container supporting PeekMax, PeekMin, Sum, and PeekNextToMax v2.0
This is another part of the update to this question. The interfaces are in this question.
To summarize, the class is a generic container similar to MaxHeap, but only needs to support the following ...