Main

August 3, 2007

DDJ Architecture & Design World: Randy Miller's "Agile Architecture"

Randy (Granville) Miller is an architect for Microsoft. He has a Microsoft blog. Last week i attended his session, "Agile Architecture" at the Dr. Dobb's Architecture and Design World Conference.

His talk started with a quick overview of agile and its benefits. As a side note, i was amazed at how much of that talk was happening at the conference. I assumed (there i go again) that it was so prevalent now that it was roughly a given. Apparently i assumed incorrectly.

After that was out of the way he talked for a bit about the place of architecture in agile methods and the disconnect between engineering practices and an entire business process or system. He used a quote from Kent Beck that is really spot-on:

My bias in writing XP originally was towards the programmers. That’s my background. That’s who I identified with on teams. However, the past five years have taught me that software development can’t be “the programmers and a bunch of other people�if the goal is excellence. Without balance between the concerns of everyone involved, some people will be unable to contribute to development, and their views are important to the team’s success.

My team's nearly 2 year experience with Scrum has certainly proven this out. In fact, Scrum's biggest benefits have materialized in communications and project management benefits over strict engineering benefits. While combining multiple roles on a single team is a fundamental agile tenet, the role of Architect is not often discussed and less so in an Agile Context. XP, Enterprise Scrum and Microsoft's MSF stuff were mentioned as methodologies that discuss the architect and architecture. The notion that architecture was unnecessary in an agile project was brought up as a fundamental myth about agile practices. After nods all around, he made his first suggestion: build stories to verify the architecture in a deployed sense, not on paper. For a client server application, build the client and the server with a really simple interface or a stub, but make it real. Put it in your environment and let it run. The appeal of making a design tangible is pretty interesting, even if it gets difficult for a lot of cases.

The rest of his presentation focused on the concepts of shadows. Working or existing code can cast what he called "Trailing Shadows". Reverse engineering databases into ER diagrams, java code into UML diagrams, etc. In my team, this has been incredibly valuable. It is a common sense task to take stock of what you have and document it, but i really like the term Trailing Shadows as an indicator of architecture. The mixture of a legacy code base and an expanding engineering team makes that particularly necessary for my team.

On the flip side of that, he talked about "Leading Shadows" from a design. Our leading shadows could come from whiteboard sketches, notebook pages, quick visio diagrams, etc. He stressed that these shadows should turn into working code within an iteration and not devolve into Big Design Up Front. Following on this discussion, he stressed building scaffolding for these sketches, writing tests for them and getting them into your continuous integration environment. A chart from his presentation shows the ideal progression of leading and trailing shadows over the course of a project.

Shadow Architecture Graph

As part of a retrospective after an iteration, review the shadows, suggested Miller. If you have leading shadows still, you need more development. If you have trailing shadows, then you are done with this architectural change.

The final interesting part of the talk was a focus on the inverse relationship between project size and the length of iterations/integrations. He gave an anecdote about the size of the team for the last Visual Studio release (~4-500 developers) and the 2 month iteration size. They found that they spent a ton of time doing integration testing and conflict resolution. This seems like a no-brainer, but is often hard to put into practice.

The shadow architecture concept is part of the Microsoft System Foundation for Agile Software Development. On that basis, i am going to do a little reading on that system. I don't develop for windows or use Visual Studio, so we'll see what is applicable.

Miller's talk was one of my favorites at the conference and helped me get some perspective on the "What is my sprint to sprint role as an architect?" question. His speaking style was great, the presentation flowed well between his material and the audience questions.

August 20, 2006

there is just so much wrong with this video

ZDNet and Microsoft have these ads playing right now where a "Developer Evangelist" is standing at a whiteboard espousing how awesome visual studio is.

I actually watched one of these, and it was focused on the visual studio team system. The video is like watching a minor nightmare. The thrust of the entire presentation is that for each of the "roles" on a project, there is a tool to cut off the need for persons of that role to speak to or work directly with persons of a different role. The roles are familiar: developer, architect, tester, build manager and project manager. It is nice that MS is looking at ways to facilitate collaboration, but sharing responsibility and building up a cross functional team is a much better solution in the long run for everyone involved.

Granted, i am judging a tool and an entire corporate philosophy based on one goofy advertainment spot, but i think it is a good picture of the super tool heavy view of development that has infected so much of the software industry. Busines and development knowledge trumps tools knowledge any day.

July 25, 2006

Inaugural Meeting of the Right Honorable Rudolph Hering Society

So Chris decided that he would finally do what we have been talking aobut for a while and create a language agnostic programmer's user group. The first meeting was freeform over dinner at the Lincoln Restaurant and featured a presentation on the Lua programming language. There were no laptops and no projectors, but there was a lot of lively debate. What are we all doing here? How does language and culture affect programming? Will the American influence on development keep up in 20 years? In 50? What is Parrot?

