KBD

Keith Devens .com

Friday, May 16, 2008 Flag waving
"Child," said the Voice, "I am telling you your story, not hers. I tell no one any story but his... – C.S. Lewis (The Horse and His Boy, ch 11)

Archive: June 01, 2002

← May 31, 2002June 02, 2002 →

Daily link icon Saturday, June 1, 2002

What did the Clintons do to our military?

I've heard many times that the Clinton administration was devastating to our military and intelligence agencies. How can I go about finding out the facts for myself? How much was the military budget cut, what bad decisions were made, etc.? I'm not sure where to look.

Even more reason to hate Canada

Via LGF, the National Post: Blood money on tap.

Since the days of Lester B. Pearson, Canadians have liked to think of themselves as international peacekeepers, the heroes in the blue berets. In Sri Lanka, and in countries such as Israel and even the United States, Canada is seen increasingly as a war financier, supplying the cash and other support that sustains political and religious violence, keeping self-styled freedom fighters outfitted with weaponry and ensuring a continued surfeit of misery for civilians and the soldiers alike.

Through negligence and indifference, the Canadian government has permitted virtually every major terrorist organization in the world to operate within its borders. Canada's failure to disrupt the terrorists on its soil has resulted in major security problems for Canada's neighbours and some of its closest allies.

Canadian-based terrorists have been arrested in the United States, Britain, France, Jordan, Algeria, Pakistan, Azerbaijan and other nations.

Canada's failure has also caused severe troubles within Canada's refugee communities, where militants have hijacked cultural organizations and religious institutions for their own ends. And it has helped create an international climate in which global terrorist organizations such as al-Qaeda have thrived.

Make sure to check out the comments for interesting discussion and a link to another relevant article.

Aggregator

Finally, my XML parser is done (for real this time). Now I get to start working on my personal RSS aggregator. My main question is: How many days worth of content does a typical RSS feed have? For instance, how often would I have to check a feed to ensure that I didn't miss anything?

Wow, PHP really does suck

No offense, that title sounds harsher than I really mean it in a way. PHP's stated goal is to help solve the "web problem". Unfortunately, as a language it kind of sucks. I've been having major problems writing some code I'm trying to write, so I decided to write my code in a largely functional style. PHP can't do that!!

Well, to be fair, maybe it can, but I have to force it to Smiley I'll let you know how I make out.

Ok, some examples. I want to write a function to test if a "key" matches a certain "tag". A key matches a tag if, given a tag of "tag", the key is either "tag" or "tag<space>[anything else]". So, I'd want to write something like this functionally:

<?php
function isKeyEqual($key,$tag){
   return 
substr($key0strpos($fullkey' ')) == $tag;
}
?>

Unfortunately, substr won't work right if the space is not found, since strpos will return false if the space isn't found, which will be interpreted by substr as '0', which will make it always return the empty string.

substr isn't amenable to a functional style. If it took 0 to mean "the end of the string", or even NULL, I could do something like:

<?php
   
return substr($key0,
            ((
$pos strpos($fullkey' ')) !== false $pos NULL)
          ) == 
$tag;
?>

But that doesn't work either. So I have to go fully back to the imperative style as so:

<?php
function isKeyEqual($key,$tag){
 
$pos strpos($full_key" ");
 if(
$pos !== false){
  return 
substr($full_key0$pos) == $tagname;
 }else{
  return 
$full_key == $tagname;
 }
}

Boo.

Update: I finally got my algorithm right. I think I'm finally done!

RSS auto-discovery

With an appropriate use of HTML metadata, if your site has the following <link> element:

<link rel="alternate" type="text/xml" title="XML" href="YOUR XML FILE HERE" />

aggregators can automatically discover your XML feed.

Lots of activity today. Seems like from the beginning of the day to the end most of the blogging world (including me Smiley) supports this. See what happens when authority isn't centralized? If this was done by a committee, they'd still be planning on a day to meet for the first time.

Can't wait to watch my XML icon show up on dive into mark.

← May 31, 2002June 02, 2002 →
May 2008
SunMonTueWedThuFriSat
 123
45678910
11121314151617
18192021222324
25262728293031



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 1 posts

Recent comments XML

"IMDB for music"

IMDB for Music? It looks to be a​couple of years old...​http://MusicTell.co...

Ken Empie: May 14, 9:57pm

Generated in about 0.114s.

(Used 7 db queries)