2008-06-28

Jugglers!


Larfin at Jongleurs! Hahaha!

What a weird day

It all started well. You know how it is, boss checks in and you "shoot the breeze" and you feel motivated again. But at lunch you drift off to lesser goods, this time eBay, fork-in-hand I was broswing. I was looking for a TIG welder, simply because I'm a welding deprived child; I had nowhere to go when I had worn my Legos out! (Pop rivets are just so boring!) During this lunch "hour" I quickly realised that I shouldn't spend £400+ on a cheap TIG welder. At least not without saving some first (read: holding back on other junk). Especially as I'd probably have to lash out £150 - £300 kitting out the TIG welder and wherever I was actually going to do the welding. This might include rewiring some plugs so that I could get "decent" power (say... 25A++..?). Anyway, I got a (probably pirated) DVD on TIG welding eBay; that'll keep me entertained.
I almost forgot, I started my day with winning an "Abrasive Cut-Off Saw". This is basically a souped up mitre saw that'll saw, pretty much anything. Good for metals, not very good for Aluminium (which happens to be my metal-darling, Titanium and Magnesium are just too demanding and expensive). The reason why it's not good for Aluminium is because it's "abrasive", and that means heat, and Alu doesn't like heat. I guess that it's OK being so light and pretty. Anyway, waiting for that.. it was a smaller part in my welding "grand plan", we'll see.
Back on track...
As I realised I should hold off on the TIG welding, I spotted this Milling Machine. You see a Milling Machine is really good for making holders and such stuff. Say foot-peg-hangers, bullet-camera-mounts, GPS (SatNav for you late-bloomers) holders etc. It was a fair bit cheaper than the cheapest one I've seen, and it was fairly close to where I live (say 35min one way on country roads). I had a thinker (and got help from Caz) and then I decided to go for it. Finished the auction, sent the seller an email, and the seller was apparently crafting an email as I was sending mine, so the wires got a bit crossed. I wanted pick-up ASAP, he suggested Saturday or Sunday. I'm away tomorrow (see below), so I was a bit gutted. But at least I would get time to sort tomorrow out... Or so I thought. I got an email back saying that pick-up is GO! So, leaving my opened beer, ice-water, and hot steaming bath, I got re-dressed and yanked a very work-worn Caz out of PVR-mode off the bed. We were going to get a Milling Machine, damnit!
Said and done, we were in the Espace, cash in hand, off to our esteemed seller. Some nice country roads later and we pull up, do a perfect transaction and even get a tiny freebie on top. Couldn't be more chuffed, one could insert a pun and say that I was "chuffed to milling bits!", but that'd be bad taste, so we leave it out.
On our way back, we realised that time had escaped us and Caz started mumbling about swapping our planned evening meal for something with "less effort"; in her case a Jacket Potato (henceforth referred to as a Dressed Boulder), and for me a juicy "square burger" with cheese and bacon, dripping with mayo, ketchup and emitting lettuce, cucumber etc... I really had to bend her arm to get her to go for the whole plan. At least it did give me a chance to reward her for getting out of lazy-bed after a long-working week (and she seldomly does that! Get into lazy-bed, hrmph).
After the meal it was obvously time for me to get clean.... Caz wanted to relax, and I suggested ear-plugs (we're bikers, so ear-plugs aren't that uncommon). I thought I'd be nice so instead of blaring out AC/DC over the main stereo I thought I'd stream it to my Nokia N800.
This was a bad move.
Simply because I discovered that I did not have a SlimServer running. Moments before entering the bath. Damn.
What follows is an intensive shell-hacking-google-searching-session, with minimal clothes (sorry! It hurt me, now it hurts YOU!), for about 2 hours. F**K! This was not the plan.
I was given a break when I finally got the artist formerly known as SlimServer; SqueezeCenter working, for a moment. For some reason it tore down my home-server... .sigh... I thought I'd not rush up to the loft and reboot, but go have a bath. Sometimes Linux machines tend to recover...
I had a niiice bath, Patchs' company appreciated.
Well out of the bath, Pingdom still reported my home server as down... better don on something better than a towel and climb up to the cobwebs to reboot the server. Gladly it popped right back into life. *phew*.
And for once, everything seems to work. The new interface on SlimServer, erhm, sorry SqueezeCenter isn't an improvement, it's just "modernised" in the way that Windows XP requires 50000x CPU power to run the same task as fast as on a Win95 machine. Not impressed so far, especially with the issues I had.
Anyway, why this is all so soul-eatingly-annoying is that in 6 hours I'm supposed to wake up, refreshed, recalibrated and as an all-enjoying f**ker to go on a bike ride. A bike ride that I've been really looking forward to.
We're heading "down saahrf" to London, and from there towards places like Box Hill and Goodwood, all guided by someone who knows the road and after the ride we'll retire to their place. Nice host and hostess and enjoy some grub to go out for a birthday party at a comedy club. Now that's a fantastic schedule (providing the Spaghetti Monster provides us with grippy roads). It's not something that I should have 5 hours sleep for and I should definitely stop drinking these lush cheap Becks Beers....

But wait, there's more.. Two of my best friends left for a very long European wide journey and they've been riddled with problems, but that's not my story to tell, so I'll leave the cliff hanger ending at this point.
With a bit of luck I'll be able to use multisyllabic words tomorrow, and perhaps get the K-R to shift a bit, Spaghetti Monster providing maybe a wheelie or two!
I HAVE A MILLING MACHINE!!!!

For now; I'm too tired/pressed for time to add hyperlinks to all references. With some luck (read time) I'll do it. You can excesise your rights by shouting for hyperlinks in the comments.

Bed... n...o...w....

2008-06-17

Ruby on Rails RJS gotcha.

I know this has been touted in all the tutorials, but I had forgotten it, so I'm assuming that someone else will forget it too.

I had a nice Ajax form, using form_remote_tag(), to update a DIV as per instructions. Having made that work, I wanted to proceed to the next level and swapped out the ERb template for an RJS template. I simply renamed the ERb template, and then stuck an RJS template in between and used replace_html to render the content in the DIV. But it didn't work.
The result was simply plain JavaScript inserted into the page. It looked stupid. The reason was simple; The RJS generated JavaScript wasn't executed in my browser. Having scratched my head, asked some of my friends, scratched some more I decided to retreat back to my documentation. I started browsing through my O'Reilly Short Cut about RJS, and there I had it, highlighted by myself, in an already highlighted box.
This is what the box says:
"Don't Use the :update Option with RJS Calls
Never use the :update option when making remote calls to actions that render RJS templates. The :update option instructs Rails to generate an Ajax.Updater Prototype object instead of an Ajax.Request object. The Ajax.Updater updates a single DOM element with the contents of the HTML response. RJS templates return JavaScript to the browser, which must be evaluated to produce the desired effects"

Of course!
So, changing this:
< % form_remote_tag :update => :my_div, :url => { :action => :my_action },
:loading => "$('indicator').show()",
:complete => "$('indicator').hide()" do % >

into this:
< % form_remote_tag :url => { :action => :my_action },
:loading => "$('indicator').show()",
:complete => "$('indicator').hide()" do % >

Note the lack of :update... it all works! There you have it, have a look into this little gotcha if your RJS JavaScript isn't executed in the browser and you get a nice plain JavaScript displayed in the browser instead of you nicely formatted executed HTML output. :)

2008-06-15

BMW day at the Ace Cafe


Caz and I rode down to Ace Cafe today to take a peek at the BMW bikes, and naturally to show off my bike. Hehehehe. Breakfast now. Yummy!!
Update: A few more pictures over at my Picasa album.

2008-06-08

Getting dirty off road.


A friend of ours has been amazingly kind and lent us his enduro bike. I took it out for a quick spin and I was totally knackered! Then it was Caz's turn to go off road for the first time ever. I'm very proud of her as she was improving lap by lap. Attached is one of her first ones. We both loved it!! Thanks to Tony who came along for the first ride on his (street tyred') DRZ400. :)

2008-06-06

Rails, Git, Capistrano, Ferret, etc... I'm exhausted.,

In the past weeks I've been trying to get my application to play nice with the latest of the "Rails-stack". This includes Rails 2.1.0, Git, Capistrano 2.3.0, Ferret (and acts_as_ferret) with the DRb server, running under Phusion Passenger, a.k.a mod_rails under Apache 2.
I must say that the only thing here working 100% as advertised is Apache and mod_rails. Thank's so much for that! Wonderful!
Let's start from the top. Upgrading to Rails 2.1.0 wasn't much of a problem, just annoying trying to get all the gems and plug-ins to play nice. I don't know if it's good or bad to prevent Rails from running without the gems declared in environment.rb. The biggest problem I had was with the datetime_toolbocks plug-in. It seems that the author isn't that bothered with updating the code to run with Prototype 1.6.x which ships with later versions of Rails. So I've reverted my Prototypes back to 1.5.x for now. Don't get me wrong, I appreciate the fact that the author has (without much acknowledgment to the original code of Dynarch's Calender) packed it up and distributed it. The functionality is pretty much spot on, and I initially wanted the Dynarch Calender as I've been using it before. What I don't like is developers being incommunicado and not providing updates (not requesting features here). But hey, it's free and I shouldn't look a gift horse in the mouth. It still took me hours to figure this all out.
All well, I was running on Rails 2.1.0. At this stage Git was working quite well after my initial problems. Now I needed to work out how to get Capistrano to like Git and how to configure it all on the server. This proved to be a task of trial and error because I just can't find any good Capistrano documentation, I also don't like the default Capistrano working layout that assumes you trigger your updates from a third client (in addition to SCM server and deploy-to-server). But that's another story and I do have my reasons. In my head I want to log into my SCM server and trigger the update from there. I also don't like the default set up of using SCM updates to get the latest source to the server. In my head (again) the server should have a minimal install, and a source code management software does not belong on the server. Luckily I can easily change Capistrano to pack up the code and copy it over to the server instead. Sadly I got lured into using both remote-cache and local-cache. I can't even remember what was wrong with remote-cache, but I stopped using it. Local cache had two issues, both not related to Capistrano. First one had to do with the fact that I wanted the local cache to reside on another partition than my temp partition. This was a bad idea because Capistrano uses hard links to copy the code over to temp and then tgz the code up. And as seasoned Unix users know (i.e not me before this) a hard link is basically the same file, and the same file can't exist on two different disks. So after a few hours on that issue, I moved the local cache to the same partition as the temp dir. After this I noticed that local cache has got issues with, erhm... caching. It doesn't seem to recognize permission changes and perhaps file changes. This could be an issue with Git, I don't know, and I can't be bothered to care. I simply ditched the cache; Bandwidth to the people!
If you're a seasoned developer/sysadmin you'll feel in your gut that my problems with caching resulted in "other problems". One naturally assumes that when you update your code, you get new code. So I've spent hours trying to figure out why things aren't updating as they should.
And then we come to the Capistrano recipes. *sigh* I find Capistrano terribly difficult to debug because the output is so vast. Once I had a basic set-up working I got stuck in trying to get Ferret working with Capistrano. This seems to be a fairly known issue, and to some degree fixed in SVN (why it's not released, I don't know). Needless to say the instructions aren't that clear, and it took me ages to get to where I was. My tip is to basically apply the patch and you should be half way there. Notice that if you do it manually, save a few hours by noticing that line 39 is deleted. *sigh*. I'm not the only one having been frustrated by this. On top of that I've done some 25+ commits into Git to try to resolve this (I refuse to code downstreams, i.e on the deployment machine in my case).

It's difficult to describe how deflated I am after all this, especially without sounding ungrateful. I can understand that some people feel the need to do rants about Rails' stability and community. Personally I guess I just have to come to terms with the fact that the Rails environment is filled with people from most spectrum, but probably overpopulated with young people who have a huge energy (which I don't want to belittle), but also that these same people have got little experience in the commitment that one makes when one writes software. Software has got a nasty tendency to linger way beyond its "best before"-date. (For those who know me I can provide this acronym to get you nauseous: HMS1). It is probably this fear of commitment that has resulted in my lack of contributions as a software developer to the world.
I'd like to communicate a few points to the contributors to the Rails environment; 1) I'm not interested in writing a f***ing blog. 2) I'm not f***ing interested in writing another f***ing facebook/twitter/myspace/social-networking/site. 3) In fact, I'll let you in on a little secret, the world needs another blog software or another social networking site like it needs another PHP DB abstraction layer, or indeed, you need another hole in your skull. Just say "no", please. 4) The application I'm trying to write is a corporate level application, I need data integrity, you know, enforced foreign keys, subqueries, transactions, and so forth. I don't care if Rails can handle it without those fancy-pants database features, but I need my data to be sound, regardless of where it's being presented. I want this requirement to be reflected in the code and the software I use.
When I install a plug-in, or indeed, Rails, I naively trust that the code I'm installing will have some sort of backing, and if it doesn't have the backing at least I'd like to know that there's no support - preferably in big red bold letters.
I'm just very happy that the era of Mongrel Clusters seem to be moving into the past. Something we can all, hopefully, point and laugh at in a few years, when our mental wounds have healed.

Just to top things off, here's what deflating my enthusiasm even more; I'm only half way through. I still want to create a deploy-to-multiple-servers Capistrano, and then I want to wipe the staging machine clean and document the installation step by step. Just to make sure everything works.
But right now I just feel like getting a bottle of Finlandia and crawling into a dark closet and not come out before the bottle is empty...
... but that would be counterproductive (even if I'd support the workers of the vodka factory), so I better get on with some more ghettoing! ;)

2008-06-03

We should boycott flights.

Having personally had an "incident" with a Heathrow "Security" Guard many many years ago I think it's now time to boycott flying as much as we can. Because things are just getting totally ridiculous!
Update: At least a bunch of people agree with me. Sadly I don't think anything is going to change.