About Kent Cowgill
Articles filed under...
.vimrc 9-11 acme aging algorithm andylester array attitude autocomplete baggyshorts BEGIN bestpractices big bike bikeshop bilk birthday blog bmi body_composition botanicgardens broken bugs bulge bumbo burnout bus butterscotch buzz cache calculator camera catalyst catnip cgi chart chin chinups chiropracter claim clog cloud code codger comics community commute complaint confusion constant coo cooking coworker cpan css dad database datamodel datatypes dbi deal debugging design devin docs documentation dsl ebook error exercise exhaustion Exporter feature_creep filecache firstpost fitness flattire flat_tire formatting fundraising funny google google_maps gravatar grilling groceries harness hash helmet highlight history home houston html humor identity ie imager indirect internet ipod journal kate kettlebell keynote kids ladder launch lazy legacy lisa lisanne list logarithmic lolcat macbook-pro maintenance map maps matthew memories meta michaelmckenna modules mom money monger mongers montreal motivation movie mvc mysql nasty notation objects offroad old oops optimize orm ouch outrage ownership park patrick paw pdf perl perlcritic phb photos pictures pinch presentation presentations principles programming progress push pushups rabbits racecondition rain rant reader recipes refactor requirements review ribs ride route run_on_sentences shadow shake site sitting slides sneaky soda sony sore soreness sorting spacebar speed spike spring sprint sql sqlite squeaky squeal statistics subversion syntax tag tags talk talks tap tasteofchicago tasty teachers technorati test testing tests text textile tire trac traffic trail training treats trick tricks tweak tweets twitter twitterpated updates ups vandalism versioncontrol video vim vimrc walk warren weather weblog welfare wikipedia winter wisconsin wishlist work workaround workouts xkcd yapc yapcna2007 youtube yummy zap

A R C H I V E S

