Articles tagged 'tech'

Ruby link round-up Feb 24

I’ve seen a number of great Ruby articles, tutorials and discussions recently (and not so recently), as well as some interesting projects, so I thought I’d write a quick round-up of links to some of the most interesting stuff. It’s split by category, with a miscellaneous list for stuff that didn’t seem to fit anywhere else.

  • Merb
    • Tutorial on getting up and running with Merb 0.9.0.
    • A list of great Merb articles.
    • An article from Ezra, the guy who created Merb, on using Merb’s integration with Rack to write handlers that run close to the http processing pipeline, while remaining webserver agnostic.
  • Amazon EC2 + S3
    • An article on using Amazon web services, Lucene and Ruby for web crawling.
    • This gem enables really easy setup of EC2 boxes for use with Rails. I’ve tried it. And it rocks.
  • iPhone
    • An article on hosting iPhone subdomains within your Rails app, to display iPhone specific versions of web applications.
    • This article goes into even greater detail on iPhone specific versions of Rails apps.
  • Books
    • Another post from Ezra, who happens to be one of the authors of ‘Deploying Rails Applications’. This post says that the book is now at the final beta stage, and includes some more advanced content such as Apache/Nginx scaling, and Xen setups. I’ve just ordered up the beta PDF, and will be receiving the paperback too when it ships in May. Hoping to do an initial review once I give the beta a read, looks very interesting though.
  • Tools and projects
    • Heroku, online Rails application creation and hosting. Very cool tool for creating or collaborating on a hosted Rails application, all through your browser.
    • Rush, a Ruby based shell, from one of the guys behind Heroku. Interesting concept, along the same sort of lines as Windows Powershell - but because it’s Ruby, it has a much better syntax :-)
    • An article about the usage of Beanstalk, a messaging queue system, to power the Nuby on Rails blog.
    • Hot off the presses, a new Capistrano preview, with some cool features such as better role definitions, and better git integration.
  • Miscellaneous
    • An article on generating feeds using microformats within html.
    • Good post from 37signals about building a web app, and making sure you get it right - even if it means starting over.
    • An article on using Ruby for scripting tasks on Mac OS X.
    • Interesting article on tackling master/slave database setups with Rails.
    • Great screencast on PeepCode about git, a source control tool that is all the rage at the minute. Really good introduction to the tool.
OK so that wasn’t such a quick round-up - but that was the best of the best from the articles and links I’ve come across over the last few months.


Thoughts on the Apple announcements Jan 17

Here are just a few thoughts on all the gear that Apple announced on Tuesday - I meant to jot this down yesterday but didn’t get chance.

I think overall, the keynote disappointed me and interested me in equal measures. First up, the Apple Time Capsule was announced. This is quite cool - it’s basically their 802.11n AirPort router re-worked to include a hard-drive. As I currently run an all-in-one ADSL modem/router, it’d be a bit of a pain, as there is no built in DSL modem in this bit of kit, so I’d need to buy one separately and hook it up. However it is a clever idea, as wireless backup is going to be infinitely more useful than wired backup for the legion of Apple MacBook users (myself included). I’ve been on the lookout for a while for a decent NAS, preferably wireless, although above and beyond Time Machine backups, I’m not certain you can use any other space on the Time Capsule drive for run-of-the-mill storage. I’d also be looking for some decent media capabilities from any NAS I pickup (DLNA compliant, iTunes streaming etc). So while the Time Capsule idea is interesting, it has to be said that it’s feature set seems somewhat limited - it seems to be firmly targeted at doing just backups, whereas I think there is definitely a market for a similar product that adds some clever media server and NAS functionality.

Next up, was the iPhone and iPod Touch updates. As an iPhone user, this seemed quite cool - I was however hoping for a beta of the SDK, or some early 3rd party native apps to be announced too. The iPhone update (1.1.3) adds some nice features, although it looks like the cell triangulation doesn’t work over here in the UK (I’m guessing it’s USA first, rest of the world later). We do have the ‘my location’ button however. Perhaps it works in certain areas of the country, or they are thinking it’ll come online fairly soon. The WebClips are a great idea, and being able to organise the home screen really reminds you that the iPhone is so much more than a phone - it’s a brilliant little machine, and even without the SDK, some great apps can now be written to look native to the iPhone, and with a WebClip shortcut, you’d be hard pushed to tell the difference (unless the phone is offline, of course). The iPod Touch update seemed an obvious one - the $20 charge wasn’t quite so obvious. I think that’s a tough sell really, and it’s hard to see exactly why Apple have done it (other than perhaps to give iPod Touch users a reason to save the $20, and save for an iPhone instead maybe). It’s certainly a silly price to put on an update that’ll let you check your mail - but only when you’re in a WiFi hotspot. I’m sure the update will be useful for some however.

