h1

Ruby, SOAP4R and WSDL

July 26th, 2006

For PeopleHub, we interface with a service provider to process payments with the banks. They, conveniently, have started to provide SOAP services, which is awesome. So, the question for me then, was how to integrate with them.

For some reason, I had trouble getting documentation on SOAP4R. The website itself is quite sparse, and there wasn’t much to see, until I found Ruby + SOAP4R + WSDL at brendanwilson.com. Brendan, much kudos to you.

Basically, using SOAP without using the WSDL to generate code is a right pain the arse. Visual Studio does some nice intgrated stuff that generates code for you, as does the Apache stuff for Java. So, in ruby land, I was lost. Of course, Rails does have ActiveWebService and ActiveResource, but these were for producing services and using REST service from Rails respectively - no good for ad-hoc stuff.

The only thing I would caution the reader about is that although Ruby comes with a version of SOAP4R as part of the standard library, it DOES NOT come with the wsdl2ruby util from the distribution. Follow all of Brendan’s suggestions and you’ll be laughing.

h1

Friggin Mambo

July 2nd, 2006

I know Mambo has been pretty popular in the past. Personally I never warmed to it, because once I got past the fancy veneer it was excruciatingly difficult for a newbie to discover how to write a >1 page module.

Apparently, I am not alone in that difficulty. For the last week I’ve been trying to get a bit of Mambo work done at my new job and it seems that Mambo developers are so scarce that anyone who is worth their salt has a job in it while no-one else knows diddly about it.

Personally I’d be happier if I could get the sites redeveloped in ANYTHING, but that’s a bit hard when the customer actually likes the admin side of Mambo and sees no reason to change. Can’t blame them for that, really…

Anyway, what a PITA. Thanks to my buddy over at albinoirishman.org though, things might come good. But why is this ‘big thing’ from a year ago now nothing but a blip on the radar? I guess from the standpoint of a CMS-only website there are new frameworks out there like Drupal, but ferchrissakes, you’d think people would want to cash in those skills for which they worked so hard. Although, from what I’ve seen, it’s not worth the pain.

h1

I love a good rant

June 19th, 2006

I love to rant. Love it. Unfortunately, when I’m in the mood for a-ranting, I’m seldom calm enough to properly construct a sufficiently soul-destroying bile-fest to inflict upon my foes. That’s one of the reasons I wanted a blog. Another reason is to pay kudos to others, especially other champion ranters. There is also the banging on about crap that is the raison d’être of blogging in general - I’m good at that too.

One of my rant heroes is Zed Shaw. He cracks ‘em out, disregarding any potential offence - the way it should be. The first rant of his I ever saw was an article entitled Indirection Is Not Abstraction, where he says (referring to EJB):

“To summarize, just to get to where we could add an object to the collection, we had to follow this chain of calls: new InitialContext() -> InitialContext.lookup() -> LocalSubscriptionHome.findByPrimaryKey() -> CustomerBean.addSubscription() -> CustomerBean.getSubscriptions() -> Collection.add(). An unbelievable 6 levels of indirection just to add a fucking object to a fucking collection. This is the kind of bullshit that chaps my ass purple and makes me want to eat babies.”

(emphasis his. That is pretty crap too, btw.)

I love it. He says it like he means it, and it hurts. Comedy gold. So I’ve made a “rant” post category, through which to vent bile. I hope it’s as much fun as it looks.

h1

Software Designer != Interface Designer

June 18th, 2006

What is it about we IT folk that makes us so crap at interface design? Personally, I can sit down and crack out some sweet code without too much drama, but man I am shit at making the UI any good.

It’s not that it doesn’t work - it’s just that it’s not particularly pretty. Or intuitive.

One of the guys at my new work is case in point for this. He’s made a CMS style thing in dotnet for the internal projects and he had it up and going nice and quick and he can put a new version in a template in a day or two. Unfortunately it’s the biggest hunk of shit to use ever. If you update a page, when you go back to the menu it puts a javascript alert on the screen saying “Page Updated” Thanks for letting me know it’s updated - but did you really need to interrupt me to do it?

