February 2008 Archives

Getting rid of the penny

Comments (4)

The US Treasury Secretary wants to get rid of the penny. I couldn't agree more. Of course "politics" is cited as why the elimination of this almost worthless currency will never happen.

Politics? Makes me pine for The West Wing:

TERRY It's called the "Legal Tender Modernization Act." SAM Which provides for? TERRY The elimination of the penny. SAM I'm sorry? TERRY It would permanently halt production of the penny. SAM Why? TERRY I'm glad you asked. SAM Yeah. TERRY Last year, the U.S. Mint cut 14 billion pennies and shipped them off to the Federal Reserve, which dumped them in our laps. They're worthless. SAM Well, they're actually worth one cent. TERRY The dollar has the buying power today that the quarter had 30 years ago. The penny's buying power shrunk to nothing. SAM Well, that's not true. You can get yourself a gumball. TERRY No, you can't. They cost a nickel. SAM Really? TERRY [sighs] I'm gonna need to give the Congressman a good reason why the White House won't support the bill if they won't support the bill. SAM Oh, don't make me give you a good reason. TERRY You want your $30 billion in school repairs? SAM Well, we're already well on our way with 140 million pennies. TERRY Sam... SAM I'll get you a good reason. Later... JOSH He wants to abolish the penny? SAM He doesn't want to abolish it, as much as he wants to give his boss a reason why we can't. JOSH Well... it's stupid. SAM Yeah, but the thing is it isn't really. JOSH Really? SAM It turns out the majority of pennies don't circulate. They go in jars and sock drawers. Two-thirds of the pennies produced in the last 30 years have dropped out of circulation. JOSH You've been reading about this? SAM It's interesting. JOSH No, it's not. SAM [stands] The Mint gets letters with pennies taped on notebook paper. Letters from citizens who found the pennies on the street and mailed them back to the Treasury to help pay down the debt. JOSH It's almost hard to believe that plan hasn't worked. SAM It's also bad for the environment. Production requires the mining of millions of tons of copper and zinc each year. JOSH Zinc? SAM In 1982, they changed the composition to 97.5% zinc and only 2.5% copper. JOSH Sam? SAM I'm turning into one of the funnel people. JOSH Yeah. SAM [pause] Donna thinks you're still pissed at her. JOSH I'm not. I wasn't before. When did she tell you that? SAM Before she left. [sits] JOSH You've heard from her? SAM No. JOSH She should be done by now. SAM Here's a riddle. What is the most ubiquitous man-made object in America that does not interact with any mechanism or machine? JOSH The penny? SAM Then penny. You can't even throw it in a tollbooth. Well, except for Illinois. JOSH Why can you use it in Illinois? SAM That's an interesting question. JOSH No, it's not. [walks off] Later... SAM You can give me a reason why the White House can't support the elimination of the penny. TOBY This is the Legal Tender... Huckleberry Bill? SAM Modernization Bill, yeah. TOBY We can't support it 'cause it'll never get to the floor. SAM Why not? TOBY Where's the Speaker of the House from? SAM He's from Illinois, which, by the way, is the only state where you can put pennies in a toll machine. Why is that, do you suppose? TOBY It's because... SAM It's 'cause Lincoln's from Illinois! And... so is the Speaker. TOBY Yes. SAM Well, that's a good reason. Well, it's a dumb reason, but it's good enough, right? TOBY Sure.

From The West Wing, War Crimes

But more importantly it reminds me of an idea I have had a long time:

What if the nation imposed a "tax" by which all sales were rounded up to the nearest nickel. The difference, just a couple of pennies in the end, would be placed in a virtual change jar for education or some other fund designated by Congress. This would:

  • save the nation millions from not having to manufacture the penny any more
  • generate potentially hundreds of millions of dollars for an important cause like education or national health care

And most people wouldn't care they were paying a couple cents extra. In fact most people would probably be thankful that they no longer have to spend 3 hours of their life every year rolling pennies, only to learn that all those pennies they just rolled amounted to little more than five dollars.

Clean Sweep Updates

Comments (2)

Clean Sweep Dashboard Widget

A while ago I switched from Apache to Lighttpd and in the process I broke my very own plugin installed locally here on majordojo: Clean Sweep. Clean Sweep is a plugin designed to help put an end to 404's on your blog that result in a lowered page rank, a poor reader experience, and poor performance overall.

In this latest release I have:

  • fixed a few bugs.
  • added support for Lighttpd making configuration as easy for this light weight web server as it is for Apache based web servers.

You may download the update from Clean Sweep's home page.

To everyone who is voting in this year's election...

