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
1answer
48 views
TextBox rendered as Label
I have created a custom web server control that will have a bool property 'RenderAsLabel' so that I can convert TextBoxes to Labels, for read-only forms. I was wondering if there is any reason why ...
-2
votes
0answers
19 views
Encryption in Java and Decryption using in C# using AES [on hold]
I have got two different systems to integrate where the Encrypted strings would be created on using Java platform. However, the encrypted strings need to be decrypted using C#.
I have the Java ...
2
votes
1answer
56 views
Do I need ninject when implementing DAL with generic repository and unit of work?
I am implementing generic repository and unit of work for the first time. I would be glad if someone can correct me if I am doing something wrong here.
This is how I communicate with my DAL from ...
4
votes
1answer
65 views
Converting string array to string (and vice-versa) for storing via XML
I'm using XML to store data and I need to store a string array in it. The best way (that I can think of) to store a string array is by converting it to a single string. In order to do that, I'm using ...
6
votes
2answers
112 views
Equality Function Generator
I have a small open source library called Equ that I've been using already on several projects. After a rework of the internals I thought I'd ask here for opinions on improvement possibilities.
At ...
4
votes
0answers
41 views
ListBox Update Handling
I have UserGroups for Users to be assigned to in a ListBox in HTML form. Items from listbox can be multi-selected or completely ...
0
votes
0answers
4 views
C# Property or Method to obtain information about a collection? [migrated]
Suppose I have a MyList class which extends ObservableCollection<MyObject> where ...
1
vote
0answers
37 views
Interacting with database in MVC
When using MVC 4 Razor (I am new to web), I get concerned about my understanding of interactions between the database and the client. Much like all apps these days, there is a lot of data that is ...
4
votes
2answers
61 views
Searching through various PDF files
I'm just looking for advice on how I can get my code to operate faster. It's pretty quick right now with searching through 30 3-page PDFs, but I imagine once there gets to be thousands of files to ...
11
votes
2answers
1k views
A fraction of the code
Following up on this post, and including some major changes suggested, here's the revised code.
Changes include:
No longer keeping an IFormatProvider at instance ...
-1
votes
0answers
35 views
How can I get persons to use my applications? [on hold]
The internet introduced me to computer programming. At 15 I started learning HTML. At 16, I started learning C#,Visual Basic & some C++. Computer software makes absolutely no money where I live so ...
8
votes
1answer
131 views
Formattable Fraction
I have written this small little program, to test how my Fraction type behaves when used with and without a custom ...
11
votes
4answers
173 views
I'm not sure if I still love Fibonacci, but my code is getting better. How much better?
Technically, this is a follow up to these two questions, but I have taken a radically different approach.
Everybody Loves Fibonacci
Does everyone still love Fibonacci
I finally allowed myself to ...
5
votes
3answers
75 views
Returning the lowest and highest number based on input
This simple console program prompts the users for a number and returns the lowest and highest numbers from their inputs. It is difficult to add more user inputs, though. How can I make this easier to ...
3
votes
3answers
164 views
Optimize parsing more and more
I have the below C# code for parsing. Do you think this is most optimize or I should use generic method or optimization required in these functions themselves?
...
1
vote
1answer
33 views
improve performance of recursive function in c# method
I'm trying to write a function which will cache objects in memory.
The function below works, but performance is unbearable. What would you recommend to improve performance?
...
1
vote
0answers
39 views
FormBuilder code suggestions for POCO
I am constructing a form builder in ASP.NET and I am wanting help with the structure of my POCO classes I have the following so far. I just don't see why I need to add to a list and then process it ...
2
votes
1answer
52 views
Validation invoking queries?
I have a question regarding whether it is viable or deemed correct if a validation object invoked a query. Essentially, I have some code that looks like this:
...
-2
votes
0answers
23 views
can you please share some sample to connect clearquest using c# [closed]
i have searched the dll or API to conncet the clearquest for fetching data till now i can't able to find any thing. so if anyone aware of how to connect pls guid me ASAP.
if using API then where we ...
2
votes
1answer
38 views
HttpRequest.Json collection - like HttpRequest.Form
I'm looking for a code correctness and best practices review on the following. I created the following in order to prevent using the same code to convert serialized JSON to something more accessible ...
5
votes
1answer
112 views
Changing the type of an object inside a method?
First off, this is not my code. I'm curious what everyone thinks about changing the type of an object inside of a method then modifying the properties of the cast type. I wanted to use composition to ...
2
votes
0answers
27 views
Resolve (domainless) machine name from DNS alias
So I have a URI with a DNS alias, and I need to I need to dynamically replace the alias with the actual machine. I started out with this:
...
2
votes
2answers
100 views
Suggestions on converting these classes to a single generic class
I have two classes that do that same thing with different types. I was thinking of using generics (but I am open to all options). QueryPermissions and the WebQueryObjects come from an external dll ...
-2
votes
0answers
20 views
How can i find out post-string from another webpage asp.net [closed]
i wanna make search page in my page from another website's page. Here is my code ;
...
9
votes
4answers
276 views
Threshed and Malachi'd: Sieve of Eratosthenes
I took a little bit from all the answers to my previous question Threshing: Sieve of Eratosthenes.
This may be bordering on code-golfing, but I think that I have a pretty good piece of code here.
...
6
votes
1answer
36 views
Convert WKT representations of geometries into GeoJson
I am working on a class library in C# to convert WKT to GeoJson. I am getting shapes in WKT out of MSSQL. A lot of the shapes ...
5
votes
1answer
105 views
0
votes
0answers
31 views
Strange LINQ Join behaviour [closed]
I've got a table in database for allocation and a view for containers.
I'm using EF and LINQ to get data.
One allocation can be related to one or more entries in containers view. If i use T-SQL ...
1
vote
0answers
29 views
HttpRuntime.Cache cache manager class
I am making code review of legacy class, which manages caching logic. Caching logic uses ASP.NET webforms HttpRuntime.Cache.
I know class, that is posted below, is ...
1
vote
1answer
61 views
ViewStateManager for more than just Controls?
Okay - so basically I have a login form that has a couple of 'states' it needs to display (connecting, input credentials, authenticating, invalid credentials, etc...etc...) - in the past I've ...
3
votes
1answer
56 views
Winforms Graphical Timer Control
This is a Graphical Timer control I made for C# Winforms, which taught me quite a bit (it is my first Custom Control). The code below is a fully working application with the Graphical Timer, some ...
7
votes
3answers
100 views
Numerically stable sum of `double`s
It's known that if you naively sum up a collection of arbitrary floating-point numbers using any floating-point standard (e.g. floats or ...
0
votes
0answers
30 views
JSON.NET Custom Serialization Using Custom JsonConverter [closed]
This code is doing custom serialization of a List. It works fine when the list is the root object. Unfortunately JSON.NET throws an Exception if the List is a property.
Here are the highlights.
1) ...
9
votes
2answers
257 views
+100
Memory-efficient string collection
My goal is to create a memory-efficient (immutable) collection of strings. The imagined use-case is checking for valid words in a Scrabble-like game.
Wikimedia Commons has a pretty good summary of ...
5
votes
4answers
361 views
Threshing: Sieve of Eratosthenes
I would like a complete threshing of this code so that I can see what I did wrong and what I am using incorrectly.
I made this super simple, trying to learn a little bit about ...
1
vote
2answers
39 views
Updating XML config files
I have been unable to find any other way to update a user config file than the following method.
...
4
votes
1answer
43 views
Code for simplifying the creation of Dimension Objects
I have a class that I use to represent a distance called Dimension.
Here is its four constructors:
...
3
votes
2answers
629 views
Faster way to get all primes between 0 - n
Is there a faster way to get all primes between 0 - n
...
3
votes
1answer
75 views
Maintaining a car collection list in a multithreaded application
I have a multithreaded application for web scraping from an automobile website. While performing web scraping, there are many links that gives the same result, so I have to check for data redundancy. ...
1
vote
1answer
42 views
Concept for saving context information
My Problem
I have a library containing business logic which is being used from 3 different projects:
Website
Local WPF Application
WCF Service
The library uses Entity Framework and a connection ...
0
votes
0answers
18 views
Graphical Timer not working as intended [closed]
This is a control I wrote for a graphical timer, however the timer does not work correctly. The pie fills out unevenly, and is completely full too soon before the timer finished counting down, I can't ...
6
votes
1answer
47 views
How to optimize K-nearest neighbours in C# for large number of dimensions?
I'm implementing the K-nearest neighbours classification algorithm in C# for a training and testing set of about 20,000 samples and 25 dimensions.
There are only two classes, represented by '0' and ...
4
votes
5answers
166 views
Search algorithm for specific values in a 3D array/matrix being super slow
I'm trying to create code that reads a text file (containing (double) numbers between 0 and 1) and filling up a 3D array/matrix (calling it matrix from now on) with ...
5
votes
2answers
110 views
Short XML parser
This is my first code in C# ever. It compiles and works as intended (not complete), but I want to see what I'm doing right and wrong as a first-timer.
...
2
votes
0answers
49 views
Code elimination once it is conditionally dead [closed]
A situation when programming code becomes dead dynamically or conditionally, such as here in this scenario. I don't want my code to be failure victim of branch prediction.
...
3
votes
0answers
15 views
Better approach to online builder
I have a windows forms application which needs customized dll files to be built and for that I am using an online builder using asp.net. I am in no way a asp.net expert not even near a beginner but ...
4
votes
2answers
49 views
User Authentication Bundle
I wrote a user authentication program(s) for an MVC application. Before you ask part of the project specs are I have to store user information in company databases on servers that aren't the web ...
3
votes
0answers
91 views
Many interfaces and lots of inheritance vs few interfaces and less inheritance?
I have a Visual Studio Solution which has a bunch of Projects in it. One of these projects is called "Services" and is basically the junction point between all remaining projects. When I built it ...
2
votes
1answer
30 views
Creating a New User Account
I feel like this maybe to much for one method... This method lives inside of a service class which is called by an interface. It dumps data into three different tables within a database.
...
3
votes
1answer
61 views
Loose coupling, accessing class properties
I'm trying to get a better understanding of decoupling methods. Right now, I have this method:
...