As a reminder for those who don’t remember, the Javascript ‘alert’ function is a modal box with a message that you MUST click before doing anything else. So when you’re going through updating all this content it’s

  1. Select page to change
  2. Edit content
  3. Click save
  4. Try to select next page but there’s that stupid alert again
  5. Click alert
  6. Swear
  7. See (1)

You know, nothing personal, good coder, but what a magnificently moronic choice for a way to tell the user something has happened - interrupting them.

For me, I don’t really want to be a UI designer. It’s too subjective for me; English, for example, was always secondary to Physics. But I’d like to think I get some of those things right…

On that topic - I need a new design for the PeopleHub Payments website. If you know someone, let me know.

h1

Prince2 is my b*tch

May 30th, 2006

I passed my Prince2 practitioner exam. As “that guy” would say: “Awesome. Totally Awesome.” And then we would do the safety dance.

For the Futurama-impared among you, suffice it to say that I am happy that I don’t have to do the exam for another 4.99 years, and then only a tiny one.

It’s a shame that the only information that I can find on tailoring Prince2 to smaller projects is in book form… Oh well. Perhaps I can find some time between meetings *cough* to get some info together.

h1

New job and no task tracking make Dan something something

May 29th, 2006

So the big news is a new job for me! It’s pretty crazy, being the second week and all, but I’m still in the steep end of the learning curve. So I’ll let that discussion pass for now.

The thing that is really killing me though, is no JIRA. I had gotten so used to having JIRA there to organise myself/others in, that without it I am stuck with (gasp) actual to-do lists. The humanity! There’s an installation of Gemini somewhere that is disused; which as far as I can tell is a feature-clone of JIRA, but, well, it’s a bit of a mess really. Needs a good ol’ DELETE FROM TASKS WHERE 1=1 I think.

The upshot of this is that everyone in dev land is a bit unsure from day to day what is supposed to be happening, which inevitably leads to meetings. Oh meetings; stealer of time, destroyer of fun.

Gemini seems ok, don’t get me wrong, it’s just that to the untrained eye (aka non-technical folk) it’s a bit complicated. Which, seeing as the only way to placate the meeting monster is by making reports, that’s not good. I don’t want to trade the time I spent in meetings with the time generating reports. I’d like it if someone wanted to know how that thing that has to be done by the end of the week, you know, that thing, was going, they could just check.

Maybe JIRA is complicated to the untrained eye too. I dunno. But save me from meetings!

h1

The importance of open discussion in software development

May 18th, 2006

I jsut finished reading an interview with Zed Shaw on O’Rielly called and I have to say it was very enlightening. It was interesting and encouraging to ‘hear’ him say: My motto here is “If I KMFU (Know My F*ing Users) they won’t have to RTFM.”

I think that this principle is so often overlooked in the programming world - and not just the Open Source world either. I can’t count the number of times that I’ve had a go at some program or other and just been lost without the docs. I do try to keep it simple for my stuff but sometimes you kinda get caught up in some idea (yours or someone else’s) and you end up implementing some crap that does the job, but that’s about it. It doesn’t ‘just work.’

This relates to something else I read today, called The Art of No. As professional coders on deadlines that usually ‘cannot move,’ there seems to be a strong inclination to say ‘no’ to any change request or feature enhancement. While this makes the deadline less distant, it makes the client/your superior/the user more distant and lowers your rapport with them all. After all, they’re paying you! So, the article above says “ask why,” so you open a dialogue into the problem and see the other side of the story.

I’ve found that telling them that “you’ll see what you can do” works wonders too. This has the following benefits:

  1. You can talk about why they want it done in a non-meeting format; the less structured the meeting the easier it is to get points across because you are less limited in time
  2. It gives you a chance to make sure that the feature they are asking for is not somehting that you were expected to build anyway
  3. You can discuss the impact on the timeline
  4. By not saying ‘no,’ you can get more work for yourself/company and thereby invoice more hours

This last point is important - none of us can work for free, but customers can sometimes forget that. Bring it back to the bottom line. Underlying this has to be a strong spec of some kind, or a time-and-materials (per hour) agreement though - otherwise there’s gonna be pain when you get to talking about what was supposed to be delivered at what tie for what cost. Get your ducks in a row at the start, and everything else is a lot simpler.

h1

Capistrano, Mongrel, and Mongrel_cluster

April 26th, 2006

EDIT 2007-06-05: An updated version of this is up here

After my hiatus on posting it seems appropriate to get back into the meaty stuff…

Ever since I started using Debian (instead of FreeBSD) I’ve been having weird problems with my rails dispatch.fcgi processes multiplying in the night. Nothing shows up in the logs, but I spawn 2 externally of Lighttpd, and in the morning i’ve got 6 of the little blighters. Of course, at 20-30 meg a pop, the poor little Xen VPS isn’t too happy about that, so I have a nightly job that kills them all and restarts them. And then, 12 hours later, 4 more than I asked for are there. It seems to be a load issue, but I digress.

So ever since I noticed that I’ve been wanting to use Mongrel to run my Rails apps. For those not familiar with mongrel, it’s a Tomcat-style application host for rails apps that avoids (huzzah) the FCGI palaver that we ordinarily have to deal with. The problem was that according to mongrel, a USR2 signal should fully restart the daemon, and it does, but it’s a tiny little bit funny in a way that makes it totally painful to use with Capistrano for automated deployment.

You see, on restart, it doesn’t re-evaluate what the ./current symlink is pointing to. So when it’s restarted over a ./current that points to ./releases/2006xxxxxxxxx1 that’s fine, but on a redeployment through Cap when this symlink is repointed to ./releases/2006xxxxxxxxx2, the mongrel instance still points to ./releases/2006xxxxxxxxx1

So that’s not so good. Btw, Zed, you’re an awesome coder and I in no way mean you disrespect here. I’m just telling the problem I faced.

Along comes mongrel_cluster. Totally fixed the issue for me, and here’s how.

1. Install mongrel_cluster, and then (in ./current) run “mongrel_rails cluster::configure”

2. open the new ./config/mongrel_cluster.yml and edit the line that starts with “cwd:” like so:

  • change “cwd: /path/to/app/releases/2006xxxxxxxxx1″ to “cwd: /path/to/app/current”
  • change the port to the first one you want for this cluster, and select how many you want (defauts to 2 which should be ‘enough’ for most cases)
  • change from “development” to “production”

3. Add the following tasks to your capistrano deploy.rb file

desc “The spinner task is used by :cold_deploy to start the application up”
task :spinner, :roles => :app do
send(run_method, “cd #{deploy_to}/#{current_dir} && mongrel_rails cluster::start”)
end

desc “Restart the mongrel cluster”
task :restart, :roles => :app do
send(run_method, “cd #{deploy_to}/#{current_dir} && mongrel_rails cluster::restart”)
end

4. Rejoice!

5. Before you do anything else, add to your crontab an @restart task to start the mongrel instances when your server comes up! Very important!

Now “rake remote:cold_deploy” and “rake remote:deploy” work for the mongrel cluster! I used the instructions on the mongrel site on how to integrate with lighttpd at http://mongrel.rubyforge.org/docs/lighttpd.html but there are equally good Apache 2.2 docs out there (why Apache 2.2 isn’t available for Debian is anoher question entirely…)
Much kudos and thanks to Zed Shaw for the excellent mongrel server and to Bradley Taylor for mongrel_cluster. Oh, and Jamis Buck for Capistrano!

h1

RimuHosting

March 30th, 2006

I’ve decided to change hosting providers. There’s no one thing that caused me to want to leave TextDrive, but lots of little things. Like getting accused of causing problems that you didn’t create. Or getting abuse in support tickets.. you know, that kind of thing that you should never do to your customers?

So after making the choice beween PlanetArgon.com and RimuHosting.com, I went with Rinuhosting mainly because they responded to my requests within HOURS of me making them, while PlanetArgon took 3 days. RimuHosting is a Xen based VPS provider, so I’ve got my own Debian instance (was Sarge, but - thanks Rob - now is running Etch)

And I couldn’t be happier! Now, the fun fun task of migrating my PeopleHub domains…

h1

Started Prince2 today

March 21st, 2006

Well, when I wanted to do some Project management training I looked around and decided on Prince2.. and I just had my first day today. It’s good stuff - final accountability does not rest with the Project manager - yay!

But they really cram in that info… it was non stop all day, and 3 days to go!