TrackBacks (0) Comments (3)

If you consider yourself a critical thinker, no matter what party, or what candidate you believe should be the next president, then I encourage you to watch the following video.

I admit, I am on a bit of a Lessig kick right now, and yes, the movie is 20 minutes long, and yes, this video is pro-Barak Obama. But, if there is one thing of actual substance that everyone should watch during the entire election process, it is this.

Battlestar Season 4 Cast Photos

Comments (1)

Arin has Pink, I have io9 -- which my friend pointed out is "Go!" upside-down. Anyways, today on my favorite Gawker blog I saw the new BSG Season 4 cast photos.

bsg_cast.jpg

Now normally I would just add something like this to my action stream, but Battlestar has a special place in my heart. Therefore I have elevated this to a full post.

More Photo Gallery Enhancements

TrackBacks (0) Comments (8)

gallery2.png

Last week I began the long overdue process of upgrading the Photo Gallery plugin to work with Movable Type 4.1. A week later I have made a number of improvements and have gotten the plugin to a point where I feel much more comfortable encouraging people to download, install and actually use it. I am using it now for my personal photo gallery - for what that is worth.

Change Log

  • The upload dialog is now completely functional
  • An upgrade function has been implemented to convert your old MT3.x galleries into Photo Gallery 2.0-compliant ones. The upgrade function right now is a URL hack, but it is simple: http://yourdomain.com/cgi-bin/mt/mt.cgi?blogid=###&_mode=PhotoGallery.upgrade

Known Issues and To Do List

  • The "Stop Design Photo Gallery (HTML)" template set is not yet functional.
  • Tagging as a favorites doesn't work - I need to migrate old installs to use the @favorite tag as opposed to the Favorite Category.
  • The template set should auto install some albums for you if none exist.
  • Add a caption field for a photo
  • Favorites do not display properly on the front door
  • Upgrade comment form to use MT4's new form
  • Paginate category archives by month somehow

Lessig in the News: Prohibition, Changing DC and a bid for Congress

TrackBacks (0) Comments (2)
Law emerges from our need to re-enforce what we already believe, consciously or subconsciously, is right and wrong.

I finally had the opportunity to watch the talk Lawrence Lessig gave this year at TED in which he draws a brilliant parallel between Prohibition and modern Copyright law. Simply put, any law that forces the majority of your population to live knowingly and willingly against the law must be fundamentally broken.

In other words, laws should be a reflection of the generally agreed upon norms of a society. The idea that law can be used as a tool to change a society's sense of right and wrong is backwards. Law emerges from our need to re-enforce what we already believe, consciously or subconsciously, is right and wrong.

I won't attempt to paraphrase his talk when you could just as easily watch him yourself -- something I encourage everyone to do. Lessig has an amazing gift in being able to distill the complexities and intricacies of copyright law in a way that makes the subject matter not only understandable, but even I dare say: entertaining and engaging.

Now, Lawrence Lessig is making the rounds on the Internet again as he contemplates running for Congress in 2008. His announcement came in true Lessig form: as a video he published to his blog (powered by Movable Type):

While Howard Dean and Ron Paul may very well deserve credit for pioneering the use of online communities to build an effective base for a campaign, and even revolutionizing how one might manage to finance a national campaign, Lessig, as a true master of the online craft, may actually have the ability to get elected - something his predecessors, despite their place in history, were never able to do.

Template Macros: The coolest template trick you don't know about

Comments (0)

Republished from Learning Movable Type, a great community resource to help people get the most out of Movable Type.

Recently when working on updating the Photo Gallery plugin to work with Movable Type 4.1 I found myself neck deep in some of the most complicated Movable Type templates I have ever seen. Of course, their complexity is exactly why the Photo Gallery plugin outputs such beautiful results.

Within these templates I have the need to take an arbitrary image asset of any size, and scale it proportionally to fit inside a well defined area. This could be a thumbnail, or a larger version of the photo at hand. What I found myself doing is replicating the same template code over and over again in order to produce the output I desired throughout the template set. Here is the template code I was using:

<MTSetVarBlock name="width" trim="1"><MTEntryAssets><MTAssetProperty 
    property="image_width"></MTEntryAssets></MTSetVarBlock>
<MTSetVarBlock name="height" trim="1"><MTEntryAssets><MTAssetProperty 
    property="image_height"></MTEntryAssets></MTSetVarBlock>
<mt:if name="width" gt="$height">
    <MTSetVarBlock name="img"><MTEntryAssets><mt:AssetThumbnailLink width="90" 
        regex_replace="/^<a[^>]*>(<img[^>]*>)<\/a>$/","$1" /></MTEntryAssets></MTSetVarBlock>