The meeting was fun and lacked any language defensiveness. Chris asked that everyone introduce themselves by saying what they do and what user groups they participate in. The group was a mix of members from LUNI, 2600, Chicago.pm, ChiPy, TechCoffee, Chicago Lisp users group and other free spirits.

We are not going to do monthly meetings, but the mailing list has been pretty lively, so discussion is happening, even if it isn't on a regular schedule. This was more fun than i have had at a user group event in quite some time.

June 22, 2006

gearing up for YAPC::NA!!!

I am getting excited about YAPC::NA. The conference starts Monday and promises 3 days of perl talks, a huge focus on Perl 6 and many other topics. Over 400 perl developers and community members will be in attendance and be hanging out around Chicago.

Last year i tried to go up to Toronto for YAPC, but work interfered. Work is a conference sponsor this year and I am giving two talks. I will definitely not be missing this year's conference. Also, most of our development is going to the conference and some people are taking advantage of the master classes on Thursday and Friday.

The conference schedule is a pretty amazing thing. 3 days of 4 tracks makes for some hard choices. I still have not planned out my schedule yet.

I also have not finished writing my presentations yet. I have spent the last couple of days doing stream of consciousness note-taking for my two talks, "Successful and Maintainable Testing for Database Backed Applications" and "Leveraging Mason to Build a Flexible, Localized Framework." These are not foreign topics for me, but i am still bringing everything together.

My mason talk will be short and sweet and present a fairly simple use of the framework that is not very well documented or discussed on the mailing lists. I am very excited to get to meet Dave Rolsky, since i owe so much of my career to HTML::Mason, but i also get to follow his presentation, which will be pretty exciting. My testing talk has been a challenge, however. As work pushes me in different directions, i often find myself cheerleading for our testing efforts, but not necessarily sitting down and banging out the code to test our application. So far, pulling the presentation together has brought my focus back to some of the threads in my work that i have let linger, and ultimately re-energized me for the tasks ahead.

I hope to see some of you out at the conference next week!!!

I am currently still preparing m

February 18, 2006

Rails Bitching

I don't want to title this post, "How I learned to stop worrying and love the rails" but it is a fairly good fit.

I have been really enjoying Ruby on Rails. At the same time, it has been pissing me off as much as I have been enjoying it. See my post on error handling in the view. Note to self: post my "solution" to that particular problem.

After spending a couple days with it, i actually did set something up that was nicer than what i had started with. I reduced an application's main form down to 10 lines of helper method calls and implemented the error handling in exactly the way i wanted. I still ended up learning a bit more than i wanted to about the rails internals, but in the end, i kind of think i don't care. If i don't like the included HTML generating methods, i can always write my own.

This realization was underscored after the recent Chicago Ruby User Group meeting. I had the pleasure of chatting with marcel and sam from the rails core team. They had the distinct displeasure of listening to me piss and moan. Rather than calling me a troll they were super polite.
After a while they basically made me realize that what i was complaining about was that rails was not 100% molded to my brain's way of determining the right way to solve problem X. The fact that i was able to use the plugin system to override the internals was not terribly elegant, but was functional. The real solution to that is to make my own helper methods that implement the widgets in the way that i want to. And ultimately, I think that is OK. I still think the strength of rails is in the adherence to MVC separation and its two killer components, ActiveRecord and ActionController.

All in all, Rails is making me think about my web development in a smarter way and making me much less tolerant of wasteful repetition. My first couple of rails projects are coming along nicely and I am happy. what could be better?

Anyway, i thought that my decision to stop bitching about something was post-worthy.

February 3, 2006

Current Bookshelf

There are 3 computer books that I am reading right now. I am making my way through them at different paces, but will have reviews of them all as I finish them.

Practical Development Environments by Matthew B. Doar. I am about a third of the way through this one. While definitely practical, the first third is spent explaining what a development environment is. I am just getting into the meat of the comparisons between different tools and philosophies. While the first section of the book is geared towards a beginner, it may not be adequately declared as such. I would suggest that someone looking for an in depth comparison between different strategies skip the first portion of the book. I don't fault the author for this trait, but I am already familiar with a number of development environments and am distinctly looking for a lucid explanation of why I should consider X over Y or Z+C over B.

My Job Went To India: 52 Ways to Save Your Job, by Chad Fowler. This book may sound a bit offensive, or brash, but from all of the reading I have done from Chad Fowler, and especially from his recent Perlcast Interview, i believe that this book is a very well-considered take on this issue. It never ceases to amaze me that as a people, Americans complain as much as they do. There is a simple reason why jobs move overseas: labor is cheaper, and a well educated, well-paid workforce severely impacts bottom lines. While that is heartless (and is not nearly as simple in reality as I made it sound in that line), the increasing globalisation is an amazing opportunity for American workers (programmers especially) to branch out and find something that is not as readily commoditizable, some not so boiler plate. I have just started this book, but am anxiously awaiting reading the rest of it.

