|
Recent Entries...
On track so far...
The week is about half way over, and so far I haven't skippe...
My pants are on fire!
I lied.
Friday evening I didn't do anything.
Saturday ...
Playing catch-up
It's been a while since I've updated my P90X progress.
A ...
Re: Yoga kicks my butt
You should try a different yoga mat. I highly recommend the...
Yoga kicks my butt
It's time for a confession.
I haven't done an entire Yoga...
Recovery week comes in the nick of time
Since it's been a few days, and I know I've rearranged my in...
Early to Bed, Early to Rise
So I'm not exceptionally healthier, wealthier, or wiser. Bu...
Chest and Back, week 3
Sure, the date that's listed for this post is 10/28, but it'...
No Procrastination, Some Pain, Some Gain
After much cajoling and self-flagellation, I convinced mysel...
Odd Math
I must be counting something wrong.
Granted, I haven't be...
|
|
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.
More updates
 Posted by
on Wednesday, March 28 2007, 7:12pm
You've probably already noticed, but I've added some additional organizational capabilities in the form of categories that each post is filed under. To the right, you'll see a little "cloud" of topics I've posted about - and the more often I post about something, the bigger the topic appears in the cloud :)
Also, I've gone ahead and tagged all my articles. Thank goodness I'm doing this now, because I'd hate to have to go back and do it after hundreds of posts :)
I've also done a lot of tweaking and refactoring of the Catalyst code that powers this thing - I started noticing a lot of repeated code for doing things like formatting posts, obfuscating email addresses, etc. So I'm doing what I can to get rid of that duplication. The only visible effect you'll see from this is that from time to time, you'll probably get an error message - that just means I'm right in the middle of fixing something :)
(Maybe I should have a prettier error message?)
More updates
 Posted by
on Sunday, March 25 2007, 10:00pm
So, it's nothing particularly earth shattering, but I've made a few updates.
- I've added an "archives" section, so it's a lot easier to jump to older posts if you're looking for something I wrote in a given month and year. Granted, there's not a lot to choose from at this point, and it's pretty obvious where I took a few breaks from posting (the first break was pretty long, and in fact was due to some of my misunderstandings).
- I decided that making the links for newer/older posts to be like
/start/blah/ instead of like ?start=blah really wouldn't be that tough, so I just went ahead and did it. I'm wondering if this is a good way to go about it though, since the "start" links are fairly ephemeral - for each and every post, those numbers shift.
- I also broke some of the uglier code out to separate subroutines. The following seemed to clutter things up in index:Local:
map {
my $hashref = $_;
my $entry = $hashref->{blog_entry};
$entry = $c->textile->process( $entry );
if( $entry =~ m/(<pre.*<\/pre>)/s ){
$entry =~ s/(<pre.*?<\/pre>)/
blog::View::Code->vimformat($1)/xseg;
}
$hashref->{blog_entry} = $entry;
$hashref;
}
blog::Model::BlogDB->get_roots( $startrow );
Also of note is that most of the temporary variables above are leftover from when I was using Kate for code syntax highlighting - the "format" method clobbered (didn't localize) $_, so I had to assign $_ to something else. I could probably take that part out and condense it a bit, but I'm not yet sure if that would interfere with readability.
Related Photos:
None
History in the making
 Posted by
on Sunday, March 25 2007, 3:33pm
Ever wonder what my earlier posts were?
Ever wish you could read more than just the last 10 entries?
Wonder and wish no more, there are now links at the bottom of each page for reading older articles.
Though I should really fix it so it doesn't use the old school ?start=blah style of navigation. But I didn't feel like reading the Catalyst documentation just right now.
Related Photos:
None
Text::VimColor works!
 Posted by
on Tuesday, March 20 2007, 12:28pm
Turns out I was able to get Text::VimColor to work after all - seems I wasn't quite reading the documentation properly. See, vim needed a little help to figure out what's what - in this case, what kind of terminal it's attached to (which it isn't in this case, which is running as a CGI under apache).
According to the documentation for vim:
-T {terminal}
Tells Vim the name of the terminal
you are using. Only required when the
automatic way doesn't work. Should be
a terminal known to Vim (builtin) or
defined in the termcap or terminfo file.
So all I really needed to do was give it a hint so it wouldn't complain about not being attached to a terminal. Therefore, the solution is:
my $vim = Text::VimColor->new(
string => $code,
filetype => $filetype,
vim_options => [qw(-RXZ -i NONE -u NONE -N -T xterm) ],
);
Unfortunately, it's slow.
It's a known issue - this is why Apache::VimColor uses caching to speed up the HTML generation. In fact, with five code snippets on the main page (just prior to this current time of writing) case the page generation speed to go from about 0.07 seconds to nearly 1.1 seconds. That's quite an order of magnitude increase. And that's not counting adding these two snippets in a single post, nor the posts in the future that will undoubtedly have more code and other syntax colored snippets.
Related Photos:
None
Kate doesn't do VIM
 Posted by
