Click here to Skip to main content
16,012,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HELP: source code of TIFF viewer, thanks Pin
John M. Drescher18-Jun-03 8:00
John M. Drescher18-Jun-03 8:00 
GeneralHELP: source code of TIFF viewer Pin
Anonymous18-Jun-03 5:48
Anonymous18-Jun-03 5:48 
GeneralAuto-Hide Views Pin
Mark Donkers18-Jun-03 5:29
Mark Donkers18-Jun-03 5:29 
GeneralRe: Auto-Hide Views Pin
nfactorial18-Jun-03 6:46
nfactorial18-Jun-03 6:46 
GeneralImplementing a Fisher-Yates Algorithm in C++ Pin
John Aldrich18-Jun-03 5:07
John Aldrich18-Jun-03 5:07 
GeneralRe: Implementing a Fisher-Yates Algorithm in C++ Pin
AlexO18-Jun-03 5:33
AlexO18-Jun-03 5:33 
GeneralRe: Implementing a Fisher-Yates Algorithm in C++ Pin
Ryan Binns18-Jun-03 15:19
Ryan Binns18-Jun-03 15:19 
GeneralRe: Implementing a Fisher-Yates Algorithm in C++ Pin
Ryan Binns18-Jun-03 15:24
Ryan Binns18-Jun-03 15:24 
Very similar to Alex's reply above, except the rand() % i
should be rand() % (i+1):
template <class T>
inline void fisher_yates_shuffle(T* array, int size)
{
   srand(static_cast<unsigned int>(time(0)));
   for(int i=size-1; i>-1; --i)
   {
      int j = rand() % (i + 1);
      if(i != j)
      {
         T temp = array[i];
         array[i] = array[j];
         array[j] = temp;
      }
   }
}


Ryan

Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)

Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

QuestionLBS_OWNERDRAWFIXED error? Pin
Jim D18-Jun-03 4:59
Jim D18-Jun-03 4:59 
AnswerRe: LBS_OWNERDRAWFIXED error? Pin
Maximilien18-Jun-03 5:07
Maximilien18-Jun-03 5:07 
GeneralRe: LBS_OWNERDRAWFIXED error? Pin
Jim D18-Jun-03 7:49
Jim D18-Jun-03 7:49 
GeneralUNC Pin
RChin18-Jun-03 4:53
RChin18-Jun-03 4:53 
GeneralModeless Property Sheet Pin
Jay Hova18-Jun-03 4:49
Jay Hova18-Jun-03 4:49 
GeneralRe: Modeless Property Sheet Pin
Joan M18-Jun-03 5:18
professionalJoan M18-Jun-03 5:18 
GeneralRe: Modeless Property Sheet Pin
Jay Hova18-Jun-03 8:16
Jay Hova18-Jun-03 8:16 
GeneralRe: Modeless Property Sheet Pin
Ryan Binns18-Jun-03 15:26
Ryan Binns18-Jun-03 15:26 
GeneralRe: Modeless Property Sheet Pin
Jay Hova19-Jun-03 1:39
Jay Hova19-Jun-03 1:39 
GeneralRe: Modeless Property Sheet Pin
Ryan Binns19-Jun-03 1:51
Ryan Binns19-Jun-03 1:51 
Generaldesign question Pin
monrobot1318-Jun-03 3:36
monrobot1318-Jun-03 3:36 
GeneralRe: design question Pin
valikac18-Jun-03 6:54
valikac18-Jun-03 6:54 
GeneralSerial communication problem Pin
justin22318-Jun-03 2:31
justin22318-Jun-03 2:31 
GeneralRe: Serial communication problem Pin
justin22318-Jun-03 3:17
justin22318-Jun-03 3:17 
GeneralRe: Serial communication problem Pin
justin22318-Jun-03 3:41
justin22318-Jun-03 3:41 
GeneralRe: Serial communication problem Pin
justin22318-Jun-03 4:01
justin22318-Jun-03 4:01 
Generalproblem with EnumDisplayDevices(..) Pin
Anonymous18-Jun-03 2:03
Anonymous18-Jun-03 2:03 

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.