The collected works of uunix - Page 12

Well, I have some details on my machine..
CPU[s] PPC970MP 2.3GHz - Is this dual CPU?
Memory 2GB
Display NVidia GeForce 6600
No Disks shown, yet disk 1 is SSD and 2 is SATA
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
ivelagacy.. NO FSCKING LINUX!!!!!
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
toasty wrote: I dabbled with linux on my Power Mac G5 when I still had it. And it also did the Apple version of fastfan! I think it's because the G5's fan control system under linux hasn't been perfected yet. It was much quieter when I threw FreeBSD on it though. Congrats on your "new" G5!

Thanks.. I've had it a few months now but it's been sat at work.
Slackware circa 1995 was the only Line-UCK I ever liked.
But it's running right now and is silent, and looks like if your were a man computer, then you'd have sex with this! So I think my manly IBM will probably begat the apple during the night and produce some aIppBleM's

Well, so much to do.. like get the drives recognized.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I see what's missing.. #include <Red.Wine>
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
And today, my beloved o2 went top of the POPS!! Poof.. the sound of the PSU not only left ringing in my ears but also caused 2 other machines to reboot and my neighbours must have though I was letting off belated fireworks for Bonfire Night.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Anyway, trip to the loft and a new PSU and all is well.

Think I may do a fresh install today.

On the plus side, Aston Villa actually didn't lose.. They didn't win, but hey ho.. I'm happy!
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
ClassicHasClass wrote: I've got a MegaST in storage doing nothing I need to do something with.

KICK OFF!!
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
chicaneuk wrote: Should you decide to stick OSX on it, I do have a genuine Apple Leopard install DVD here mate which I'd be happy to loan you.

I do indeed, as I do have some legacy stuff (AJA control software) & that was my plan all along. I actually wanted OSX server & has a copy but it's a grey CD dedicated to a certain machine & in this case it's my Mac Mini server, so no go there.

But if you do have a black OSX cd, I'd certainly borrow it, but there really is no rush on this. Maybe next time I see you. :)
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Oskar45 wrote: This is not meant politically. But what occurred there last night should be shocking for everyone of us. It could happen anytime anywhere again. Oh, what an insane world we live in.

Shocking and awful chap. To this day I only understand the motive as != Muslim = Death ? Am I wrong and ignorant of what this is all about?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Instead of blowing against the wind, I changed my super lotto program to work on IRIX, AIX & Windows using ostringstream to convert the INTs to Strings.

First off the board was the random seeding issue. which I had implemented wrong in the first place but it did leave me wondering..
Basically the program:
Generates as many random lottery draws of 6 numbers as inputted by the user.
Adds a count of each number drawn.
Calculates the highest drawn 6 & the lowest drawn 6.
At first this was done through a loop which went through the list sequentially, but that proved to be biased towards the end numbers in the loop, so say number 1,4,5,6,7,8,10 had been drawn 100 times, number 1 would always be pushed off the list. To counter this, each number taken from the list index was also a random number, so 10 could be checked first and maybe 1 last.
Each time a random number was obtained, a new seed was created and this was my mistake.
The IRIX, AIX compile would always get stuck finding the last 2 entries in the list index whilst sorting, yet the windows always worked fine, this had me scratching my head with possible timing issues. I had a loop to delay the time for the new seed by 1 second, and yet it was never able to sort the last 2 numbers.
I changed this to produce a single seed at the beginning, all was well and I was able to remove any sleeps, pauses or loops. To speed things up further, I may remove each entry checked from the list and reduce the random number for the list index sorting.

The AIX can produce a 10,000 lotto sample in about 4 mins, as does the windows machine which is an i7 - Quite impressive I thought. The SGI (300MHz Octane2 - 1.5 GB of memory) is still running and has taken half an hour so far.

Below is the code taken from the windows machine because I'm on it right now. It's exactly the same apart from a few headers in and out.
I may do some time trials on my machines and maybe win the lotto in the process.

Code: Select all

#include "stdafx.h"
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <list>
//#include <unistd.h>
#include <ctime>
#include <cstdlib>
#include <algorithm>

