April 2008 Archives
This is a simple perl script that checks if the passed in input data is binary or not by checking if, within the first 8k the number of non-ascii characters exceeds the number of non-ascii characters by a factor of 2. It's fundamental in that it doesn't check for unicode files, so is probably broken in that case.
#!/usr/bin/perl -w
use strict;
my $buffer;
my $nread;
$nread = sysread(STDIN, $buffer, 8192);
my $nchars = 0;
my $nbinchars = 0;
foreach (split(/ */, $buffer)) {
my $value = ord;
if ($value < 32 || $value >= 127) {
$nbinchars++;
} else {
$nchars++;
}
}
exit ($nbinchars * 2 > $nchars);
I like the general way of installing applications on the apple. Drag program into Applications folder, and you're done!
The only problem comes in when you actually have to use installers, as they want to put things in various locations in system-protected locations. 9 times out of 10 they don't come with an uninstaller, so removing them can be a bit of a difficult task, especially if they spew themselves everywhere.
Another issue with the mac installers is that they're shell scripts. People keep forgetting that the mac file system hierarchy contains loads of spaces. Don't forget to trap filenames with quote marks "$foo"! It's broken quite a few systems as a result of forgetting this fact.
The only problem comes in when you actually have to use installers, as they want to put things in various locations in system-protected locations. 9 times out of 10 they don't come with an uninstaller, so removing them can be a bit of a difficult task, especially if they spew themselves everywhere.
Another issue with the mac installers is that they're shell scripts. People keep forgetting that the mac file system hierarchy contains loads of spaces. Don't forget to trap filenames with quote marks "$foo"! It's broken quite a few systems as a result of forgetting this fact.
One of my co-workers had to say goodbye to his father today. He suffered from Alzheimers, which is probably one of the worst things that anyone can get. To progressively lose all those things that hold us together as an individual is probably one of the worst things that can happen.
My father passed away less than a year ago, but he was as vital, as intelligent and as cogent as he ever was. We never expected him to pass so suddenly. If I had to see him disintegrate in the way that Stephen had, then I don't think I could have taken it.
Make the most of your family while you have them. Even if they're mad, causing problems, or simply cranky, they're your family.
My father passed away less than a year ago, but he was as vital, as intelligent and as cogent as he ever was. We never expected him to pass so suddenly. If I had to see him disintegrate in the way that Stephen had, then I don't think I could have taken it.
Make the most of your family while you have them. Even if they're mad, causing problems, or simply cranky, they're your family.