Click here to Skip to main content
15,889,861 members
Home / Discussions / C#
   

C#

 
GeneralRe: God book on patterns in C# Pin
Jim Stewart26-Aug-03 10:20
Jim Stewart26-Aug-03 10:20 
GeneralCuting out a part of a bitmap Pin
Ylis23-Aug-03 11:45
Ylis23-Aug-03 11:45 
GeneralRe: Cuting out a part of a bitmap Pin
J. Dunlap23-Aug-03 13:47
J. Dunlap23-Aug-03 13:47 
GeneralRe: Cuting out a part of a bitmap Pin
Ista23-Aug-03 19:17
Ista23-Aug-03 19:17 
GeneralRe: Cuting out a part of a bitmap Pin
Ylis24-Aug-03 6:12
Ylis24-Aug-03 6:12 
GeneralEFFICIENCY: lock{} or .Synchronized Pin
MeisterBiber23-Aug-03 11:45
MeisterBiber23-Aug-03 11:45 
GeneralRe: EFFICIENCY: lock{} or .Synchronized Pin
Julian Bucknall [MSFT]25-Aug-03 10:15
Julian Bucknall [MSFT]25-Aug-03 10:15 
General80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 7:01
MeisterBiber23-Aug-03 7:01 
hi !

i have the following problem:

i have -lets say- 3 procedures, which should be called at a given probability:
60 % proc. A
30 % proc. B
10 % proc. C
how can i manage this?

my idea:

r = new Random();
if (r.NextDouble() < 0.6) -> A
if (r.NextDouble() >=0.6 and < 0.9) -> B
if (r.NextDouble() >=0.9 and < 1.0) -> C

in principle this works fine, BUT
is this efficient?
is it exact?
what about the pseudo-random-number-generator in c#?

do you have any suggestions ?!?!?!

THANK YOU !
GeneralRe: 80% call doA() , 20% call doB() Pin
Daniel Turini23-Aug-03 12:10
Daniel Turini23-Aug-03 12:10 
GeneralRe: 80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 13:21
MeisterBiber23-Aug-03 13:21 
GeneralRestricting access to non *.aspx files Pin
Meysam Mahfouzi22-Aug-03 18:16
Meysam Mahfouzi22-Aug-03 18:16 
GeneralRe: Restricting access to non *.aspx files Pin
Mazdak22-Aug-03 19:38
Mazdak22-Aug-03 19:38 
Generalcan't receive KeyPress Event in Window Form Pin
zecodela22-Aug-03 15:22
zecodela22-Aug-03 15:22 
GeneralRe: can't receive KeyPress Event in Window Form Pin
MeisterBiber23-Aug-03 8:38
MeisterBiber23-Aug-03 8:38 
GeneralRe: can't receive KeyPress Event in Window Form Pin
Ista23-Aug-03 15:39
Ista23-Aug-03 15:39 
GeneralRe: can't receive KeyPress Event in Window Form Pin
A.Wegierski24-Aug-03 20:07
A.Wegierski24-Aug-03 20:07 
GeneralRe: can't receive KeyPress Event in Window Form Pin
Ista25-Aug-03 3:22
Ista25-Aug-03 3:22 
GeneralDistribute code in separate files Pin
sumeat22-Aug-03 14:01
sumeat22-Aug-03 14:01 
GeneralRe: Distribute code in separate files Pin
J. Dunlap22-Aug-03 14:13
J. Dunlap22-Aug-03 14:13 
GeneralCaret implementation Pin
Lasse Johansen22-Aug-03 11:03
Lasse Johansen22-Aug-03 11:03 
GeneralRe: Caret implementation Pin
A.Wegierski24-Aug-03 20:23
A.Wegierski24-Aug-03 20:23 
GeneralRe: Caret implementation Pin
Lasse Johansen26-Aug-03 9:50
Lasse Johansen26-Aug-03 9:50 
QuestionHow to change Back Color of ToolBar Pin
sumeat22-Aug-03 9:39
sumeat22-Aug-03 9:39 
GeneralRemote Object in IIS Pin
Mazdak22-Aug-03 7:23
Mazdak22-Aug-03 7:23 
GeneralRe: Remote Object in IIS Pin
Meysam Mahfouzi22-Aug-03 18:06
Meysam Mahfouzi22-Aug-03 18:06 

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.