Squeak: Learn Programming with Robots by Stephane Ducasse. This book is probably the one I am most excited about. I remember so vividly the few times my elementary school classed was bused to the one school in the district that had a Macintosh lab. We would program (in Logo, perhaps? I need to nail that detail down. ) in a graphical environment and would have several different tasks: Draw lines (of various shapes, sizes and colors), draw shapes, do basic animation and program a course for a car on a track to take. The Squeak environment has fascinated me, primarily as the most practical way to learn Smalltalk. The environment that accompanies this book is very similar to the environment I used as a child. The premise is that you are in charge of a bunch of robots. Your raw materials are: Bot (a class or factory for making robots), and a few simple commands for the robots themselves( Go, Jump, turnLeft, turnRight, etc) and a Color factory. The book is not designed for children necessarily, but the environment and some of the exercises are definitely child-friendly. I spent some time Friday night introducing Juliana to this environment and it was a blast. We spent some time drawing lines, making the robots turn, and trying to draw rectangles and triangles. Hearing my 5 year old say, "I am giving the robot the "Go" message!" is pretty cool. Much, much, much more info on this will be coming soon.

Also, in the vein of learning to program, I am anxious to pick up Learn To Program from the pragmatic programmers. There is a great picture on flickr of a little girl reading this book. I'll update this post with that pic when i dig it out. Yay! As I was typing this post, I noticed that Perlcast has an interview with Chris Pine, the author of Learn To Program. Excellent.

What are you reading?

January 5, 2006

Snakes and Rubies video/audio is out

The video and audio for the Snakes and Rubies is available for download.

There are video and audio versions in split or complete format. Please use the BitTorrent versions to help with the load.

I helped shoot the event, and Jacob Kaplan-Moss from the Django project shot footage and did the editing and Josh McAdams of Perlcast recorded the audio for the event.

I can't wait to watch this later today. Since i am sitting in a starbuck's dialed in on my treo, i will be watching this later today when i get to the office. :)

December 17, 2005

Rails View Error Handling

I am writing a few apps right now in rails. Actually, i am converting some apps from Mason to Rails to see how it goes.

One thing that i want to change right away is the big red summarized set of error message when a form has trouble.

Searching through the rails wiki turns up an example of customizing the display of an individual field that has an error (with the caveat that it doesn't work on fields hooked up to foreign keys in the model). This requires redefining a helper method stored in a class variable. The redefinition looks like this:

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
      msg = instance.error_message
      title = msg.kind_of?(Array) ? '* ' + msg.join("\n*") : msg
          "<div class=\"fieldWithErrors\" title=\"#{title}\">Please fill in this field: #{html_tag}</div>"
end

To be able to display my own error message summary, i need to do the following:

class ActionView::Base
    def error_messages_for(object_name, options = {})
        options = options.symbolize_keys
        object = instance_variable_get("@#{object_name}")
        unless object.errors.empty?
            content_tag("p", "Bah!  There were errors!")
        end 
    end
end

While this is simple, it is a weird option. At the snakes and rubies, David spoke about what was "above the cut" for rails. To David, an rss generator is above the cut. Apparently, requiring users to redefine internals to change the display of error messages is not above the cut.

What seems simpler is to provide a place for your controller or application view to define templates for error messages and an optional method to transform object.errors on its way into this template. At least leaving display logic in the views/ tree would give people most of what they need in the place that they would look for it first. Now, i know that ActionPack is a pretty tightly coupled controller + view combination, but this still seems clunky.

I didn't find a lot of good info online for this need, so if anyone knows of any examples that i can look at, i would appreciate the links. Also, if anyone knows a simpler way that i can get these things done, please let me know.

Selenium Hackfest

I went to the Selenium Hackfest that was sponsored by the Chicago Ruby Users Group and hosted at ThoughtWorks with Chris, Eric and Garret from work.

The purpose of the event was to investigate a few patches and improved the ruby driver support for Selenium. Chris and I tried to integrate and test the Frame Support patch from James Wang, but ran into a lot of trouble. The patch is fairly large and we were both completely unfamiliar with Selenium's internals. I need to post our results to the Selenium Dev List and try to contact James as well, to get a better feel for what was done and what i need to do to understand it.

Update: James contacted me and gave me some more info on the patch. Hopefully this will help me integrate and test it better!

I have a vested interest in having frame support, since the main application i want to test sadly uses iframes to poorly mimic Excel's "Freeze Panes" feature.

The event itself was a lot of fun, even though i didn't technically accomplish anything. Also, this was probably my final user group event of the year.

December 11, 2005

Chicago User Group Goodness

Chicago seems to be buzzing lately, with all sorts of fun stuff.

I have always been active in the user groups in the area, but lately things have really been picking up. Attendance at the perl, python and ruby meetings has been growing at a healthy clip and we are even starting to do more cross-language events (even if this one was being pitched as a fight. ;) ).
Thursday saw the first Perl and Python social event in chicago. A bunch of snakes and camels piled into a crowded Monk's pub on lake, talked code, made introductions, had beer spilled on us by drunk lawyers and stumbled home through chicago's first big snowstorm of the season.