<mt:else>
    <MTSetVarBlock name="img"><MTEntryAssets><mt:AssetThumbnailLink height="90" 
        regex_replace="/^<a[^>]*>(<img[^>]*>)<\/a>$/","$1" /></MTEntryAssets></MTSetVarBlock>
</mt:if>

Yikes.

To complicate things further, each time I cut and pasted this code around I had to modify it slightly depending upon the size of the photo I wanted to output. This presented the following problems:

  • my template code was getting very messy.
  • my template code was getting harder and harder to update because I had the same code in multiple places

What I found myself in need of is something a developer might call a "function" or "macro." In layman's terms, I needed a way to write this template code once, and then to invoke along with a few parameters in order to change its behavior and output as needed.

Luckily, Movable Type has exactly what I needed: a little template tag called MTSetVarTemplate. This template tag allowed me to define just such a macro so that I could reduce all of the complicated template code above into something far simpler:

<MTVar name="photo" max_size="90">

Wow, what an improvement!

To achieve this I defined the following template code inside of a template module I created. I then included that module in my header to ensure that I could use it anywhere I needed within my templates I needed to:

<mt:ignore>
  This template module is responsible for outputting the associated image with the current
  photo/entry in context. You can pass in the max_size parameter to control the size of 
  the image.
  Example:
    <mt:getvar name="photo" max_size="90">
</mt:ignore>
<MTSetVarTemplate name="photo">
<MTSetVarBlock name="width" trim="1"><MTEntryAssets><MTAssetProperty property="image_width"></MTEntryAssets></MTSetVarBlock>
<MTSetVarBlock name="height" trim="1"><MTEntryAssets><MTAssetProperty property="image_height"></MTEntryAssets></MTSetVarBlock>
<mt:if name="width" gt="$height">
        <MTSetVarBlock name="img"><MTEntryAssets><mt:AssetThumbnailLink width="$max_size" regex_replace="/^<a[^>]*>(<img[^>]*>)<\/a>$/","$1" /></MTEntryAssets></MTSetVarBlock>
<mt:else>
        <MTSetVarBlock name="img"><MTEntryAssets><mt:AssetThumbnailLink height="$max_size" regex_replace="/^<a[^>]*>(<img[^>]*>)<\/a>$/","$1" /></MTEntryAssets></MTSetVarBlock>
</mt:if>
<mt:getvar name="img" trim="1">
</MTSetVarTemplate>

This is still a lot to chew on, so let me break down exactly what is going on:

  • First, I use the <mt:ignore> tag to document what I had done and allow others to more easily re-use the module I created.
  • I define the name of the macro by using the name attribute on the <mt:setvartemplate> tag.
  • I invoke the macro, by using the <mt:getvar> tag.
  • I am able to access parameters I pass into the macro using a common programming syntax, in this case using the $max_size variable.
  • I am able to pass parameters into the macro by including them in my <mt:getvar> tag like any other attribute. For example (notice the max_size attribute corresponding to the variable of the same name inside of my macro):

I can't tell you how pleasantly surprised to find this feature. Using it greatly improved the readability of my templates, and also made them much each to maintain over time. And now looking back i can think of a million places through out my templates on every site I have ever worked on where this could really help make my template simpler and easier to maintain.

Movable Love

TrackBacks (0) Comments (0)

Aaron Bailey just launched a beautiful new site devoted to all of the amazing blogs powered by Movable Type. It is called Movable Love and will serve not only as an index of blogs powered by MT, but will specifically showcase and highlight those sites that stand out from the rest as beautifully designed sites powered by MT.

Movable Love Screenshot

I for one can't wait to see this directory take shape. I know I have already submitted my favorite web sites that I know are powered by Movable Type... have you?

Here is just a sampling of some of my personal favorites that I have already submitted:

What blogs are you going to submit?

See also and not to be confused with: Lovable Type.

Stop Design Photo Gallery Plugin for Movable Type 4.1

TrackBacks (0) Comments (28)

In today's Movable Type hackathon I chose to focus on a Movable Type plugin of mine that has been neglected quite far too much since the release of MT4: the Photo Gallery plugin. I held off primarily because I knew that the template set feature in Movable Type 4.1 was going to make the user experience for the Photo Gallery plugin totally worth the wait.

gallery2.png

What I have hacked together so far is far from perfect, but it serves as an excellent and fully functional preview of what is in store for this plugin in the coming weeks. Please, install it, use it and let me know what you think.

