Archive for the ‘blog’ Category

In early November O2 iPhone and BSkyB announced that they were releasing a limited free trial of the Sky News & Sports Mobile App [iTMS link] for the iPhone.

Pretty cool? Yes, three months of free small-screen Premiership Football, NHL Ice Hockey and…. wrestling. Pretty lame? Well, craning your neck to watch a three inch screen while sitting or in bed really there isn’t a comfortable way to do it without some form of scaffolding in front of your face. Regardless you can’t look a gift horse in the mouth, and so I enjoyed the ability to flick on or off during a big game to see the score and maybe a highlight or two.

The service costs £6 per month and auto subscribes after the trial ends and I believe it’s on a rolling monthly basis.

I signed up on 11 November, the week the offer was released with an iCal event scheduled for the week before the free offer expired, so that Mr Mastercard didn’t come into play.

According to the offer’s FAQs page you can cancel by going to this SkyID website – I didn’t see that before I cancelled my subscription, so I can’t vouch for whether it works or not.

How to cancel

The MySky site claims that as a non residential Sky Subscriber I’m a ‘guest user’ and not able to view or manipulate my account – so [unless the above link works] you need to call Sky Mobile enquires, the number for which is 08442 411 531 in the UK (& ROI it seems). All you need to do is enter your home number, then confirm your username and email address and tell them you wish to cancel the contract. Quite easy.

Verdict

Good application well executed, but without a TV-out (does the iPhone have one?) or some form of phone stand to relieve your neck muscles it’s a bit of a pain to use.

Every year since I was very young I’ve been coerced into giving up something for Lent. If you don’t know what that is check out the Wikipedia article for loads of information — perhaps more than you need.

Basically Lent is a Christian festival bookended by Shrove Tuesday & Ash Wednesday (that’s Today) on the Winter side and Palm Sunday / Holy Week / Easter Sunday on the other. The period of forty days reflects the forty days that Jesus spent in the desert being tempted, before his final journey to Jerusalem before being tried, sentenced and crucified.

We are told in the Bible that after being baptised by John (the Baptist), Jesus fasted for forty days in the desert. During this time, the devil appeared to Jesus and tempted him. Jesus having refused each temptation, the devil departed and angels came and brought nourishment to Jesus. [source]

Any lenten sacrifice we make is a pale imitation of Jesus’ trials in the desert, but it is part of the journey of a Christian to become more like Christ and as long as what you “give up” isn’t genuinely trivial it can be of benefit.

When I was younger it was chocolate, or sweets, or both which from the perspective of a child was difficult; this year I’ve decided to forsake my Facebook and Twitter accounts from Today until Easter. This is neither equivalent to fasting forty nor a single day, but I do believe it will improve my lifestyle, productivity in work, and encourage me to just turn off the computer instead of wasting time. I’ve decided that instead of consuming so much social media I will instead read more, and write more, hence this first personal blog post in well over a year.

Hopefully I’ll have something to write about.

Are you giving up something/anything for lent?

My old friend Chris has just launched a tennis related blog at http://lovetennisblog.com/

If that’s your sort of thing, check it out!

EDIT AGAIN: Much better..

To get a ‘num_reqd’ array of random objects, you can use something like this.

  named_scope :large, :conditions => ['image_file_name IS NOT ?', nil]
  named_scope :small, :conditions => ['small_image_file_name IS NOT ?', nil] 

  def self.get(num_reqd,features_arr=[],size="large")
    if size=="small"
      collection = Feature.small
    elsif size=="large"
      collection = Feature.large
    end

    return collection if collection.size <= num_reqd

    # num_reqd.times{feature=self.random(collection); features_arr.push(feature) unless features_arr.include?(feature)}
    features_arr = collection.find(:all, :limit => num_reqd, :o rder => 'rand()')

    if features_arr.size < num_reqd
      return Feature.get(num_reqd, features_arr, size)
    else
      return features_arr
    end
  end

EDIT: It's much cleaner and easier to use something in the form below, though the following is probably useful in some cases and is possibly interesting as a code snippet.

User.find(:all, :o rder => 'rand()')


---- end edit.

Working from a baseline of the code found here at almosteffortless.com I've extended a 'random record grabber' to get a specific number of unique records from a Rails data table.

