Last week pretty much just sucked. I was tired and life was busy, and it wasn't fun at all. This week is much better despite the two tests I have in the next two days and the paper I have to present on Friday. Bring it on Data Structs! You too, Database! (Actually I am kind of fearing the database test, one of its main points is embedded SQL - not my strong point.)
So last night I was doing my Assembler homework which included a problem where I had to write a program that checked if a number between 0 and approximately 4.5 billion was prime. I did that, but it made me curious... is there a better way to do this? Of course there is. My program immediately disregarded even numbers, then tried to divide by each odd number less than the square root of the test number, looking for a remainder of zero. If it did not find one, then we're finished, get out, it's prime. But why divide by all those odd numbers when only a few of them are prime? So I pulled out my C++ skills and wrote a measly 20 lines of code, which aimed to generate a file that held all primes that would fit in a 32-bit register. The program proceded to check a number, and if it were prime, then write it to a file. The program would use the numbers in this file to check the new numbers. (Given 2 is prime, the file started with a 2 in it.) I did not take into consideration the amount of time it takes to write to disk in my equation. So I broke the program (you may know it better as hitting the 'X') and checked my file. It only got up to primes around 65 million. So I started a program that only wrote to the file and never read from it, using the old odd numbered algorithm. I started it at 9:30 this morning, and it is still running. I don't even know how far it is because I forgot to program a cout into the code, and I can't open the file because it's in use. Hopefully it's close to being done. This afternoon, Kent Jones told me that I should write it to a .bin file. Apparently it will read and write a lot faster than the .txt I'm using. Next time I'll take that into consideration.
Well, I guess I'll get back to work now. I actually have work now.