Thirdly, was the movie rentals and Apple TV 'take two’. On the movie rental front, this was largely useless being in the UK and all - apart from the obligatory sentence 'US for now, international later in the year’. Outside of all the hype, it’s important to remember that us Europeans that happen to have Xbox 360’s have been through all this before, with the Video Marketplace first coming to the US around 18 months ago, before finally coming online for us shortly before Christmas. I think it’ll really come down to the content that each service offers when iTunes movie rentals finally launches over here, but seeing as I’m yet to use the Xbox 360 video marketplace, it isn’t a particularly big deal for me regardless of when they get their act together. I like the idea of downloading movies, but I’d far rather download to keep, than rent (something that seems to only be available again, in the US, through iTunes). And the movie studios are going to have to realise that people aren’t going to pay the same they do for a physical DVD, to download the movie, especially when it’s released AFTER the DVD. Downloading movies over the net is effectively cutting out physical media and distribution costs, and a retail middleman - it’s high time that this was reflected in the prices given to consumers.

The Apple TV 'take two’ does seem like a good idea, and I like Apple’s rather refreshing 'we made a mess of it first time out’ stance. I also like that it’s simply a software update, and that there’s a price reduction (although more on price later). However I still think that there’s a couple of things that could help it really take off. They should provide 'Apple TV’ as a software-only package to install and run on other Mac’s - many people custom build media solutions using beefier Mac Mini’s, so that they can include more storage, a quicker machine (for things like HD decoding), and TV tuners. On top of a 'software+hardware’ bundle, they could effectively offer 'Apple TV’ as a piece of software on DVD (or available via digital distribution?) for order on the Apple store as usual. This might increase the take-up on the software itself, and would get more people looking at using iTunes movie purchase and rentals, as well as buying iTunes music straight from their TV. Seeing as how they’ve just radically overhauled the product without touching the hardware, I think it’s obvious that the product is the software itself, and decoupling it from the hardware could push the idea over the edge.

Lastly in the keynote, and most disappointingly - the MacBook Air. Don’t get me wrong - it looks incredible, and from a design standpoint is great. I also think the specs are about right, and think that the multi-touch trackpad is a great idea. However with all of the rumours in the build-up, there was definitely a sense that something really radical could be announced - not just a marvel of design, but something that technologically pushes the boundaries. I think that being able to cram a computer that powerful into something so light and thin is brilliant, but with the 'Air’ name, and the slogans surrounding 'cables not included’, I sensed that Apple was about to do something special. Something like induction charging, thereby waving goodbye to the power cable. Now of course this kind of technology is still very early stage, but if anyone was going to take it and run with it to drive innovation and consumer adoption, it would be Apple. Imagine not having to run a power cable to your laptop! The other potentially gamechanging rumour that was floating around was having a wireless broadband solution built-in to the machine, either EDGE (like the iPhone), or even 3G, or perhaps even a way to share the iPhone’s EDGE connection over Bluetooth. This would have been groundbreaking, and it would have meant that the new laptop they were announcing, like the iPhone, was usable anywhere. With the iPhone connection sharing option, it could have driven iPhone adoption too. That doesn’t mean that at some point I won’t look at getting a MacBook Air - I think it looks like a decent piece of kit. But I just think with the hype that they knew the rumour mill would crank out prior to MacWorld, having something with one or both of these incredible technologies in might have pushed the keynote over the edge - instead, with the lack of a 'One More Thing’, and the economy as fragile as it is, Apple stock took a tumble. It’s also worth mentioning that the Air does have a few hurdles - notably, it’d be interesting to see how hot it runs (remember the original MacBook’s and MBP’s?), and also with the lack of an optical drive (not including the optional, clunky external superdrive), the 'remote disk sharing’ feature touted needs to work really well.

That was it for the keynote, although there is one other bit I want to touch on - pricing. I mentioned while talking about the Apple TV price reduction that I’d come back on to pricing, and the reason is because once again it seems that us in the UK are getting a raw deal. Now it’s possible that it’s the same elsewhere internationally, but speaking just for myself when browsing these new goodies on the Apple store, the price difference between here and the US is staggering. For example, the base MacBook Air over in the States can be pre-ordered for $1799. At the current exchange rate (1.891), this would put it at £951.35. However, on the Apple UK store, pre-ordering the MacBook Air costs a whopping £1199! That’s a difference of £167.65, on the base model alone (and an increase of around 26%). And to doubly illustrate my point, how about the cheapest Apple TV, shortly to be updated with 'take two’? In the US, the 40 GB Apple TV is available for $229, which is the reduced price. This equates to £121.10. In the UK, we will pay £199 for the same thing. That’s an increase of 64%, for the same item! This has been going on for years with Apple gear, and they usually give some excuse about VAT and the added cost of doing business in Europe. But the notion that that has to result in a 25% to 65% increase in various prices is crazy. The bottom line is that as a fan of Apple products, I definitely think that they could do better to bring prices down over here so that comparing the UK and US stores wasn’t quite so frustrating :-)

