Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
GeneralRe: There is already an open DataReader associated with this Command which must be closed first Pin
Ravi Bhavnani9-May-08 17:30
professionalRavi Bhavnani9-May-08 17:30 
GeneralRe: There is already an open DataReader associated with this Command which must be closed first Pin
boblaw9911-May-08 3:49
boblaw9911-May-08 3:49 
AnswerRe: There is already an open DataReader associated with this Command which must be closed first Pin
Seema Gosain9-May-08 19:31
Seema Gosain9-May-08 19:31 
AnswerRe: There is already an open DataReader associated with this Command which must be closed first Pin
Ennis Ray Lynch, Jr.10-May-08 17:42
Ennis Ray Lynch, Jr.10-May-08 17:42 
QuestionAngles: Why Can't I get less than 45degrees? [modified] Pin
RedHotFunk9-May-08 9:22
RedHotFunk9-May-08 9:22 
AnswerRe: Angles: Why Can't I get less than 45degrees? Pin
Anthony Mushrow9-May-08 10:12
professionalAnthony Mushrow9-May-08 10:12 
GeneralRe: Angles: Why Can't I get less than 45degrees? Pin
RedHotFunk9-May-08 11:27
RedHotFunk9-May-08 11:27 
Questioniterating dictionaries Pin
invictus39-May-08 8:53
invictus39-May-08 8:53 
Hi
I work with some very large arrays (millions of items) in an algorithm, however, since most fields contains the value 0 I decided to use a Dictionary to represent only the array's fields where the value is not 0.

Dictionary means that the first int is the index of the array in which the value would appear, and the second int is the value of this index.

Now, I have two of these "arrays" that I need to compare. For each _existing_ index I need to find the difference between the arrays.

E.g. index i exists in dict1 (first dictionary) but not in dict2, thus the difference should be the value of dict1[i] alone. index i exists in both dictionaries thus the difference should be dict1[i] - dict2[i].

Now, in theory this should be possible to achieve with iterating each unique index in BOTH dictionaries only once (e.g. if an index occurs in both dictionaries it should only be iterated once)

My suggestion was that I start by getting the first item from each and compare the index of these.if they are equal I would increase both iterators.if one is higher than the other I would increase the iterator until they are equal or the other one is lower. This would be repeated until both are iterated through. Any ideas how I can do this with C# and Dictionary?

Any ideas? need to do this iteration as fast as possible. In C I could do some pointer magic to achieve this, but I am not familiar with C# dictionary iterators/enumerators so I have no idea whatsoever how to solve this.
AnswerRe: iterating dictionaries Pin
Pete O'Hanlon9-May-08 9:03
mvePete O'Hanlon9-May-08 9:03 
AnswerRe: iterating dictionaries Pin
PIEBALDconsult9-May-08 10:38
mvePIEBALDconsult9-May-08 10:38 
AnswerRe: iterating dictionaries Pin
Daniel Grunwald10-May-08 5:11
Daniel Grunwald10-May-08 5:11 
GeneralRe: iterating dictionaries Pin
invictus310-May-08 5:15
invictus310-May-08 5:15 
GeneralRe: iterating dictionaries Pin
invictus310-May-08 5:54
invictus310-May-08 5:54 
Questionlistbox_indexchanged read from MySQL Pin
Privilegue9-May-08 8:24
Privilegue9-May-08 8:24 
AnswerRe: listbox_indexchanged read from MySQL Pin
CodingYoshi9-May-08 11:33
CodingYoshi9-May-08 11:33 
QuestionWeird focus problem Pin
kensai9-May-08 3:34
kensai9-May-08 3:34 
AnswerRe: Weird focus problem Pin
CodingYoshi9-May-08 11:35
CodingYoshi9-May-08 11:35 
GeneralRe: Weird focus problem Pin
kensai10-May-08 2:50
kensai10-May-08 2:50 
GeneralRe: Weird focus problem Pin
CodingYoshi10-May-08 9:41
CodingYoshi10-May-08 9:41 
GeneralRe: Weird focus problem Pin
kensai10-May-08 12:53
kensai10-May-08 12:53 
AnswerRe: Weird focus problem Pin
Dave Sexton10-May-08 0:30
Dave Sexton10-May-08 0:30 
GeneralRe: Weird focus problem Pin
kensai10-May-08 2:35
kensai10-May-08 2:35 
QuestionI need help starting multiple and communicating between application domains [modified] Pin
Togakangaroo9-May-08 3:15
Togakangaroo9-May-08 3:15 
AnswerRe: I need help starting multiple and communicating between application domains Pin
CodingYoshi9-May-08 11:44
CodingYoshi9-May-08 11:44 
GeneralRe: I need help starting multiple and communicating between application domains Pin
Togakangaroo9-May-08 14:37
Togakangaroo9-May-08 14:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.