Wednesday, 5 November 2014

Living with Inbox by Gmail

Day 1

So far Inbox has enabled me in getting my email in order. Initial thing of note are the brilliant snooze feature. This has allowed me to snooze an email about an order from Amazon that was delivered to work but I forgot to take home. I snoozed it until I got to work, yes, you're able to snooze by location which is an immensely useful feature and seemingly works perfectly - I now have the order I forgot yesterday, sat on my desk ready to take home, brilliant!

Inbox makes it easier to get emails out of your face either in bulk or individually. I naturally found myself compelled to click the tick that archives the email - this isn't as easy in Gmail since you have to have opened the email first or select it from...yawn! Click the tick and you're done.

I particularly like the way that the web app is a single page app. There's no opening emails and being taken to a different page - the email just expands in the window you're in, taking full advantage of the full width app. That's right folks, there no pesky permanent side bars taking up valuable space.

Which leads me on to the design. Obviously inspired by Google's new Material Design guidelines it's an immensely clean interface with pop-out menu's when you need them. Clean, simple and user-friendly.

So, that's day one. So far, I like it. More to come...

Saturday, 7 December 2013

Problem streaming DLNA content on XBOX ONE?

After owning an XBOX 360 for many years I've grown quite fond of the interface and the platform Microsoft has built in XBOX Live. My XBOX plays a huge part in our family's entertainment and with all the features XBOX ONE brings to the table I went ahead and ordered the Day One Edition.

One of the most common features we take advantage of is streaming DLNA content from our home server. Yes the method of accessing that content has changed somewhat with XBOX ONE but personally I prefer it. The Nexus 7 is a great companion device! Recently we encountered a problem streaming this content and for whatever reason the XBOX disappeared from the list of available receivers. I scratch my head over this issue for a day or so - it was shutdown and restarted a number of times to no avail, or so I thought. I'd totally forgotten that I'd set the XBOX up to sleep - to enable the 'XBOX On' voice command. This prevents the XBOX for shutting down completely and thus doesn't fully close down any applications, including XBOX Video, which is used to play the DLNA content.

I wanted to document my experience with the possibility of helping someone with the solution. Given the situation explained above, to solve this issue turn the XBOX off and disconnect the power. Once reconnected turn the XBOX back and you see it run through the full boot-up routine. This will confirm to you that the XBOX and all application would have been shut down fully.

When you attempt to stream DLNA content again, all being well it should work normally. Good luck!

Disclaimer: I take no responsibility for any damage or further problems that may occur as a result of performing the actions explained in this post. Actions taken with your property are your own responsibility. That said, I hope the information provided helps!

Sunday, 24 November 2013

Clickable links in your Twitter feed

I recently had a request from a client asking to make the links in their Twitter feed clickable. Now for many developers the first thing that pops into their mind is something like:

"Oh, you're gonna need regex for that..."

Judging by my research on the subject it seems many developers have indeed taken that approach. However, as many will know regex is a pain to maintain - not to mention time consuming to create in the first place. There's usually a performance hit associated to regex too.

The solution? Handily Twitter has this concept of 'Entities' which groups URLs, Hashtags and other such things together. In this post it's URLs we're interested in so I'll stick with that but the code can easily be extended to serve up Hashtags as hyperlinks too.

When you request a feed from Twitter the data you receive contains all sorts of information about each post. Right from the post itself to who replied/retweeted. Within the detail of the tweet you'll find a section containing 'Entities' - as mentioned above, you'll find all the URL's posted in the tweets text. Now here's the really useful part, Twitter also provide the character position within the text where the URL begins and ends - handy, eh? So this is what I used to wrap the URLs in <a> tags and here's my code...


Note that this is a PHP function but the concept could be converted to any language. If you need help feel free to comment and I'll see what I can do.

Pop this function into your class (maybe called Twitter). Once in place modify the function that obtains your feed and pass the json decoded array to this function, simply:


Note the function doesn't return anything as you're passing the array by reference. In effect the _applyEntities() function is a modifier/decorator function so there's no need to catch its result. Also, if either the feed is empty or no URLs are found the feed won't be altered in any way.

Final Notes

If you convert my code or use a similar method in a different language please post a comment and I'd be happy to add your Gist to this post - share the wealth!

Tuesday, 20 November 2012

Competency based interview techniques

Recently I've been invited for interview with a number of prospective employers. I always find interviews highly stressful to the point where once the interview is over I end up with a severe head-ache. However, in preparation for my most recent interview I adopted a method called the STAR technique.

Rather than repeat what can be found on the internet in the matter of seconds I urge you to check this link out:

