C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

learn more… | top users | synonyms

0
votes
1answer
28 views

What is (or where can i find) the algorithm to decode FLAC to PCM?

I'm trying to program a very basic FLAC player using 100% C# completely from scratch. My understanding of this type of thing is very limited, so I'm using this project as a way to learn about ...
0
votes
1answer
55 views

Rewriting code under BSD license

I am currently studding OpengGL with OpenGL Supebible 5th edition. I've found interested for me some C++ code that is distributed with the book (see also on google code). That code is under New BSD ...
-10
votes
0answers
45 views

Avoid anonymous user voting more than once [on hold]

I am implementing website about article , now i am going to implement anonymous voting for each article . i maintain one table for tracking article voting this table has the following fields ArticleId ...
0
votes
0answers
41 views

Calls to methods inside an N-Tier Architecture

In matters of architecture it would be wrong make calls inside the User Interface Layer to methods inside of Business Layer where the methods returns the list of all the elements in some table and ...
3
votes
1answer
59 views

Different scoring algorithms for different competition elements

I am creating a scoring system for a competition that is somewhat obscure, but it resembles the Olympics in terms of its high-level structure. Therefore, I will ask my question in terms of an ...
1
vote
0answers
33 views

Error Handling when no access to Visual Studio or application start point

I've recently joined a project where we are extending the functionality of an external application that our company has bought. It is an Office Add-In with an admin console that allows you to create ...
0
votes
0answers
29 views

Improving dynamic report performance

We are building an ASP.NET MVC website with SQL Server backend hosted on Azure. It's a simple app but it stores quite a bit of user data. The app will allow users to "Export" data to an Excel ...
-1
votes
0answers
33 views

Generate custom unique key in asp.net dynamic data [on hold]

I am new to ASP.net dynamic data. I have a column in database (tracking ID) it requires to be generated in a pattern through code i.e "23041401" (the date and a 2 digit increment number). I have tried ...
1
vote
1answer
66 views

Why did Microsoft dropped the RESX model for RESW in Windows Store applications?

Why did Microsoft choose to change the resources management system from .NET's RESX files? RESX had useful code generation, providing developers auto-completion for resources names and outputting ...
1
vote
1answer
32 views

Session states in ajax callback

Someone told me Session or HttpContext.Current.User will return different value when we are working with ajax postback, in case of when the are so many user are live to site. For example, suppose ...
1
vote
0answers
50 views

An efficient way of starting an arbitrary number of consumer threads?

I have a Producer/Consumer implementation where the number of consumers is configurable (this is a form of configurable throttling). The producer and consumer are kicked off like this: var cts = new ...
6
votes
2answers
336 views

Why is there a new() constraint in C# but no other similar constraint?

In C# generics, we can declare a constraint for a type parameter T to have a default constructor, by saying where T : new(). However, no other kinds of constraints like this are valid - new(string) ...
0
votes
1answer
78 views

Application use on website

Is there a good way to run a C# application on clientside in lieu of JavaScript? I have done some front end work with JavaScript and backend C# for web developing at an old job, but I am interested in ...
1
vote
1answer
64 views

Most Appropriate Authentication Type for MVC5 project

I am about to start a new ASP.NET MVC5 project and I am planning the authentication / authorization requirements at present. The client wants Windows authentication, to prevent their users having to ...
-5
votes
1answer
77 views

What are the differences between lists in C# and arrays in PHP? [on hold]

I am a php developer and I want to learn some basics of C# but I really can't get my head around how lists work in C#. What are the main differences between a C# List<T> and a PHP array?
0
votes
1answer
59 views

Natural Language to Search Criteria - Date Ranges

Consider an application that stores a set of records that contain: Description Cost Purchase Date I'd like to be able to allow users to utilize natural language to search the dataset. For ...
0
votes
1answer
67 views

Generic object construction - Inherited Classes

Basically I am writing a MSMQ based multi-threaded messaging pattern utility library. It's like a set of components all inherited (directly or indirectly) one class that's called my base component ...
-4
votes
1answer
57 views