So over-all then, the SteveNote at MacWorld this year had some good points (innovative Time Capsule, cool looking MacBook Air, iPhone update), and some bad points (lack of innovation on new MacBook bar the design, movie rentals being US only for the time being, new gear being completely over-priced over here). Still, the circus that is Steve Jobs giving a keynote (this year completely bringing Twitter down) is always fun and worth following. Looking forward to the announcement of the iPhone SDK next!


rsync Jan 14

Switched to using rsync to deploy this blog now. Since I re-wrote the blogging software to generate a simple static html site, I needed an easy way to deploy. I was using a Capistrano-esque method of deploying the entire site to dated directories (‘200801142252’, for example), and then I was simply symlinking the public web directory to the most recent release. This has the benefit of being able to quickly roll-back to previous releases (handy when doing major template changes etc), but having to re-deploy the entire site every time I wrote a post wasn’t really very efficient. So I’ve changed it to use the rather brilliant rsync to maintain the site on the webserver now. From my ruby code, I just shell out to rsync as follows:

`rsync -avzr -e ssh #{LOCAL_PATH}/* #{REMOTE_USER}@#{REMOTE_HOST}:#{REMOTE_PATH}`

This runs rsync in verbose, archive mode, using compression, and runs recursively. It specifies the local path, and the remote path for use over ssh (I was using scp over ssh before anyway). It’ll prompt for the password on the command line (although you could setup and specify a key to use with the ssh connection to avoid that). This solution will then keep the local and remote paths in sync, and will mean I can update the blog much more easily and quickly. Hopefully that’ll mean a few more regular posts coming soon… :-)


Hot Routes Feb 10

Last day or so I’ve come up against a couple of intriguing Rails problems while trying to knock up some plugins for an app I’m writing. I’ll write up the second of the two problems later, but here goes the first…

Put simply, I wanted to define a route within my plugin. My plugin implemented a controller (and also contained a view for that controller, see one of the latest features to hit edge Rails ahead of Rails 2.0).

I searched to try and see if anyone had come up against a similar task, but didn’t see any concrete answers. My testing led me to realise that every time a call to ActionController::Routing::Routes.draw is made, it completely clears and re-generates routes based on the block passed to that method. So simply calling draw with a new block containing my required route wouldn’t work; it’d overwrite other routes, or end up getting overwritten by other routes later in the chain.

I then figured it was time to get cracking with some meta-programming, and that I was going to have to re-define and extend the draw method in order to be able to map the routes I want, and do it in a way that’d be flexible and fair to the original Rails routes file, and other plugins that wanted to toy around with routing. I came up with the following:

module ActionController
    module Routing
        class RouteSet
            alias draw_old draw
            def draw
                draw_old do |map|
                    map.connect "controller/action", :controller => "mycontroller", :action => "myaction"
                    yield map

Let’s give this a quick run-through… I’m re-opening the ActionController::Routing module, and specifically the RouteSet class where the draw method exists. I’m using alias to copy the existing draw method to a method name “draw_old”, before re-defining the draw method itself. Within my version of the draw method, I’m calling the old one and passing it a block that firstly defines the routes I wanted to add to the application, and that then yields the appropriate mapper object back to any block passed in to the draw method itself. Dependent on where you want your route to appear in the scheme of things, you could always map your plugins custom routes after you yield the mapper to the calling block, so that they appear after any other routes. Another tweak would be to alias the existing draw method to something like “draw_old_APPNAME”, where APPNAME is the name of your application. This would ensure that if multiple plugins implemented something similar, that they then wouldn’t clash.

There may be a better way to tackle the problem, but after half an hour of working the problem over (mad props to my boy Mike for helping me tweak the solution into something useful and re-usable), I think I came up with a pretty solid answer, and with a bit more time, something that could probably be wrapped up into a module or plugin all of its very own. Bottom line? Ruby as a language rocks, the dynamic nature and meta-programming features opens whole new doors of functional programming to me, and I’m having to really think outside of the box to see some of the amazing things you can do with it.


Debuggering Feb 5

This is a pretty nice idea, and looks like a really useful tool. It’s in a fairly early stage, but it is shaping up to be quite nice. Think I’ll grab it, take a look, and see if I can help out somehow…


Mmm... sandwich Sep 29

This is genius.


RIDE-ME, one time Aug 13

So, RIDE-ME has hit version one, and I’m proud to say I was able to be a part of it. In fact this is the first release that has some of my work in it, namely the add-in architecture, and the console add-in built on top of that. It’s shaping up pretty nicely now, and recently I’ve been working on a Rails project using RM with almost no problems. I know I’m a bit behind the times blogging about the release, but come on people, please digg it - we are getting plenty of downloads but a spot on the frontpage wouldn’t go a miss ;-)


Can I Play With Madness Jul 18

Some online fictitious craziness from dotnet funny man Rory Blyth. Was listening to an old DotNetRocks episode featuring him the other day, man he cracks me up.



My first real contribution to project RIDE-ME, the add-in architecture, is now in the trunk of the source tree. Check it out, comment, submit patches or let me know feedback. I’m pretty pleased with it, and it should foster some nice add-in development hopefully :-)


Extra, extra, read all about it Jul 15

Hmm, via SvN, Newshutch, a nice looking web based feed aggregator. Might be worth a play.


For all these times, that we walked away Jul 14

Bit of a catch-up here, as it’s been far too long since I blogged:

  • England are out, and the World Cup is over. The first event left me feeling raw anger towards the Portuguese (who over the years have given me plenty to be pissed about). The second was a rather bittersweet event. On the one hand, I’d far rather see neither France nor Italy win it, but out of the two I would have to have reluctantly picked the aging French surrender monkeys, rather than the greasy match-fixing Italians, to have won it. But the Zidane incident made the entire thing worthwhile, it was pure enjoyment seeing him getting his marching orders, with the classic shot of him leaving the field yards away from the World Cup trophy, combined with the fact than an Italian was for once legitimately polaxed.
  • I got me SkyHD installed, and it is sw-eeeet. I can now watch HD sporting events, movies, and other assorted goodies (including alsorts of random documentaries, which I’d never usually watch except for the fact that it’s in HD). The box itself is sleek and chic, and bar a couple of random lock-ups last couple of days, has behaved excellently for a first generation piece of equipment. Oh, and the Sky+ PVR system is fantastic, I forgot how much I missed being able to setup entire series to be recorded with a couple of remote clicks.
  • I’m wrapping up the add-in architecture for RIDE-ME. I hope to have it in my branch by the end of this weekend, and then merge it over after then to trunk. We can then test the hell out of it, while the other guys start to write whatever add-ins they can dream up. Eventually, in the 1.0 release, it’ll see the light of day, and we hope to build a nice add-in community around it. Oh, and I’m now hosting all of the resources for the RIDE-ME project.
  • Did I mention HD? I’m currently watching Die Hard With A Vengeance apparently in HD (didn’t even realise HD cameras were around back in ‘95), and Bruce Willis never looked so good.
  • I’ve been having a lot of fun with the object/relation mapping framework I’m working on at the minute, integrating it tightly with the model-view-controller framework I knocked together. It’s starting to come together, and I’ve just implemented associations in queries (read: joins). I’ve got a reason for putting all of this together, and that reason is almost ready for the big-time, so watch this space…
  • I’ve ordered a SleepTracker watch, but there’s no stock at the minute so I gotta wait.
  • The new Rise Against album is fantastic, along with the latest albums from Billy Talent and Lostprophets, expect reviews soon
  • RubyCLR is superb, I think John Lam might be a genius
I think that’s mostly it believe it or not, so peace out for now.


Plug In Baby Jun 27

Here’s a good post from Phil Haack about plugins, and making a plugin architecture resilient to versioning. He presents some good ideas, some stuff worth thinking about in there. I’m thinking about and working on plugins loads at the minute, including working on an add-in architecture for Project RIDE-ME. Reading this post though made me start to question some of the terminology, where a lot of the time I’m using “plugin” out of context. The way I now see it, there are plugins, add-ins, and providers. I’m about to refactor a bit of code I’ve been working on, as it is effectively a provider system, for database and logging providers, however I’ve referred to it throughout as plugins, and I feel this is now slightly out of context…

Plugin: something fairly generic, to be able to “plug in” new components to change almost any aspect of an application
Add-in: something that is contained, used more within rich user interfaces to provide a specific bit of UI content or functionality, much more refined than a general purpose plugin
Provider: some kind of general functionality such as data querying, logging, that can be achieved against different sources, hence the need for differing providers

This is now how I’m starting to formalize some of the terms above, and while almost all of the reflection code remains the same regardless, the design of the architecture depends heavily
on which of the above you are trying to achieve.

Technorati Tags: , , , , , ,


Page 1 of 3 | Next page