Archive for the tag 'coding'

Finally got the prince.org staff blog up and running

I’ve been trying in spare cycles here and there to deeply integrate a WordPress-based blog into prince.org, for the staff (myself and all the moderators) to be able to muse on new policies, changes, whatever. We have a forum for that currently in the message boards area but that’s not the most effective way to disseminate stuff, as a lot of folks don’t actually read that forum, and there’s nothing that calls out new posts there (or differentiates the moderator-authored ones from the general question/complaint posts).

It was an interesting coding experiment to dive into WP’s guts a bit and figure out how to do this properly. I like the final solution; essentially the latest WP code gets dropped into /blog/ on the site, and a custom theme and plugin are symlinked in when I deploy the site, from my codebase. I don’t need to change a single line of WP code, and I get integration with my own session management/user database/authentication, a completely custom look and feel, and a nice administrative panel. I think added a new homepage module (in the upper right) to help guide some traffic to it (since I think postings there are really relevant to all visitors), which was trivial since I have a standard methodology for that. Overall I really think it’s a big win, and for probably less than a total of 10 hours work, with about 25% of that being CSS (which I suck at).

If you want to see how it turned out, head on over and check it out: the prince.org staff blog.

Best source-control commit log entry of the week

Ryan, working on the WordPress codebase, changed the category code to be more flexible. Here’s his commit entry:

“In your cats, making them back compat.”

OK, that’s pretty good. Lolcat phrasing, about code, with an actual cat(egory) reference. That’s a triple score!

We don’t need no stinkin’ marketing strategy

I was skimming this month’s Doctor Dobb’s Journal, which doesn’t take long in recent years due to the Microsoft-centricity of the ads and overall relatively lightweight article content (there’s always a gem or two, though, which is why it gets skimmed at all), but ran across an ad for a programmer’s editor that grabbed me, not in a good way.

The ad says “Need a Code Editor that’s Powerful - Flexible - Robust and Supports over 40 Languages?” (For the 1 person who reads my blog who isn’t a geek, by this of course, they mean programming languages)… “Introducing Dr Koder, The Powerful, Dynamic Code Editor(tm)”.

OK, this is fairly wrong on a few levels, as obviously it has to be powerful, and “dynamic” to some degree, and edit code. So why trademark that expression, I have no clue. But the more important bit is “Dr Koder”. No period after the Dr., but I would assume they mean it in the form of “Doctor”, even though there’s no crazy tagline like “heals your code quick!” or “diagnoses your code ills” or similar. So forgiving that, the main point is, “Dr. Koder”, with a K yet? What is this? No self-respecting developer, let alone software engineer, is going to proudly reply to “what editor do you use?” with “I’m a Dr. Koder man!” It just sounds lame. No wait, not just that… it IS lame. A terrible name. Obviously, the engineer(s) who wrote this thing, got naming rights. Don’t do this. Get some consensus, ask around, hire someone… something.

Adding to the hilarity, is the “ComingSsoon! Signup [sic] for your copy Today!” As if, developers wait around for that next great editor with baited breath, and stand in line to get it the first moment, etc. That’s for iPhones, not code editors. Here’s how it works with editors: you download a free trial. If the trial is cripped in any way besides time-limited (and that, something reasonable along the lines of 30 or 60 days), you ditch it. You try it with a small project. You read the manual (well, only after figuring out there’s something you’re “not quite getting”). You see if it compares to Eclipse. You see if it’s got some magical redeeming features / look and feel / behavior (a la TextMate on the Mac only), and if not, stick with Eclipse (or heaven forbid, the Microsoft Visual Studio tools if you’re so deeply stuck in that world), or emacs/vi if you’re a diehard Linux geek and don’t understand the productivity gains of a modern IDE. That’s how it works. Dr Koder has no chance at this point, in other words. Maybe they should get the free trial up and running, and only then advertise it.

Meanwhile, I’ll be using my free trial of Dr. Browzer to surf the web–it kicks Firefox’s ass!!

Blurb (Ruby on Rails SF startup) is hiring

I don’t know if there’s a TON of great Ruby-on-Rails jobs out there, but this looks pretty interesting, I’ve personally used the Blurb service and application and it’s really quite impressive… it’s sort of like the books you can make from within iPhoto, but taken a couple of orders of magnitude more powerful. The finished products aren’t too cheap (well, neither are the iPhoto books), but are quite nice. I don’t have any idea how much RoR there really is to do, seems like a lot of the work is in their client, but hey, someone can contact them and find out :)

Here’s the posting, cribbed from this post at Valleywag’s jobs section (yeah, I know, it’s a little weird they even have one… what is the catchphrase, “reaching more rumor-loving engineers than Craigslist”?):