int generateRandomNumber()
{
int iReturn = 0;
iReturn = rand() % 59 + 1;
return iReturn;
}
int main()
{
time_t timer;
struct tm y2k = { 0 };
int seconds;
y2k.tm_hour = 0;   y2k.tm_min = 0; y2k.tm_sec = 0;
y2k.tm_year = 100; y2k.tm_mon = 0; y2k.tm_mday = 1;
time(&timer);  /* get current time; same as: timer = time(NULL)  */
seconds = difftime(timer, mktime(&y2k));
seconds = seconds % 10000000;
srand((int)seconds);

using std::cin;
using std::cout;
using std::endl;
using std::getchar;
using std::list;
using std::sort;
using std::string;
using std::stringstream;
string sExit = "n";

int iNumberCount1[60] = {};
int iNumberCount2[60] = {};
int iRandom1=0;
int iRandom2=0;
int iRandom3=0;
int iRandom4=0;
int iRandom5=0;
int iRandom6=0;
int iMainLoopMax = 0;
time_t now = time(0);
char* dt = ctime(&now);
cout << "\tThe local date and time is: " << dt << endl;
list<int> lList;
int iListCount = 1;
cout << endl << endl << "ENTER SAMPLE AMMOUNT (MINIUM 61):";
while (!(cin >> iMainLoopMax))
{
cout << "INCORRECT VALUE";
cin.clear();
}

for (int iMainLoop = 0; iMainLoop < iMainLoopMax; iMainLoop++)
{
int iSkip1 = 0;
int iSkip2 = 0;
int iSkip3 = 0;
int iSkip4 = 0;
int iSkip5 = 0;
int iSkip6 = 0;
cout << "Remaing iterations: " << iMainLoopMax - iMainLoop << endl;
iListCount = 0;
lList.clear();
while (iListCount < 7)
{
do
{
iRandom1 = generateRandomNumber();
if (iRandom1 != iRandom2 &&
iRandom1 != iRandom3 &&
iRandom1 != iRandom4 &&
iRandom1 != iRandom5 &&
iRandom1 != iRandom6)
{
cout << "\t\tDraw Number: " << iRandom1 << endl;
lList.push_front(iRandom1);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip1 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom1 " << endl;
}
} while (iSkip1 == 0);
if (iListCount == 6)
break;
do
{
iRandom2 = generateRandomNumber();
if (iRandom2 != iRandom1 &&
iRandom2 != iRandom3 &&
iRandom2 != iRandom4 &&
iRandom2 != iRandom5 &&
iRandom2 != iRandom6)
{
cout << "\t\tDraw Number: " << iRandom2 << endl;
lList.push_front(iRandom2);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip2 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom2 " << endl;
}
} while (iSkip2 == 0);
if (iListCount == 6)
break;
do
{
iRandom3 = generateRandomNumber();
if (iRandom3 != iRandom1 &&
iRandom3 != iRandom2 &&
iRandom3 != iRandom4 &&
iRandom3 != iRandom5 &&
iRandom3 != iRandom6)
{
cout << "\t\tDraw Number: " << iRandom3 << endl;
lList.push_front(iRandom3);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip3 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom3 " << endl;
}
} while (iSkip3 == 0);
if (iListCount == 6)
break;
do
{
iRandom4 = generateRandomNumber();
if (iRandom4 != iRandom1 &&
iRandom4 != iRandom2 &&
iRandom4 != iRandom3 &&
iRandom4 != iRandom5 &&
iRandom4 != iRandom6)
{
cout << "\t\tDraw Number: " << iRandom4 << endl;
lList.push_front(iRandom4);
lList.sort();
lList.unique();
iListCount = lList.size(); iSkip4 = 1;
iSkip4 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom4 " << endl;
}
} while (iSkip4 == 0);
if (iListCount == 6)
break;
do
{
iRandom5 = generateRandomNumber();
if (iRandom5 != iRandom1 &&
iRandom5 != iRandom2 &&
iRandom5 != iRandom3 &&
iRandom5 != iRandom4 &&
iRandom5 != iRandom6)
{
cout << "\t\tDraw Number: " << iRandom5 << endl;
lList.push_front(iRandom5);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip5 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom5 " << endl;
}
} while (iSkip5 == 0);
if (iListCount == 6)
break;
do
{
iRandom6 = generateRandomNumber();
if (iRandom6 != iRandom1 &&
iRandom6 != iRandom2 &&
iRandom6 != iRandom3 &&
iRandom6 != iRandom4 &&
iRandom6 != iRandom5)
{
iRandom6 = generateRandomNumber();
cout << "\t\tDraw Number: " << iRandom6 << endl;
lList.push_front(iRandom6);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip6 = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom6 " << endl;
}
} while (iSkip6 == 0);
if (iListCount == 6)
break;
cout << "Draw List Count: " << iListCount << endl;
}
cout << "-----------------------------------------" << endl;
lList.unique();
iListCount = lList.size();
for (list<int>::iterator list_iter = lList.begin();
list_iter != lList.end(); list_iter++)
{
cout << "\t\tLotto Number: " << *list_iter << endl;
iNumberCount1[*list_iter]++;
iNumberCount2[*list_iter]++;
}
//I can't recall why this is here FFS!!
for (int iWait = 0; iWait < 999999; iWait++)
{
if (iWait % 100000 == 0)
cout << ".";
}
cout << endl << iListCount << " List Size" << endl;
cout << endl;
}
// End of Part 1 Draw

// Start of Sort
int iNumbersDrawn = 0;
for (int n = 1; n < 60; n++)
{
if (iNumberCount1[n]>0)
{
cout << "  " << n << " Drawn " << iNumberCount1[n] << " times." << std::endl;
iNumbersDrawn = iNumbersDrawn + iNumberCount1[n];
}
}

int iHigh1 = 0;
int iHigh2 = 0;
int iHigh3 = 0;
int iHigh4 = 0;
int iHigh5 = 0;
int iHigh6 = 0;
int iLow1 = iMainLoopMax;
int iLow2 = iMainLoopMax;
int iLow3 = iMainLoopMax;
int iLow4 = iMainLoopMax;
int iLow5 = iMainLoopMax;
int iLow6 = iMainLoopMax;
string sHigh1 = "";
string sHigh2 = "";
string sHigh3 = "";
string sHigh4 = "";
string sHigh5 = "";
string sHigh6 = "";
string sLow1 = "";
string sLow2 = "";
string sLow3 = "";
string sLow4 = "";
string sLow5 = "";
string sLow6 = "";
cout << endl << "CALCULATING HIGH DRAWS" << endl;
for (int n = 1; n < 60; n++)
{
int y = generateRandomNumber();
int iExit = 0;
cout << ".";
if (iNumberCount1[y] != 0)
{
std::ostringstream convert;
convert << y;
if (iNumberCount1[y] >= iHigh1)
{
cout << endl << "INSERTING " << y << " @ Posistion 1" << endl;
iHigh6 = iHigh5;
iHigh5 = iHigh4;
iHigh4 = iHigh3;
iHigh3 = iHigh2;
iHigh2 = iHigh1;
iHigh1 = iNumberCount1[y];
sHigh6 = sHigh5;
sHigh5 = sHigh4;
sHigh4 = sHigh3;
sHigh3 = sHigh2;
sHigh2 = sHigh1;
sHigh1 = convert.str();
iExit = 1;
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh2)
{
cout << endl << "INSERTING " << y << " @ Posistion 2" << endl;
iHigh6 = iHigh5;
iHigh5 = iHigh4;
iHigh4 = iHigh3;
iHigh3 = iHigh2;
iHigh2 = iNumberCount1[y];
sHigh6 = sHigh5;
sHigh5 = sHigh4;
sHigh4 = sHigh3;
sHigh3 = sHigh2;
sHigh2 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh3)
{
cout << endl << "INSERTING " << y << " @ Posistion 3" << endl;
iHigh6 = iHigh5;
iHigh5 = iHigh4;
iHigh4 = iHigh3;
iHigh3 = iNumberCount1[y];
sHigh6 = sHigh5;
sHigh5 = sHigh4;
sHigh4 = sHigh3;
sHigh3 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh4)
{
cout << endl << "INSERTING " << y << " @ Posistion 4" << endl;
iHigh6 = iHigh5;
iHigh5 = iHigh4;
iHigh4 = iNumberCount1[y];
sHigh6 = sHigh5;
sHigh5 = sHigh4;
sHigh4 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh5)
{
cout << endl << "INSERTING " << y << " @ Posistion 5" << endl;
iHigh6 = iHigh5;
iHigh5 = iNumberCount1[y];
sHigh6 = sHigh5;
sHigh5 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh6)
{
cout << endl << "INSERTING " << y << " @ Posistion 6" << endl;
iHigh6 = iNumberCount1[y];
sHigh6 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
cout << endl << y << " NOT INSERTED" << endl;
}
iNumberCount1[y] = 0;
}
else
{
n = n - 1;
}
}
cout << endl << "CALCULATING LOW DRAWS" << endl;
for (int n = 1; n < 60; n++)
{
int y = generateRandomNumber();
int iExit = 0;
cout << ".";
if (iNumberCount2[y] != 0)
{
std::ostringstream convert;
convert << y;
if (iNumberCount2[y] <= iLow1)
{
cout << endl << "INSERTING " << y << " @ Posistion 1" << endl;
iLow6 = iLow5;
iLow5 = iLow4;
iLow4 = iLow3;
iLow3 = iLow2;
iLow2 = iLow1;
iLow1 = iNumberCount2[y];
sLow6 = sLow5;
sLow5 = sLow4;
sLow4 = sLow3;
sLow3 = sLow2;
sLow2 = sLow1;
sLow1 = convert.str();
iExit = 1;
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow2)
{
cout << endl << "INSERTING " << y << " @ Posistion 2" << endl;
iLow6 = iLow5;
iLow5 = iLow4;
iLow4 = iLow3;
iLow3 = iLow2;
iLow2 = iNumberCount2[y];
sLow6 = sLow5;
sLow5 = sLow4;
sLow4 = sLow3;
sLow3 = sLow2;
sLow2 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow3)
{
cout << endl << "INSERTING " << y << " @ Posistion 3" << endl;
iLow6 = iLow5;
iLow5 = iLow4;
iLow4 = iLow3;
iLow3 = iNumberCount2[y];
sLow6 = sLow5;
sLow5 = sLow4;
sLow4 = sLow3;
sLow3 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow4)
{
cout << endl << "INSERTING " << y << " @ Posistion 4" << endl;
iLow6 = iLow5;
iLow5 = iLow4;
iLow4 = iNumberCount2[y];
sLow6 = sLow5;
sLow5 = sLow4;
sLow4 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow5)
{
cout << endl << "INSERTING " << y << " @ Posistion 5" << endl;
iLow6 = iLow5;
iLow5 = iNumberCount2[y];
sLow6 = sLow5;
sLow5 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow6)
{
cout << endl << "INSERTING " << y << " @ Posistion 6" << endl;
iLow6 = iNumberCount2[y];
sLow6 = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
cout << endl << y << " NOT INSERTED" << endl;
}
iNumberCount2[y] = 0;
}
else
{
n = n - 1;
}
}
cout << "\tThese are your recommended HIGH numbers: " << endl
<< "\t" << sHigh1 << " with " << iHigh1 << " draws" << endl
<< "\t" << sHigh2 << " with " << iHigh2 << " draws" << endl
<< "\t" << sHigh3 << " with " << iHigh3 << " draws" << endl
<< "\t" << sHigh4 << " with " << iHigh4 << " draws" << endl
<< "\t" << sHigh5 << " with " << iHigh5 << " draws" << endl
<< "\t" << sHigh6 << " with " << iHigh6 << " draws" << endl;

cout << "\tThese are your recommended LOW numbers: " << endl
<< "\t" << sLow1 << " with " << iLow1 << " draws" << endl
<< "\t" << sLow2 << " with " << iLow2 << " draws" << endl
<< "\t" << sLow3 << " with " << iLow3 << " draws" << endl
<< "\t" << sLow4 << " with " << iLow4 << " draws" << endl
<< "\t" << sLow5 << " with " << iLow5 << " draws" << endl
<< "\t" << sLow6 << " with " << iLow6 << " draws" << endl;
sExit = getchar();
while (sExit != "Q")
{
// Left in for Windows Console
}
return 0;
}
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I tried firing Xcircuit up , it requires tcl version > 8. I have tcl-8.4.11 installed ?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Absolutely correct chap, suppose I was more focused on getting it running than optimizing.

