|
Interesting.
So if you're at home, but your laptop is connected to the office network (via VPN or whatever), are you getting the expected results?
Off-topic: I've been working with PowerShell lately, and I must say I like the ability to call anything from .NET right from a command prompt. I was able to run all 3 of your calls without firing up VS...(yeah, I know, welcome to a few years ago...)
|
|
|
|
|
No, I ran those lines of code in my app at my office.
I then TeamViewered into my home PC and ran the same against my home network (Win 7 pro on a home LAN. My server is Win Server 2013)
Two entirely different networks. I just wanted to see what that code would return. But the fact that at home I get the same results from all 3 functions bothers me.
If it's not broken, fix it until it is
|
|
|
|
|
Is LOGONSERVER (the environment variable) of any use? Can you look for an AD server?
|
|
|
|
|
I have downloaded the source code of {
Open Source Extensible Enterprise n-tier Application Framework with Multilayered Architecture
} I have open it in visual studio it compiles well and giving no error when i run the application it gives me error
"
No connection could be made because the target machine actively refused it 127.0.0.1:13000
please help me to configure this project into my laptop.
modified 14-Feb-16 3:04am.
|
|
|
|
|
You should post your question in the forum below the article so the author can help you.
|
|
|
|
|
|
Hi,
I'm using System.Windows.Forms.DataVisualization.Charting in WindowsForms (C#). I'm looking for a solution to show only whole numbers on the X-axis (time-axis) in a dynamically (every 100ms) updated chart.
Every time-step data is added to the chart (and old data is removed), so the labels on the x-axis should dynamically "move" form the right to the left. But I want only see whole number e.g. 4, 5, 6. Of course, the first and last label can not be placed at the min and max of the axis. And, I do not want to see a first label like 4.3!
Would this be possible? Does anyone have a solution for this problem?
Thanks in advance!
CJ2010
|
|
|
|
|
DataPointCustomProperties.LabelFormat
Gets or sets the format of the data point label.
You can set this property in the designer via the Series Collection Editor (on the chart "Series" collection property).
|
|
|
|
|
hey everyone , i am actually trying to implement an algorithm in which missing values of a datagrid is to be identified and if there is an empty cell that whole row will be compared to the all next rows and it will be checked that which row is highly matched to the row which is having missing cells . and that missing cell will be assigned the value of that matching rows same cell.for example if following is the data
name class age
ain 3 45
jow 4 48
3 45
goerge 5 42
ain 40
result:
ain 3 45
jow 4 48
ain 3 45
goerge 5 42
ain 3 40
i have done the coding till finding the missing values . hope anyone help with the rest
|
|
|
|
|
Step 1: Define the minimum requirements a row must meet to be considered a match. E.g. Do the names have to be equal? Or do both names converted to lower or upper case have to be equal? Or does one name have to be contained in the other? Do the numeric values have to be in a certain range of each other?
Step 2: Define a scoring-function that calculates the matching-score of a row to the row with missing values. E.g.: initial score = 0. Names are equal? -> score=score+100. Names are "lower-case-equal"? -> score=score+80. Numeric values of column X are equal? -> score=score+50. Numeric values of column X are within a certain (absolute or relative) range of each other? -> score=score+30. (Values are totally made up, you need to find values that make sense for your data, only you know what's important there.) Or, for numeric columns: score=score+Math.Abs(value1-value2)
Step 3: For each row (except the one with missing values): If it meets the minimum requirements for a match calculate the matching score. If it's higher than the last one calculated, "memorize" the row-object in a variable and update the variable for the highest-score-so-far.
Step 4: Write the values of the found best matching row that are missing in the row for which you did all this to the same.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
modified 12-Feb-16 16:36pm.
|
|
|
|
|
hey there thanks for your help but i am new to C# and getting the first missing and matching with all other record ad so n i becoming really difficult to code. even if i focus of missing cells .
|
|
|
|
|
Please use the "Reply"-link below a reply (my answer in this case) to respond to it. Here you replied to your own question and I didn't get notified of it.
Please show the code you have to far and I'll try to help you.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
In my current project I have to look up a lot of objects by their name. In order to make this "semantically type-safe" I thought of wrapping the name-strings in semantic types for the different types of those objects. I haven't seen this done in any other project yet, only with semantic types for strings that for human understanding actually present a specific type of entitiy, like email addresses, phone numbers etc. and then also encapsulate the functionality to ensure that the string is semantically valid. In my case I would just need something like this:
class NameOfSomeType
{
public readonly string Name;
public NameOfSomeType (string name) { Name=name; }
}
As I haven't seen something like this done anywhere yet I would like to ask for your opinion of this.
Sascha
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Sounds like a good idea to me.
Would it make sense to use a struct rather than a class ? That way, you'd have less memory overhead and GC churn.
I'd be inclined to use a read-only property instead of a field, but only because it "feels" cleaner.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: Would it make sense to use a struct rather than a class ? That way, you'd have less memory overhead and GC churn. The types for which I would use these semantic name types belong to a type hierarchy and are polymorphically used in several places; so with structs I would probably have to have several new method overloads which I could prevent with classes (and sub-classes) instead of structs. Also I'm guessing that the performance degradation will be insignificant because although those name lookups happen at a lot of places it's anything but the "main business". I'll probably profile both ways
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Opinion on how to do it or opinion if it is worthwhile and valid?
|
|
|
|
|
RugbyLeague wrote: Opinion on how to do it or opinion if it is worthwhile and valid? The latter. As I haven't seen this done anywhere yet I thought maybe I'm missing something which is why it's not being done.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
If you think it will bring something to your code - compile time checks etc. then go for it.
|
|
|
|
|
There are several articles here on CP about using Semantic Types in .NET. You might want to take a look at some of these[^] (I have read the first three articles before and they are all really enjoyable).
This space for rent
|
|
|
|
|
I've read those (more or less thoroughly) - what made me ask my question anyway is the fact that those articles deal with semantic types for "real world entities" (ZipCode, EmailAddress, etc.) including conversions or validity checking or formatting - while I would just need a surrogate for something like
typedef string NameOfSomeType
for application-internal use only.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Addressing the requirement of looking up "object type names":
class Program {
private static List<Type> _types = new List<Type>();
static void Main( string[] args ) {
_types.Add( typeof( DateTime ) );
_types.Add( typeof( int ) );
_types.Add( typeof( bool ) );
double d = 1.0D;
Register( d );
int index = _types.IndexOf( d.GetType() );
Console.Write( index );
Console.ReadKey();
}
static void Register( object o ) {
_types.Add( o.GetType() );
}
}
|
|
|
|
|
Thank you - but you misunderstood: It's not about looking up types by their type or type-name but about looking up objects by a given name (like "bob"). And because there are several different types of those objects it would seem to make sense to have their names wrapped in dedicated semantic types instead of just passing strings around in order to avoid passing a name of an object of type A where the name of an object of type B is expected.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I see no restriction on "names" then; 2 objects could have the same name.
Sounds like you need an object "IDentity" property.
|
|
|
|
|
I have done this, and it works particularly well when dealing with database fields. One thing that I have found particularly useful with this pattern is to include implicit type conversions to and from string, so that passing the objects to standard framework functions becomes a breeze. It also makes initialisation simple and intuitive
Email myAddress = "mick@midimick.com";
System.Net.Mail.MailAddress mailAddress = new System.Net.Mail.MailAddress(myAddress);
|
|
|
|
|
Very interesting post, Sascha. I was hoping Marc Clifton would post in this thread, since he's done some interesting work in this area.
What do you think about using T4 to generate semantic types ?
cheers, Bill
«In art as in science there is no delight without the detail ... Let me repeat that unless these are thoroughly understood and remembered, all “general ideas” (so easily acquired, so profitably resold) must necessarily remain but worn passports allowing their bearers short cuts from one area of ignorance to another.» Vladimir Nabokov, commentary on translation of “Eugene Onegin.”
|
|
|
|