Learning new topics and improving the ones we know some about [on hold]

If there is more than one topic that you need to learn for your work projects how do you approach for learning it? Let's say you work 8:00 am to 6:00 pm. So you have a few hours at nights on weekdays ...
0
votes
2answers
161 views

How to go about saving a Snippet / Block of Code [duplicate]

I am currently learning C#, I am pretty proficient in Java. A project I have been working on for a while is basically an application that lets you input code "Snippets" or blocks of frequently used ...
4
votes
4answers
166 views

Purposely raising exceptions to use catch

For a typical if...else wrapped with exception handling, is something like the following example a recommended practice to avoid code duplication? try { if (GetDataFromServer()) { ...
0
votes
0answers
28 views

Creating New Wrapper Objects and Extension Classes and Keeping it Organized

Here's my situation: I'm programming an embedded device with a very simple, but customizable LED array display. It's 10 RGB LEDs linearly setup. The LEDs will be used to display many different ...
2
votes
1answer
85 views

Accessing a private array when I have an extension method

I'm trying to make a number of data classes for my C#/XNA game, which would essentially be a wrapper around T[,]: public interface IGrid<T> where T : struct { Point Size { get; } T ...
0
votes
1answer
62 views

Advise on loose coupling between user controls

I have 5 user controls on the page and each control implements it's own interface that contains properties and events. In order to enable communication between user controls, I am creating a property ...
6
votes
8answers
984 views

Would a “downcast if block” be a reasonable language feature?

Consider the following "if cast": class A { public void f1() { ... } } class B : A { public void f2() { ... } } A a = foo(); // might return A or B if ( a is B ) { // Inside block, ...
2
votes
2answers
187 views

Is there a point in using closures for non-fully functional programming languages? [duplicate]

Maybe I don't understand closures fully but take for example C#, why would I use closures when I can use classes? Am I missing something? Note that I read this one already but my question is specific ...
0
votes
3answers
68 views

Relative encapsulation design

Let's say I am doing a 2D application with the following design: There is the Level object that manages the world, and there are world objects which are entities inside the Level object. A world ...
0
votes
3answers
278 views

C# - Typical instantiation of new object - is there a way to avoid repetitious syntax?

When learning C# (and OO concepts more generally at the same time) something I found very distracting is exemplified by the following line: ExampleClass exampleObject = new ExampleClass(); It's the ...
0
votes
0answers
51 views

How to design socks proxy server (OOP)

I'm working on a socks server application written in C#. But I don't really know how to design this in a nice way. I got this for Socks V4 and V4A: I'm not sure if it clears things up, but I think ...
2
votes
0answers
38 views

how to process document state transition?

Imagine there is an application (ASP.NET MVC) that processes some documents. The document must be revised several times by different group of users. state/role rules: simple user can only publish ...
0
votes
1answer
182 views

How to make C# methods work like javascript functions?

I'll keep it simple, I want to make C#'s methods work like javascript's functions. Mainly so I can convert this - function makeVariable(terp) { var me = {value: 0}; return function () { ...
0
votes
0answers
62 views

Designing a scripting/programming language - translation - Javascript to C# [closed]

So I'm making a small scripting language. I am following a tutorial online, it explains them. Now it has gotten to a part about closures, but I do not know how to do this in C# nor how I would set ...
1
vote
1answer
82 views

alternate approach of binary serialization/de-serialization

Is it possible to convert a list of object directly to byte[] (and vice versa) to gain performance (by avoiding serialization/de-serialization)? What I have in mind is that a list is somewhere in ...
0
votes
3answers
198 views

How to design an IDisposable that unconditionally needs to be disposed?

Consider a class that implements IDisposable, and that has members in such a way that it will never become eligible for garbage collection when it is not disposed. And as it will not be garbage ...
-1
votes
1answer
44 views

assembly.GetTypes() vs assembly.DefinedTypes.Select(t => t.AsType());

public static IEnumerable<Type> GetAccessibleTypes(this Assembly assembly) { try { #if NET40 return assembly.GetTypes(); #else return ...
0
votes
1answer
50 views

Modifying XML documents using deserialization/serialization VS LINQtoXML and XPATH [closed]

I have XML documents that I need to modify, I also have the XSD schema that defines their structure. What I did was this using XSD.exe tool I create class object from the schema in program ...
0
votes
0answers
37 views

Sproc chaining verse discrete calls from OO code

I'm currently working on a change at work to generalize a function that was sloppily coded up to work for a particular use case. The function calls a particular sproc that checks if an entity exists ...
-1
votes
1answer
77 views

Word recognition in a string without spaces or punctuation marks

I have a small C# project that reads a file and gives me an output: a string that does not contain spaces nor any types of punctuation marks. It may also contain a few misspellings. Ex. Output: ...
1
vote
1answer
143 views

Are there any valid uses for the System.Collections.Specialized classes any more?

Are there any valid uses for the classes in the System.Collections.Specialized namespace any more or are they all superseded by the classes in the System.Collections.Generic, ...
0
votes
1answer
175 views

Are VB.NET and C#.NET projects created from Microsoft Visual Studio “Open Source” safe? [closed]

I'm developing software in VB.NET and C#.NET and planning to release their source codes as fully open source. Are these projects "open-source" safe? My doubts are: VB.NET and C#.NET are using the ...
0
votes
0answers
34 views

Repository pattern & unit of work - Issue - Timeout error [migrated]

I am implemented Repository Pattern & Unit of Work after following tutorial from microsoft ...
0
votes
0answers
77 views

Are your code-first classes your domain classes? [closed]

When using Entity Framework does anyone else make a distinction between their code-first data classes (used to generate their DB) and their domain classes? If you don't, how do you reconcile the ...
0
votes
1answer
140 views

Should I use inheritance or an interface?

So in a nutshell I have an abstract class : public abstract class Member { public string PCode { get; set; } public string Reference { get; set; } public DateTime? ElectedDate { get; set; } } And ...
0
votes
2answers
92 views

Testing C# Eventhandler Subscription

I want my unit tests to be able to verify that some events were subscribed or unsubscribed at specific points. Currently, I see two options. VerifiableEventHandler Each client subscribes using the ...
1
vote
1answer
95 views

Best practice for projects architecture - server side [closed]

The usual way (that I'm familiar with) to divide the server side is the n-layer architecture : DAL - data access layer, usually has the Entities and the context (and maybe include also a repository) ...
-2
votes
0answers
68 views

Define relation parent \child [closed]

I have the following table ParentId id operator 12 13 * 12 14 * 12 15 * 12 1 - 12 ...
0
votes
0answers
36 views

SQL Permissions differ in SSMS and ASP.NET? [migrated]

I have created a schema and user called "WebAPI" which is used by ASP.NET project to get stock levels. So, I have simple stored procedure: SELECT p.ProductCode, SUM( sl.Qty ) AS 'Qty' FROM ...
1
vote
1answer
109 views

How can I create a set of random numbers based on a total and number of objects?

For example with: Total population = 400000 Number of villages = 800 The average population is 500 How can I randomize the amount of people in each village using a specified deviation (eg +-50) so ...
-1
votes
1answer
88 views

Moving from windows mobile 6 to windows phone [closed]

I have been working on building applications under windows mobile for pocket Pcs for two years. now I have a large set of applications that is already built. one customer wants the same applications ...
0
votes
1answer
172 views

The problem of dependencies management

Let's consider the next situation: We have a module A which has a class Crt570 intended to interact with a device. We have a module B which uses Crt570 in the class called M100Communicator. We have ...
0
votes
1answer
66 views

A specific problem with architecturing a part of our application

Firstly, I'll try to describe the real world model of what we are trying to express in C# code. We have a device called M100. It's purpose is to read\write data from\into cards (plastic or ULTRALIGHT ...