Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating databases programmatically Pin
Jacob Dixon26-Jan-08 12:23
Jacob Dixon26-Jan-08 12:23 
GeneralRe: Creating databases programmatically Pin
Paul Conrad26-Jan-08 12:24
professionalPaul Conrad26-Jan-08 12:24 
GeneralRe: Creating databases programmatically Pin
Sourie27-Jan-08 23:39
Sourie27-Jan-08 23:39 
GeneralI need help with prime numbers. Pin
Alex50126-Jan-08 11:03
Alex50126-Jan-08 11:03 
GeneralRe: I need help with prime numbers. Pin
Paul Conrad26-Jan-08 12:10
professionalPaul Conrad26-Jan-08 12:10 
GeneralRe: I need help with prime numbers. Pin
DaveyM6926-Jan-08 12:51
professionalDaveyM6926-Jan-08 12:51 
GeneralRe: I need help with prime numbers. Pin
Paul Conrad26-Jan-08 13:12
professionalPaul Conrad26-Jan-08 13:12 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 14:51
sitebuilderLuc Pattyn26-Jan-08 14:51 
yep.

a major performance improvement can be obtained by replacing
for (int i = 2; i < num; i++) by

if (num==2) return true;
for (int i = 3; i*i <= num; i+=2)


i.e. only test odd dividers less/equal the square root of num.


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: I need help with prime numbers. Pin
Alex50126-Jan-08 18:05
Alex50126-Jan-08 18:05 
GeneralRe: I need help with prime numbers. Pin
GuyThiebaut26-Jan-08 13:18
professionalGuyThiebaut26-Jan-08 13:18 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 14:52
sitebuilderLuc Pattyn26-Jan-08 14:52 
GeneralRe: I need help with prime numbers. Pin
GuyThiebaut26-Jan-08 22:52
professionalGuyThiebaut26-Jan-08 22:52 
GeneralRe: I need help with prime numbers. Pin
Alex50126-Jan-08 18:13
Alex50126-Jan-08 18:13 
GeneralRe: I need help with prime numbers. Pin
PIEBALDconsult26-Jan-08 15:57
mvePIEBALDconsult26-Jan-08 15:57 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 16:18
sitebuilderLuc Pattyn26-Jan-08 16:18 
GeneralIC Programmer with C#. Pin
hdv21226-Jan-08 8:20
hdv21226-Jan-08 8:20 
GeneralRe: IC Programmer with C#. Pin
DaveyM6926-Jan-08 8:37
professionalDaveyM6926-Jan-08 8:37 
GeneralRe: IC Programmer with C#. Pin
Spacix One26-Jan-08 9:19
Spacix One26-Jan-08 9:19 
GeneralRe: IC Programmer with C#. Pin
hdv21226-Jan-08 11:02
hdv21226-Jan-08 11:02 
Questioncreating logger based on threads and queue Pin
kriskris26-Jan-08 3:43
kriskris26-Jan-08 3:43 
GeneralRe: creating logger based on threads and queue Pin
Paul Conrad26-Jan-08 5:42
professionalPaul Conrad26-Jan-08 5:42 
GeneralRe: creating logger based on threads and queue Pin
Adeel Chaudhry26-Jan-08 6:29
Adeel Chaudhry26-Jan-08 6:29 
GeneralAppDomain with non domain-neutral assemblies Pin
Softbal26-Jan-08 3:25
Softbal26-Jan-08 3:25 
GeneralBrowser Help Object BeforNavigate problem Pin
sepel25-Jan-08 23:30
sepel25-Jan-08 23:30 
GeneralWindows right click menu... Pin
anderslundsgard25-Jan-08 23:04
anderslundsgard25-Jan-08 23:04 

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.