Saturday, September 29, 2007

Rails plugin: optional parameters for partial views

Just "published" my very first Ruby on Rails plugin today.

Been using it in a personal project of mine for awhile.

Basically, its optional parameters for partial views, to make it a bit more clean.

==View.rhtml==
render :partial => 'post', :locals => { :post => @post}, :opts => { :show_comments => true }

==_post.rhtml==
<% if opts.with_default(:show_comments, false) %>
Yadda yadda
<% end %>

Not much code, but its a simple idiom I found myself repeating (a lot) so I wrapped it up into a plugin.

linkage:
Arron's rails plugins

Tuesday, September 25, 2007

Amazon Mp3: DRM-free music - I just popped my mp3 consumer cherry

Amazon MP3: DRM-free music. That means it works on any mp3 player. I approve!

Prices are competitive with iTunes.

Launched today. Lots of good music (my opinion, YMMV).

This is the first time I've actually bought an mp3 - I grabbed an MC Lars single, Hipster Girl.

I've never really been willing to buy an mp3 before because of the hassles dealing with the DRM if I wanted to back it up or anything (I go through more computers and MP3 players than I'm comfortable with), but since it was DRM-free grabbing some MC Lars tracks was obvious.

The experience was really good - the Amazon MP3 downloader was optional, but I wanted to give it a try anyway, and it was a really smooth downlolad, install, and launch.

Think I'll go back and grab some more tracks later on today, after I'm finished working. Amazon Mp3's prices are that sweet-spot where its just cheap enough to be a convenient way of grabbing mp3s. The DRM-free bit is what sealed the deal, because there's no way I'm dealing with that kind of hassle for more than 5 minutes.

Tuesday, September 18, 2007

An hour with CodeGear's 3rdRail product

I've been waiting for this one to come out -- sort of. It's been on my periphery, but I hadn't kept up with it until I got an email in my inbox touting the release.

First impression: weird name. Not very Google friendly, either.

Second impression: Looks like Aptana / RadRails. A lot. Mostly because they're based on Eclipse, but still.

So, I downloaded it about two hours ago, got it set up and everything -- they ask you to register for a trial key, but the software apparently will run for 5 days without a trial key.

I managed to slough through the whole 21 minute web video of 3rdRail in action before-hand. A lot of impressive stuff, but a few telling signs when the narrator quickly pages away from 3rdRail's RHTML editor. There's a good reason for that: the RHTML editor, like RadRails by default, is really quite awful. More on that later.

So, I've got the IDE cracked open in front of me. All Rails IDEs can handle the newbish "create project from scratch" scenario, so I ignored that completely and went straight to File --> Import. They're clearly expecting this: there's a wizard for importing an existing Rails project into 3rdRail with a few clicks.

On the initial run you've got to set up your Ruby interpretor, which should have been a straight-forward process (check c:\ruby\ first please, sheesh), but wasn't. Setting up the Ruby interpretor also required me to set up the "Interpreter system libraries," which it should have been able to parse from the Ruby installation directory, but didn't, so whatever, k-thx. It doesn't tell you exactly what it means by that, either, so I just picked some random directory and hit 'OK.'

I went back to check on it a few minutes later and the system libraries grid was filled with all the correct values -- apparently auto-detected after I clicked on the 'OK' button. Whatever.

The project import process is dog-slow: apparently 3rdRails does something "special," and by "special" I mean they need to consume about 100MB and waste 5 minutes before making the project available.

The IDE is pretty impressive at first glance: they've got a Rails-centric view of the project, where everything is neatly tucked away; you've got "layouts" (all your layouts), "models" (all your models), etc. Kind've like the raw folder structure, except inside, say, Models, you can drill down into a particular model and get all sorts of good information, like a model's attributes, the model's members, its associations and aggregations, too.

When you jump into a model / class, on the right pane there's an "inbound" and "outbound" section. Outbound shows what attributes / models / etc this model references, and inbound shows what attributes / models / etc in this model is referenced externally. When it worked (once), it worked great.

Unfortunately, this feature appears to be very buggy -- I've got a perfectly valid production site running on Rails. The 3rdRails kept vomiting up the most basic error of all: "java.lang.NullPointerException."

People!

People!

Check your freakin' nullables.

I get the error every time I "click through" source code, which makes it pretty hard to use the IDE.

On the upside, code completion is pretty good.

On the downside again, RHTML editing is crap.

No joke: you've basically got templates for common Rails idioms, but that's it. It's no good -- I gotta keep my head in HTML as much as I have to keep it in Ruby, so what they're giving me is just half the tools. But, surprisingly, 3rdRail's CSS editor is actually OK. Not sure what's up with that.

Aptana's RadRails ships with two editors for HTML: the default (god awful) RHTML, but also the most delicious HTML editor I've ever used in a free product. Change the default editor for .RHTML files to Aptana's, and you're kickin' ass and taking names. The CSS editor is, as well, pretty sweet. I would totally recommend stealing their HTML editor and integrating it into 3rdRail instead of what they're using right now. Take Aptana's CSS editor too, while you're at it.

Overall, it stacks up pretty fairly against Aptana, except for one problem: price.

$299.99?

Too much.

I would pay maybe $59.99, $69.99 for this software. It'd be a different answer if Aptana / RadRails wasn't available, and it is, and that's the problem - aside from Code Completion, Aptana has most of 3rdRail's touted features, all for the wonderful price of "free." That pushes Aptana into the "good enough" category for most developers, of which I am one.

Anyway, that's it. If anything interesting crops up before the trial times out, I'll probably blog about it in furious rage.

Back to hacking.