Briefly, it helps you break down your example to a particular question (see here for what a competency based interview is: into meaningful categories. These categories, in turn, help you structure your reply and give a more rounded answer.

After the actual interview I still felt a little groggy but no head ache! Hoora! Honestly, though, it made me feel more confident in the interview and I now feel I gave the best I could. At your next interview, why not give it a go - maybe it would work in non-competency based interviews too!

Oh, and of course, GOOD LUCK!

Just one reason why I don't like/use Facebook!

It is extremely rare I even look at Facebook, let alone share or just use it. Yes, I have an account and it does have a fair amount of content on it from my University days. Now, it's a site I rarely frequent.

My girlfriend on the other hand likes to pop the odd photo up there and generally peruse her friends comments and make the odd comment herself. Like this past weekend, for example, our cat was making a humorous pose so she decided to take a photo and post it on Facebook.

As you're probably aware Facebook has a little feature akin to Google+'s re-post feature and Twitters retweet feature - called share. Aptly named, it allows someone who can see your post to share said post on their 'wall'. When someone took advantage of this feature and shared the photo of our cat it got me to thinking:

"Hang on! What if your privacy settings stipulate that you only want your friends to have access to your content?"

I conducted a little research, as my girlfriends privacy settings DO stipulate that only her friends can see her content. There appears to be no way to control if anyone can share your content like there is on Google+. Google+ gives you the option to 'lock' posts to prevent anyone from passing your content on. So, if someone was to see her content and either 'like' it, 'share' it or anything else possible to have said content feature on their 'wall' those privacy setting become null and void, totally useless, pointless, FAKE!

It seems Facebook have a very different opinion on what the word privacy actually means or they've had their ass kicked and decided to implement a half assed solution. My advice is, if you want to share something with your friends and still maintain control over your property - invite them round for a drink or dinner, then show them. Don't use something like Facebook!

Friday, 27 July 2012

Google Nexus 7 16GB - First Impressions

Well, I ordered a Nexus 7 16GB on the 21st June directly from Google and it arrived on the 19th July. I was a little brassed off that others who had pre-ordered theirs from Google's partners received theirs before the official release but now I have it, I'm immensely happy.

I didn't have any preconceived ideas of what I would use the device for - I just wanted a tablet and have done for some time. Now I have it, however, I seem to play games, browse Google Currents/BBC News and other news outlets a heck of a lot more now. It seems to have opened a new door for me.

The device itself is VERY well built, solid, very light and feels nice in the hand. Navigating between home screens is very snappy - Jelly Bean/Project Butter have done wonders for this device and that's before you consider what is under the bonnet. You're looking at a Tegra 3 - a quad core power house with and additional 16 graphics cores. When it comes to games it's obvious how much of a difference there is between Tegra 2 and 3.

For those looking into the tablet market and are not already hooked into the Bermuda Triangle that is Apple's ecosystem, this tablet has to be somewhere near the top of your list. The only drawback at this stage is the size of the screen. Whilst I don't have any problems with this, other might. However, I've heard rumours of a 10 inch device on the horizon - so lets see how that pans out.

Do you have a Nexus 7? What are your thoughts on Google's first step into the tablet market?

Tuesday, 12 June 2012

Deploy Meteor to AppFog

In the past year or so I've been fiddling with the CloudForge based Platform as a Service (PaaS) It's a service still in its BETA phase of development but it still provides a very simple method to deploy and scale your apps FAST!

Anyway, I became aware of Meteor recently. Meteor is, and I quote from their website "Meteor is a set of new technologies for building top-quality web apps in a fraction of the time, whether you're an expert developer or just getting started." I could elaborate on what I think Meteor is but I'm still trying to paint my own picture of it and I implore you to go and check it out for yourself. What I will say at this point, however, is that it's BRILLIANT!

So, my goal was to deploy a Meteor App to AppFog. Simple, no? Well, no, not really. There are a few things to note prior to deploying your app to AppFog - otherwise you will encounter some errors.

Firstly, you need to have Meteor bundle your app into a more nodeJS style application. To do this, from a terminal window navigate to your app folder and type (now bare with me as this will seem long winded):

meteor bundle app.tgz

Then untar the bundle and move it into your application folder:

tar -zxf app.tgz (this will untar the app into a folder called 'bundle')
mv bundle/* [app folder] (replace [app folder] with the folder of your choice)

Now what you have, in effect, is a nodeJS app. All we need to do now is make a couple of tweaks to the code and she's ready to launch.

Open up the folder in you favourite editor (I use Sublime Text 2). Now open the 'server.js' file located in the server folder. Scroll down to line 54 where you'll see 'var port' being assigned. Change 'process.env.PORT' to 'process.env.VMC_APP_PORT' so the line should now read:

var port = process.env.VMC_APP_PORT ? parseInt(process.env.VMC_APP_PORT) : 1337;

All this does is tells our app where to find what port it should be listening on for incoming requests. Without this change the app will fail to start as it won't be able to hook onto an inbound port.

Next we need to setup MongoDB access. Without meaning to teach you to suck eggs, make sure you have provisioned the MongoDB service within AppFog prior to deploying your app. Otherwise, again, the app will fail to start as it's looking for a database that isn't there. So, just under where we made the port change you'll see 'var mongo_url'. Comment this line out for future reference and add these 3 lines:

var env = JSON.parse(process.env.VCAP_SERVICES);
var mongo = env['mongodb-1.8'][0]['credentials'];
var mongo_url = "mongodb://" + mongo.username + ":" + mongo.password + "@" + mongo.hostname + ":" + mongo.port + "/" + mongo.db;

AppFog adds our MongoDB credentials to the 'VCAP_SERVICES' environment variable so all we have to do is fetch this information from there and construct a MongoDB url for our app to use.

That's it - lets deploy our app! Back on the command line (terminal) from your applications folder type:

af login (this will ask for your email address and password for AppFog)
af update [app-name] (replace [app-name] with the name of your app in AppFog)

Your app will now deploy and start up. For a working example, my app is deployed here:

If you want the actual code that I deployed you can download it here: