Send As SMS

Sunday, November 26, 2006

Ack...

I apologize for my tardiness. I think there are no more tests until finals, and thus I will try to post more. If you read this blog you probably already know. But you should ask me a question about what I'm doing next summer if you don't know. I don't think I'll post it because I'll only tell you if you care.

So I get back to Spokane today and my CS Lab is a little jumbled. There's construction happening next door and they moved stuff around in my room... arg. Well Spokane is white for good now, til spring. It should be a fun winter!

Tuesday, November 14, 2006

Week from Hell...

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.

Thursday, November 02, 2006

First snow...

Well, today we got our first snow of the year. It's white. And wet. And slushy. I can no longer ride my longboard. Lame. At least it looks cool, until people walk on it.

-AZ