For a couple of upcoming examples, there will be a cross language hack fest for Selenium on Tuesday, December 13th, hosted by ThoughtWorks. Also, the Yet Another Perl Conference North America, which will be held here in Chicago, has extended room out to the local language groups.

Despite the recent fun, one thing that i have found myself doing (and regretting) is spending more time on the language bickering itself over the spirit of an open, dynamic language. People bitching about perl can suck it, since perl pays my bills. :) In all seriousness, though, while everyone has the desire to defend their choices, i really see everyone learning something from the idea pollination that has been happening.

2005 has been, and 2006 looks like it will shape up to be, a great time for Beautiful Dynamic Languages.

October 11, 2005

Catalyst Vs. Ruby On Rails

I have constantly been on the hunt for a great framework for building web applications. My motivation is that writing web applications is 90% boring bullshit.

I have read a lot about Ruby On Rails, Django and Catalyst and have been experimenting with them all with varying degrees of interest and success.

Django is nice and has the advantage of being written in Python. I feel like it is too wrapped up in the style of the applications that birthed it as a framework, though. This fact has pushed Django off to the back for the time being. I am still keeping an eye on it, but my lazy eye is on that job.

Rails has the advantage of being awesome, but the disadvantage of being THE MOST AMAZING THING EVER, DHH 4 EVA. The hype bothers me, even if it is (partially) justified. I finished my first application with Rails this week and i like it a lot. I like ActiveRecord the most, but the whole framework is pretty nice.

Catalyst seems really scrappy to me, but is nice, if a bit rough around the edges. I am working on converting a couple of small mason applications over to it to see what works and what doesn't. The catalyst project could definitely use more tutorials and documentation. To that end, I am presenting an introduction to Catalyst at this month's Chicago.pm meeting. John W. Long of the Chicago Ruby user's group will be presenting on Rails.

Having a task and a deadline has really helped me to learn more about both frameworks and actually solve problems with them, rather than just dicking around with tutorials.

Once the presentations happen, I will post slides up and sample applications.

Anyone interested in attending the presentation can get more information on times and places for the meeting.

June 19, 2005

simple mason app added to Catalyst examples...

The recent perl.com article on Catalyst has me pretty excited.

I have been looking for a better way to use the power of Mason without the mess that most apps start falling towards. The features that catalyst provides look like the perfect fit for what i want to do, and it introduced me to HTML::Prototype, which has allowed me to do a quick ajax mockup for a work application in 19 minutes the other day. Nice.

After reading the article, i immediately started to change the app to use the Mason View instead of the default Template Toolkit view. Sebastien Riedel saw my post about it on the Mason discussion list and added it to the examples for Catalyst. I am flattered, especially since i only did about 15 minutes of monkey work to get this to work. :)

Download MiniMojo-mason from the Catalyst SVN repository.

June 11, 2005

chipy meeting was great

Thursday's chipy meeting was excellent. I was able to meet some great people and listen to some excellent presentations.

Chris's coverage and Ed's coverage already covered the bases pretty well.

We had to stop talking at one point to let people get through all of the presentations that we had, which is an excellent problem to have. :)

The best part of the night, for me, was the fact that no one made fun of my simplistic and perl-ish python in my myghty sample application. :)

May 28, 2005

cool python library

i need to check this out.....

http://www.pythonware.com/products/pil/

December 13, 2004

MTRecentImages honors text formatting plugins

After doing a little bit of digging, I found out how to get the formatted version of an entry (rather than the raw version that I was previously using). What this means is that you can use MTRecentImages regardless of what kind of text formatting you wish to use. I am partial to MarkDown, so I am happy about this fix.

There are no syntax or usage changes with this release, only increased functionality. I have also verified that the plugin works with Movable Type 3.0 and higher.

As always, you may download the newest version at the plugin's home page or via the RecentImages page at mt-plugins.org.

September 20, 2004

The Mighty Mason, or Another Brick in the Wall

What is Mason? The secretive cult that rules the world? How about the web application framework that will rock your world?

HTML::Mason is the web application framework behind Bricolage, Amazon and Salon.com to drop a few names.

On Wednesday, October 6th, i will be presenting a talk on Mason at the Chicago Perl Mongers meeting. The meeting will not be at our normal location in Vernon Hills. It will be at the Grayslake Public Library, north of Chicago, at 7PM. Please be punctual as we will need to be packed up by 8:45.

The talk will focus on HTML::Mason and show a practical example on how to take an existing CGI based web application and convert it to efficiently use (some of) the power of Mason. I will have code samples and the presentation slides posted here by Tuesday, October 5th.

Basic Outline: * What is HTML::Mason? * How do i use it? * Installation * Basic Syntax * Express Yourself. * Why do i need to use some fancy framework? * Re-use/Don't Repeat Yourself * Make the simple things simple, and hard things possible. * Mason tips * The Autohandler * The dhandler * Components * A practical example.