Instructions

  1. Make sure you have MTOS 4.1 or MT 4.1 installed.
  2. Download PhotoGallery-2.0.zip
  3. Follow the installation instructions.
  4. Create a new blog and use the "Stop Design Photo Gallery (PHP)" template set.
  5. From the Create menu select "Upload Photo."

The rest should be, I hope, self explanatory. If it is not, then that is a bug.

About Photo Gallery 2.0 (alpha)

upload.png

This is not an official release. It is a preview and chance for me to hear some feedback from users.

In case you were wondering, here is an overview of some of the enhancements found in Photo Gallery 2.0:

  • easy to install photo gallery - using MT's template set system you can install a PHP version of Doug Bowman's templates.
  • photo album nomenclature - when you are in the administrative interface managing a photo gallery, the classic bloggish language of MT is replaced by more familiar photo related terminology, e.g. "Album" vs. "Category".
  • faster publishing - the templates have been completely refactored to be faster to publish and faster to process new uploads.
  • easy photo management UI - using Movable Type's built in asset management interface it is far simpler now to view all your photos from within the admin interface.
  • better upload dialog - a better and simpler photo upload dialog has been provided to allow you to view the photo while you provide a title and caption for it.
  • no hacked custom fields - data is now stored logically within an entry allowing users to realistically edit a photo even after it has been uploaded and saved.

But remember, I am not done yet. So expect the following soon...

  • OpenID support for commenting
  • a second plain HTML photo gallery option

Movable Type is whatever you want it to be

TrackBacks (1) Comments (1)

What has always drawn me to Movable Type is its flexibility. Most of the time we, that is Six Apart: my employer and creator of Movable Type, talk and think about MT's flexibility in terms of the web sites it is capable of producing and the vast array of plugins one can build on top of the platform.

Today Mark released [a plugin that] provides a user interface to Movable Type that is virtually identical to that of WordPress.

But there is another axis of customization that is rarely exploited that is perhaps one of the most remarkable ways in which one can bend and twist Movable Type to one's will: the ability to completely re-skin the core user/administrative interface of the application. The first time this feature was fully utilized was when we released the iPhone interface for Movable Type. The fact that it took Brad Choate less then 8 hours1 to actually port the entire interface to a completely different look and feel is amazing to me.

Of course, one might chalk his efficiency up to fact that he also happens to be Movable Type's lead engineer, and arguably the single most experienced and knowledgeable Movable Type hacker on the planet --- thereby making this feat less compelling.

Enter Mark Carey.

Today Mark released the second plugin capable of re-skinning Movable Type. This plugin however provides a user interface to Movable Type that is virtually identical to that of WordPress.

wpui-dashboard.png

To quote Mark, "Yes, the above image is Movable Type, not Wordpress. ;)"

From what he tells me, it only took him about 10-12 hours to achieve.

Remarkable.

For the engineers out there: think for a moment back when you last embarked on a redesign of a product you worked on. How long did it take you? I am willing to bet that no matter how long it took, it took longer then you thought it would.

It is just amazing to me to think that someone can turn around a total redesign of the Movable Type application in such a short period of time.

But what does this mean for Movable Type users? I guess it depends on who you ask, as there are some MT users that cannot imagine using anything but MT4's new look and feel. On the other hand, I have spoken with some users, WordPress converts in particular, for which MT4's user interface was a very drastic change for them.

For those users, and other users thinking about making the switch from WordPress to Movable Type, this plugin allows them to experience MT via a more familiar user interface. Users can then transition to MT's default design when they feel more comfortable doing so.

I just like the fact that Movable Type really is whatever you want it to be. It doesn't seek to constrain you to a single way of doing things. It is not encumbered by NIH mentality and seek to embrace the best the web has to offer, from OpenID to Pingback. Movable Type, in its form, function and design seeks to free you from constraints and make anything possible.

God, I really do love this product.

1 This does not account for the time to actually design the user interface, and come up with the HTML and CSS coding standard to use.

For Guitar Hero IV

Comments (0)

Stumbled upon from a post on Read/Write Web (powered by Movable Type) I thought this would make an excellent, excellent track for the next version of Guitar Hero. Amazing.

Super Bowl Ad Wrap Up

Comments (0)

I, like so many other people I know, only watch the Super Bowl for the ads. And then last year it finally dawned on me that I actually don't have to watch the Super Bowl at all! Did you know that you can watch videos on the Internet? Wow.

But thanks to NotCot and their nice round up of the best Super Bowl television commercials, it looks like I can delete the Super Bowl from my TiVo.

superbowl.jpg
Original image from NotCot.

Implementing Ping Back for Movable Type

