C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform
-1
votes
0answers
6 views
Mixed programming with C++ and C#
I want to develop a software using the VMware SDK (Written in C/C++). However, for the GUI part I found C# (Windows Forms) more easy. Am thinking to develop the core functionality in C++ then present ...
1
vote
1answer
46 views
Database Context and Singleton injection with IoC
All of the below relates to a ASP.NET c# app.
I have a Singleton Settings MemoryCache that reads values from database on first access and caches these, then invalidates them using SQL Service Broker ...
0
votes
0answers
11 views
How can I upload a large zip file to Amazon Glacier with .NET? [migrated]
I'm writing a simple application to zip a directory and upload it to Amazon's Glacier storage. I was able to upload a simple directory (12MB), but when I attempted the same feat with a larger ...
-1
votes
0answers
15 views
C# - SQL UPDATE command Quotaion Mark Error [migrated]
SOLVED
I have textBox1 - User can write any character or digit. 1-Insert code looks like:
SqlCommand com = new SqlCommand("Insert into Client (Denumire,CIF,RegCom) values ...
-1
votes
0answers
18 views
Facebook friends tracker [on hold]
I would like to build a management app in C# (probably ASP.NET C# using .NET 4). I would like to GET a list of my Facebook friends and then save there names, display pic, Date of friendship and there ...
0
votes
2answers
108 views
Critique the Structure of my Horse Racing Betting Platform
I am creating a program (mostly just for fun) that displays live prices for horse racing markets and the prices that several models predict they should be. I am very interested in the optimal way to ...
2
votes
3answers
133 views
Breaking the “ubiquitous language” by having an IoC Container in Domain Model?
I am a bit new to DDD and bear with me if my understanding seems way off.
My question is about Udi's solution to domain events, particularly the class DomainEvents (see code below)
An excerpt from ...
0
votes
0answers
7 views
C# Threads ModuleName does not appear in the error code [migrated]
I am doing C # Programming with Process and Process Threads of the lists, but I'm just listing the kinds of Thread but did not find in our help modulename.
TempThread.ModuleName does not appear in ...
-3
votes
0answers
72 views
How exactly does C# compare 2 strings? [on hold]
If I am comparing 2 strings, what is the exact criteria for comparison in the English language? For example, if my two strings are "hi" and "Hi", which one will be larger? What about "@" and "#"? "1" ...
-1
votes
1answer
50 views
Getting Started, With an Eye on Job Opportunities [on hold]
I have some experience as a C/C++ programmer, but I've been pursuing other things. I'm thinking about jumping back in more seriously. I've developed something of a game plan, and I'm wondering if ...
2
votes
1answer
60 views
Where do service implementations fit into the Microsoft Application Architecture guidelines?
The guidelines discuss the service layer with its service interfaces and data/message/fault contracts. They also discuss the business layer with its logic/workflow components and entities as well as ...
7
votes
5answers
587 views
Which way to terminate reading loop is the preferred approach?
When you have to iterate a reader where the number of items to read is unknown, and the only way to do is it to keep reading until you hit the end.
This is often the place you need an endless loop.
...
1
vote
1answer
106 views
What are the options to do a portable app (w/o installation) on Windows? [on hold]
I have a requirement to build a Windows application that can run from a usb device without any installation. Do I have any other option except C/C++?
I am a C# guy so working in VC/MFC/Win 32 is like ...
1
vote
1answer
113 views
Is there a specific pattern that this data processing code follows [on hold]
Take this method for processing data from various sources
public List<object> Do(List<object> inputs)
{
foreach(var image in inputs.Cast<Image>()) { ......}
foreach(var ...
4
votes
3answers
425 views
why no native compiler of C# or other “productive” language?
I've been reading about D and Go and how they aim at being compiled to machine code yet be convenient (like garbage collection, no need to manipulate pointers unless needed) and I agree that there is ...
-3
votes
1answer
141 views
Is 2014 finaly mature enough for Choosing a cross platform development front-end and back-end [closed]
I'm as CTO , just founded a new company .
After many years of mostly using MS various technologies , my new company needs :
Cross platform environment (Android , IOS , Windows phone , Windows , ...
2
votes
3answers
209 views
Optimal way to implement this specific lookup table in C#?
I want to create a lookup table for this data:
The "input variables" (what is used to "lookup") are 4 different doubles that can each take on 1 of 200 numbers (the numbers range from 1-1000 but there ...
4
votes
1answer
267 views
Understanding unit testing concept
I've just started writing unit tests and I'm not sure am I doing it the "right way." Should I test every class "by removing dependencies"? In other words, does unit testing mean: "test part of a code ...
0
votes
0answers
57 views
Data Binding ListView in Server/Client Application
I am currently making a Server/Client Application using NetComms Library and BetterListView. The default .net listview does not support Data Binding.
I am going to be binding the listview to a List. ...
1
vote
1answer
88 views
Loading data for ShoppingCart item
I'm currently trying to cover our shopping cart with unit tests.
Class ShoppingCartItem has property Term. It also loads available terms for this item upon object creation. Currently this is done ...
0
votes
4answers
309 views
Using C# to Learn C++ [closed]
I know the basics of C++, but I am far from proficient. I need to know C++ but am more interested in learning C#. Will I become proficient at C++ by learning C#? If not, will learning C# improve my ...
0
votes
0answers
77 views
Web Farm access to pool of resources
I am learning how to structure an application using a web farm (for high availability rather than load). I have a pool of resources in which one user can access one element in the resource pool at any ...
3
votes
2answers
614 views
Should I use a list or an array?
I'm working on a windows form to calculate UPC for item numbers.
I successfully create one that will handle one item number/UPC at a time, now I want to expand and do it for multiple item ...
4
votes
2answers
131 views
C# gadgets overloading the form (can't see the woods for the trees) [closed]
I have the task of taking over a C# program that is very badly written, however I am new to C#. The form has many objects including labels, buttons, panels, etc, which overlap each other. The form is ...
0
votes
0answers
25 views
Which assembly do I need for DispatcherTimer? namespace not working [migrated]
I have an issue on a project using WPF. I am trying to use DispatchTimer. I see in another example the using DispatcherTimer = Windows.UI.Xaml.DispatcherTimer; namespace.
This does not work for me. ...
0
votes
2answers
159 views
What is right choice of Data Access Layer for large application
I am using Singleton pattern for my application, I have used ADO.NET Entity framework as my Data Access Layer, after login to my application, it's taking 3 to 5 minutes to load the dashboard.
Is ...
3
votes
2answers
173 views
Efficient solution for dictionary updates
Let's start with the problem:
There is a large dictionary X that contains {key, value} pairs, i.e.:
X = [{100, 10}, {101, 0}, {103, 0}, {106, 2}, {110, 1}]
Every t seconds, X has to be updated ...
3
votes
6answers
417 views
Stacking keywords on top of each other - poor style? [closed]
I have always wondered about this, especially in C/Java style languages. For example, consider the first 3 lines of this C# code:
lock (serviceLock)
using (var client = new ServiceClient())
try
{
...
1
vote
1answer
64 views
Syncing objects from code with the view in WPF
I've been reading some into it, but I am time pressed, so I would require a simple solution now and I promise to read up on it later. I come from a winforms c# background, and have lately been working ...
5
votes
2answers
428 views
Faster reads, on an infinite grid plane, than using a hash table?
In the past, I've had alot of success just using a .NET Dictionary, with a TKey consisting of the X,Y coordinates merged together. However its read performance, despite being amortized constant time, ...
-2
votes
1answer
272 views
Is switching from .NET to Java for the APIs and Frameworks justified? [closed]
First of all, this is not intended to be a flamebait. It's a serious question for an impartial advice. If you are emotionally attached to either of the two languages, this probably not addressed to ...
3
votes
1answer
190 views
which sorting algorithms is using OrderBy
I am litle curious about what sorting algorithm is using OrderBy (linq to objects). quicksort? heapsort? introspective sort ?
As i see in MSDN documentation List.Sort is using introspective sort:
...
0
votes
0answers
61 views
Why does Visual Studio run code after my breakpoint during a debug session? [migrated]
I am working on a project in c# that using threading to initialize multiple calls to xcopy to copy user directories from one workstation to a network location.
When I run the program in debug mode, ...
7
votes
4answers
282 views
What are good ways of balancing informative exceptions and clean code?
With our public SDK, we tend to want to give very informative messages about why an exception occurs. For example:
if (interfaceInstance == null)
{
string errMsg = string.Format(
...
0
votes
2answers
59 views
Unit test DAO code using SQL Lite when the application database is Oracle
We have an application with Oracle backend. The DAO layer is written in C# and uses nHibernet to perform the data operations.
To unit test our DAO code, we use SQL Lite which creates the database ...
1
vote
2answers
195 views
How do I make multiple calls to a web service without taxing that service heavily? Scaling question
is there a good pattern for how to send multiple calls to a web service but without taxing it and ensuring the data is sent back? I don't know enough to correctly describe the problem to even start ...
-4
votes
1answer
146 views
When should var be used instead of declaring an explicit type?
var Id = from value in Enumerable.Range(0, 100)
select value;
IEnumerable<int> ids = from value in Enumerable.Range(0, 100)
...
-1
votes
2answers
163 views
I've been on C# course and struggle to remember things? [closed]
I'm an apprentice and I've been on a couple of training courses in C#, I understood the concept of c# programming and covered inheritance etc, but when I've came to code for my coursework "I've got to ...
0
votes
0answers
71 views
Script files as resource or solution project?
I've written a program for another group within my company that uses scripts. These scripts are user selected by the use of two drop down lists: category and name. Currently the application uses an ...
3
votes
0answers
244 views
How can we calculate Big-O complexity in Functional & Reactive Programming
I started learning functional programming, I am trying to compare between different algorithms that are written in an imperative, functional , parallel programming and using Collections and Lamda ...
1
vote
4answers
157 views
Should timeout be a public static property or a parameter to every function?
TLDR: Should TIMEOUT be a public property on my static class, or a parameter to every function?
Background:
I am releasing a c# client-api library that facilitates communicating with our REST api.
...
2
votes
4answers
170 views
DTOs matter on ASP.NET MVC JSON Action?
I recently came across an internal project where they were using DTOs throughout the solution, and when I sat down to implement a new MVC controller with a JSON REST endpoint I decided to use an ...
0
votes
2answers
94 views
Multi regex matching — what to do to optimize it?
I have multiple regexes matching an input in greedy-first mode. All regexes are already compiled and I don't see what I can do more to speed-up things. I mean using tools coming with .Net framework.
...
8
votes
5answers
430 views
Should I write an interface API before an implementation?
I've been delving into more "organized" programming recently and I've been learning that I should be programming to an interface, not an implementation. With that in mind, would it be better to ...
0
votes
1answer
204 views
Should we always write Defensive null check in code? [duplicate]
Are there any scenarios where we should not write defensive checks for null?
Should we write defensive code or check for NULL every time we have passed a parameter or received a value back from a ...
0
votes
0answers
24 views
MouseDown Event occur slowly in C#.NET. But I hope this event occur quilckly [migrated]
I am devloping C#.NET program.
I code Label's BackgroudImage changing in Label_MouseDown Event, But Bakground Image change after few seconds when I mouse down the Label.
Why? Help me
Label Mousedown ...
4
votes
3answers
218 views
Authoritative sources for exception handling best practices [closed]
My work place suffers from a bad case of the Pokemon Exception Handling anti-pattern with constructs like the following splattered across the code base:
try {
...
} catch (Exception ex) {
// ...
1
vote
1answer
116 views
Either Monad and Exceptional Circumstances [duplicate]
I have a function returning an Either such as GetUserFromDb(int id).
If the database is offline, should I catch the error in the function and wrap it in a failure / Left case or should I let it ...
0
votes
2answers
203 views
Is navigate between more than one class a bad practice? [duplicate]
I have the following class with the following function (some implementation details have been skipped):
public class TitleScreen : GameScreen
{
public Texture2D titleScreen;
public override ...
3
votes
0answers
176 views
Monad Transformers in C# [migrated]
I am working on using monad transformers in C#. I would like to know if the following code I present, shows that I have understood this. I am fairly new to this so any feedback / comments are really ...