Type: Posts; User:
...ok I didn't see that, but in my defense; in what world does Alt+S serve as a shortcut to confirm an action such as posting a reply? TAB order is the universally accepted way to traverse controls....
Wow, I can honestly say I have never seen the full page add before. Perhaps it is because I was almost never logged out previously and have been automatically logged out three or four times since...
So, before I start, I want you guys to know that I (we) appreciate your hard work and I don't mean to crap on it here, but as you know, people get vocal about things they dislike far more often than...
You're not going to be able to do it without using a lot of reflection, though it is possible. Here's an overview of one approach: ...
And on a side note, you cannot "dispose a class", but I get what you were trying to say.
I have still yet to see a valid test case.
1. What are your compiler options?
2. Show us your real algorithm.
O(n^2) simply means that the worst case time needed to execute the algorithm is...
The algorithm is slow because it has O(n^2) complexity in time, not because you used a for loop instead of a foreach. Again, testing an empty loop makes no sense since it will be optimized away. If...
When discussing performance....
1. Show your compiler options or it didn't happen.
2. The first time your code runs it needs to be compiled by the JIT compiler, so you need to run a large number...
You can make it an instance level variable.
Just a nitpick because I see this so often. This method:
bool CheckHealth(int health)
if (health > 0)
alive = true;
Did you try any of .NET thread-safe collection classes before implementing your own?
Umm... ok, so what "seems wrong" exactly?
Not an 'idiot' at all, everyone starts somewhere, and the mere fact that you wish to learn about this stuff puts you ahead of most people already. ;)
You do seem to hold some misconceptions that...
But it won't be cleaned up by the GC because there is a valid reference to the object in the list. There is no other way; you would have to manually manage the list of objects (and you're probably...
The problem here would be stale references. You would need to make sure that objcts which are no longer needed are cleared from the list or they will *never* be GC'd.
Also, you can't use 'ref' in...
Next, stop testing equality between floating point numbers like that (in general). What every computer scientist should know about floating point numbers
Useless posts are, well, useless. Instead of editing out relevant information, leave the question and post the answer so that you may help people in the future. This is a forum after all.
I have to ask why you are using a timer here in the first place.
A Windows.Forms.Timer acts as an asynchronous callback mechanism. The Tick callback is in fact executed on the main (UI) thread,...
No problem, happy to.... yell? :D
No, this is the wrong way to write software.
The decision to declare a variable at a given scope is one of function, not performance. When a variable can be local to a function, it should be. ...
Don't create a new instance of your application object. Use the same one which generated the dictionary.
This is unnecessary:
Item tmpItem = new Item();
tmpItem = iMasterList[tmpR];
You create a new object and immediately throw it away. Simply use
Item tmpItem = iMasterList[tmpR];
No, it doesn't. It suspends the thread it was called on, no others. You need to remove that Sleep. However, if your program simply exits if you remove the sleep.... then I am perplexed as to why...
Well yes, but there are strict rules as to when and how they may be used, so while the syntax is the same as C++, the semantics are not, and their use case is very narrow and rare in C#.
Click Here to Expand Forum to Full Width