Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Logging stopped after CFileDialog::DoModal() invoking Pin
David Crow20-Dec-08 6:33
David Crow20-Dec-08 6:33 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Jijo.Raj20-Dec-08 8:42
Jijo.Raj20-Dec-08 8:42 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Igor IP21-Dec-08 21:25
professionalIgor IP21-Dec-08 21:25 
Questionrandom number generation Pin
mathy20-Dec-08 2:13
mathy20-Dec-08 2:13 
AnswerRe: random number generation Pin
Jijo.Raj20-Dec-08 2:20
Jijo.Raj20-Dec-08 2:20 
AnswerRe: random number generation Pin
David Crow20-Dec-08 6:34
David Crow20-Dec-08 6:34 
GeneralRe: random number generation Pin
Luc Pattyn20-Dec-08 7:04
sitebuilderLuc Pattyn20-Dec-08 7:04 
AnswerRe: random number generation Pin
CPallini20-Dec-08 7:54
mveCPallini20-Dec-08 7:54 
The following recipe correnspond to the (pseudo) extraction of numbers from a bag:
<ol>
<li>Create an array containig all the candidate numbers, for instance <code>int value[]={1,2,3,4,5,6,7,8,9,10};</code>,
 initialize a variable that will keep  track of the sequence length, for instance <code>len=10;</code></li>
<li>make an loop for how many numbers you wish to extract, at each cycle</li><ol>
  <li>select an index number via <code>index = (int)( (double)rand() * len / RAND_MAX);</code></li>
  <li>keep the number corrensponding to the index, for instance <code>num = value[index];</code> that is you extracted one.</li>
  <li>swap the index selected with the one at the (the current) bottom of the array, i.e. <code>swap(value[index], value[len-1]);</code></li>
  <li>decrement <code>len</code>;</li>
</ol>
</ol>

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: random number generation Pin
Michael Schubert20-Dec-08 13:06
Michael Schubert20-Dec-08 13:06 
QuestionProblem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.19-Dec-08 23:52
Shameer E.A.19-Dec-08 23:52 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Code-o-mat20-Dec-08 0:08
Code-o-mat20-Dec-08 0:08 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Stuart Dootson20-Dec-08 1:21
professionalStuart Dootson20-Dec-08 1:21 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.20-Dec-08 18:39
Shameer E.A.20-Dec-08 18:39 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Randor 20-Dec-08 18:54
professional Randor 20-Dec-08 18:54 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.20-Dec-08 19:17
Shameer E.A.20-Dec-08 19:17 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Randor 20-Dec-08 7:46
professional Randor 20-Dec-08 7:46 
QuestionLooking for an ADT that can sort by view (so to speak) [modified] Pin
Mustafa Ismail Mustafa19-Dec-08 20:35
Mustafa Ismail Mustafa19-Dec-08 20:35 
AnswerRe: Looking for an ADT that can sort by view (so to speak) Pin
Stuart Dootson20-Dec-08 1:00
professionalStuart Dootson20-Dec-08 1:00 
GeneralRe: Looking for an ADT that can sort by view (so to speak) Pin
Mustafa Ismail Mustafa20-Dec-08 1:21
Mustafa Ismail Mustafa20-Dec-08 1:21 
QuestionHow can change CRect Value? Pin
Le@rner19-Dec-08 20:30
Le@rner19-Dec-08 20:30 
AnswerRe: How can change CRect Value? Pin
Hamid_RT19-Dec-08 20:45
Hamid_RT19-Dec-08 20:45 
GeneralRe: How can change CRect Value? Pin
Le@rner19-Dec-08 21:04
Le@rner19-Dec-08 21:04 
GeneralRe: How can change CRect Value? Pin
Code-o-mat19-Dec-08 21:55
Code-o-mat19-Dec-08 21:55 
GeneralRe: How can change CRect Value? Pin
Le@rner19-Dec-08 23:21
Le@rner19-Dec-08 23:21 
GeneralRe: How can change CRect Value? Pin
Code-o-mat19-Dec-08 23:26
Code-o-mat19-Dec-08 23:26 

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.