Click here to Skip to main content
15,891,204 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Creating Bitmap from MemoryStream Pin
The Man from U.N.C.L.E.3-Mar-10 3:02
The Man from U.N.C.L.E.3-Mar-10 3:02 
QuestionTimer reset Pin
Bob Beaubien26-Feb-10 11:57
Bob Beaubien26-Feb-10 11:57 
Answerclue Pin
Luc Pattyn26-Feb-10 12:23
sitebuilderLuc Pattyn26-Feb-10 12:23 
GeneralRe: clue Pin
Bob Beaubien26-Feb-10 12:34
Bob Beaubien26-Feb-10 12:34 
GeneralRe: clue Pin
Bob Beaubien26-Feb-10 12:40
Bob Beaubien26-Feb-10 12:40 
GeneralRe: clue Pin
Luc Pattyn26-Feb-10 13:13
sitebuilderLuc Pattyn26-Feb-10 13:13 
QuestionCode problem or exceeded array limits? Pin
Hurricane300026-Feb-10 5:15
Hurricane300026-Feb-10 5:15 
AnswerRe: Code problem or exceeded array limits? Pin
Luc Pattyn26-Feb-10 7:09
sitebuilderLuc Pattyn26-Feb-10 7:09 
Hi,

this is horribly inefficient for many reasons:
- you are converting strings to numbers all the time; it they really are numbers, store them in a numeric data type, not string.
- ReDim Preserve is expensive as it has to allocate a new array, then copy all the data. When the number of items in a collection varies, you should consider using a real collection instead of an array; use a collection type if those are available, or create your own linked list structures.
- For two arrays of size S1 and S2, you are performing S1*S2 comparisons. It would be cheaper to sort the first array, sort the second array, and then perform the equivalent of a merge-sort on both. This will improve speed dramatically and reduce the memory load drastically.

So throw it all out; start using lists of numbers; then sort and merge. It would handle millions of numbers in a matter of seconds.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.

modified on Friday, February 26, 2010 1:50 PM

AnswerRe: Code problem or exceeded array limits? Pin
Gideon Engelberth26-Feb-10 7:56
Gideon Engelberth26-Feb-10 7:56 
GeneralRe: Code problem or exceeded array limits? Pin
Hurricane300026-Feb-10 9:39
Hurricane300026-Feb-10 9:39 
QuestionExit on Keyboard button Pin
Bob Beaubien25-Feb-10 15:54
Bob Beaubien25-Feb-10 15:54 
AnswerRe: Exit on Keyboard button Pin
Dr.Walt Fair, PE25-Feb-10 17:00
professionalDr.Walt Fair, PE25-Feb-10 17:00 
GeneralRe: Exit on Keyboard button Pin
Bob Beaubien25-Feb-10 17:17
Bob Beaubien25-Feb-10 17:17 
QuestionShortcut Keys [solved] Pin
Mehdi Ghiasi24-Feb-10 23:20
Mehdi Ghiasi24-Feb-10 23:20 
AnswerRe: Shortcut Keys Pin
Nuri Ismail24-Feb-10 23:31
Nuri Ismail24-Feb-10 23:31 
GeneralRe: Shortcut Keys Pin
Mehdi Ghiasi24-Feb-10 23:44
Mehdi Ghiasi24-Feb-10 23:44 
GeneralRe: Shortcut Keys Pin
Nuri Ismail24-Feb-10 23:46
Nuri Ismail24-Feb-10 23:46 
QuestionHow can I programatically select video source using WebCam_Capture.dll PinPopular
M Wyatt24-Feb-10 13:53
M Wyatt24-Feb-10 13:53 
AnswerRe: How can I programatically select video source using WebCam_Capture.dll Pin
cybertronick4-Feb-11 1:20
cybertronick4-Feb-11 1:20 
Question.Net equivalent to ADODB? [Solved] Pin
Gregory Gadow24-Feb-10 6:08
Gregory Gadow24-Feb-10 6:08 
AnswerRe: .Net equivalent to ADODB? Pin
Pete O'Hanlon24-Feb-10 6:44
mvePete O'Hanlon24-Feb-10 6:44 
GeneralRe: .Net equivalent to ADODB? Pin
Gregory Gadow24-Feb-10 10:18
Gregory Gadow24-Feb-10 10:18 
GeneralRe: .Net equivalent to ADODB? Pin
Pete O'Hanlon24-Feb-10 10:43
mvePete O'Hanlon24-Feb-10 10:43 
GeneralNote to self: read inner exception messages Pin
Gregory Gadow24-Feb-10 12:09
Gregory Gadow24-Feb-10 12:09 
GeneralRe: Note to self: read inner exception messages Pin
Pete O'Hanlon24-Feb-10 12:32
mvePete O'Hanlon24-Feb-10 12:32 

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.