Tuesday 30 November 2010

Gotcha: heroku with git+svn pushes your working copy

For the MatchFounders website, I've been working with svn on Heroku using git just as a deployment tool... and I came across a bit of a gotcha the other day.

git commit will add your *working copy* to your next deployment.

Luckily it didn't turn out too badly for us - I was just mucking about with some pagination links... and quickly fixed the bug I'd been working on before deploying again... but if I'd been right in the middle of some big hairy code refactor, or something... I'd have had to go find heroku's docs on rollbacks pretty darn quick.

So - just be aware that if you use this method, to add a step to your process-control to make sure you only deploy from a 'clean' working copy.

Tuesday 23 November 2010

Ruby median

Was trawling through the google analytics search keywords and noticed somebody was looking for an Enumerable#median method when they came to this site. Got me thinking...

I went googling for solutions and found that some of them were just plain wrong... can't have that.

module Enumerable
  def median
    # trivial cases
    return nil if self.empty?

    mid = self.length / 2
    if self.length.odd?
      (entries.sort)[mid]
    else
      s = entries.sort
      (s[mid-1] + s[mid]).to_f / 2.0
    end
  end
end

This one isn't the most time-efficient (the sort can get long). I'd need to implement the selection-algorithm for the most optimal solution... but it'll do for a quick fix. I'll post again here if I get around to the better one.

Friday 19 November 2010

MatchFounders hits 500

MatchFounders.com hit its first milestone today: 500 registered members. I'm pretty pleased with that, seeing as how it's been a part-time on-the-side project that started on what's basically a hackfest.

Still got heaps to do before it becomes a world-dominating site, of course... but I'm pretty happy with that amount of activity after only a month and a half. Enough to post about it on the matchfounders blog... along with our upcoming dastardly plans.

Saturday 13 November 2010

mobile broadband roaming

The directors of MoneySpyder have been reading "The 4-Hour Workweek" by Timothy Ferriss and are all fired up about the idea of us working from home (amongst other things). Basically, they're hoping to kick the expense of an office - which is fair enough.

So I casually asked "so, does this mean I can take my laptop on the road?"

I was kinda surprised when they answered yes.

w00t!

So, I finally have the option to live my original dream - spend a month in France, a month in germany, a month in spain...

BUT...

(you knew that was coming)...

I've just checked what it costs to get international roaming on mobile broadband, and it doesn't look pretty.

Actually, that's an understatement... it looks downright atrocious.

I'm currently on three mobile - and I pay around £15 a month for 5G of internet usage. As yet I've never busted that limit - I think I use around 1.5-2G. I used to have a 1G account (with O2) but that wasn't enough for me - eg when I needed to do a full ubuntu upgrade.

However - when I checked into the mobile broadband roaming rates I discovered that they don't bundle your monthly allowance - it costs per mg... and not at the usual overlimit pricing rate of around 10p per meg - it costs you £1.25 per meg!

This would mean my normal monthly usage would come to cost of £2000-£2500 PER MONTH!

Yes, that's over two thousand pounds per month!

Now - I can understand that it costs a fair bit more to use overseas carriers, than to use their own.... but even if *they* bought the data at retail prices, and then charged *us* retail on top of that - this would come to only *twice* our normal per-meg rate...

Not 166 TIMES my normal monthly amount.

There is something seriously wrong there!

Now - the pages all say "well, just don't use as much internet when on the road"... but unfortunately, I have no choice. I am a Web developer - that requires me to do a bit more than just checking email or checking the local weather online. I need to download the latest codebase, get copies of db dumps, upload and deploy sites, go to the online site and test it thoroughly... etc etc. Even if I cut out all recreational internet use (and where's the fun in that) I'd still be using about a Gig a month.

I've noticed that a very few enlightened companies have begun to offer something a *little* better (eg orange travel bundles), but even so - they're still not even approaching regular internet usage. The orange bundle offers 50M at £40 - which would make my monthly spend "only" £1200 - so, half the rate of the Three option... but still in the ridiculous zone.

Now, I've wandered about online in search of a better solution, but I have only a couple of viable options.

Firstly - I could spend my life in a Maccas or Starbucks (or equivalent) for the purposes of the free WiFi connections... rather than actually enjoying the variety of local establishments. Of course - they do expect you to actually purchase some of their wares - and I refuse to eat the former, and the latter is definitely not my cup of coffee-flavoured-milk.

Also - it's quite difficult to actually do real work in a busy cafe. It's ok for a few hours - but it's tough to be there all day. I'd also have to shut down, pack up and potentially lose my table every time I needed to dash to the loo. :P

The second alternative would be to just buy a new dongle from the country I'm visiting... for each country I visit. This feels expensive and wasteful... but if you compare it to the roaming rates - it actually works out cheaper... *far* cheaper.

With Three's quoted roaming rates, it would cost me an average of £85 per day.
Even if a new dongle cost me £100 (for the PAYG version) - I could buy one every two days - and still be paying less.

Ridiculous as this seems, it seems to be my best real option.

If anybody knows of a better solution, let me know!

Dongle-sharing?

But then I got to wondering: perhaps there's others out there wanting to do the same thing. If we each buy a dongle for a different country and then swap with each other - this would be far less expensive. Just buy our own PAYG sims. Or perhaps there are others of you out there already in a different country (that I want to visit) who'd be willing to rent me your own dongle for a month... I'd even pay a refundable deposit!

Any takers?

Wednesday 3 November 2010

NaNo Wrides again!

It is the month of November, and once again would-be-authors are hurriedly scribbling on pages, or tapping away furiously to meet their daily goal... the elusive 1667!

NaNoWriMo has begun!

I've got my wordcount up on the left again, but you can see more at taryneast's author page.

For those not in the know, "NaNoWriMo" Stands for "National Novel Writing Month" - a writerly self-challenge where people from all around the world pledge to write 50,000 words in the month of November. No, it's not a charity, and it's not a competition... it's just a chance to give it a go and see if you can finally pull that novel out of yourself that you've been procrastinating about for years...

Before you dismiss it as an obscure, minor little thing that only a few weirdo wannabe-writers have heard of... you might want to know that it's more popular than you might think! As of yesterday there were 156,415 authors signed up worldwide, who wrote a collective 55 million words. Yes, that's millions, and yes that's just yesterday!

It's crazy-fun and I recommend it to anyone - especially anyone who thinks they're a terrible writer, or who thinks nobody wants to read what they write... but secretly has a tiny desire to be known as an author. Trust me, NaNoWriMo is for you.

It's only day two - there's still plenty of time to join in the fun! Go on, give it a shot! What have you got to lose? :)