Basically - the random method makes a database call to get the ids of a table, and sends back a random entry. self.get is a recursive method which provides a 'total number required' and a base array to start from (if you wish to specify entries to appear in the otherwise 'random' list). First year computer science should help get your head around the rest!

def self.random
    ids = connection.select_all("SELECT id FROM features")
    find(ids[rand(ids.length)]["id"].to_i) unless ids.blank?
  end

  def self.get(num_reqd,features_arr=[])
    num_reqd.times{feature=self.random; features_arr.push(feature) unless features_arr.include?(feature)}

    if features_arr.size < num_reqd
      return Feature.get(num_reqd, features_arr)
    else
      return features_arr
    end
  end

Be aware, there is more efficiency to be found in the database call (i.e. it should be cached). Also, you'll want to be sure there are at least 'num_reqd' items in the database.

The last week or so my Leopard iMac has been waking up in the middle of the night… it’s quite annoying.

Finally found the answer here:
macrumors – leopard imac waking from sleep issue.

It turns out the problem is caused by having Screen Sharing enabled, and the 5900 port (VNC) being exposed to the outside world through my router. While this allows me to remote connect from another Mac ….

The problem lies in the fact that the screen comes to life whenever ANYTHING connects to this port, be it another Mac, or a port scanner… before even authentication takes place. Tested this by trying to SSH to that port – bang, my monitors come to life.

Fixed it by removing the external port forward, and just using SSH into the Mac. Apple needs to stop waking up the screens until authentication has taken place.

Basically this means that the really awesome TouchPad app that got Fireballed a few weeks ago is only really useful if you turn off your computer (completely) at night or are willing to manually turn off port 5900 (the VNC port).

The weird thing is that this worked fine on Tiger.

So perhaps with Snow Leopard this won’t be a problem… ?

I’ve had huge amounts of pain getting WordPress set up locally over the last few weeks on my old machine and when it struck again with my new development environment it definitely time to write down the required steps to get a great LAMP/Rails setup prepared (for me)!

Leopard has PHP and Apache fairly up to date, and probably MySQL as well, but I decided to get MySQL up to scratch using the Universal Binary along with a few command line instructions available here (guide and links to downloads).

I didn’t use this script myself, and at a year old it may have a few imperfections, but HiveLogic have a fairly well rounded Ruby/Rails install going on.

Finally, WordPress to go on your LAMP stack will be a lot less painful using this guide for Tech Recipes.

Any suggestions additions or replacements for this list? Drop a comment!

The Geeky Irish Rockstars I have six draft posts in the wings waiting to be pushed out, works in progress related to technologies I’ve been working with lately for Contrast.ie

Working on a still-hush-hush project with the lads best known for their rock star company photo and probably this week for their choice of marketing for Exceptional, the bug tracking tool for Rails (and more) at Railsconf in Las Vegas.

Part of the reason there’s been so little going on here is that I’ve been… well… rather busy. Trying to get client work done as well as freelancing with Contrast has been a bit of a struggle and I’ve just spent three days getting my brand new 24″ iMac set up and running… a pain worth the endurance, though I’m fairly certain I now need a bigger desk!

So, some posts about Rails, HAML, Cucumber, and possibly a very very late review of FOWA Dublin which never quite got finished coming up in the next few weeks.

Stumbled across this fella on Twitter today, noticed he worked at Slide (who make successful/annoying Facebook Apps). None the less (I joke) he writes a blog at http://www.unethicalblogger.com/ and has recently been writing a series of ‘ProTips’ on using Git Repos for his work colleagues.

I think it might prove useful: http://www.unethicalblogger.com/blog_categories/git will be taking a read in my spare time.

So ferries are ok.
Busses are crampt, smell like on-bus toilets, and take far longer to get places than they should.
Ayr is dull and a very wet place.
Ayrshire, similarly, is rather dull full of sheep and precipitation of a cold variety.
I hope it snows in Edinburgh tonight.
And we haven’t reached Glasgow yet.

O2 Broadband (the Telefonica rebranding of Be Broadband) has a restriction on its SMTP ports, the only port-25 connection you can use is for the smtp.o2.co.uk server for o2 mail. If you want to use your own email provider such as Google Mail you have to use a different port, so for example use the SSL port 587 for Gmail connections.

Hope that helps someone!