Half-Penny For Your Thoughts

rounded down to the nearest cent



Categories


Recent Articles




Graffitiwok

jQuery and GraffitiWok

So, GraffitiWok is heavy on the javascript, heavy on the ajax-y goodness, etc. I started out using Prototype. Actually, Prototype worked pretty well, but I became frustrated with it. It does so much that it was making it difficult to get my own custom code going. So, I tried mootools, but that ended up causing some weird problem slowing down everything. I gave up and went back to prototype.

Later, I started needing to do some remote form submittal. Rails has helpers to generate the code Prototype needs, but it’s pretty nasty code if you don’t have the helpers. And I didn’t feel like writing them. That’s when I found this slide show, which shows some advantages of using jquery. Particularly, it’s easy to use without all those Rails helpers (Prototype is a bit too Rails-centric, in my opinion). For a js-heavy app, I wanted to have that control to not need to rely on helpers in my views that I didn’t understand.

So, I started with jquery, and the excellent array of available plugins. I have no intention of using prototype again. Jquery may not be the best js library out there (and no doubt which is best depends on the usage), but I find it much easier to use than prototype.

I did miss one thing with prototype, which was it’s “class” structures that look and feel more like Ruby than the typical javascript class structure. But, then, Prototype messing with javascript at all sorts of levels was one of the things that got on my nerves, so I was in some ways glad jquery does build in that kind of thing. Instead I went searching for a separate library.

This base.js script does the trick nicely, and it’s a separate piece that I can add in to a project or not, instead of one monolithic library that just does too much. Combined with jquery and a few choice plugins, it saved me a lot of time on the javascript for GraffitiWok.


Graffitiwok

Built with Merb and DataMapper

So, GraffitiWok was my first adventure using Merb and DataMapper after a fair amount of Rails experience. Although, I stopped fairly near the beginning to work on my blog app, Wistle which also benefits from these great libraries. Some thoughts about using them.

Merb

I’m excited about the forthcoming merging of Merb and Rails, because I really like Merb, but it doesn’t have all the toys Rails has. Part of that’s good, because I don’t always want even most of the Rails stuff. As I understand, the merging will include Rails having Merb’s ability to specifically load various parts of the framework (and different ORMs, testing libraries, etc). The ability to have more control over dependencies is really nice, even when I’m not concerned about memory: I just like having a better idea of what all I’m loading with the app. For GraffitiWok, there wasn’t a whole lot I needed.

I did start using haml more than erb. Haml is great, although I’m still more comfortable in ERB. I guess that’s mostly personal preference.

The display method (roughly similar to Rails’ render method) is one of my favorite features of Merb and something I use consisently in the GraffitiWok code. It’s just easier to use. I also really like that what’s rendered can just be a string returned from the action method. Much more simple and logical, at least to me.

DataMapper

There are occassions when I just don’t get DataMapper. Like how do I order a query by random(). Seriously. Anyway, the models in GraffitiWok were pretty simple, except maybe the user stuff. I really like listing the properties in the models. Anyway, for the most part I’m more than willing to say goodbye to active record. I can’t think of any particularly telling example, but DataMapper just makes more sense to me. I guess it’s the feeling that there’s less crazy magic going on.


Graffitiwok

GraffitiWok.com

Well, I have another little fun web app up and running. Check it out at GraffitiWok.com. Aside from the chance to advertise a site from which I don’t expect to ever profit, I thought I’d share a bit about developing it, with this article as an intro and then some additional discussion in later articles.

The Idea

The concept is that off post-it type notes on a board of no particular size limit. Actually, the real concept was a web site that acted as a wall on which people could draw, but alas. Features I’ve considered and may not get around to are the ability to add pictures and videos to this “wall” or “board” as I’ve ended up calling it in the code. Actually, I think it turned out kind of neat. It’s just that it doesn’t actually meet any need that I can think of. Oh, well, it was fun.

The Technology

GraffitiWok introduced me to several technologies: Merb, a Ruby web framework soon to be integrated with Rails, DataMapper, a Ruby ORM, similar in theory to ActiveRecord, although rather different in practice, jquery, a javascript library, and the version control software git. For those who follow this blog, you’ll figure out that this project has been a long time in process, about a year with seeds before then, as Wistle uses Merb and DataMapper; GraffitiWok actually proceeded Wistle.

Anyway.

It was a fun way to learn about these technologies and that’s what the follow up articles will be about.

Developed for Firefox

Yes, it works in IE. It might even work in Safari and Opera (I haven’t tried), but I really developed this to work in Firefox. Why? Because I could. After all, it was primarily for fun, not money, and I didn’t feel like worrying about browser incompabilities. Although, thanks to jquery, those are probably minimal. Still, it was really nice not spending a great deal of time jumping between browsers–especially since IE became very slow with it at several points.


Comics

Time Warp

Reading through archives of several comics lately that are the micro-evolutionary variety (e.g. nobody ages), I’ve been wondering a bit about when / how the artists decide to make backward jumps in time. A specific example of this question comes into play with school aged characters. To some extent, the characters do age during the school year, if only because the school year proceeds from start to finish in a reaonable fashion. That is, at the beginning of the school year, the character is starting a given grade and at the end of that same school year, the character is finishing that grade.

But, then, we’re only talking a year, so that doesn’t matter a whole lot. And, yet, each summer, at some point, the artists revert from talking about having completed a given grade to talking about starting that same grade. Which I would think would occassionally get confusing.

Naturally, there’s often a long summer story arc, a camp or something of that sort, in which school is not really mentioned. And that seems to be a key to dealing with what with otherwise be major changes. Just ignore it for a while. (No, if you’re wondering, there’s no point to this article).

Another side of the micro-evolution comics, though, is the ability to have more involved non-major-event storylines. Take For Better or For Worse, which I stopped reading years ago because it seeed like it was constantly moving through long involved story lines in which the characters’ lives completely changed (or showing a character who has grown without any notice whilst another story arc was in process). Going through the same year over and over allows the author to keep exploring different aspects of that time in the characters’ lives.


Politics

Hebron

This is how I feel.

Old King Saul’s time is done. No, he wasn’t terrible. He helped the nation through a crisis, and for a time we were more united. But that didn’t last. And yes, maybe he was God’s choice, but then, maybe God was just giving us what we wanted: a leader who was “one of us”.

He started out promising. He had the right character. A good guy, charismatic, that sort of thing. But maybe he got a bit drunk with power. And maybe he looked for advice in the wrong places. He saw enemies where he should have seen friends. He saw the need for action when he should have chosen restraint.

This is where I am.

The gates of Hebron. David, ready to take his crown. But it’s hard to hear over the whispers, the people I love, I want to respect. “Didn’t he fight for the Philistines? He’s a Judahite, you know? He’s just good at motivating a small group of people. He isn’t really one us. He said he served Saul, tried to help out, but he was really a traitor. Have you heard what his priest did?”

They don’t want answers. I don’t want the questions. I want to celebrate, but it’s hard.

This is how I feel.

And, yes, maybe I won’t cry out in celebration. Maybe I just don’t have the guts. But I will be happy today, I will be hopeful. I will accept his leadership and be glad. And maybe I’m wrong, and maybe he’ll fail. Wouldn’t be a first time.

O, Saul, why did you only ever see enemies all around you?