|
IList obviously keeped back an HTable and under the sorting algorithim it has used the QuicSort. So it can be use an ArrayList of generic or any enumeratic variations that hold the algorithm.
There many ways to develop for any special queries by an arraylist.
There have some question;;;
1- Why?
2- What is our aim
3- What is our strategy it is linking to the platform and technology
4- which is cheaper for our credentials
5- Prefere
|
|
|
|
|
I don't get why people cling to arrays in C#, they are less easy to use than egneric Lists and hvae a similary large overhead (the amount of methods available for an array is pretty much the same as for a List).
From what heard there is also no speed improvement.
And Arraylist should be used as rarely as possible, if all elements have the same type, it's easier to work ith them instead of first having to cast each object.
Besides worker threads, that only have 1 object as possible parameter, I can't think of the nedd to hae differnt bkect types in the same collection.
modified on Tuesday, February 24, 2009 9:16 AM
|
|
|
|
|
Hello,
I do not know if this is a horror or not, but it was a horror for me.
In a project i wrote this little gem:
#define stdcall_api __stdcall
Do not do that ever. Now i cannot build any project in Visual C++ (2008).
I think this is really a horror, no?
|
|
|
|
|
Dunno, does it conflict with something? If not, what's the problem?
|
|
|
|
|
Judging by the "Now i cannot build any project in Visual C++ (2008).", I'd say that's quite a horror - although I can't see how a #define could affect "any project", unless added to a (very) commonly include header.
|
|
|
|
|
Right, but it must conflict with something. And did it work in 2005?
|
|
|
|
|
Hello thoru,
Although I was sure that this issue should not make any error . I gave it a try in my installed VS2008 in my machine.
I made a new C++ project with a precompiled headers and non-empty project, every thing went good .
Redwan Al-Bougha
|
|
|
|
|
Maybe this isn't the right place for this post since I don't have the code (so please move it if it doesn't belong), but it is clearly a horror on the part of the original programmers.
We use the enterprise shipping software of a major shipping company (that uses yellow trucks with red lettering). Whenever we ship something using the software, a floppy disk must be in the drive (even though it neither reads a file from the disk or writes a file to the disk), otherwise it will fail with a .NET error WHILE TRYING TO EXECUTE THE C# COMPILER!
While I'm sure that in some circumstances, writing code on the fly can be beneficial, I cannot even begin to imagine that it is even remotely necessary for shipping packages.
|
|
|
|
|
What does it do if you don't have a floppy drive?
|
|
|
|
|
I don't know. The machine that they provided has one. It's just on the one machine which has the scale and label printer attached.
|
|
|
|
|
Sounds like a poor mans dongle
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
You wouldn't want someone belittling your dongle, would you?
|
|
|
|
|
even worse, it's a poor man's floppy dongle!
|
|
|
|
|
Scott Barbour wrote: a floppy disk must be in the drive
Any floppy disk, or a specific one provided by them?
|
|
|
|
|
Scott Barbour wrote: cannot even begin to imagine that it is even remotely necessary for shipping packages.
Same here.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I guess the message was "Drive not A not Ready" from crss.exe. The reason for that is simple.
You have in your application somewhere a drive letter selection combo box.
That little snippet should exhibit this problem:
foreach (DriveInfo d in DriveInfo.GetDrives())
{
Console.WriteLine("Root: {0}", d.RootDirectory);
}
All you have to do is to check the DriveType if it is removeable and skip it altogether. If you do not access it then you wont have any problems with drive not ready messages.
Yours,
Alois Kraus
|
|
|
|
|
I found this in some legacy code at a place where I worked:
public class MyClass
{
private FooEventArgs Foo_Event;
public void MyMethod()
{
Foo_Event = new FooEventArgs( … );
.
.
.
}
}
Foo_Event is used only in MyMethod, but it is declared as an instance variable of the class. At least they did not make it public .
Also I really don't like having "_Event" appended to the variable name. It isn't an event it is event arguments.
Of course, this pattern was repeated for several variables.
Bill W
|
|
|
|
|
Just refactor the code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Yep, that is exactly what I did
I just find this kind of code irksome.
Bill W
|
|
|
|
|
Hopefully that particular coder isn't somewheres else coding mission critical stuff...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I just know they are no longer working at the same place. But, the code does work so no one, other than fellow programmers, would even be aware that there is something wrong with the code. This is one of the reasons that I believe in peer code review, not to critize, but to give folk a chance to learn better ways of doing things.
Bill W
|
|
|
|
|
CIDev wrote: This is one of the reasons that I believe in peer code review, not to critize, but to give folk a chance to learn better ways of doing things.
I totally agree. A peer review of the code you posted could have perhaps helped the coder improve. Of course that depends if they are open to constructive criticism.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I agree with the code review and that one hopes the programmer is open for constructive criticism. However, the one giving the advice should also be open to rebuttal. I've been in situations where I give an answer, in a nice, logical tone and got blasted for going against the criticism. I wasn't trying to be rude, but explaining why I did what I did. Of course, the guy giving the criticism was a hot head to begin with, which may not have helped.
But yes, code reviews are very helpful and a good learning environment as long as all parties are open-minded to some degree.
|
|
|
|
|
sa_runner wrote: the one giving the advice should also be open to rebuttal
I agree.
sa_runner wrote: the guy giving the criticism was a hot head to begin with
So like Donald Duck?
sa_runner wrote: as long as all parties are open-minded to some degree
That is indeed a necessity for a code review.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Working on an old vb6 project I found this treasure ...
Function conv8(number) As String
If number = "" Then
number = 0
End If
conv8 = Hex(Numero)
Select Case Len(conv8)
Case 1
conv8 = 0 & 0 & 0 & 0 & 0 & 0 & 0 & conv8
Case 2
conv8 = 0 & 0 & 0 & 0 & 0 & 0 & conv8
Case 3
conv8 = 0 & 0 & 0 & 0 & 0 & conv8
Case 4
conv8 = 0 & 0 & 0 & 0 & conv8
Case 5
conv8 = 0 & 0 & 0 & conv8
Case 6
conv8 = 0 & 0 & conv8
Case 7
conv8 = 0 & conv8
End Select
End Function
Obviously they wrote also a Conv1, Conv2, Conv4 ... and thank god there was no need for a Conv64 !!!!
Don't write code: generate it!
|
|
|
|