|
Yes, I gave you a one. In my opinion it was a bad answer because you were encouraging the idiot to not do basic, simple research and rather rely on someone else to do their work.
If you want to be an ass, go right ahead, knock yourself out, have fun.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ass aside and I admit I wanted to be one right then,
so ass aside do you honestly belive he was going to txt his way into documentation?
I highly doubt it.
I just got rid of him.
After all, he replied to my reply to Luc's more than fine answer. I was the first to 5 it.
So appologies for the my being an ass but I just don't agree with you on this one.
Just an irritated, ranting son of ... an IT guy.
At your trolling services
|
|
|
|
|
We have the reponsibility to encourage proper coding, design, architecture, etc. not just give answers.
Get rid of him? No, you just encouraged him to come back and ask more stupid questions rather than develop the skills that will help him to succeed in this career. We've been around here longer than you and have seen the pattern many times.
If you want to aplogize for being an ass, then remove the distracting, unnecessary posts pointing it out.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
And if we help "developers" to solve their problems, they will soon have our jobs, because they are SOOO smart ....
|
|
|
|
|
please do not remove a message that has replies; it should not be possible to do so but it is, and it is against the forum guidelines.
Now return to your book and pay special attention when you reach 'D'.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
modified on Wednesday, June 2, 2010 3:51 PM
|
|
|
|
|
|
You didn't remove it by mistake, it took a conscious and deliberate act on your part. You were more than likely trying to save yourself embarrassment from posting such an obvious question
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello
I embedded an resource "WINGDNG2.TTF" with vs2010.
Now I'm not able to access to that resource.
I try to access to it whith
"assemblyname.WINGDNG2.TTF"
or "mynamespace.WINGDNG2.TTF"
or "WINGDNG2.TTF"
but alway I have resource file not found.
I don't know whats wrong. Mybe because my namespace has an dot (.) ?
Thank you.
|
|
|
|
|
Yes, it is still confusing me when to use namespace/assembly name while accessing resources. Somethimes neither is required:
string resourceName="resources.myapp.ico";
icon=new Icon(type, resourceName);
works for me, when the icon file "myapp.ico" is located in the project's "resources" folder.
No namespace, no assemblyname involved.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I want to open my .Net Desktop Application in Java Desktop Application. If anybody as any method or any other functionality to achive this task, please provide the same. OR Convert the .Net Application (EXE) into ActiveX control.
|
|
|
|
|
That is a Java question; launching an app does not depend on the language of the callee. All it takes is to use Google and find some documentation[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I am working on a text editor application and I would like a status strip on the bottom of the window but I cannot see the last line of the text box because the strip overlaps it. And if I set the docking of the text box to top I can set the size so it will not overlap but then it will not stretch vertical with the window. How can I set the text box to stretch with the window but not overlap the status strip?
Y*Live Long And Prosper*Y
|
|
|
|
|
Set dock to fill on the textbox and then right click the textbox control and click bring to front.
|
|
|
|
|
Ahhhh. Thanks!
Y*Live Long And Prosper*Y
|
|
|
|
|
Hello All
Am developing a MultiThreading Application and I have searched the internet for guide lines how to write a thread safe methods.
I found some conflicts and I would like if any of you help me to figure out the correct solution.
Below is Example of a Method That I need you to Evaluate if it is thread safe or not and Why.
public static int Search(string xml, char item)
{
return xml.IndexOf(item);
}
|
|
|
|
|
Well calling IndexOf will invariably run through a loop at some point looking for item
Is this thread safe?
public static int Search(string xml, char item)
{
for(int i=0; i<xml.Length; i++)
{
if(xml[i] == item)
return i;
}
return -1;
}
EDIT: As others have said strings are of course, immutable. I deserve a kick for that one.
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
modified on Wednesday, June 2, 2010 10:20 AM
|
|
|
|
|
IMO everything you said was correct, however it did not provide an answer, it merely rephrased the question.
I will not provide a kick you say you deserved.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I but I was trying to point out that if the string changed while your where looping you would have a problem. But of course in c# when you pass a string it's a whole new object. Been working with C++ for too long now it seems, where everything has pointers or pointers to pointers. In one case a had a pointer to a pointer to a pointer, pointy.
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
|
|
|
|
|
SK Genius wrote: when you pass a string it's a whole new object.
Now that deserves a kick. A string parameter is not a new object, in fact it is a pointer (they like to call it a reference), just as it is in C/C++/Java. However it points to an immutable object, something the compiler will not allow you to modify, only replace.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Indeed, right you are. Glad too see I'm earning my Kicks.
I know that (almost) everything is passed by reference so you get the actual string but anybody who modifies or replaces it is then pointing to a new object, leaving the old one intact until GC will eventually devour its soul, right?
My current favourite quote is: Punch them in the face, see what happens!
-SK Genius
|
|
|
|
|
yes, that method is thread-safe: its results only depend on input parameters, and both string and char are immutable, so there is nothing that can disturb the method; also the method is not changing the outside world, so it isn't disturbing anything itself.
As soon as you start referring to other data, such as class members, things may change though.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
As you aren't operating on a member variable in this example, and you have a nice self contained method where you have immutable data, this is perfectly thread safe. In other words, there is no chance that another thread can change the value of xml or item and affect the outcome.
Suppose that you changed it so that xml was a member property of type XMLElement, and you passed item in - then you could have a none thread-safe method because you could affect XMLElement before you actually performed the operation on the XML.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Not if you change the string with unsafe code.
Otherwise the result will of course be correct for the (old) value of the xml parameter, but not necessarily for "something else" (I mean, if you passed in this.Xml or something like that, the result (when it is returned) may have nothing to do with the current value of that field)
|
|
|
|
|
Some articles say that if you pass variables to your method that are not immutable or reference variable this may make the method not Thread Safe.
Does any one has more details about this point if it is correct or wrong and why?
|
|
|
|
|
What exactly do you mean?
|
|
|
|