|
Really? String concatenation? And multiple queries? That's how it's done?
string xpath = string.Format("/Objects/Object[@name='{0}']/Height", Name);<br />
Doc.SelectSingleNode(xpath).InnerText = Height.ToString();
led mike
|
|
|
|
|
Stupefy wrote: that reads through an xml file
How?
Also your XML is not valid so until you fix that it will be difficult to help you.
led mike
|
|
|
|
|
Hello all.
Now that I have discovered extension methods, I am revisiting my libraries of handy-dandy routines to see where it makes sense to convert them. In doing so I am also revisiting a question about how to handle methods that work on different data types.
I am wondering if anyone out there has any opinions or knows any arguments for/against writing such methods in a particular style. I know there probably isn't any one "right" answer, but I thought it would be informative to hear what other programmers think.
For instance, I have a lot of methods that work on strings. I also need the same operations to work on character arrays. So I might end up with something like
public int foo ( char[] SourceData ) { ... }
public int foo ( string SourceData ) { ... }
I have also handled this using
public int foo ( char[] SourceData ) { return foo(new string(SourceData)); }
public int foo ( string SourceData ) { ... }
and even
public int foo ( object SourceData )
{
string source;
if ( SourceData.GetType() == typeof(string) ) source = SourceData;
else if ( SourceData.GetType() == typeof(char[]) ) source = new string(SourceData);
else error_condition;
...
}
I started to look at generics, but it seems that they may be a bit of overkill for routines that only handle 2 or 3 different data types.
Opinions? Critisisms? Other ideas? All are welcome.
Clive Pottinger
Victoria, BC
|
|
|
|
|
cpotting wrote: I started to look at generics, but it seems that they may be a bit of overkill for routines that only handle 2 or 3 different data types.
Why would generics be overkill. Just because you are limiting to only 2 or 3 data types, generics are still very useful. Let's face it, generics (in most cases) are often only used against a couple of types only. Don't limit yourself just because your code doesn't use every possible type.
|
|
|
|
|
Pete O'Hanlon wrote: Don't limit yourself
He may not be.
led mike
|
|
|
|
|
led mike wrote: He may not be.
Smooth. You've definitely mastered the one liner.
|
|
|
|
|
Thanks Pete. I will take a look a closer look at generics.
I'm not quite sure what led mike meant by "He may not be", though.
Clive Pottinger
Victoria, BC
|
|
|
|
|
Well I've had two years of learning from some of the best
led mike
|
|
|
|
|
I'm trying to figure out a way to set a tooltip for each individual ColumnHeader on a ListView. Unfortunately, ListView can't extend ColumnHeader by default, at least that's what ToolTip.CanExtend(object) reports when I try to run it on an instance of ColumnHeader.
I was wondering if anyone could point me in the right direction for this. After doing a Google search I found a few message board postings where WndProc was overloaded on the ListView control butall were too vague or used types they didn't define.
I know column headers in DataGridView are able to handle ToolTips so I'm going to take a look at that via reflector. Hopefully, that'll shed some light on what I need to do.
-JC
|
|
|
|
|
Hi All,
I want to display the sum of the values of a field on my report.
im using 'Running total fields' , then i select the field, bud i don't see the 'Sum' selection on the 'Type of summery' combobox...anyone any idea???
Thanx.
|
|
|
|
|
Try adding a formula field and setting its value to the sum of the field you're looking for.
So the formula text would be something like:
Sum ({Table.Fieldname})
The Sum function also allows you to set specific criteria on what to count. I'm not sure how flexible it is, but it's there.
-JC
|
|
|
|
|
hello allll
i have assingned a task to recognise the image that is a mathematical number 0,1,2,3,4,5,6,7,8,9
using image processing
plz any one guide me through this whole process and regard me code
if anyone have
i have to use c# plz guide me for the C# tooo
waiting for replys
thanks
|
|
|
|
|
Read the first message in the forum titled "How to get an answer to your question", pay attention to item #2
Then after you have done that, go to the articles on this site and you will find a series on C# Image Processing. You will find the articles under the "Chapters" menu item.
led mike
|
|
|
|
|
Obviously you're too stupid and lazy to handle the task. Try doing something you can handle, like sweeping streets or selling fruits.
No one is going to guide you through any process or give you C# code.
Idiot
|
|
|
|
|
B.Tanner wrote: Try doing something you can handle, like sweeping streets or selling fruits.
LMAO gotta add that to my CPHog quote list
Try doing something you can handle, like sweeping streets or selling fruits.
B.Tanner - the C# forum
|
|
|
|
|
O Mr. hello i was just askig for the guidence and as you cant do this
so please shut up as you dont know I am lazy or not.
assinging me the task means some one has confidence on me.
Ok and if you dont have manners to rply then please dnt trouble yourself anymore to rply again.
I am very much new to image processing and asking help in this regard .
IDIOT
|
|
|
|
|
Hi there,
I want to extract the image src from the image tags in HTML files
::HTML Text::
<button class="toolbar" style="height:26px;width:22px" onclick="return InsertText(' ');"><img src="http://www.codeproject.com/" alt="Insert a smile" border="0" width="16" ></button>
::Output String::
http://www.codeproject.com/
Thanks
|
|
|
|
|
Bora Vuth wrote: I want to extract the image src from the image tags in HTML files
Extracting the content between the opening and closing elements of a HTML tag is a pretty common problem.
Have you made any attempt to solve the problem yourself, i.e. by searching the web?
If not, I suggest you do so. People who can't do basic research generally don't receive help in this forum.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for the suggestion.
I wish I didn't do research on the net so that I can deserved what you've said.
Anyways, I think I better get help from others rather than from those who help nothing.
|
|
|
|
|
I only help those that help themselves.
As you don't seem to be interested in solving the problem yourself and expect the solution handed to you on a place, you'll get no further help from me.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: don't seem to be interested in solving the problem yourself and expect the solution handed to you on a place
Frankly, i did spend half an hour solving it already before I posted for help. Just right 10mns after posting this, I figured out the solution.
You have to understand that not everyone is like what you've thought that when they face problem they just jump up straight to the forum for help!! They might have tried their best already before coming to the forum.
You might have thought that you are a great forum answerer, but without good attitude and respectful to others, you deserve nothing from us.
|
|
|
|
|
Bora Vuth wrote: You might have thought that you are a great forum answerer, but without good attitude and respectful to others, you deserve nothing from us.
I don't want anything from you. I already know how to solve problems like yours. To be quite frank, judging by your skill level I doubt there's anything useful you could teach me.
I'm happy to help people who have demonstrated they're made a serious attempt to solve the problem they are asking for help with. I saw no evidence of this in your posts. If you want respect, first you have to deserve it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: To be quite frank, judging by your skill level I doubt there's anything useful you could teach me.
I am just a freshman to the forum stuff and the IT Industry. I also do not expect to teach anything useful to master mind.
Hmm, probably I haven't yet made myself clear to show my attempt. But I don't know how serious is consider to be serious! If we have a scale for that, it's wonderful.
|
|
|
|
|
Bora Vuth wrote: Hmm, probably I haven't yet made myself clear to show my attempt.
Correct. You haven't.
Bora Vuth wrote: But I don't know how serious is consider to be serious!
Demonstrating that you have made some attempt to solve the problem by yourself would be a start. Post what code you have written so far and indicate which bit is causing a problem. Post links to the articles you have read and indicate where you require further information. You didn't do any of these things. All you did was ask someone to provide you with a solution. To me, that sounds like asking us to do your work for you.
Bora Vuth wrote: If we have a scale for that, it's wonderful.
Obviously there isn't a scale. However, hopefully you understand how to frame your questions in the future.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
He he!
That sounds reasonable!!!
Will try to make things clearer next time!!
Thanks
|
|
|
|