I started to write my own biking app for Windows Phone then found an app that was much better than I could hope to achieve. So here is the source code for my app, which might be useful if you want to do something similar, or just want to see an example Windows Phone app. Be warned, the code is not particularly pretty.
Saturday, July 07, 2012
Tuesday, July 03, 2012
Endomondo and the app that will never be
I’ve written before about the two bike apps I’ve found for my Windows Phone, MyBikeMap and MapMyRide. I was so convinced that they were the only two options available that I started to write my own bike app. I got quite far with it, then I noticed a new app, Cyclocomp. I downloaded it and was quite impressed but decided it had a fatal flaw, it lets the phone go to sleep, the same problem that MapMyRide had. Wondering if I’m doing something wrong or am using these apps in a way nobody else is I had a look around for a review of it. That led me on to another app Endomondo. So I thought I’d give it a go and was immediately impressed.
The user interface is simple and elegant, the displayed stats can be configured to whatever you prefer, the map takes up the whole screen and you can even receive pep talks (and you can turn them off!). And even better, the data gets uploaded to the Endomondo website where you can view the map and see lots of geeky stats about your rides. And you can even enter challenges with other users, challenges that I am bound to lose since there’s clearly some very fit, active people on there. My only complaint is the map occasionally seems to get confused and stops showing the trail of where you’ve come from. But for free, it’s pretty much perfect.
And it rather puts my feeble effort to shame, so I guess my bike app won’t be seeing the light of day…
Thursday, May 24, 2012
I don’t rate Rated People (or maybe I do)
You’ve probably seen the adverts where Phil Spencer, the man whose remarkable negotiating skills can sometimes get £5,000 knocked off a £500,000 house purchase, tells us about this remarkable website which can connect us punters with local tradesmen. To me this seems like a good idea for a website and I have some work that needs doing, so thought I’d give it a spin.
So I filled in my details, entered the job details and waited for a response. And then, nothing. OK, not entirely true, I received a couple of text messages and emails. A couple of days passed and I received an email telling me that I hadn’t had a response and maybe I should expand on my job description to get a response. So off I went and updated the description and hit submit and then I was presented with a 404 error (for the non technical, this means the website is broken). So I tried again and got the same result (definition of insanity - doing the same thing over and over again and expecting different results). And I gave up at that point.
OK, slightly annoying, but no worries, I’ll drop them an email and let them know and I’ll update the description later when it’s fixed. So I go to their contact page. I can ring them, but not at this time or I can send them a tweet or write on their Facebook page or add a comment to their blog. No feedback form, no email address. I didn’t particularly want to berate them on a public forum, maybe the problem is something specific to me, so none of those options appealed. Yes, yes, I see the irony, I am now berating them quite publically (hello my many reader), but I’m annoyed now.
So, so far, Rated People is something of a failure for me. I think if you’re going to be spending a bunch of money on TV advertising, quite a bit of effort should also be spent on the product…
Update – A funny thing happened today, I got a call from Rated People, specifically due to this blog post. I’ve ranted about a few companies on here and never got any response from the company involved, so it was a pleasant surprise to get some feedback. I should also say that I did eventually manage to update my job description and also got a response from an interested builder, who is repairing my pointing as I type. So it would appear my initial review of Rated People may have been overly negative. And what’s more, Phil Spencer is no longer doing the voice over on their ads…
Sunday, May 13, 2012
Smart phone + app + bike mounting > bike computer
I recently took possession of a new Nokia Lumia 800, thanks to work, and immediately thought it would make a great replacement for my Veloset GPS 600 bike computer. Hearing Windows Phone didn’t have many apps, I thought I’d have to write my own biking app, but it turns out there are already a couple available, both free.
The first is MapMyRide. This initially seemed pretty good, but it has one fatal flaw, it lets the phone go to sleep. If you want to look at the map as you ride it is pretty tricky. You really don’t want to be fiddling with your phone when you’re riding.
Next up is MyBikeMap, which has one big advantage in that it doesn’t let the phone sleep, so I can look at my map all the time during my ride. It’s also well designed, with a simple user interface and showing just the pertinent information on the screen displayed when riding. It’s not perfect, my main complaint is the lack of support for miles, but it’s hard to complain too much when it’s free and it does most of what I want.
The final piece of the puzzle is something to attach the phone to my bike. I went for this mounting, primarily because it came up first on a Google search. The phone fits it perfectly and I was pleased to realise I could leave the zip open slightly to still have access to the buttons and I was able to use the touch screen through the plastic cover. But it does have a somewhat major problem as I found out today. Although the coupling between cover and bracket on the bike is perfectly adequate when riding on a road, if it gets a jolt then the cover (and the phone) can go flying. And you might not even notice until you look down some time later.
The design of the mounting is kind of weird, the cover is attached to the bracket not once but twice. One of these couplings is pretty secure, but the other isn’t. So the solution I’ve come up with is to glue the weaker coupling and I’m hoping this solves the problem. But you may want to consider this issue before purchasing this mounting.
But other than the teething problems, I’m pretty happy with this set up. It’s great to have a map in front of me as I ride, since it gives me much more opportunity to try heading off down a road or track that I don’t know without worrying about getting completely lost. And it makes me think the market for high end bike computers may not last much longer. Why spend £200 on one of them when a smart phone can do the same job?
Saturday, May 12, 2012
KmlLayer error handling in Google Maps
Two years ago I noted that the KmLayer in Google Maps didn’t provide an event to inform me if there was a problem when loading the KML. Things have moved on and an event has been added to the API at some point. Usage is as follows.
var kmlLayer = new google.maps.KmlLayer(url, { map: map });
google.maps.event.addListener(kmlLayer, 'status_changed', function() {
if (kmlLayer.getStatus() == 'OK')
$('#status').html('');
else
$('#status').html('KML loading problem - ' + kmlLayer.getStatus());
});
Saturday, April 14, 2012
How to increase your AdSense revenue
My proper website has been around for about 12 years. For most of that time it had very few visitors and the money I made from advertising was minimal. Then a couple of years ago advertising revenue started going up. It’s now plateaued but I earn a nice wedge of cash ever month, not enough to give up the day job but enough to add a decent amount to my income. So what’s my secret and how can you do the same thing?
Firstly, you can optimise the placement, colours and number of AdSense units. Now this may well improve your revenue but the problem is it is almost impossible to figure out if revenue increased due to changes to your ads or just due to random fluctuations. Take a look at my daily income over the past month.
There’s a lot of volatility in those figures. Admittedly you can slice the data in different ways which can produce better results but even with no changes to my ad setup, the daily numbers are all pretty volatile. And if you aren’t making a lot of cash from your ads, your figures are likely even more volatile. So I figure if you want to optimise you ad setup, then you need to be looking at weekly or monthly numbers, so the feedback loop on changes is going to be pretty slow. To be frank the limit of my optimisation of ads is to increase the number of ad units to three (the maximum allowed and also probably the maximum number that wouldn’t be too annoying to a user of you site).
So what did cause the increase in my income? Simple really, an increasing number of visitors. My graph of monthly visitors and my graph of monthly AdSense revenue are almost identical. So unfortunately the answer to the question of how to increase AdSense revenue is another question, how to increase the number of visitors to your site.
And the answer to that question is actually pretty straightforward I reckon. The first part is fully within your control - Produce a lot of content of a reasonably quality. i.e Content that search engines will consider to be of value and hence index. The second part isn’t completely within your control, gain some inbound links from reputable sites. I actually think this will naturally follow from producing content that people appreciate.
In some ways I can’t help thinking this is the business model that Facebook has adopted, get a shedload of content (although in their case its helpfully created by their own users) and shove ads on it.
Friday, April 13, 2012
Fun with flags
The Big Bang Theory hasn’t been quite the same since the geeks started to pair off with girlfriends (since half the humour was about them failing spectacularly in their endeavours with the opposite sex), but Sheldon’s recent video podcast ‘Fun with flags’ was rather splendid.
Saturday, April 07, 2012
Creepy ads
I’m used to visiting a website and their adverts then following me round the web afterwards. It’s happened with Dell and some property website. They even seem to make an effort to show me relevant stuff (laptops I was looking at or properties in the area I looked at). Then after a few days they disappear. I find it a bit creepy and it’s a bit of an eye opener to realise what the ad companies know about me (or about the cookie that’s sat on my machine).
But there’s an advert that’s been following me around for months now, for LeanKit Enterprise Kanban. I’m pretty sure this ad can’t be getting shown to everybody on the web, since this is a pretty niche product, so I can only assume it’s appearing because I visited their site ages ago. This has gone beyond creepy, this is just plain weird. Is showing me the same ad for months on end actually effective? Are the advertisers paying a premium for it?
Friday, April 06, 2012
Cross browser selectSingleNode for XML in Javascript
Internet Explorer has a non-standard method available in XML documents returned from AJAX calls called selectSingleNode. Pass in some XPath and it returns the first node that matches the XPath. Other browsers have ways of doing the same thing, but they are more long winded. So in short, I like the IE implementation and since I don’t fiddle with XML in JavaScript that often I often forget that selectSingleNode is not supported on all browsers (and if you’re wondering why I use IE as my primary browser, it’s because it’s still, just about, the most popular browser out there).
So here’s a cross browser version of selectSingleNode (not my own work, copy and pasted from somewhere I can’t remember on the web)
function SelectSingleNode(xmlDoc, elementPath) { if (xmlDoc.evaluate) { var nodes = xmlDoc.evaluate(elementPath, xmlDoc, null, XPathResult.ANY_TYPE, null); var results = nodes.iterateNext(); return results; } else return xmlDoc.selectSingleNode(elementPath); }
Update – This no longer works in IE10, since selectSingleNode has been removed from the XML document returned from AJAX calls. This can be worked around by setting the response type of the XmlHttpRequest, like so
xhr.responseType = 'msxml-document';
Update – There’s a more fully featured version of this now available
Monday, March 19, 2012
Business Optix blog now live
The blog of my employer Business Optix has gone live. We’ll be posting there as we roll out new features to our web and desktop products, along with tips and tricks to use the current software and any other company news. Keep up to date by signing up to the RSS feed.
Saturday, March 10, 2012
Veloset GPS 600 bike computer review
My first foray into the world of bike computers was a Sigma 1609 device. I quite liked it, since it was simple to use with a clear display, big chunky buttons and a very low price. The only minor downside was a certain amount of faffing around required to get it configured initially since it needed to know how big my wheels were.
But one day on my ride to work, a driver decided it would be a good idea to pull out at a junction without looking to see if anybody was coming and knocked me to the ground in the process. As I dusted myself off at the side of the road I heard a crunching sound and realised me and my bike had successfully got to the road side but my Sigma hadn’t.
So it was time to get another bike computer, since they are quite addictive. Being a map geek, I thought it was time I bought one with GPS, so I could map my routes on my PC. The Veloset GPS 600 caught my eye, since it was probably the cheapest GPS enabled bike computer available.
And it when it arrived first impressions were good, coming in a nice attractive box. But firing it up was disappointing. For some reason it uses a butt ugly font to display text and since it’s only a small device it’s not only ugly but difficult to read as well.
And things got worse when I fired up the accompanying software, which is possibly the ugliest software I’ve seen in my life. For people used to fondling iPads and the like, this will probably be a grave disappointment. But it does what it needs to do, importing data from the computer and displaying it in various graphs (speed, altitude) and on a map. It does consistently show my average speed as being higher than my maximum speed, which my basic grasp of maths suggests is incorrect, but other than that it seems to function correctly.
Which can also be said for the bike computer itself. It’s not the prettiest device ever but it does what it needs to do, displaying current speed, average speed (this time accurately!), distance covered, altitude, journey time etc. I’m not particularly keen on the touchpad buttons, since it’s easy to press them by accident and it’s impossible to press them at all when wearing gloves. Also on occasion the GPS seems to take a while to switch itself on, so the starts of journeys are sometimes lost.
So in conclusion, it’s the cheapest GPS enabled bike computer available and it shows in the presentation. It’s not a device you’ll fall in love with, but it does do everything it needs to do.
Tuesday, March 06, 2012
Finding a UserPrincipal for an email address
I wanted to let users log in to our application using their Windows user name or their email address. In order to achieve this aim, I needed to get hold of a UserPrincipal from the user’s email address so I could then test the password they entered was correct. It took quite a lot of searching to find the relevant code, so I thought I’d post the pertinent part here.
PrincipalContext context = new PrincipalContext( ContextType.Domain, Environment.UserDomainName); UserPrincipal user = new UserPrincipal(context); user.EmailAddress = "test@test.com"; // create a principal searcher for running a search operation PrincipalSearcher pS = new PrincipalSearcher(user); // run the query PrincipalSearchResult<Principal> results = pS.FindAll(); foreach (Principal result in results) { // do something useful... }
Tuesday, February 14, 2012
The scale of the universe
If like me you find it hard to grasp how the tiny the tiniest things are and how massively huge the biggest things are, then have a look at this
I’m not sure our minds can ever fully comprehend these different distances and sizes, but maybe it’ll help…
Monday, January 30, 2012
Let’s outsource the bankers
The main argument for bankers earning vast amounts of money seems to be that in a global market, they’ll just bugger off somewhere else if we can’t match the money available elsewhere. But the odd thing is, for the rest of us, globalization has led to stagnating wages as jobs have been outsourced to countries with cheaper labour. Odd that the free market doesn’t work in the same way for the rich as it does for everyone else.
So if we assume that maybe this argument is a bit of a fib, and assuming we can find decent replacements in some far off land who are willing to work for a much smaller pay packet, can’t we just outsource all our bankers along with some of our well paid CEOs? That’s some offshoring I wouldn’t mind seeing.
Saturday, January 28, 2012
Developer interview questions
A while back I had to interview some people for a developer role at work so came up with a few questions, combining a few from the web with some of my own. This is essentially a note to myself for next time I’m interviewing.
jQuery
What's a jQuery selector? How would you select an item by its ID? By its class?
Give some examples of JQuery UI effects and widgets and what they could be used for
.NET
What's an interface? Compare and contrast with an abstract class
How does memory management differ between .NET and a non-managed language? How can we make .NET behave more like a non-managed language?
What are generics? Why use List<> instead of ArrayList?
What's a virtual function? How does it relate to OOP?
Web
What is a RESTful web service? Why are they preferred to SOAP web services?
What are the common data formats returned by an AJAX web service call? Is one better than the other? What about if you wanted to call it from a fat client?
Name and describe several HTTP status codes
Name the various HTTP verbs and when they are used
General
Your application has a performance problem, how would you investigate the issue?
An error occurs in your web application but only in production and only happens occasionally, how do you go about tracking down the problem?
What are some of the issues around multi-threaded applications?
Discuss some ways of ensuring code quality remains high in a project
Saturday, January 21, 2012
Do it yourself inbound link alerts
Embedded Analytics provide a nice service that will email you whenever somebody clicks on a new link to your site. I’ve been signed up for a while and it’s interesting to see who’s linked to my site. But I received an email last week informing me that my site had so many inbound links that I would have to start paying for the service. To be fair the amount they were going to charge me wasn’t a lot, but I couldn’t really justify spending money on something that is essentially just a way to waste a bit of time for me. And I also figured I could probably do the same thing myself through the Google Analytics API, since this is what Embedded Analytics uses.
I’m assuming that Embedded Analytics uses the source for visitors to your site to spot new links. There is a downside to this since it won’t spot links that have been added but have not been clicked on, but generally these won’t be that interesting, since they presumably are links on low traffic sites.
So to implement this requires a few steps. Pull out the data from Google Analytics and store this data somewhere (DB, XML file, whatever). Then next time we pull the data out of Google, check for new URLs in the returned data and send a notification of these new URLs. Embedded Analytics also goes a step further and validates that the links are valid and that the pages containing them are available from the web. I was only really interested in the first part of this solution so have written a piece of code to pull out the URLs using the Google Data API for .NET. The rest of the work is left as an exercise for the reader!
using System; using Google.GData.Analytics; namespace GoogleAnalytics { class Program { static void Main(string[] args) { AccountQuery feedQuery = new AccountQuery(); AnalyticsService service = new AnalyticsService("DoogalAnalytics"); service.setUserCredentials("email", "password"); DataQuery pageViewQuery = new DataQuery("https://www.google.com/analytics/feeds/data"); pageViewQuery.Ids = "ga:202885"; pageViewQuery.Metrics = "ga:visits"; pageViewQuery.Dimensions = "ga:source,ga:referralPath"; pageViewQuery.Sort = "ga:source,ga:referralPath"; pageViewQuery.GAStartDate = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"); pageViewQuery.GAEndDate = DateTime.Now.ToString("yyyy-MM-dd"); DataFeed feed = service.Query(pageViewQuery); for (int i = 0; i < feed.Entries.Count; i++) { DataEntry pvEntry = (DataEntry)feed.Entries[i]; string host = pvEntry.Dimensions[0].Value; string path = pvEntry.Dimensions[1].Value; Console.WriteLine("http://" + host + path); } Console.ReadLine(); } } }
Friday, January 06, 2012
Another take on peer to peer lending
It seems a little strange to me that at a time when banks are meant to be desperately trying to increase their balance sheets, they are offering such meagre interest rates. I dunnow but maybe offer some decent rates and people will shove their money in your bank? But it seems they have decided it’s better to offer crap rates and hope we are too stupid to realise we can get better returns elsewhere.
So for a few years I’ve been stashing cash in Zopa and getting a return that manages to beat inflation by lending money directly to people, with the caveat that there is a higher level of risk than having money in the bank.
But I’m obviously not the only person to choose this option and rates have been falling of late. And although I’m happy to finance personal loans, i did have a hankering to lend money to businesses, especially since this seems to be something else banks are failing to do properly*
Which is where Funding Circle comes in. This is peer to peer lending but the other party is a business. Interest rates are currently some what better than Zopa. Time will tell how bad the default rates are but I’m going to drip feed some money in there and see how it pans out.
*I always thought banking was pretty straightforward, take in money from deposits, then lend it out to other people and skim a bit of profit from the transaction. Simple and a bit boring. Maybe they should have stuck to this slightly dull job, rather than inventing, buying and selling insane derivatives that nobody understands and nobody can quantify the associated risk. Get back to doing what you’re meant to do and people might get off your back a bit…
Friday, December 30, 2011
Why all the free ads for Facebook?
A while back I picked up a copy of the Evening Standard and was surprised to see Facebook and Twitter logos at the top of every page, suggesting readers follow ES on these two websites. And this is just an extreme example of what I’m seeing more and more. Ads on the telly and in newspapers no longer show the URL of the company’s website, but the URL of their Facebook page instead.
But the thing that confuses me is why big companies would choose Facebook as their main point of contact with their customers? Sure, social networks are the big thing at the moment and getting users to follow you or like your product might have some benefit, but there seem to be a number of downsides.
First, who owns all the data being collected about your customers? My guess is Facebook. Can you extract that data if Facebook decide they don’t want you anymore or you decide to move? I guess it’s probably possible via the Facebook API but it seems somewhat risky. And even if you do extract it, Facebook will no doubt keep hold of it as well.
Then there’s the question of ads. The company pages I’ve seen on Facebook seem to have the same ads as any other page. I’ve found no indication that companies get any of the income from those ads, so why drive traffic to Facebook so they can make money from your brand? And what if Facebook decide to show ads for one of your competitors?
Frankly it all seems a bit odd. Big companies have big IT departments and generally have their own websites, fully under their control. It is pretty simple to add some Facebook widgets to your own site and get integration that way which seems a more sane approach if you want to get hooked into Facebook.
For a one man band kind of company, I can see the sense in putting you web presence on Facebook, it’s a lot simpler and cheaper than building your own website, but for multi-nationals my prediction for 2012 is that this is something they do much less of.
Monday, December 26, 2011
Friday, December 02, 2011
Goodbye Google Friend Connect
I’ve been disenchanted with Google Friend Connect for a while. I only used it for commenting on my website but it has a number of weaknesses
- A crappy user experience
- No notifications of new comments, which is a pain if you only receive a handful of comments
- Ignoring query strings in URLs, so comments don’t stick to the right page
- Weird date formatting and no control over how they appear
For a long while I assumed Google would actually update the widgets but I’m not sure anything ever got changed after the initial release. It was released and then, nothing. Even a visit to the site shows a copyright notice from 2009, which suggests they haven’t done much with it for some time.
So I had been meaning to convert to some other system but just hadn’t got round to it. Then I noticed Google have decided to can it (which of course hasn’t been mentioned anywhere on the Friend Connect site itself), so I decided it was time to finally do something. Google’s suggested solution is to hook into Google+, but that seems like a pretty useless way to add commenting to a website. So my suggested solution is to sign up to Disqus, it takes about 10 minutes to plug it in to your website and looks pretty good straight out of the box.