int generaeteRandom though was the left overs of moving 99% to the top of the main and seeding only once, which is why it looks messy.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
4 Minutes down to 25 seconds on Power5, about an hour down to 56 seconds on 300MHz Octane2.. for 10,000 draws after cleaning up code.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Yup, that was implementing all your changes, changing everything to arrays etc.. I'm now running a 1,00000 sample draws. I've added the ability to add the number of draws as an argument so that I can #time ./a.out 1000000

Code: Select all

//If you supply an int above 61 as a command line argument, user input will not be required
//and iMainLoop is the argument supplied. iMainLoop is the number of lotto draws.

#include "stdafx.h"  //Include for Microsoft Systems / Remove for UNIX systems
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <list>
//#include <unistd.h> //Remove for Microsoft Systems / Include for UNIX systems
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <ctime>
#include <cstdlib>
#include <algorithm>

int generateRandomNumber()
{
return rand() % 59 + 1;
}
int main(int argc, char* argv[])
{
// Seed the randomizer with the current machine seconds
time_t timer;
struct tm y2k = { 0 };
int seconds;
y2k.tm_hour = 0;   y2k.tm_min = 0; y2k.tm_sec = 0;
y2k.tm_year = 100; y2k.tm_mon = 0; y2k.tm_mday = 1;
time(&timer);  /* get current time; same as: timer = time(NULL)  */
seconds = difftime(timer, mktime(&y2k));
seconds = seconds % 10000000;
srand((int)seconds);


using std::cin;
using std::cout;
using std::endl;
using std::getchar;
using std::list;
using std::sort;
using std::string;
using std::stringstream;
string sExit = "n";

int iNumberCount1[60] = {};
int iNumberCount2[60] = {};
int iRandom[6] = { 0 };
int iMainLoopMax = 0;
time_t now = time(0);
char* dt = ctime(&now);
cout << "\tThe local date and time is: " << dt << endl;
list<int> lList;
int iListCount = 1;

// Check if an argument is supplied. If it is, is it valid?
// If any doubt, set the default run to 1000.
if (argv[1] != NULL)
{
if (!(atoi(argv[1]) >> iMainLoopMax))
{
cout << endl << endl << "INCORRECT ARGUMENT - USING DEFAULT 100";
iMainLoopMax = 1000;
}
else
{
iMainLoopMax = atoi(argv[1]);
}
}
else
{
cout << endl << endl << "ENTER SAMPLE AMMOUNT (MINIUM 61):";
while (!(cin >> iMainLoopMax))
{
cout << "INCORRECT VALUE";
cin.clear();
}
}
cout << endl << "ITERATIONS: " << iMainLoopMax << endl;

// Start running the 6 ball lotto draws.
for (int iMainLoop = 0; iMainLoop < iMainLoopMax; iMainLoop++)
{
int iSkip[6] = { 0 };
cout << "Remaing iterations: " << iMainLoopMax - iMainLoop << endl;
iListCount = 0;
lList.clear();
bool theSame = false;
while (iListCount < 6)
{
for (int i = 0; i<7; i++)
{
do
{
iRandom[i] = generateRandomNumber();
theSame = false;
for (int j = 0; j<7; j++)
{
if (i == j)
continue;
if (iRandom[i] == iRandom[j])
theSame = true;
}

if (!theSame)
{
cout << "\t\tDraw Number: " << iRandom[i] << endl;
lList.push_front(iRandom[i]);
lList.sort();
lList.unique();
iListCount = lList.size();
iSkip[i] = 1;
cout << "List Count: " << iListCount << endl <<
" iRandom[" << i << "] " << endl;
}
} while (iSkip[i] == 0);
if (iListCount == 6)
break;
}
cout << "Draw List Count: " << iListCount << endl;
}
cout << "-----------------------------------------" << endl;
lList.unique();
iListCount = lList.size();
//Copy the list to another list because later on, we will destroy the lists when sorting high draws and low draws.
for (list<int>::iterator list_iter = lList.begin();
list_iter != lList.end(); list_iter++)
{
cout << "\t\tLotto Number: " << *list_iter << endl;
iNumberCount1[*list_iter]++;
iNumberCount2[*list_iter]++;
}
cout << endl << iListCount << " List Size" << endl;
cout << endl;
}
// End of Part 1 Draw

// Start of Sort
int iNumbersDrawn = 0;
// Display each number with the amount it has been drawn.
for (int n = 1; n < 60; n++)
{
if (iNumberCount1[n]>0)
{
cout << "  " << n << " Drawn " << iNumberCount1[n] << " times." << std::endl;
iNumbersDrawn = iNumbersDrawn + iNumberCount1[n];
}
}
int iHigh[6] = { 0 };
int iLow[6] = { iMainLoopMax };
string sHigh[6] = { "" };
string sLow[6] = { "" };
cout << endl << "CALCULATING HIGH DRAWS" << endl;
for (int n = 1; n < 60; n++)
{
int y = generateRandomNumber();
int iExit = 0;
cout << ".";
if (iNumberCount1[y] != 0)
{
std::ostringstream convert;
convert << y;
if (iNumberCount1[y] >= iHigh[0])
{
cout << endl << "INSERTING " << y << " @ Posistion 1" << endl;
for (int i = 5; i > 0; i=i-1)
{
iHigh[i] = iHigh[i - 1];
}
iHigh[0] = iNumberCount1[y];
for (int i = 5; i > 0; i=i-1)
{
sHigh[i] = sHigh[i - 1];
}
sHigh[0] = convert.str();
iExit = 1;
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh[1])
{
cout << endl << "INSERTING " << y << " @ Posistion 2" << endl;
for (int i = 5; i > 1; i=i-1)
{
iHigh[i] = iHigh[i - 1];
}
iHigh[1] = iNumberCount1[y];
for (int i = 5; i > 1; i = i - 1)
{
sHigh[i] = sHigh[i - 1];
}
sHigh[1] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh[2])
{
cout << endl << "INSERTING " << y << " @ Posistion 3" << endl;
for (int i = 5; i > 2; i = i - 1)
{
iHigh[i] = iHigh[i - 1];
}
iHigh[2] = iNumberCount1[y];
for (int i = 5; i > 2; i = i - 1)
{
sHigh[i] = sHigh[i - 1];
}
sHigh[2] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh[3])
{
cout << endl << "INSERTING " << y << " @ Posistion 4" << endl;
for (int i = 5; i > 3; i = i - 1)
{
iHigh[i] = iHigh[i - 1];
}
iHigh[3] = iNumberCount1[y];
for (int i = 5; i > 3; i = i - 1)
{
sHigh[i] = sHigh[i - 1];
}
sHigh[3] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh[4])
{
cout << endl << "INSERTING " << y << " @ Posistion 5" << endl;
for (int i = 5; i > 4; i = i - 1)
{
iHigh[i] = iHigh[i - 1];
}
iHigh[4] = iNumberCount1[y];
for (int i = 5; i > 4; i = i - 1)
{
sHigh[i] = sHigh[i - 1];
}
sHigh[4] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount1[y] >= iHigh[5])
{
cout << endl << "INSERTING " << y << " @ Posistion 6" << endl;
iHigh[5] = iNumberCount1[y];
sHigh[5] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
cout << endl << y << " NOT INSERTED" << endl;
}
iNumberCount1[y] = 0;
}
else
{
n = n - 1;
}
}
cout << endl << "CALCULATING LOW DRAWS" << endl;
for (int n = 1; n < 60; n++)
{
int y = generateRandomNumber();
int iExit = 0;
cout << ".";
if (iNumberCount2[y] != 0)
{
std::ostringstream convert;
convert << y;
if (iNumberCount2[y] <= iLow[0])
{
cout << endl << "INSERTING " << y << " @ Posistion 1" << endl;
for (int i = 5; i > 0; i = i - 1)
{
iLow[i] = iLow[i - 1];
}
iLow[0] = iNumberCount2[y];
for (int i = 5; i > 0; i = i - 1)
{
sLow[i] = sLow[i - 1];
}
sLow[0] = convert.str();
iExit = 1;
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow[1])
{
cout << endl << "INSERTING " << y << " @ Posistion 2" << endl;
for (int i = 5; i > 1; i = i - 1)
{
iLow[i] = iLow[i - 1];
}
iLow[1] = iNumberCount2[y];
for (int i = 5; i > 1; i = i - 1)
{
sLow[i] = sLow[i - 1];
}
sLow[1] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow[2])
{
cout << endl << "INSERTING " << y << " @ Posistion 3" << endl;
for (int i = 5; i > 2; i = i - 1)
{
iLow[i] = iLow[i - 1];
}
iLow[2] = iNumberCount2[y];
for (int i = 5; i > 2; i = i - 1)
{
sLow[i] = sLow[i - 1];
}
sLow[2] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow[3])
{
cout << endl << "INSERTING " << y << " @ Posistion 4" << endl;
for (int i = 5; i > 3; i = i - 1)
{
iLow[i] = iLow[i - 1];
}
iLow[3] = iNumberCount2[y];
for (int i = 5; i > 3; i = i - 1)
{
sLow[i] = sLow[i - 1];
}
sLow[3] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow[4])
{
cout << endl << "INSERTING " << y << " @ Posistion 5" << endl;
for (int i = 5; i > 4; i = i - 1)
{
iLow[i] = iLow[i - 1];
}
iLow[4] = iNumberCount2[y];
for (int i = 5; i > 4; i = i - 1)
{
sLow[i] = sLow[i - 1];
}
sLow[4] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
if (iNumberCount2[y] <= iLow[5])
{
cout << endl << "INSERTING " << y << " @ Posistion 6" << endl;
iLow[5] = iNumberCount2[y];
sLow[5] = convert.str();
iExit = 1;
}
}
if (iExit == 0)
{
cout << endl << y << " NOT INSERTED" << endl;
}
iNumberCount2[y] = 0;
}
else
{
n = n - 1;
}
}
cout << "\tThese are your recommended HIGH numbers: " << endl;
for (int i = 0; i < 6; i++)
{
cout << "\t" << sHigh[i] << " with " << iHigh[i] << " draws" << endl;
}
cout << "\tThese are your recommended LOW numbers: " << endl;
for (int i = 0; i < 6; i++)
{
cout << "\t" << sLow[i] << " with " << iLow[i] << " draws" << endl;
}
sExit = getchar();
return 0;
}