linkage:
3rdRail
Aptana

Friday, September 14, 2007

Blocking OpenID providers?

Oh, geez. I just saw this HILARIOUS nugget on someone's blog as I was surfing for information on OpenID (I'm implementing it for a website as a secondary login scheme).

This post is relatively meaningless; it's just some dude's vendetta against some other dude, so he blocks the guy's OpenID provider from using his blog. Whatever. The blog post is completely irrelevant because its all misshapen and skewed anyway, but thankfully that's not the important part.

The gold nugget, the priceless, sterling jewel of the post is in the comments section, where some commenters basically ask,

Isn't banning OpenID providers against the spirit of OpenID?


To which the author replies, verbatim,

How would the general users (i.e. non-geeks) know the particular provider/company is evil (which I believe is a good reason), unless they have problems using its services/products?


Thank God.

A moral authority for OpenID.

I mean, look, I can see blocking an OpenID provider for technical reasons like spam -- that day will eventually come -- but blocking one because you've got a beef, an arguably subjective beef at that, with the guy who runs the provider?

Man, come on, be serious. That is some serious high-school level drama there.

Even better, its not like people using the banned provider are going to be, "LULZ, MUST SWITCH PROVIDER."

Does he seriously, seriously think a "non-geek" is going to get another OpenID somewhere else, and now be using TWO OpenID providers? TWO? Now we're back to the whole problem of a different login for each site, because some motherfucker blocked another motherfucker, and started an iNuclearWinter.

At that point the value of having an OpenID (and actually USING it) quickly approaches 0, and we're back to jump again.

Thursday, September 13, 2007

WTF is with Windows Live?

I used to use Windows Live Writer on a semi-regular basis until they stopped updating it (publically) and its bugs / glitches became more and more of a chore to deal with every passing day.

But now it's been about a year, year and a half, and now I'm ready to give it a spin. I've got some things to write about on another casual blog I maintain, and I hate the web-based interface for writing on it, so I thought I'd give Windows Live Writer another spin.

So I go to download WLW (Windows Live Writer), but instead I get a generic Windows Live suite installer that insists on installing Windows Live Messenger (that I already have installed) and Windows Live Desktop Mail (that I already have installed).

All I wanted was the goddamn WLM software. Was that really so hard for Microsoft to do? There's no way to cancel any of the other items to keep them from installing; hell, the only things it prompts you for is, "Do you want to install our awful toolbar and equally bad bullshit homepage ? ? ?"

That aside, some of the Windows Live software is really useful, but I don't know why they even bothered with the ridiculous branding. None of the software interoperates in any way. In fact, I think the only thing they have in common besides the name is the toolbar flair.

Sometimes I wonder what it's like to work at Microsoft. From the outside looking it, it's as if the teams there can pretty much do whatever they want and the end result doesn't matter. Microsoft Max, a suite of software that doesn't work as a suite, Vista...

Well, that's it for now.

Thursday, September 06, 2007

Umbraco: Why, God, why?

Will someone please tell me what's the deal with everyone raving about this CMS?

I've spent about 6 hours with it and already I want to claw my eyes out.

I'm using 3.0 RC1 (the "recommended" version), and it's chock full of bugs that make the interface unusable with Firefox, and, thanks to good coding practices, about 2 crossbrowser UI bugs. How long has it been since you've seen a "modal dialog window," the unresizable kind, where form elements are actually out of view? Apparently not long enough, for Umbraco.

After surrendering to the inevitable and firing up IE7, I began to -- slowly very slowly -- enjoy Umbraco. You know, some rough edges aside, it's an OK CMS.

And then I tried to embed an image into a template.

Oh, yeah. I knew the programming gods had a grudge against me when I tried to perform one of the most simple tasks for a CMS and it failed miserably. Quickly, Google to the rescue! All over the web you find this: "well, you'll have to write an XSLT to get the image url and output an img tag, and then you just create a macro to call the XSLT and presto!"

No, my friends, no fucking PRESTO here. This is a CMS, the whole purpose of using one is so I don't have to hard-code shit everywhere. For some reason they let you pick out "Media" (images, files, etc) as a valid property type, but don't provide access, in templates, for you to grab the various attributes of the property, like, oh, I don't know, THE GODDAMN URL.

Seriously, why are you going to give me the ID of a JPG. What the fuck am I supposed to do with that? Really, what? How did you get to version 3.0 of a software product and decide that yes, that was a really, really good idea.

How does a CMS make it to version 3.0 like that? I'd like to say, "magic," but fuck all if magic explains why when I try to move a content node, the pop-up dialog closes but the content tree doesn't refresh.

I'm staring down the barrel of goddamn-what-the-fuck, and its name is "Umbraco 3.0"

But wait, there's more! Just when I thought it couldn't get any stupider: you can't turn off debugging on production mode.

Yeah, you heard me write (write, get it?!), you can't turn of debugging. A helpful work around includes doing some URL-rewriting if the user tries to hit the debug url, claims some page some where that conveniently isn't on the main Umbraco site.

In other words, Umbraco sucks.

This is all without including a ton of minor bitches I have, including:
  • the fact that the Rich HTML editor doesn't fucking Rich HTML,
  • something I like to call, "The Mystery of the Disappearing Quotation Marks" inside of the template editor (which, ironically, also sucks),
  • and what I tentatively refer to as, "An Awful User Interface: Are You Prepared?" when visiting the "Member's" section of Umbraco
What's funny was, the wizard for installing and setting up Umbraco was pretty decent. It's unfortunate that the rest of the CMS isn't as polished.

link juice:
Umbraco