Click here to Skip to main content
15,894,540 members
Home / Discussions / C#
   

C#

 
GeneralRe: Int64 Array overloading problems Pin
harold aptroot30-Jan-10 23:56
harold aptroot30-Jan-10 23:56 
AnswerRe: Int64 Array overloading problems Pin
OriginalGriff30-Jan-10 21:48
mveOriginalGriff30-Jan-10 21:48 
GeneralRe: Int64 Array overloading problems [modified] Pin
Zerodagreez30-Jan-10 21:53
Zerodagreez30-Jan-10 21:53 
GeneralRe: Int64 Array overloading problems Pin
OriginalGriff30-Jan-10 22:06
mveOriginalGriff30-Jan-10 22:06 
GeneralRe: Int64 Array overloading problems Pin
Zerodagreez30-Jan-10 22:20
Zerodagreez30-Jan-10 22:20 
GeneralRe: Int64 Array overloading problems Pin
Luc Pattyn31-Jan-10 1:42
sitebuilderLuc Pattyn31-Jan-10 1:42 
AnswerRe: Int64 Array overloading problems [modified] Pin
Zerodagreez30-Jan-10 23:29
Zerodagreez30-Jan-10 23:29 
GeneralRe: Int64 Array overloading problems Pin
Dan Mos31-Jan-10 0:19
Dan Mos31-Jan-10 0:19 
A couple of sugestions:

1) You are still using an array of bools => use the BitArray class
2)
Zerodagreez wrote:
for (Int64 l = 0; l <= newInt; l++)
{
if (newBool[l] == true)
{
listPrimes.Items.Add(l);
listPrimes.Refresh();
}
}

}


If the number inputed by the user is large the code above will cause a lot of flickering.
use
listPrimes.BeginUpdate()
for (Int64 l = 0; l <= newInt; l++)
{
if (newBool[l] == true)
{
listPrimes.Items.Add(l);
}
}
listPrimes.EndUpdate();

3) Even better than at point 2 you could add it to the list as soon as found.
   Put the job/workload in a background worker or separate thread, and from that thread as soon as you find a number that is prime add it to the list

GeneralRe: Int64 Array overloading problems Pin
Zerodagreez31-Jan-10 0:26
Zerodagreez31-Jan-10 0:26 
GeneralRe: Int64 Array overloading problems Pin
Dan Mos31-Jan-10 1:11
Dan Mos31-Jan-10 1:11 
GeneralRe: Int64 Array overloading problems Pin
OriginalGriff31-Jan-10 1:12
mveOriginalGriff31-Jan-10 1:12 
GeneralRe: Int64 Array overloading problems Pin
Zerodagreez31-Jan-10 7:52
Zerodagreez31-Jan-10 7:52 
AnswerRe: Int64 Array overloading problems Pin
#realJSOP31-Jan-10 0:07
mve#realJSOP31-Jan-10 0:07 
GeneralMessage Removed Pin
31-Jan-10 0:17
Zerodagreez31-Jan-10 0:17 
GeneralRe: Int64 Array overloading problems Pin
#realJSOP31-Jan-10 0:46
mve#realJSOP31-Jan-10 0:46 
GeneralMessage Removed Pin
31-Jan-10 7:48
Zerodagreez31-Jan-10 7:48 
GeneralRe: Int64 Array overloading problems Pin
PIEBALDconsult31-Jan-10 8:31
mvePIEBALDconsult31-Jan-10 8:31 
GeneralRe: Int64 Array overloading problems Pin
#realJSOP31-Jan-10 9:03
mve#realJSOP31-Jan-10 9:03 
GeneralRe: Int64 Array overloading problems Pin
Zerodagreez1-Feb-10 3:53
Zerodagreez1-Feb-10 3:53 
GeneralRe: Int64 Array overloading problems Pin
Zerodagreez1-Feb-10 14:46
Zerodagreez1-Feb-10 14:46 
AnswerRe: Int64 Array overloading problems Pin
PIEBALDconsult31-Jan-10 8:49
mvePIEBALDconsult31-Jan-10 8:49 
Questionchange Items selected in a listbox in runtime Pin
googoojkhan30-Jan-10 19:29
googoojkhan30-Jan-10 19:29 
AnswerRe: change Items selected in a listbox in runtime Pin
Dan Mos30-Jan-10 20:08
Dan Mos30-Jan-10 20:08 
GeneralRe: change Items selected in a listbox in runtime Pin
Luc Pattyn31-Jan-10 1:47
sitebuilderLuc Pattyn31-Jan-10 1:47 
GeneralRe: change Items selected in a listbox in runtime Pin
Dan Mos31-Jan-10 2:20
Dan Mos31-Jan-10 2:20 

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.