IBM returned 1,000,000 in 40Minutes 53Seconds.
Octane returned 1,000,000 in 1Hour 45Minutes 37Seconds

ALAS.. the improvement wasn't as much, but still worth it.. I found a delay loop still in the old program.
The memory taken up are both very similar before 3744k after 3760k
Pre clean-up 10,000 1Minute 27Seconds
Post clean up 10,000 1Minute 19seconds

Must not forget that, it's a random program, so whatever algorithm, one could still take longer than the other.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
foetz wrote: if you wanna beef it up more you could replace the iostreams with c stuff and use static inline for generateRandomNumber()

NICE!
Shaved off 18 seconds !! :D
Inline 10,000 1Minute 1Second

Also thinking I may remove the copy of lists for high and low and NOT setting them to zero when sorted, but this may mean more hit attempts?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
vishnu wrote: But if you do an image search for "yuriko tiger" there's not a single pic of her wearing anything even remotely approaching tiger stipes... :?: :?: :?:

What if you google 'ivelagcy's lady ga ga' ?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
When my Sunblade2000 was in action, I had a SunPCi[3 or 4] and I had it driving it's own monitor & keyboard/mouse and it was very cool. So if I was to do this, I'd make sure I had an empty slot in the octane and have external VGA KB/Mouse/USB, in fact, if you didn't have a PC cage you could use the blanking plate.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I have tried it chap, in fact it was you who pointed it in out to me.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Anyone use ThinStuff and connect via RDESKTOP? (Off topic again... )
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
FORTRAN = Phillips G700 Programming Cartridge 37 9 ?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Just run a 10000 test on my super fast Octane2.. 21 Seconds.. beating the IBM by 4 seconds
Octane2 300MHz 1.5GB RAM Single CPU 1 Min 5 Seconds
Octane2 600MHz 4GB RAM Dual CPU 21 Seconds
IBM 285 Power5 2GHz 1GB RAM Single CPU 25 Seconds