on Sunday, March 18 2007, 3:03pm
I guess I shouldn't be surprised.
I was hoping to post up bits and pieces of my .vimrc file - after all, Text::VimColor displays .vimrc syntax just fine. Naturally.
Unfortunately, Kate doesn't appear to support .vimrc files.
At least not yet.
Until I write Syntax::Highlight::Engine::Kate::Vim, I'll have to make due with using the 'LPC' syntax file, which at least colors comments differently from non-comments , and somewhat reliably.
Here's a snippet from my .vimrc for some new (to me) features that I've been playing with lately:
set tabstop=2
set expandtab
set shiftwidth=2
set autoindent
set smartindent
vmap <tab> >gv
vmap <s-tab> <gv
Enjoy!
(Note, due to difficulties and annoyances beyond my control, I've manually edited the above snippet using Text::Textile formatting.) Figured it out.
Trying to display pre tags inside a pre block
 Posted by
on Saturday, March 17 2007, 11:00pm
I think I know why I can't show HTML pre tags inside a pre block, and it's not Kate's fault, and it's not Textile's fault.
It's my fault.
if( $text =~ m/<pre class="([^"]+)"/s ){
$lang = $1;
$text =~ s/<pre[^>]+>(.*)<\/pre>/$1/s;
}
See the problem?
I'll probably have a few more posts about this until I figure it out.
But it's not like you were doing anything better than reading this :)
Syntax highlighting
 Posted by
on Saturday, March 17 2007, 4:00pm
Always looking for inspiration, I happened upon Jonathan Rockway's blog and noticed that he makes use of syntax highlighting in his Angerwhale blog. After a few aborted attempts to use Text::VimColor, I broke down and decided to try out Syntax::Highlight::Engine::Kate.
I'm pretty pleased, after I finally figured out enough of how it formats bits of code and how to translate that to my vim colorscheme of choice.
All it takes is the following modifications to your text:
<pre class="Language">
# your code here
And if Kate recognizes your 'Language', it'll format your text.
N.B. -- I can't quite figure out how to show a closing 'pre' tag inside a 'pre' block. Hope that doesn't offend you.
Pardon my dust
 Posted by
on Sunday, February 25 2007, 11:00pm
Please forgive me - I'm working on updating this. "This", of course, can mean different things. But what I mean is that I'm working on finishing my Grand Unification Project. What's that? Well, I'm finally bringing everything together. And finally making my blog public. It's done in Catalyst, everything else is plain CGI.
All this means is that you might find some things that don't work from time to time. If you encounter this, please excuse me. I'm only human. I can't know about every single bug. Yet.
So far, most of my blog has been updated. I even have a new version of my photos up and running. Even my resume has been somewhat updated... :)
Catalyst wins again
 Posted by
on Thursday, February 15 2007, 12:00pm
So I'm in love with catalyst all over again.
I got tired of trying to figure out all these fancy-schmancy Object Relational Mapping database classes and trying to massage them to be able to understand my simplified database - which is a single table which is joined to itself for attaching a comment to a particular entry. I really didn't see any need for a separate table, since the structure of a comment doesn't really differ from the structure of a root post. Other than the fact that a root post doesn't have a parent.
Thinking that restructuring the database was just too much work, I just ripped out the ORM and created a model class that simply ran queries and returned the results.
Also, I added support for running my blog as a CGI and found that it was a really simple conversion, and only needed to update a few methods that I wasn't properly using before.
Related Photos:
None
Finally figured it out!
 Posted by
on Tuesday, December 19 2006, 12:00pm
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.
Related Photos:
None
A little more detail on using a new model
 Posted by
on Tuesday, May 09 2006, 4:34pm
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:
None
|
|