If anyone has anything specific they would like me to talk about, please let me know.

August 15, 2004

MTRecentImages plugin error.

So i just made 2 posts using the Markdown text formatting plugin. (this is my third).

My plugin expects real HTML. Markdown (and pretty much any other text formatting plugin) may not actually have HTML in there. Fun! What i need to do is figure out if i can manually call the Markdown formatter before looking for images if an entry is indeed formatted using Markdown. Until I figure this out, my recent images page & montage page are not updating properly. Grrrr.

August 12, 2004

funny test failure

so I was writing some tests for a module at work that interfaces with another company's product and pulls down reporting data. Sorry, i will not be naming names. :) One of the tests i always like to write is a test to make sure that a call will fail properly as well as succeed. So I proceed to write the following test.


    my $api = MODULE->new({ username => 'invalid', password => 'invalid' });
    ok( !$api->login(), "invalid login should fail." );

To my anger, my login failure test kept failing! I looked at the code a couple of times for errors before it occurred to me that invalid/invalid could actually be someone's account. Sure enough, a manual trip to the site in question confirmed that invalid/invalid was a real login. That is insanity! Add some rules to enforce at least some type of decent password.

Stunning.

August 5, 2004

big release for MTRecentImages

Ok. After this post, i will get to some more interesting things, such as my growing interest in ruby, more fun music stuff and some random garbage. Once my schedule starts to even out, look for more regular postings.

Anyway, thanks to some helpful comments, i have added a few new features to the plugin.

  • Offset to start the list of images off after N images
  • Include/Exclude categories by name or number
  • Image details can be generated as well as image thumbnails.

The plugin can be downloaded from http://www.multiply.org/perl/mtplugs/ and be saved right over your old plugin. You can also read the documentation for the plugin at that link.

What I would like to do is compile a list of people using the plugin and show off some nice examples. If you use it and want me to add you to the list, trackback this post or post a comment.

A couple of the sites that I know are using it come from the very people that helped me form this new functionality. Thanks everyone!!! * rearviewWindow.com * Everything New York * Geren Mortensen * Central Maryland Photographers' Guild

July 6, 2004

Data::Form::Elements is coming out

Well, I have finally put a module out on the CPAN (it's in the temp site of PAUSE right now. Once it gets verified it will go up to my CPAN page).

Data::Form::Elements is a module that provides a nice OO wrapper around Data::FormValidator for dealing with forms. I use it for a large mason site, but it does not have to be a web form. The docs have the pretty straightforward examples and more info.

You can download the module from my site.

Please send me any feedback. :)

June 27, 2004

new montage page

the development version of my plugin has a random detail function that will pull out a part of an image. I am using this right now to add a recent images montage page to the Notebook.

I like the juxtaposition of pieces of each image. Some nice shapes are showing up.

June 14, 2004

auto thumbnailing for MTRecentImages

I have wrapped up v1 of the auto thumbnailing feature of my MTRecentImages plugin.
You can see the new thumbnails in action on the homepage about halfway down the right hand side. Thumbnailing is only turned on if you specify the new thumbnail attributes in your MTRecentImages tag.
This also will only work for stuff on your server, and following a pretty straightforward file structure. By this i mean that if you have fancy apache rules for where things are, the thumbnailing is probably not going to work for you. But that is OK. This can't be all things to all people. I just wanted something simple that I could use.

May 31, 2004

updated MTRecentImages plugin

