Archive - May 10, 2007

Date

If anyone need the 2000*2000 prime spiral, download it here

in

I used 1 hour 26 minute and 48 seconds to generate this image, and I haven't find anyone online made one this big yet. If anyone found this useful, just download though the attachment.

UPDATE: Also include a 5000*5000 prime spiral created in 78.825353 seconds with my small optimization that make it 650 times faster.

Notes for May 10

in

At Dinner Table...
Chao: I have a great idea
(Silence)
Chao: I have a great idea
(Silence)
Chao: I have a great idea
(Sound of food chewing)
Chao: I have a great idea
Dad: shut up and eat your food!
Chao: I'm so glad I have a very supportive family.

I'm going to work very very hard to get into Harvard...
...and drop out
...to piss my parent off and increase my blog view...well the blog view is more important...

Ms. Tex. giving us muffins after hurting our feelings:
"You should be embarrassed about your test result."
"Even cave man can do better."
"You guys are going to work at KFC until you are 40"
"Then, you all become homeless"
It's important for you to know that I made the last 3 up for dramatic effect. But I wish she hurt us more so we might get pizza.

Budding Sexually

Simple file shredder in PHP

File shredding is used to destroy the data written on the disk. Usually rewrite the data once is enough to destroy the data, but for extreme measure, use super strong magnetic field.
The function I wrote below WORKS ONLY IF new data is written directly on top of the original file. This will be determined by your file system, and I don't know which file system works, but I know that NFS or Journaling file systems does not work.

function shred($filename,$strength=1,$fast=null){
	$size = filesize($filename);
 
	while($i < $strength){
		$fh = fopen($filename,'w');
		if($fast){
		$str = chr(rand(0,255));
			$str = str_repeat($str,$size);
		}else{
			$str = md5(rand(0,2147483647));
			$n = 32;
			while($n<$size){
				$str .= md5($str);
				$n+=32;
			}
		}
 
		fwrite($fh,substr($str,0,$size));
		fclose($fh);
		++$i;
	}
	return true;
}

The Universal History of Computing

Numbers... compute with numbers...
Interesting topic...
1st history book I'm reading in a year.

And yet, it's boring, like all history books. But the content is good, and the paper quality is great for start fires.

Recommend to anyone who have time to spare.

Status: 
Already Read
Rating: 
Excellent

The large, the small and the human mind

Who would know the mind of Roger Penrose can be this fascinating. He successfully abstracted everything into 3 different worlds--Platonic world1, mental world and the physical world we live in--and made a close connection between each one of them.
I would recommend this book to anyone who is interested in physics, philosophy or just some mind-opening knowledge.

  1. 1. Mathematical world
Status: 
Already Read
Rating: 
Excellent
Honey Pot that kill bots