Now running a Million draws on each. (again tests are random and not like for like)
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
What was the original topic again ? :oops:
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
dexter1 wrote:
uunix wrote: FORTRAN = Phillips G700 Programming Cartridge 37 9 ?

Oh, you mean this piece of trash? :
Image

I'm afraid it included only BASIC and Z80 machine code, no Fortran alas. Plus you had to be a buddhist Monk for the oodles of patience it required to program anything.

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!! Yes!! Trash???????????? :cry:
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
A moral question...

A friend asks you to re-do his PeeCee.. but save pics & vids..
So you do a back up etc and a restore etc.. all OK.. even though your so called friend never bothered to pay you.. hey ho about that..

BUT!! In the collection of pics and videos, you find a video of his missis getting naked in a toilet cubical with a female friend of hers Etcetera.. E T C E T E R A !!!!! Say no more..

Moralist question is.. would you put it on youporn.com?

And lets say your name was John..
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Indeed..
I'd like to test if it utilizing both CPUs by restricting it to a single CPU, If I Recall Incorrectly.. what is the command runonone ? Am I thinking of a smoke/jaleo command?
It does use both CPUs we can see from top. Further testing with a new machine introduced:

Octane 2 - 2x600MHZ - 3584MB Ram -- 10,000 Draws - 21s
IBM Power5 2GHZ - 1GB Ram -- 10,000 Draws - 24s
Octane 2 - 1x300MHZ - 1536MB Ram -- 10,000 Draws - 1m 03s
Octane 1 - 2x195 MHZ - 768MB Ram -- 10,000 Draws - 1m 31s
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
foetz wrote: "runon" is what you're looking for