Well, i have added automatic image thumbnail generation ( at Bill's request). I need to generalize one part of the code and removed my hardcoded hack before i release it, but i should be able to do that this evening. You can see the thumbnails in my recent images sidebar (halfway down the home page). The directory for the thumbnails is configurable as is the maximum size of the thumbnails. I don't want to make this too complicated, though, so I think that may be as far as these options go. Maybe i will add something to fetch remote images to make thumbnails as well, but for now this works solely on local images.

May 16, 2004

bugfix in MTRecentImages

I had a comment on mt-plugins.org in march regarding my plugin but hadn't been notified, so I didn't know about it. I did, however, realize that some of my images were not being picked up by the plugin, so I finally did something about it.

As it turns out, I was only processing the main entry body and not including the extended entry in the fold. This solved my problem, and hopefully it solves that user's problem as well.

You can download the updated plugin now if you need the fix.

February 13, 2004

MTRecentImages update (enough already, with the updates!)

So I have added many requested features (limiting by category or size, exluding by category) and incorporated Ari's contributions to MTRecentImages. Read the docs, install and enjoy!
I should have updated the file with the newer version number (1.0), but i forgot. I will do that later.

February 12, 2004

MTRecentImages extended + New Features coming this weekend.

I received a nice note this afternoon from Ari Paparo regarding my new MTRecentImages plugin. He has added a tag that will return the permalink for the entry containing the image (an excellent addition). Thanks, Ari!
Ari Paparo Dot Com: Image Archives and Image-Only RSS in Movable Type
As for new features, I am in the process of adding features to show only images that match (or don't match) a certain category, plus matches for width, height and file type of your site's images. Should make this quite a bit more useful.
Does anyone have any other requests?

February 8, 2004

Movable Type Plugins Page

I have made a new Movable Type Plugins page to house info about my whopping ONE plugin (although there shall be more to come. There shall!

You can download the MTRecentImages plugin there, plus browse its documenation. I submitted this to mt-plugins.org, so hopefully it gets picked up in a day or two.

February 4, 2004

Recent Images Update

Check out the new Recent Images link, built using my new and improved recent images plugin. I need to submit this to the mt-plugins.org repository. I need to clean up the code, add some POD and put it on it's own nice little page (along with my javascript syndication template).

RecentImages plugin

Excellent.
After some trial and error, I have v1 of my RecentImages plugin for MT available.
Basically, this just loops through your entries until it finds
num_images
worth of images, and will print the ALT text and the link to the image. Use it like so:
<MTRecentImages num_images="10">
   <a href="<$MTRecentImageUrl$>"><$MTRecentImageName$></a><br/>
</MTRecentImages>

To install it, simply make a file called recent_images.pl in your mt plugins directory and copy the following code into it.
#!/usr/bin/perl -w
use strict;
use lib '../lib';
use MT::Entry;
use MT::Template::Context;
use vars qw( $error );

use constant NUM_IMAGES => 10;

BEGIN {
        eval {
                require HTML::TokeParser;
        };
        $error = $@;
}

MT::Template::Context->add_container_tag(RecentImages => \&images);
MT::Template::Context->add_tag(RecentImageUrl => sub { shift->stash('image_url') });
MT::Template::Context->add_tag(RecentImageName => sub { shift->stash('image_name') });

sub images {

        my ($ctx, $args) = @_;

        if ($error) {
                return $ctx->error('Error with : required modules not installed');
        }

        my $num_images = $args->{num_images} || NUM_IMAGES;
        my $blog_id = $ctx->stash('blog_id');

        my $iter = MT::Entry->load_iter(
                        { blog_id => $blog_id }, { sort => 'created_on', direction => 'descend' }
                );

        my @images;

        while (my $entry = $iter->()) {
                push @images, extract_images($entry->text);
#               push @images, { image_url => 'asdf', image_name => 'foobar' };
                last if @images >= $num_images;
        }

        my $res = '';
        my $builder = $ctx->stash('builder');
        my $tokens = $ctx->stash('tokens');

        foreach my $image (splice @images, 0, $num_images) {
                $ctx->stash('image_url',  $image->{image_url} );
                $ctx->stash('image_name', $image->{image_name} );

                # defined (my $out = $builder->build($ctx, $tokens))
            # or return $ctx->error($ctx->errstr);
                my $out = $builder->build($ctx, $tokens);

                $res .= $out;

        }

        return $res;

}

sub extract_images {
  my $content = shift;

  return unless $content;

  my @found_images;

  my $stream = HTML::TokeParser->new( \$content );

  while (my $token = $stream->get_token ) {
    if ( $token->[0] eq 'S' and lc($token->[1]) eq "img" ) {
        my $img_attr = $token->[2]; # the attributes for this image tag.

        push @found_images, { image_name => $img_attr->{'alt'}, image_url => $img_attr->{'src'} };
    }

  }

  return @found_images;
}

December 14, 2003

because I am sooooooo cutting edge...

I have just added an almost compliant ATOM 0.3 feed to the notebook.

November 18, 2003

The Son of Perl Blogging Techniques + ChangeBlog update.

Jeremy Zawodny was kind enough to give my changeblog a nod, so I thought this would be as good a time as any to finally post my updated Perl Blogging Techniques presentation. :)
Download (788K PDF)

The changeblog is about to get some updates, as well. I have started to re-write the chatMonkey server for a multi-user gaming/chat application using POE. Fun!

Read his comments.

November 12, 2003

Javascript Syndication Template

Inspired by a look at XML::RSS::JavaScript by Ed Summers, I decided to crank out an MT template to do the same thing.
Here are the short steps, more details (probably it's own page) to follow:
1) Create a new template file. I call mine "Javascript Syndication." Name the output file rss.js
2) Create a new MT plugin (I called mine mt-rss-javascript-encode.pl) in your MT plugins directory. The code should look like this:
package MT::Plugin::FormatForJavascript;
use MT::Template::Context;

MT::Template::Context->add_global_filter(js_encode => sub {
    (my $s = shift) =~ s/'/\\\'/g;
    return $s;
});

1;

That should just about do it. Then, to use it, give someone the following snippet of JS:
<script Language="JavaScript" src="rss.js" />
Here is an example: Sorry. The embedded script in an entry was freaking out my RSS feeds. You can see the results in the "Recent Code Changes" section on the side of the screen.

October 9, 2003

Blogging Talk (take two!)

I will be giving my Perl Blogging Techniques talk again this coming Tuesday, October 14th @ the Uniforum PerlSIG (special interest group).

Check the Uniforum site for details and directions.

CPAN contributions

Just finished up some changes to HTTP::Recorder that I submitted to the author. Hopefully those should be rolled in to the next release.
The changes are:
1) Links are properly generated with the right index (ie, the 3rd link called "Download."
2) added checks so that only responses of type text/* are modified by the script (this lets images and other binary files come through OK).
3) Fixed a small problem where incorrect Content-Length headers would be sent due to the modifications the script makes to log everything
4) Added some space between requests in the log file and added a comment function.

October 8, 2003

CPAN ID

I am now an officially registered Perl CPAN developer. I have some web testing modules, some blogging modules and some other random stuff in mind (like contributing to the excellent HTTP::Recorder).

Hopefully my CPAN profile page will look a little more exciting soon(tm). ;)

September 30, 2003

sorry. i really should set up a testing blog. ;)

i promise that I will set up a test blog for all of my garbage postings.
This is an annoyance to all of you who read my site and expect quality. Real quality. Not some garbage from a guy that can't be bothered to set up a testing blog for his garbage. ha!

testing my console settings!

Well, shiver me timbers.
I wonder if this is really going to work. I would certainly like that.
Boy oh boy would that make my little heart go pidduh-padduh.

September 19, 2003

foiled by verisign

well, i tried to send verisign's sitefinder a polite note and this is what I get:

[jason@tetsuo jason]$ telnet 64.94.110.11 80
Trying 64.94.110.11...
Connected to 64.94.110.11.
Escape character is '^]'.
FUCK OFF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>405 Method Not Allowed</TITLE>
</HEAD><BODY>
<H1>Method Not Allowed</H1>
The requested method FUCK is not allowed for the URL OFF.<P>
</BODY></HTML>
Connection closed by foreign host.

mrtg is a good thing

After reading unix-girl's post on mrtg, I remembered using it a long time ago for a job. This may be able to help me with isolating why the colo box reboots every now and again. If i can isolate traffic spikes or figure out if it is totally random, I will be happy. Of course, maybe if the host moved it to a better spot in the facility it may help as well, considering they once "accidentally" unplugged it.

I need a chart to demonstrate the uptime. Maybe then I can get to the bottom of this.

;)

September 18, 2003

blogging talk article and comments?

My talk at Monday's Chicago PM meeting went pretty well. There was some lively discussion, although I need to rearrange part of the talk.
In that spirit, I am starting work on converting the talk to an article or a set of articles. If anyone has any comments, please send them over. Also, thanks to everyone at the meeting for suggestions and questions!
Also, I will be giving a modified version of the talk at the upcoming Uniforum perlSIG at the college of dupage (details / directions).

September 15, 2003

Perl Blogging Techniques code and handouts!

Hi All.

I have finished up the handout materials and code samples for my Perl Blogging Techniques talk at tonights Perl Mongers meeting. The samples are available for downloading now. The handout is a PDF file.

September 11, 2003

Apologies and announcements

Thanks for tolerating a few weeks of random, incoherent posts (most of which have been deleted).
In the process of wrapping up the code for my perl blogging techniques talk, i made lots of test posts which should have simply gone to a test blog. Ha! I am not that smart. ;)
Anyway, new content to expect here soon:


  • Zelda: The Wind Waker extensive review

  • Golden Sun: The Lost Age review

  • Big Questions review

  • Local gallery observations

  • Photo galleries


Also, in an effort to organize my coding projects, I have set up changeblog. Changeblog will detail what I am coding. Exciting, eh? Anyway, check it out, hopefully it will be chock full of interesting goodies.

[SushiBubblegum CVS] CVSROOT

Update of /usr/local/sbgcvs/CVSROOT
In directory tetsuo.mengelt.com:/tmp/cvs-serv31277

Modified Files:
modules
Log Message:
Removed flaky build docs script from modules.

[SushiBubblegum CVS] chatmonkey

September 10, 2003

Basic Scripts completed for Perl BLogging Techniques

I have finished the basic posting scripts thanks to Net::Blogger. The module is good, if poorly documented. I could write docs, I guess, but I am busy. ;)
Code samples and talk slides to come soon.

August 30, 2003

Technorati down. :(

Just when i was getting ready to open up Net::Technorati (assuming someone else hasn't started already), the Technorati servers are unreachable. Feh.

August 29, 2003

MT Plugin idea

For the talk (but useful in general, I think), I am going to make an MT plugin that looks for patterns that look like CPAN module names. If they are there, it will change them into a link to the homepage for the module on the CPAN.

Mech Hack script input prompt test post.

Ok.

I have hacked the WWW::Mechanize MT hack so that it properly follows the F(*$ing javascript redirects. It also asks for input. Yay.

I basically want a shell script so I can do this at a prompt (where i am most of the day):
mtpost
title
entry

Nice and quick. Nothing really to fire up except for perl, but that is lickety split here.

WWW::Mechanize hack (the saga continues)

OK. I think I nailed it.

WWW::Mechanize hack

How many javascript onload events do they need?!?!?!

WWW::Mechanize hack

How many javascript onload events do they need?!?!?!

August 27, 2003

WWW::Mechanize hack (from examples)

This post comes from Dan Rinzel's WWW::Mechanize MT hack. I want to integrate this with some of the XML-RPC interfaces to make a more complete posting tool.

August 24, 2003

blogging talk outline v1

I have the first outline put together for my upcoming blogging talk.
Any comments are appreciated.

Continue reading "blogging talk outline v1" »

August 11, 2003

random postings

i will be testing out some alternative interfaces for movable type here, so bear with me for a short string of pointless entries.
And, yes, I am aware of my audience size, so Bill, this message is for you.

hi there

hi there

(posted via Net::Blogger::MovableType)

August 9, 2003

perl blogging techniques talk

I am giving a talk next month at the chicago.pm meeting on perl blogging techniques.

The following topics will be discussed:
1) blogs as webservices
2) blogs for syndication (RSS/RDF)
3) mobile blogging (with kpix & the skog as examples)

if anyone would like to give me a second (or third) set of eyes on the talk before I give it, it would be greatly appreciated!

July 24, 2003

more testing stuff from Andy Lester

Yay! I couldn't make it out to Portland for OSCon, but Andy Lester's presentation is posted on the O'Reilly site. The talk is one testing large projects. Neat.

O'Reilly Open Source Software Convention 2003

July 18, 2003

Fellow Chicago.pm'er up on O'Reilly's site

Fellow Chicago.PM'er Andy Lester has this great little article on the O'Reilly Network site called O'Reilly Network: Process improvement on the sly [July 18, 2003].

At my last job, for a while I was a one man development shop and CVS was a lifesaver. Not only did I have a rich set of backups in case I lost (or a client deleted) some code, but a project manager or another developer could look in and get a history of the changes in plain language, not only in code.

Also, as a new convert to automated testing, Andy's first testing talk is a great introduction. I hope that he will put his recent OSCON speech up as well.

July 7, 2003

here come the SKOGS!!!

Now, armed with only a pdaphone, a server with sendmail, a free sketch program and a 40 dollar palmOS email app, you too can run your very own SKOG!
What is a skog you may be asking yourself? Well, step right up!
SKOG is a gawky combination of the words sketch and log. Kind of like BLOG is part of the word weblog (despite a weblog being, for the most part, an IIS or Apache log file and NOT a journal-ish, slashdot-ish site).
View the very first SKOG right here at multiply.org
http://www.multiply.org/mobilesketches/.
The SKOG setup is a variation on the moblogging stuff I set up for setpixel this weekend. As i clean up the source and add some basic security I will post it up for consumption here. If you are dying to get your hands on it and are comfortable with some perl, email me and let me know that you just gotta have that wacky code!

July 4, 2003

moblogging

I cranked together a little moblogging script last night that accepts pics and text via email and saves them out to a gallery. Very v0.1 but definitely a good start.

Anyone interested can email me for the code, but you need to have access to a sendmail alias file to make a mobile adddress that will post. Then there are security and permissions concerns. Ah well. It is a start. Email me if you want a copy of the script.

April 21, 2003

chicago.pm SOAP talk

I just got back from my first chicago perl group meeting and it was a lot of fun.

Ed Summers gave a great introduction to SOAP::Lite and webservices in general. His talk is archived here:
http://ink.inkdroid.org/talks/soap/. Thanks, Ed! I would actually like to do a companion talk at some point to talk about the success of webservices for blogging. I should try to put something together.....

The group was an interesting bunch. For each, "I use perl for XYZ at my job" story there was a matching, "I used to use perl for ABC when I HAD a job...." story. feh.

All in all a good evening. Some ale, some code talk and some new contacts.

February 8, 2003

Yay! Did it!!!

Allright, now we're talking.

I finally have php 4.3.0, MySQL 3.23.X, apache 1.3.27 and mod_perl 1.27 installed!

I ripped out the default perl install from redhat 8, as well as php, mysql and mod_perl, since they were all using the latest stuff. I, of course, only have books and tuts on mod_perl 1. grrr.

Anyway, I have some books coming from Sams for mod_perl and apache 1/2 stuff, so that should help out with that.

Tracey, Juliana and I will be heading out to do a little shopping here in a little bit, but when we get back, more Perl!!!!

Muhahahaha

February 7, 2003

lots of configuration

well, last night I recompiled perl 5.8.0 on my redhat 8 system.

It actually went pretty smoothly, but there were latin8->utf8 problems. I don't actually know what that means, but i had trouble compiling a bunch of modules. ;)