|
If I'm using an ArrayList in C#.NET, is the order guaranteed to stay the same as the order I add items to it?
Started by adambox on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You can access any element by index in O(1) Slow insert and delete .
Are
Guaranteed order Random access.
|
|
I'm using a pre-build event in Visual Studio to run a batch (.bat) file that performs some code generation (specifically, I'm running SqlMetal.exe to generate LinqToSql code).
Is the batch file guaranteed to finish before the compilation begins? Or does...
Started by DanM on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The batch file will complete only after the process it has started has ... .
See Gotcha! Visual Studio Pre/Post-Build Events for more info.
But note that if you have more than one step in your pre-build, only the last step will be checked for errors .
|
|
It seems as though the following calls do what you'd expect (close the stream and not allow any further input - anything waiting for input on the stream returns error), but is it guaranteed to be correct across all compilers/platforms?
close(fileno(stdin...
Started by Greg Rogers on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Nothing is guaranteed correct.
Nasty.
Seriously.
Don't do it.
Misbehavior on any other software module.
|
Ask your Facebook Friends
|
If I've got a List with the following entries:
Apple Banana Grape Cherry Orange Kiwi
Is the result of
fruit.FindAll(f => f.Length == 6)
guaranteed to always be
Banana Cherry Orange
or could the order be different?
Started by PaulB on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The documentation.
It's not guaranteed in the sense that it doesn't say it in the documentation, however if you look, although it doesn't explicitly say that it is guaranteed to be in the same order.
|
|
Given something like
foreach (keys %myHash) { ... do stuff ... } foreach (keys %myHash) { ... do more stuff ... }
Is Perl guaranteed to iterate over the keys in a consistent order if the hash is not altered?
Started by mazin k. on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Working around the edges.
Then, you're guaranteed to access keys in same order.
Order is subject to change in future versions of perl, but it is guaranteed to be the same order the saved result.
|
|
The documentation doesn't guarantee that. Is there any other place that it is documented?
I'm guessing it might be stable since the sort method on lists is guaranteed to be stable (Notes 9th point: "Starting with Python 2.3, the sort() method is guaranteed...
Started by sundar on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I do realize that the docs aren't 100% clear about this identity; doc patches are always happily... .
Yes, the intention of the manual is indeed to guarantee that sorted is stable and indeed that it uses exactly the same algorithm as the sort method.
|
|
If I send two TCP messages, do I need to handle the case where the latter arrives before the former? Or is it guaranteed to arrive in the order I send it? I assume that this is not a Twisted-specific example, because it should conform to the TCP standard...
Started by Smashery on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
To extract the messages from the buffer, but you are guaranteed that the bytes are in their transmitted.
|
|
This is a fundamental question, but an important one none the less...
When starting a C++ program whose main method has the following common signature:
int main(int argc, char* args[]) { //Magic! return 0; }
is args[0] always guaranteed to be the path...
Started by Bit Destroyer on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
It's so not-guaranteed that students used to try to hide.
Will always point to the actuall program.
|
|
In the C++ code below, am I guaranteed that the ~obj() destructor will be called after the // More code executes? Or is the compiler allowed to destruct the obj object earlier if it detects that it's not used?
{ SomeObject obj; ... // More code }
I'd ...
Started by JF on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
The lifetime of an object with automatic storage duration ends at the end of its potential .
It is guaranteed.
|
|
If I can ping my DB server, is my MSSQL connection guaranteed to work? I am using a default connection string in my code. My program runs fine locally but overseas sites are having issues and I am wondering if SQL might be using a TCP or UDP port that...
Started by Matt on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
As far as I understand your question you are asking whether... .
The server itself can be up - running and pingable without the SQL Server Serice running .
The SQL Server Service must at least be running on the server for any mssql connections to work .
|