Posting after the jump… Read more »

Trying out TextMate

[tags]TextMate, apple, software, coding, blogging, emacs, Ruby, rubyonrails, wordpress[/tags]

I’ve been trying out [TextMate][] for a couple of weeks on the Mac. So far, I’m really impressed, and very likely to fork over the license fee (around $75). Which is really quite a lot for an editor when you consider the wealth of good editors already out there, and free, not the least of which is Emacs, which I’ve been happily using on and off for hmm, probably 15 years at this point. Sure, I’ve forayed into the Visual Studio IDE when I was developing on Windows, and used the Borland (text-mode) environment when I wrote a lot of Turbo C++ before that; I’ve toyed with Eclipse as well more recently. But Emacs ports on the Mac aren’t too great (including stability issues), and TextMate pretty much seems to be written with an Emacs state of mind with regards to extensibility, etc. It even has some Emacs keybindings lurking in the default configuration.

But what got me on this kick was playing with [Rails, or RoR, or Ruby on Rails][rails], the almost sublime web-application framework built on [the Ruby language][Ruby]. It seems a lot of the influential RoR community, are Mac-heads and use TextMate for developing code. The Ruby support in TextMate is quite good, and there is special ‘modes’ to use Emacs terminology (’Bundles’ to use TextMate terminology) just for Rails as well. And they’re very nice.

My essentially frothing at the mouth praise for Rails and Ruby can wait for another post, although let me say they are both quite excellent, especially if you keep in mind the problem domain, and don’t think of them as C++ or J2EE replacements. (But PHP and typical Java web app replacements, well that’s another story… and I recommend reading [O'Reilly's Beyond Java book][Beyond Java] to get it.) The interesting bit is how much having an excuse to feel out the editor and understand some of the hooks and extensions available for it, have made me really understand how it can empower me. I guess it was always that way with Emacs as well, although the alternative was something edlin-ish (I don’t think the Prime I first started using it on had a vi port, even.)

But here’s my first words on this: TextMate is excellent, so far. Ruby (and Rails) are as well. I feel excited to be exploring this stuff.

and p.s., this blog post was written and edited from within TextMate using the ‘blogging’ bundle and [Markdown][], via the [PHP Markdown Extra][] plugin for WordPress! About all it needs now is to support the [Ultimate Tag Warrior][] plugin, and I’m never using WordPress’ writing interface again… from my Mac anyhow. (**Update** it seems you can still get the main tagging stuff to work if you turn on ‘embedded tag support’ in UTW and then use the SimpleTag format. Cool! Thanks to [this blog post][vimposting] about posting from vim of all things, for the hint!)

[vimposting]: http://coopblue.com/blog/2006/06/posting-to-wordpress-from-vim-with-tags-and-markdown/
[Ultimate Tag Warrior]: http://www.neato.co.nz/ultimate-tag-warrior/
[Beyond Java]: http://www.oreilly.com/catalog/beyondjava/
[Ruby]: http://www.ruby-lang.org/
[rails]: http://rubyonrails.com/
[TextMate]: http://macromates.com
[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/
[Markdown]: http://daringfireball.net/projects/markdown/syntax
[Wordpress]: http://wordpress.org/

Magical, incompatible Firefox display style value for table rows

I was writing some javascript to show/hide table rows based on user input (filtering to match search terms), and saw some really weird behavior. Now, of course, the first problem is that I was writing JS code, which I pretty well suck at. But, this seemed simple enough.

Whenever I’d hide a row, and then make it visible again, the header row would get confused, and all of the unhidden rows’ columns would be squeezed under the first header column. Weird, since the DOM hadn’t changed, and they had equal numbers of columns, etc., as always. After a bunch of head scratching a searching, I finally found this short article which talks about exactly this issue, and apparently it’s specifically a Firefox oddity.

The net/net is that Firefox has another CSS ‘display’ value besides just hidden/inline/block… they have a very special one called “table-row” which makes this work properly. Whodathunkit. But, it works great now, using the try/catch strategy outlined in the link above.

Firefox plugin wanted: Pretty-Printer for JSON

Hmm, when you start working with a bunch of webservices that spit out JSON (really, it’s inevitable; leave XML for interfacing with the Big Iron, especially since almost noone seems to understand when to use attributes, and so most docs are 95% elements), you’re going to want a nice way to look at the output for visual debugging. That’s one thing the current crop of browsers finally got right, is being able to pretty-print XML, even without a default stylesheet. For example, here’s what I get in Firefox for part of a sample document (cropped, the doc is valid!): Read more »