
Journal Journal: I love perl
perl -F: -ane '$hash{$F[0]}++;} for my $key (keys %hash) { print "$key: $hash{$key}\n"; } {' <file>
At a couple of my old positions, various people of varying levels of education always kept coming up with the hare-brained idea of making XML the defacto format for anything, from internal data files to configuration files. Granted, there is an advantage to this--there are XML parsers either built-in or readily available to just about every programming language in common use nowadays. Not that said people ever thought about using those parsers--they were just on the whole XML bandwagon from reading hypey trade mags.
The author of Thinking in Java, Bruce Eckel, in his article "Simplifying XML Manipulation," wrote the best description of why I personally think that XML is a poor choice for internal data files and just fucking stupid for config files:
My initial strategy for XML was to recognize it for what it is -- a platform independent way to move data from one place to another -- and then, as much as possible, to ignore it and assume that I would only have to actually look at XML when I was debugging something...
Fedex and the Post Office (and UPS apparently also works this way) -- [use] something that's almost XML-RPC, but it's not, and you're expected to assemble your XML by hand and then use HTTP to send it to the server, then unbundle the XML that comes back...
The point being that here's a case where the XML should have been invisible, but you have to mess with it by hand.
C:\>w32tm
/resync
There is no longer a '-once' option to the w32tm program, and you shouldn't need to stop and restart the w32time service for this to take affect.
Looking at the following code:
if ($foo == 1) {
echo "Foo is 1";
}
elseif ($foo == 0) {
echo "Foo is 0";
}
If $foo is not defined (as in the case of, say, an unposted $_POST variable), $foo == 0 evaluates as true.
All null values equal 0 apparently, forcing any specific zero-check to look as follows:
if ($foo == 1) {
echo "Foo is 1";
}
elseif (($foo == 0) && (is_numeric($foo))) {
echo "Foo is 0";
}
Sometimes I hate this language.
count (PHP 3, PHP 4 , PHP 5)
count -- Count elements in a variable
Description
int count ( mixed var [, int mode])Returns the number of elements in var, which is typically an array (since anything else will have one element).
If var is not an array, 1 will be returned (exception: count(NULL) equals 0).
Except, for some reason, count($var) where $var == NULL returns 1.
WTF?
"item" is apparently a reserved word in Internet Explorer's Javascript parser. Go figure.
Because making that assbag of a device work faster and/or better means one less headache a day.
From a usenet post to alt.os.windows2000 by Gerry Kroll:
Error:
"Connection to
....." is not a valid name. The entry name must contain at least one character that is not a space and cannot begin with a period. Choose a different name
Solution:
Your problem is a corrupt RASPHONE.PBK file. It has a false end-of-file character in it. Essentially, the EOF character defines a file size that doesn't match what's recorded in the folder's directory.
Since you're going to re-create the entries anyway, simply search for all occurrences of RASPHONE.PBK and delete them.
Why did the Roman Empire collapse? What is the Latin for office automation?