(16)
(3)
(4)
(2)
(4)
(11)
(1)
(1)
(3)
(2)
(2)
(10)
(5)
(2)
(3)
(4)
(9)
(21)
(3)
(3)
(1)
(6)
(4)
(1)
(4)
(3)
(2)
(1)

    Is Kent Cowgill Online?
    View Kent Cowgill's profile on LinkedIn
    Add to Technorati Favorites

    Recent Entries...

    Week 3, day 2 for push ups

    I'm posting a bit more than a day or two per post, hoping I ...

    Chin ups week 1 column 2, push ups week 3

    August 6: Push ups: 27 then 20 (wow these seem tougher than...

    Exhausting chin ups, continuing with push ups

    August 4: I'm really glad I took the opportunity to rest ...

    Logarithmic tag cloud

    It's been a while since I've posted anything technical. Pos...

    Weekend bike rides

    August 2: I got out on my bike today. I had to raise the s...

    Still week 3 for push ups, finishing week 2 for chin ups

    July 31st: Push ups: 27 then 19 then 19 (the last 5 of whic...

    Tough push ups, and easier chin ups? Oh, kettlebell, too!

    July 29th: The push ups day I'm dreading. I'm feeling mostl...

    Push ups exhaustion test, continuing on with the chin ups.

    July 27th: Exhaustion Challenge, push ups. 31. Kind of dis...

    Weekend Respite.... or is it?

    So I ended up buying a kettlebell and getting back on my bik...

    Gotta keep going - on with week 2

    July 25: Super tired today. Woke up very early, had a pedi...

    weblog | `web·lôg -läg |
    noun
    Another term for BLOG
    ORIGIN 1990s: from web in the sense [World Wide Web] and log in the sense [regular record of incidents.]
    blog | bläg |
    noun
    A web site on which an individual or group of users produces an ongoing narrative.
    ORIGIN a shortening of WEBLOG.

    Figured it out, pictures are a-flowin'

    Kent Cowgill

    Sweet.

    It only took re-writing the thing from the ground up, switching out completely the modules I was using - but I finally managed to get that silly picture stripper/thumbnailer working again.

    Were it not for Imager by Tony Cook or Email::MIME::Attachment::Stripper by Casey West (with my friend Yaakov recommending the former and perlmonks.org for the alternative to MIME::Parser) - I'd still be spinning my wheels.

    During the debugging, I'd get MIME::Parser to appear to work, but then Image::Magick would stop working. Or MIME::Parser would fail me in strange and non-reproducibly ways but Image::Magick would faithfully render an incomplete image file.

    But no more.

    Related Photos: perl imager photos

    New Years Resolution

    Kent Cowgill

    I've resolved to figure out why my photo uploader keeps cutting off my pictures I email from my phone.

    It's driving me crazy - it used to work like clockwork. Snap a little photo with the phone, punch a few buttons, click click bang, and whaddaya know, my photoblog gets automatically updated. With a thumbnail and a picture that aren't broken.

    I'm working on it as I write this, waiting for slow email to arrive at my server.

    We'll see...

    Related Photos: photos bugs debugging

    Finally figured it out!

    Kent Cowgill

    So, I'm a moron.

    Seems I'm not making proper use of the Model:: modules. I had originally found an old out of date tutorial making use of the Class::DBI helper scripts, so that's what I used in making this blog. Problem is, the tutorial was woefully incomplete, AND CDBI seems to work - at the surface - without any additional configuration.

    Except when you have a stupid datamodel that requires you join a table to itself and get a count of child rows for each parent row.

    These days, using Class::DBI seems frowned upon by the catalyst community, so I think instead of trying to fix what's broken, I'll just use a different model to access my data - HOPEfully one that isn't woefully broken, lets me write some of my own nasty SQL and actually reference the correct results to stuff into TemplateToolkit.

    Too bad I'm busy working on my wishlist, otherwise I'd tackle this issue straight away.

    Newest to do list

    kent Cowgill

    Ok, now I really need to concentrate on the formatting.

    I think for now I'll just do some simple multiline substitutions. A single linebreak gets turned into a br tag, two linebreaks next to each other get turned into para tags (which of course means that the beginning of all entries get a para by default). Update: I'm just going to use Textile.

    Next, HTML entities will go away. Cross site scripting anyone?

    Maybe there's already a plugin for this... (Catalyst::Plugin::Textile?)

    1. Add skin support
    2. Add parent topics to the top of the view template, add links to the recent table to read more of the recent posts.
    3. Maybe don't show "view" links for 0 replies?
    4. Add a threaded view. This will involve some more advanced SQL.
    5. Look into Class::DBI::Sweet - see if I can translate my single table join-to-itself query with Sweet - why junk up my code with ugly SQL?
    6. add next and previous navigation once I get over 10 entries.
    7. Move the SQL code to the Model object! :)
    8. Continue to tweak the look & feel. Maybe move it from index.tt to the header.tt. Maybe instead re-think the templating system?
    Related Photos:

    New To do list

    kent Cowgill
    1. Fix formatting. Implement either WikiStyle or some other psuedo-html formatting. At the very least, encode line breaks. They're killing me. While I'm at cleaning up the input, how's about cleaning up the input? :-)
    2. Add the no-cache header.
    3. Add skin support.
    4. Add a real threaded view?
    5. Low hanging fruit: incorporate some better navigation, look & feel, left hand navigation, etc.
    Related Photos:

    nasty sql

    kent Cowgill

    Ok, I'm not one for figuring out nasty SQL. I was about to ask my friend Devin to lend a hand, since he's really good with SQL. However, I was able to figure out what I was looking for, and that was:

    
       select a.blog_id,
         a.blog_parent_id,
         a.blog_title,
         a.blog_date,
         a.blog_authorname,
         a.blog_authoremail,
         a.blog_entry,
         count(b.blog_id) as child_count
       from blog a left join blog b
       on a.blog_id = b.blog_parent_id
       where a.blog_parent_id is null
       group by a.blog_id
       order by a.blog_id desc
    
    
    

    And the result of that query counts the sub-comments for each main comment in the very blog you're looking at now ;)

    Related Photos: sql devin nasty

    To Do list

    kent

    These are some of the items on the current to do list. If you'd like to suggest some features, just click on the "Comment on ..." link at the bottom of this post.

    1. Fix formatting, maybe parse text in a wiki fashion. Don't make the users type in HTML for things like bold, italics, etc.
    2. Change the database schema to support child posts (for comments on posts).
    3. Implement comments :-)
    4. Add the no-cache header.
    5. Maybe do some quality checks on the input, to make sure no crap gets put in.
    Related Photos:

    A little more detail on using a new model

    kent Cowgill

    The first time around, I was using a flat(ish) SQLite file, which worked just fine from my development platform, i.e. running the server as myself, connecting to it on port 3000.

    All well and good, but once I moved the application over to running under mod_perl, I kept getting errors like "Can't open readonly file" "Can't open any file" etc. I was sure it was permissions, so I chown'd the database file to nobody, and iteratively worked up to chmod'ing it to 777 - even moved it to a more publicly accessible location.

    I still don't know what it was. Instead, I moved my database schema over to a mysql database, regenerated my Model modules with the helper script, changed the Model module's references (before I refered to the Model module as blog::Model::CDBI::Blog, but I had to change that to blog::Model::CDBI::mysql::Blog in two places in my Controller - but other than that, *every*thing else worked flawlessly, including the ability to add new posts :-)

    Related Photos: catalyst datamodel orm sqlite

    first post

    kent Cowgill

    this is a test to see if the 'ole MVC framework really delivers on the promise - i just pulled the model rug out from under it without changing any other code... does it work? can i add entries to my new shiny database?

    Related Photos: firstpost mvc

    Journal entries started!

    Kent Cowgill

    Ok, once again I'm burning the midnight oil trying to digitize the whole of my experiences on the ride. Or at least the 11:30pm oil. Whichever.

    So I've put up the beginnings of my journal, but please keep in mind that I'm typing this stuff out as fast as I can!

    I've also starting putting captions on my pictures because I suppose I just felt like doing a lot of typing ;)

    Enjoy for now, and I'll post more when I can :)

    Related Photos: journal bike ride

    Newer articles | Main Page | Login | Older articles

    Do you want to buy me ? Find more gift ideas at my wishlist