Cheers Foetz, running on an individual brings the time to match the IBM 25 Seconds 10,000.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I can confirm that 4.2.10 on my system produces the ^C, not much help with your problem, but I suppose at least we know that version SHOULD work?

Any chance it's your environment, keyboard etc etc?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I really must get some lighting in my room!

Progress is being made with smoke and vbob and my mega-goliath video production centre.
First pic shows obtaining source from a 1980 UNIX system 4 Conference. All screen in sync.

Second shows recorded clip in playback mode. Video still playing on the 2 Sony CRTs


Next stage is the dogs on the beach in Cornwall video from 7 years ago..

IT JUST LOOKS DAMN COOL!! Although not as a cool as it would with a FUEL next to the Octane.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Yes. It's very noisy. I think though putting anything in the lower cage will cause the fans to replicate a Harrier Jump Jet.

Saying all that, it's a noise level that is acceptable (just) unlike a 1u rack server.

BTW, good luck running that combination of monitors..
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
yetanother**ixuser wrote: here she is...


Someone needs to add to this so it stays on the first page.. just so I can see that pic each day!
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Where is linux-blunderland? Surly world wide?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Nice pose :D
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
That does look nice.. but also very noisy.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
It's been awfully quiet here the last few days? Has everyone gone elsewhere? Was hamei more than 1 person? Is it because Christmas is around the corner?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
[flash=][/flash]
ivelegacy wrote: so, no xmass-news for me :D ?

Do you deserve one?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I have a software library sealed, part number 013-2478-012 REV A
I don't want to break the seal unless it's something I need. Does anyone have any info on this?

Cheers
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Cheers chaps, yes I was getting close to suspecting it was around that. No need to open it then.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
I had a disk go on mine also and the floppy does cause issues when it's attached. My battery had been fixed with a CR2302, but required a redesigned hairclip to enhance the connections.

The problem with mine is that the mouse goes haywire randomly. Not after a certain time or activity or anything etc.. It may work ok on boot up.. then again it may not, it may work after 10 mins, then again it may fail after 10 mins.. Anyway, it's in the loft for a later day.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
So you want us to help you obtain government military software & data do you? hmmm.. I see nooo problem whatsoever in this.. have you actually just asked the government for it? Directly?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo:
Brilliant.. at long last (I feel quite connected to this machine now).. I also agree regarding Ian, hopefully he's blushing like a tomato.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
MyDungeon() << :Fuel: :Octane2: :Octane2: :Octane2: :Octane: :Indy: MyLoft() << :540: :Octane: MyWork() << :Indy: :Indy: :O2: :O2: :O2: :Indigo: :Indigo: