Archives for January 2009

January 2009 (28)
SMTWTFS
« Dec Feb »
123
45678910
11121314151617
18192021222324
25262728293031

Like this Archive Calendar widget? Download it here.


Chaining fun with window.onload

I set myself a task: write some raw JavaScript for a web page. By raw , I mean no jQuery, no Prototype, no MooTools, just me and the editor. Because I wanted to reduce the effect I had on the global footprint, I declared one global object like so. var FOO = { // stuff initialize : function () { // setup stuff } }; So far so good. I then wanted that initialize() function to run once the page was loaded. The immediate solution was this: window.onload = FOO.initialize; But that causes a problem in that...

READ MORE

EZDSL for Delphi 2009

As mentioned here a while back, the number of changes needed to make EZDSL compile with Delphi 2009 are minimal. The main reason, I suppose, is because EZDSL doesn't use strings all that often and when it does, it uses the string type without doing any clever stuff with any instances. So, there are all the changes: EZDSLHsh.PAS: there was a packed record in there, an early beta of D2009 complained about the packed keyword, so I removed it. Shouldn't make any difference to any other Delphi (not that...

READ MORE

Party Shuffle Friday

I was messing around with iTunes just now and I clicked on Party Shuffle for the first time. Heh, it generates a constantly generating playlist of random songs, and that gave me an idea for a regular blog post: Party Shuffle Friday. Mark Chu-Carroll on Good Math, Bad Math does a similar thing, so I'm going to shamelessly plagiarize his idea and give it a new name. 8 easy steps , by Morissette, Alanis, from the collection . This was one of those CDs that my wife buys for a single track and then never...

READ MORE

Archive Calendar for GraffitiCMS released

Well that didn't take too long. Just enough time to open up an account at CodePlex, start a new project, point TortoiseSVN at it, and upload. The biggest time sink was actually the readme file and deciding on the license (I went for the MIT license ). I've now published the Archive Calendar for GraffitiCMS on CodePlex . You can get it here . If you want the source code, you can download it from the project's repository. Now playing: Matt Bianco - Wap Bam Boogie (from Indigo )...

READ MORE

PCPlus 264: Regular expressions

I write a monthly column for PCPlus, a computer news-views-n-reviews magazine in the UK (actually there are 13 issues a year — there's an Xmas issue as well — so it's a bit more than monthly). The column is called Theory Workshop and appears in the back of every issue. When I signed up, my editor and the magazine were gracious enough to allow me to reprint the articles here after say a year or so. After all, the PDFs do appear on each issue's DVD after a couple of months....

READ MORE

Making the Calendar into a Graffiti CMS Widget

Last time I kind of trailed off. The Archive Calendar was working fine as a Chalk extension and I had a business trip to make for a week and doing the work to change it into a widget wasn't at the top of my list. Earlier this week, though, back safely in Colorado Springs, I spent a couple of hours extracting it all out as a joint widget/Chalk extension assembly, all ready for posting on CodePlex. Since this is the first widget I'd written, and since the official help page is a little, er...

READ MORE

Writing an Archive Calendar, part 4b

Man, paging — the second bug I'd reported to myself in part 4 — was long-winded, mainly because I was trying to use the built-in paging system and spent far too much time tracing through Graffiti code in Reflector. In the end, I abandoned that line of attack, mainly because I think I'd been gaming GraffitiCMS by creating a "post" called archive, when it was really a list of posts, and the auto-generated default.aspx was all wrong for that purpose. Further investigation will wait for a rainy...

READ MORE

Writing an Archive Calendar, part 4a

OK the first bug I reported to myself in the previous post was trivial to fix. I changed the PostReader class to add a couple of new methods GetFilteredPostsForMonth() : public static PostCollection GetFilteredPostsForMonth( int year, int month) { return GetFilteredPostsForDate(year, month, 0 ); } and GetFilteredPostsForDate() : public static PostCollection GetFilteredPostsForDate( int year, int month, int day) { PostCollection posts = GetPostsForDate(year, month, day); PostCollection filteredPosts...

READ MORE

Writing an Archive Calendar, part 4

Not much more to discuss for phase 1 of the Archive Calendar since we've covered the code. This post is a kind of wrap up (although it does contain a couple of warnings at the end) and we'll talk about what you have to do in order for the calendar to actually work and display the archived posts. First up: to display the calendar on the home page just enter this into your layout.view file (or the home.layout.view ), essentially in one of the sidebars. $JmbChalk.ShowCalendar() and the calendar will...

READ MORE

PCPlus 263: Generating simple permutations

I write a monthly column for PCPlus, a computer news-views-n-reviews magazine in the UK (actually there are 13 issues a year — there's an Xmas issue as well — so it's a bit more than monthly). The column is called Theory Workshop and appears in the back of every issue. When I signed up, my editor and the magazine were gracious enough to allow me to reprint the articles here after say a year or so. After all, the PDFs do appear on each issue's DVD after a couple of months....

READ MORE