|
Interesting, I've never made that distinction before. I've had to avoid using foreach when I was modifying the collection (adding and removing elements), but for everything else I just use foreach. Personally I find the IEnumerator interface rather ugly and suspect it was designed to be hidden under the covers, so I'm content to leave it there. I definitely respect any conventions that make code easier to follow and understand though.
This blanket smells like ham
|
|
|
|
|
It is eerily reminiscent of COM, isn't it? Just when you thought you were free from interface coclasses...
Actually, thinking on some of the comments in this topic, I ended up going back and rewriting it as a for loop this morning anyway, which let me keep the same counter variable and get rid of the IEnumerator.
|
|
|
|
|
At one point in my life IDL actually started to make sense to me.
This blanket smells like ham
|
|
|
|
|
I'm very sorry and I hope you can find the help you need.
|
|
|
|
|
Were you just trying to delete the treeview thingy you clicked on via index?
try this:
Private Sub TreeView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseUp
me.TreeView1.Controls.RemoveAt( me.TreeView1.Controls.GetChildIndex(me.TreeView1.GetChildAtPoint(new Drawing.Point(e.x,e.Y)))
End Sub
GaltSalt
maker of .Net thingys
|
|
|
|
|
No, actually I was just trying to access a node's index in the TreeNodeCollection in order to be able to insert another node before or after it in the collection. I just noticed the somewhat incomprehensible code in the Managed C++ section of the MSDN help for that method while I was browsing around.
Please don't bother me... I'm hacking code right now. Doesn't anybody remember what "hacking" really means?
|
|
|
|
|
Can someone please tell me what Software Development Methodology is?
Is it object oriented or struvtured and where did it originate from?
And can you please give axamples of each.
Thank you.
egionare
itsavvy
|
|
|
|
|
If you google it, you will get more results than you can shake a stick at. Also, this is the wrong forum.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
egionare wrote: Can someone please tell me what Software Development Methodology is?
A real short answer: methods for developing software. There are many different methods out there and describing just a few of them is beyond the scope of a quick message. You need to do a search online to just begin getting a grasp of it.
egionare wrote: Is it object oriented or struvtured
No, those are programming paradigms.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
That's right, this question does belong on the "Coding Horrors" board.
|
|
|
|
|
I've been frustrated the last couple of days trying to get multiple files to upload while still updating individual progress bars in a responsive WPF UI. I finished it this moring, and I came up with this oh so satisfying line:
<br />
fu.ui.UploadFile(fu.file);
I think that might be the coolest and most satisfying line of code I have ever written.
You might see this line in Coding Horrors the next time some other coder runs across it!
-- modified at 9:21 Wednesday 1st August, 2007
|
|
|
|
|
I had one the other night:
if (car is Missing) return null;
(it's valid C#!)
|
|
|
|
|
Missing? I can only find that in the Microsoft.JScript namespace, unless you have your own Missing. If the former, it's very tentatively valid C#.
|
|
|
|
|
System.Reflection.Missing
|
|
|
|
|
Just another glaring indictment of the perpetual impotence of MSDN indexing, finding only the most obscure occurrence of the Missing class.
|
|
|
|
|
|
No doubt. I always use Google to search MSDN, not their own search.
|
|
|
|
|
i didn't know it ws posssible to serach msdn with the built in search function
|
|
|
|
|
That makes for a good technical interview question:
"In the .NET Framework base class library, what is the Missing class?"
Very zen-like, a bit like the missing link...
|
|
|
|
|
else return car;
Greetings from Germany
|
|
|
|
|
else return (Missing)car;
|
|
|
|
|
|
I'm trying to figure out how an old C application work.
i = 0;
while(i <= 1024) {
if(RxData[i] == 13 && RxData[i+1] == 10 && RxData[i+2] == 13 && RxData[i+3] == 10)
break;
i++;
}
PosBD = i;
i = PosBD;
EDIT: PosBD and i are declared as int .
Although the while body might be quite clever because it's fast (who's brave enough to understand where the code is used?), I really don't get the 2 final lines...
-- modified at 13:25 Tuesday 31st July, 2007
If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker
My Blog - My Photos - ScrewTurn Wiki
|
|
|
|
|
Well it's checking for 2 line returns so the first thing that comes to mind is SMTP or HTTP :P
Last 2 lines are just plain stupid.
|
|
|
|
|
First thing that came to my mind too .. though only a 1k limit, bit of a kicker with a long POST request.
I'm largely language agnostic
After a while they all bug me
|
|
|
|