TrackBacks (0) Comments (8)

Years ago Ben Trott introduced one of the first seminal technologies and protocols that would shape the very nature of blogging and our industry today. Subsequently, WordPress released an alternate Link Back protocol, the umbrella term to refer to all of these notification schemes.

The release of a second notification protocol spurred some mild debate among protocol junkies about which one is better. Let's review the general state of affairs:

  • TrackBack is pretty broken as it stands today. The discovery mechanism is god-awful, and the protocol is prone to exploitation and spam. Generally speaking, given the percentage of TrackBacks that are spam, it makes me wonder why bother at all. The spec is so bad for example that WordPress claims it supports TrackBack, but blatantly doesn't even implement it as written.
  • PingBack does not have the breadth of adoption that TrackBack has (at least when TrackBack was first released), but it is moot given the sheer market force of WordPress. It is in some respects more secure, but not fundamentally, just consequentially. That too doesn't matter because the net result is the same: there is less PingBack spam then TrackBack spam.

So in this week's hackathon I thought I would take a stab at implementing PingBack for Movable Type. I am not done yet, but there is code available and it does technically work.

Up until now, all of my opinions on PingBack were merely philosophical, but now that I have an implementation under my belt I have a deeper more informed position on the pros and cons of the protocol.

  • XML-RPC - the fact that PingBack utilizes XML-RPC is most likely the reason why the protocol is marginally less spammy than TrackBack, because it raises the bar for spammers and eliminates random HTTP POST spam from the equation. But here is the rub - because PingBack has no authentication layer associated with it, it is still fundamentally as insecure as TrackBack.

  • Weak Requirements - The idea behind PingBack is more reliable stems from the requirement that a server ("A") should confirm that the client ("B") indeed has a valid link from B to A. However, the requirement, as stated, is actually:

    The server MAY attempt to fetch the source URI to verify that the source does indeed link to the target.

    Something I learned from Brad Fitzpatrick when helping to shape the YADIS protocol is that any specification that includes a MAY requirement, might as well not stipulate the requirement at all because you are signaling to the developer that the requirement is not important. Even though authors of the PingBack specification cannot control the implementations, they should at least put a stake in the ground and say - if you want to be compliant with this spec, then you MUST take steps to ensure the validity of the ping. As it stands now, that step is optional.

  • Insufficient Data Exchange - strictly from a developer perspective the fact that the protocol only calls for two pieces of data to be sent from a client to a server, the source URL and target URL, makes the process of implementation a little frustrating. With so little data being exchanged, it is incumbent upon the developer to extract any meaningful data at all from the source URL. There is no transmission of an excerpt, an author, a source title, or anything. I must determine all that for myself.

    Now in theory this is not so bothersome, because in theory that is all the data you should need. But in practice the fact that there is no deterministic, specified or even recommended way for me to do so, makes the process of implementation bothersome. What PingBack needs is a binding to Atom, or a recommendation that states a source URI should publish an XML representation of the originating resource to make it easier for a server to extract an excerpt, author name, post title, etc. Then again perhaps rewriting a spec to work around my laziness isn't always the best approach. :)

Does it matter?

Actually no. My opinions actually have no bearing on whether or not I will implement or how I will implement PingBack. Because the reality is that with so many WordPress blogs out there, it would be a disservice to Movable Type users not to.

Plus, let's face it: noone is going to change the PingBack protocol simply because I have some issues with it. C'est la vie.

Which leaves us with...

Where to go from here?

What this process has left me with is a renewed appreciation for how important notifications are in the world of online communications. Ben Trott invented something fundamental to modern communications and the fabric of interconnected online content, and just because the current set of specifications all kind of suck in their own way, does not lessen that importance.

Therefore, the industry really should reinvest in these protocols in to improve security, reduce spam, and broaden adoption to more communications tools.

I don't know what the solution is, but my growing belief is that neither TrackBack or PingBack is adequate anymore. I am confident however that there is no need to waste time in the politics of inventing a new standard when we already have one that is more then sufficient: Atom).

So I wonder, does Atom have a role to play in enabling publishing systems to help communicate and establish links between one another?



Recent Entries

Automagic URL redirection and SEO maximization in Movable Type
Clean Sweep now allows me to change my URL structure without worrying about how Google might penalize me. Clean Sweep…
Creating plugins in Movable Type, with NO PERL REQUIRED
Not to long ago I began work on a very cool new theme, or Template Set, for Movable Type. I…
Keeping a watch over customers using Twitter, and what it really means to be "open"
Not too long ago I stumbled upon a user who was having problems with Movable Type who I later helped…
Change Congress