KBD

Keith Devens .com

Saturday, March 20, 2010 Flag waving
... we can never use experience to prove the inductive principle without begging the question. Thus we must... forgo all justification... – Bertrand Russell ("On Induction" in The Problems of Philosophy)

Archive: April 18, 2003

← April 17, 2003April 19, 2003 →

Daily link icon Friday, April 18, 2003

More URL questions

Joe recently changed his URLs to look like: http://bitworking.org/news/Bulu_0_93_Now_Deployed
from urls that were based simply on numeric ids like http://bitworking.org/news/81 (doesn't work anymore).

Currently, my URLs look like: http://www.keithdevens.com/weblog/3777

I'd like to do something like he did. Except I really don't like what he did, because then all titles ever have to be unique (which is bad). There are a few options:

LGF has URLs like: http://www.littlegreenfootballs.com/webl...91_Peaceful_Religion_Seething_in_Iraq
where he has the id and obviously ignores everything starting with the first underscore.

Den Beste has ones that look like: http://denbeste.nu/cd_log_entries/2003/04/SomenewsfortheBBC.shtml
where the URL is relative to the month and has words smushed together.

I could smush words together, but I'd probably just replace spaces with underscores (and correct other non-url characters). The other option would be something like http://www.keithdevens.com/weblog/3777#The_heroism_in_Harry_Potter, but I really don't like using "fake" anchors. Plus, it would make it impossible to have something like http://www.keithdevens.com/weblog/3777#The_heroism_in_Harry_Potter#comment7777

I'd like to get dates in there too, but for me that gives you urls that are just way too long: http://www.keithdevens.com/weblog/archive/2002/Jun/11/GET_after_POST_revisited

And I really don't want to make the posts dependent on the title, which can change.

Simon's URLs are instructive: http://simon.incutio.com/archive/2003/04/17/pythonRoundup

Where they're relative to the date, and are based on a unique name (within the day, at least) which mustn't change (as opposed to a title). I really like this. The URLs aren't overly long if you don't choose a long name, yet they can still be descriptive. The downside is that you have to go through the effort of choosing a good name every time. Plus, there's no hook in w.bloggar for the post name. I could fake something, but that's icky.

So, I have a few choices:

  • I can keep my short URLs and add on an ignored title like Charles does with LGF. So that would look like: http://www.keithdevens.com/weblog/3778/More_URL_questions. You can still put comment anchors on it, so it wins there. Plus, it's easier to read than something with smushed words like '/3778/Moreurlquestions', or even '/3778/MoreUrlQuestions'. And if I change the post title, which happens sometimes, links don't break. And there're no problems with posts that don't have titles. So this is definitely what I'm leaning towards. But maybe it's better with something like '/3778|More_URL_questions' or ''/3778-More_URL_questions'' so it doesn't give the appearance of being a 'directory'?
  • I could go the super-long route and have URLs like http://www.keithdevens.com/weblog/archive/2003/Apr/18/3778/More_URL_questions. Again, the URL isn't dependent on the title, which is a requirement. But it's freaking huge. One of my goals is to have URLs that generally won't wrap in an e-mail program (and even if they do, to not affect where the URL resolves to if you click on it).
  • I could do something like Simon does. This URL would then look like: http://www.keithdevens.com/weblog/archive/2003/Apr/18/URLQuestions. Not too bad, but still long. The URL is dependent on the name, but it won't wrap in an e-mail program that wraps at 76 chars if my short name is less than 22 characters Smiley. However, to be safe I could make the uniqueness of the URL dependent only on the first N characters so it wouldn't matter if some got cut off.

Keep in mind that these don't necessary have to be exclusive. For instance, my weblog software still allows URLs that look like: http://www.keithdevens.com/weblog/archive/2003/Apr/18/#id3777

I just don't use those for linking, because if you do that you have to provide a separate "Comments" link, and you wind up with other problems, as Simon discovered.

Anyway, any comments?

The heroism in Harry Potter

Via HPANA, Bob Bankard: We can be Heroes.

But there's something big to be said for children's entertainment; it's written by people who believe there's still a chance to make a difference. It's written with a message, in the hope that the message might stick. Take our case in point, Harry Potter.

There are other lessons there, of course... The importance of friends, of trust, of honor, honesty and loyalty. Hard concepts of right and wrong, with no easy surrender to seductive and deceptive shades of grey. All of those cliched values that made us look up to heroes as children. All of those cliched values that made us want to be heroes ourselves.

Before Harry Potter, it was Spider-man, or the X-Men; before them, Superman, and Batman. It reaches back through the ages - The Scarlet Pimpernel, King Arthur, Hercules, Ulysses. All of them icons who represented the very best of what mankind could be, coupled with preternatural power to accomplish epic tasks for the good.

The lesser tasks, by inference, were left to us. We shared their values, and we burned to make a difference. We could be heroes too.

It's a little sentimental, but a good read.

And, anyone know the context of this Green Lantern quote in the article: "("The rats... Neverd've pulled this with a Democrat in the White House." - Green Lantern. Honest: JLA #73.)"

Also see The Cowboy Code.

Tax Facts

Lots of interesting tax facts from Oliver.

Some excerpts:

The dollar sign $ is a modification of the figure 8 that used to be stamped on the old Spanish coins called pieces of eight

I always wondered where it came from!

We definitely need tax reform:

- The official manual of the Internal Revenue Service is over 38,000 pages
- The IRS employs 114,000 people; that's twice as many as the CIA and five times more than the FBI
- Taxes eat up 38.2% of the average family's income; that's more than for food, clothing and shelter combined

- The original federal tax form was 4 pages long (including the instructions)

Tax freedom day:

- In 2003, Tax Freedom Day is on April 19

That means that we all work for the government for almost a third of the year.

- Sixty percent of the members of the Ways and Means Committee and the Senate Finance Committee don't do their own taxes
- Congress gets free tax preparation services. The rest of us pay $30 billion a year for professional tax help

That's very interesting!

Finally, this explains the M.O. of the Democratic party:

- "The government that robs Peter to pay Paul can always depend on the support of Paul." - George Bernard Shaw

One more argument against the latest cry of "It's all about oil!"

Charles:

The "it's all about oooiiilllll!" argument is so tiresome by now that I wish I could reach through my monitor screen and choke the idiots who insist on regurgitating it over and over, as if their irrational effluvia were wisdom from on high.

A new column by Christopher Hitchens does a great job of pointing out the silliness of this non-argument: Oleaginous - People who prefer Saddam Hussein to Halliburton. Oh, I know; it won't stop the birdbrains from chirping oooiiillll! oooiiillll! like mindless hungry magpies -- nothing will. But all we can do is keep hammering them with facts.

From the article at Slate:

In front of me is a copy of the Arab Times, published in Kuwait City and picked up during my recent trip to the region. It gives a matter-of-fact account of the state of affairs in the Rumaila field, as of March 29. About 10 oil wells were ablaze, many fewer than had been feared. (A great number of bombs and charges had been laid, but either the local officers did not obey the order, or the order never came, or the fields were secured by British and American special forces too swiftly to allow the planned sabotage to occur.)

At any rate, a burning well is a tough proposition and an uncapped well -- permitting a wholesale discharge -- an even tougher one. The situation was being handled by Boots and Coots, a fire-control company with an almost parodically American name, which is based in Houston. Boots and Coots, which also worked in Kurdistan and Kuwait after the much worse conflagrations of 1991, is subcontracted for the task by Kellogg, Brown, and Root (another name Harold Pinter might have coined for an American oil company), which is in turn a subdivision of Halliburton. And "Halliburton," which admittedly sounds more British and toney than Boots and Coots, was once headed by -- cue mood music of sinister corporate skyscraper as the camera pans up in the pretitle sequence -- Vice President Dick Cheney.

Well, if that doesn't give away the true motive for the war, I don't know what does. But unless the anti-war forces believe Saddam's fires should be allowed to burn out of control indefinitely, they must presumably have an idea of which outfit should have got the contract instead of Boots and Coots. I think we can be sure that the contract would not have gone to some windmill-power concern run by Naomi Klein or the anti-Starbucks Seattle coalition, in the hope of just blowing out the flames or of extinguishing them with Buddhist mantras. The number of companies able to deliver such expertise is very limited. The chief one is American ... The other main potential bidder, according to a recent letter in the London Times, is French. But would it not also be "blood for oil" to award the contract in that direction? After all, didn't the French habitually put profits in Iraq ahead of human rights and human life? More to the point, don't they still?

Anyway, I wanted to quote more. It's a good article.

Updated PHP function to merge two arrays

I was just reminded to post my final version of the function I wrote to merge two arrays in the way I needed it.

<?php
function merge(&$a, &$b){
    if(
is_array($a) and is_array($b)){
        if(isset(
$a[0])){ # $a is a numeric array, so copy b straight over it
            
$a $b;
        }
        
$keys array_keys($a);
        foreach(
$keys as $key){
            if(isset(
$b[$key])){
                if(
is_array($a[$key]) and is_array($b[$key])){
                    
merge($a[$key],$b[$key]);
                }else{
                    
$a[$key] = $b[$key];
                }
            }
        }
        
$keys array_keys($b);
        foreach(
$keys as $key){
            if(!isset(
$a[$key])){
                
$a[$key] = $b[$key];
            }
        }
    }else{
        
$a $b;
    }
}
?>

This merges two arrays key for key, recursively, unless array $a is a plain old numeric array rather than an associative array, in which case it overwrites array $a with array $b. If a key exists in both arrays (and the value is a scalar, instead of another array, in which case it would recurse), it overwrites the value in array $a with the value from array $b. If $a and $b aren't both arrays, then $a is overwritten by $b.

SharpReader is awesome

Ok, SharpReader is freaking awesome. It supports categories, has multi-threaded updating of feeds, and the entry threading feature is amazing. It tells me when someone else I read refers to the post I'm currently reading. Really fantastic. Even more reason to include entire posts in your RSS feeds. People, you listening??

Hopefully I won't wind up hating SharpReader after using it for a little while like I did with the last RSS reader I tried. One good sign is that pieces of SharpReader have grown on me after using it for a little while. For example, the way it keeps old posts around. It works more like an e-mail client, where you have to explicitly delete old items, rather than having them expire in some way. At first I didn't like this. Syndirella kept a configurable number of old items around (I think it defaulted to 50). NewsDesk only kept items around that were in the current feed. After using it though, I think SharpReader does it the best, because posts simply stay around for as long as you want them to. Seems like the best plan to me, even though you do have to explicitly delete old posts (but there are a lot of keyboard shortcuts to help you delete a lot of old posts at once Smiley ).

Ooh, cool. It exports feeds in the OPML file in the same order as they appear in your SharpReader window. Makes sense, right? Now I don't have to sort my OPML file before displaying it. In fact, now I shouldn't!.

Oh, one feature I want is the ability to "Open in Separate Window" on a feed as well as an individual post. It should really have that.

... Testing how SharpReader notices updated posts. And again...

High confidence in Bush on economy

Via Wunderkinder, I found this bit interesting in this article by Larry Kudlow at NRO.

A recent NBC News/Wall Street Journal poll shows Bush with a huge 71% approval rating right now. On tax policy, respondents had more confidence in Bush and the GOP (52%) than in congressional Democrats (38%). It seems that the president's political clout, even on taxes and the economy, is greater than many media pundits would have us believe.

I never understood why people seemed to have confidence in democrats regarding the economy. This is good to hear.

← April 17, 2003April 19, 2003 →
March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



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

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.068s.

(Used 7 db queries)