C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
2
votes
1answer
27 views
Tuple/Lookup conundrum
I have a list of plans and a list of contacts, and I have to check whether contact.ProviderId matches plan.ProviderId. If they match I need to store in a contactUI the plan.Name
Provider to plan is a ...
0
votes
0answers
17 views
Feedback and Advice on my N-Tier Application Architecture
I am working on an application that will use an N-Tiered approach. I would appreciate any feedback and advice on my architecture before I proceed any further.
DataLayer (Class Library Project)
...
-1
votes
0answers
32 views
Generic Interface in Dependency Injection [closed]
Lately I have encountered this kind of case where I must provide the user to be able to load bunch (bulk) of transactions using csv (spreadsheet) into database table. Some kind of batch operation I ...
2
votes
0answers
26 views
Monkey testing a SmartCard library
My definition of monkey testing is basically playing with a program in as if I was a monkey (press every button, unplug things, go in the wrong order..etc etc)
So I made a rather simple SmartCard ...
1
vote
1answer
43 views
Code review for an abstract repository implementation
I have a repository abstract class that encapsulates pretty much all of the CRUD functionality:
public abstract class DataRepository<T> : IRepository<T>
where T : class
{
public ...
1
vote
2answers
42 views
MySQL GEAR, C# class for ASP.NET project
I've developed my own class in ASP.NET project to access MySQL and make queries, scalars and read the result from it.
I want you to review my class and tell me where did I make a mistake, thanks!
...
3
votes
1answer
54 views
Quadratic Primes
This is one of the slightly trickier Project Euler Questions I have seen (Question 27)
Considering quadratics of the form:
n² + an + b, where |a| < 1000 and |b| < 1000
where |n| is the ...
4
votes
3answers
109 views
Sum of primes less than 2,000,000
I have been attempting the questions at Project Euler and I am trying to find the sum of Primes under two million (question 10)
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the ...
2
votes
1answer
46 views
How to remove goto statement from iterator
I'm implementing a simple iterator in C# over an xml document, in order to process an xml document in as much a streaming manner as possible. For this reason, I'm using an XmlReader variable in a ...
2
votes
1answer
40 views
Cropping and combining two images on server
I've coded following two methods to combine images that are HTTP POSTed to the server:
// Crops two squares out of two separate images
// And then combines them into single image that's returned as ...
5
votes
1answer
124 views
smallest number divisible by all numbers from 1 to 20? Project Euler question 5
I'm currently working my way through the questions on Project Euler and I am on question 5. Is this the best possible solution? Any suggestions welcomed!
List<int> divisors = new ...
2
votes
2answers
69 views
Largest Palindrome efficiency
I have written an algorithm to find the largest palindrome under a given number, but I am sure my code loses efficiency by creating new arrays in every pass. I am currently learning about efficiency ...
2
votes
1answer
31 views
Code review for a windows form that generates invoices
I have a C# program that I would like to have reviewed. I am new to programming and want to know how it could be improved. It is a Windows Forms project that generates a pdf using the iTextSharp ...
1
vote
0answers
40 views
Improving the CRC code with “unsafe features”
I have the following CRC 16 code.
Is it possible to improve the performance of the code with unsafe constructs.
My knowledge about pointer arithmetic is rather limited.
public enum Crc16Mode : ...
6
votes
2answers
95 views
Handle static objects using custom adapter
I have read some articles discussing about why static is bad, some of them refering static as not-testable, non-mockable, has state (non-stateless) and everything else.
However I have encountered ...