Archive for July, 2009

31 Jul 2009

Some thoughts on the ASP.Net MVC Framework

No Comments Agile, C# Coding, Software Dev & Productivity

A few months ago, I got tired of ASP.Net.  I was tired of developers who depended on server-side controls, the Microsoft ajax implementations (as opposed to under-the-hood javascript ajax), excessive use of session and view state.  My preferred method of coding which relies more on the html than on the “runat=server” attribute, was considered old fashioned.

pics 006
Creative Commons License photo credit: paulb

So, I wanted to look at something else.  In my mind, Asp.net was getting too bloated and heavy.  I started learning Ruby on Rails.  RoR is a fantastic framework which integrates testability and maintainability.  Rails is the framework—Ruby is the language.  It’s easy to set up an Model View Controller site very quickly.  I love Rails, but I hate Ruby.  I had to lean how to do everything over again in Ruby.  It was like learning to speak a new language—even the simple things were hard.

Then, I looked at the ASP.net MVC framework that was released earlier this year.  The MVC framework is like Rails for ASP.  It keeps aspects of ASP.Net that I really like (like master pages and C#) and moves away from the bulky server-side, viewstate heavy, controls (like the DataGrid) that slow down ASP.Net performance.

My faith in ASP.Net is restored.  My brief foray into the hip and trendy world of Ruby development has given way to working on Microsoft code again.

I’ve been using the MVC framework in a few projects now.  I’ve started writing a Chinese Dictionary application (using the CEDict database) and am enjoying every minute of it.  I don’t know if I’ll every put this site live, but coding it is helping me learn the finer points of the framework.

There are some great MVC tutorials here:

http://www.asp.net/mvc/learn/

The best video tutorial (to start off with) is “Creating a Movie Database Application with ASP.NET MVC”.

28 Jul 2009

RunKeeper vs. Nike+

3 Comments Running

A couple of years ago (in 2006), I started using the Nike+ iPod sensor while running. I’ve written several posts about it here.  I’ve written about how to attach the sensor to your shoe without buying Nikes special shoes with pockets in the souls and I’ve written an api to retrieve the data from the Nike+ site with C# to use in other apps.  I love the little device and it works perfectly with my iPod nano—it gives me music and a measurement of how far I’ve run (roughly).

But there are some things I really hate about the iPod Nike+ sensor.

First, it’s not as accurate as it could be.  The transmitter is attached to my left shoe, so it works like a pedometer.  I’m not a treadmill runner, so my self-pacing is terrible.  My stride is based on the terrain or my mood.  It’s not consistent—but it’s close enough.  It’s cheaper than shelling out for a Garmin Forerunner.

Second, it’s wasteful.  The transmitter in the shoe has a battery that can’t be replaced or recharged.  You have to buy a new one when it dies.  I’ve been through two of them now.  Last week I found that my standard three-mile run was registering as two and a half miles.  The battery in my shoe transmitter was running low again.  I really didn’t want to throw this into a landfill somewhere and buy a new one for £20.

Third, I can’t get to my data easily.  Nike has a website that stores all your run data.  It’s possible to get a feed of the data, but not officially.  Some people out there have found ways to tap into this data (Running Tracker, Ear-fung.us, and myself) —but they do this using an unofficial api into the Nike services (which sometimes changes).  Nike wants to build their own running community (we need another community?).

So, I started looking for an alternative.  A few months ago, a friend at work told me about an iPhone app which uses GPS.  I looked into it and started using RunKeeper, an iPhone app with an online service.  I’ve used it on a few runs, and I will never use Nike+ again.runKeeper

RunKeeper is better than Nike+ for the following reasons:

  • It uses GPS instead of a pedometer sensor
  • It maps your runs for you on Google maps and Google earth after the run.
  • I don’t have to buy a transmitter every twelve months.
  • I can track bike rides as well as runs.
  • I can still listen to music while running.

There are some things I would like to see in the application.  I still can’t get to my data except through their interface (that I know of) so an open API would be nice.  I need to turn off wifi before the run—which is not difficult, but the only awkward step (this is due to the way an iPhone works).  And, I’m not too crazy about the idea of taking my expensive phone out on runs with me.  But aside from this, the application works great.

If you are a Nike+ user, and you have an iPhone too.  Try this app.  You won’t go back.

28 Jul 2009

Spotify online music service is pretty good

2 Comments Miscellaneous Rants, Software Dev & Productivity

I like to listen to music while coding.  I always have.  Sometimes I’ve worked at jobs where they allow this (media companies like BBC never mind developers with headphones) and some that don’t (investment banks never allow this).  So it’s nice when I get to do some coding at home on my own pc with my own set-up (Visual Studio 2008, twin monitors, etc) and my own music.  So when I’m at the desktop PC, I usually have iTunes open in another window.

So I have a pretty big music collection—not tied to a specific genre.  I’m hardly a connoisseur of music and would be out of place in any conversation about music, but I know what I like.

Yesterday I heard about Spotify from a friend who raved about it.  I downloaded the app and gave it a try.  I think I found my new background-music application for writing code.image

Spotify is a desktop application which streams music to the desktop. You can chose any song they have in their library (I have found most that I’ve looked for) and listen to whole albums, etc.  When I heard about it, I thought is sounded a lot like Last.fm, which is an okay personalised-radio station service application.  But Spotify seems to have no lag or buffering.  It seems to download the tracks as needed in one go, without streaming.  Not sure how the technology works underneath, but by watching the network usage on task manager, I see the network usage spikes only when a new track starts to play.

My only concerned with listening to music on the internet is that Orange broadband is already complaining about how much bandwidth I’m using in the evenings (since I spend a lot of time watching mlb.com, iplayer, and youtube videos).

I’ve found some articles online that refer to Spotify as an iTunes-killer.  I hardly think that’s the case.  If I was tied to this desk and never listened to music on my iPod in the car or while running, that would be the case, but you don’t keep the music, you just listen.  You can listen to albums or tracks and set up playlists.

Spotify is also being referred to as a legal alternative to piracy.  I can see that.

I’ve only started using it a few days ago, but am very pleased with it.  I’m using the free account (ad-supported), but they have pro accounts for £10 a month.  There are some adds inserted between the tracks, but I’ve listed by about 5 hours now and have only heard one.

It’s a nice service available in the UK now if you have a chance to take it out.

25 Jul 2009

Fast Food while Dairy Intolerant

2 Comments Miscellaneous Rants

Some members of my family are dairy intolerant.  This is usually fine when cooking at home (there are plenty of substitutes for milk products), but very difficult when going out.  During the Summer, I take my kids out on day trips around England and it is not always possible to prepare food in advance.  And, I love the junk food.  So, we’ll go to a fast food place.

The problem with dairy intolerance is that so many foods have milk (lactose, whey, or just “milk proteins”) in their ingredients.  Common sense doesn’t work when trying identify what has milk in it.  Most types of hot dogs, for example, include milk protein (but not all of them).  The tomato sauce on Pizza Hut pizzas include milk.  The BBQ ribs at TGI Fridays contain milk.  It has taken me a while to learn what to look out for.

If you have children that have (or you yourself has) an intolerance or allergy, you know how difficult this can be.  Last week, for instance, I stopped into a Subway and asked the store manager if their rib sandwich contained any dairy products.  He looked annoyed and told me that he had to read the ingredients on the box back in the freezer.  I asked him if he could do that.  He disappeared for a minute and returned with a giant white box which he read the side of.  “No, no milk,” he said.  But I couldn’t be sure if he was looking for the term “lactose” or “whey” or anything else which might include it.

Most fast-food chains make nutritional literature available online (although never usually available in the store).  I’ve printed out the documents for all the major chains which exists in the UK and pasted them all together.   I’ve found that printing all of the documents out (two pages to a sheet–double sided) and highlighting all the milk products makes going out for fast food a bit easier.  It’s easy to keep this print-out in the car so we have it if we need it.

Here is a set of links of the big chains ingredient documents.  These are all American chains, but the links are to the UK sites (not sure if they vary in the UK).  If you have children with food intolerance, I hope you find this useful.

McDonalds

http://www.mcdonalds.co.uk/static/pdf/food/OurFood-Booklet.pdf (pages 8-27 have ingredients listed)

Burger King

http://www.burgerking.co.uk/files/documents/ingredients.pdf

KFC

http://www.kfc.com/nutrition/pdf/kfc_allergens_april09.pdf

Pizza Hut

http://www.pizzahut.co.uk/media/77466/ingredients_list_starters_&_sides-0609.pdf

Dominos

http://www.takeafreshlook.co.uk/downloads/PizzaBasesToppingsIngredients.pdf

13 Jul 2009

An update on my trip to China

5 Comments China

Last month, I was supposed to go to China.  I had planned to attend the CISIS conference in Dalian. This is one of the largest technology fairs in China for IT Service companies.  I had the flight and hotels booked and registered with the conference. I worked with the UK Trade and Investment office to set up some private meetings with Chinese software companies, too.

The problem I had was that my American passport had less than 6 months time left on it– a China visa requires more than 6 months remaining on a passport.  The Chinese embassy also wouldn’t give me a visa from the UK unless I had proof of permanent UK residence in my new passport.

I had 6 weeks to get everything sorted before the conference.  But I had to (1) get a new American passport from the US, (2) get my UK residency visa transferred to it by the UK Home Office, and (3) get a visa from the Chinese embassy.  The US got me the new passport in three weeks, but the UK Home Office took 5 weeks to transfer the residency visa over (I tried to speed it up, but bureaucracy is bureaucracy and no one could help).  I had to cancel all my travel plans and lost a few hundred quid in the process.  It’s not easy being an expat sometimes.

So, now I’m making new plans for a new China trip.  I’ve missed the CISIS conference, but still plan to visit some Chinese software companies out there sometime in the next few months.  Now that I have a brand new US passport and my UK visa seal is all up-to-date, I’ve sent my visa application to the Chinese embassy in London.  This time, I won’t make any travel plans until I get the documents in hand.  I’m going to wait until after the summer holidays to book any business meetings out there.

According to the Chinese London Embassy website, the visa process for China should take only 4 days.  They have a site called VisaForChina.org.uk which is dedicated to issuing Visas from the UK (due to the large amount of visa requests they get).  The site has some problems.  The English wording is obscure in some places.  It also has a visa application wizard you can fill out online, but it crashes on the first page in Firefox and gets all the way to the last page in IE before it displays it all back to you as null fields and errors on the form (better to download the pdf and fill it out by hand).  But, it is a helpful site.

I’ve had a few people from my last job ask why I’m not in China yet.  This is why.  Things are up in the air now, but I’m enjoying the sunshine of the summer.

I’ll keep you posted, of course.

06 Jul 2009

My domain is being used for spamming

4 Comments Blogging
ASCII Art Junk Mail
Creative Commons License photo credit: Yandle

I woke up this morning to about a hundred out-of-office replys in my inbox and junk mail folder.  It turns out, someone is using my Overpass.co.uk domain in an email reply-to and sending out loads of sex-related spam.

I’ve been searching for what to do about this, and it turns out that there’s not much I can do.  Since the spammers are not sending from my server and only using the reply-to, all I can do is hope that it stops soon.

Apprently, this is a pretty common problem.

If you get an email from Overpass, it wasn’t sent by me.

05 Jul 2009

Nike+ API Revisited

1 Comment C# Coding, Running, Software Dev & Productivity

One of the highest traffic posts I get on this blog is the brief post on accessing the Nike+ API with C#. I’m pretty proud of that post, but I don’t keep up with how the API works.Running Shoes

The Nike+ API is not published, so it’s not public.  It can change at any time.

If you are interested in the Nike+ iPod API, there is a much more up-to-date blog you may want to have a look at.  It’s called Running Tracker.  I’ve been subscribed to the RSS feed of this site.  They’ve created a cross-platform desktop application to examine the data stored with Nike.  I know about their API changes through Running Tracker.

If you have come to this site about the API, by all means, use the code if you can– but also check out the Running Tracker site as it is more up-to-date on the subject than I have been.  Their application doesn’t use C#, but it might be able to help you out with more information.

Creative Commons License photo credit: marksteelenz

04 Jul 2009

Leave it on or shut it down?

5 Comments Miscellaneous Rants, The Environment

I turn my desktop computer (running XP) off every day when I’m not using it.  It is a pain to wait for startup and shutdown times, but I’m concerned for the environment and all that.

I think most people leave it running 24 hours.  I can understand why.  Sometimes it take over 10 minutes to really get all services loaded.  I’ve tried hibernate, but the Dell 9150 I use comes back from Hibernate with the fan running at full speed and it’s very noisy.  Windows seems to be geared for 24 operation– with automated processes kicking off at different times of the day.  It’s like the fridge– but I’m not sure how it compares in terms of energy consumption.

I’ve actually set my bios to kick on at 4am so the computer has finished start-up before I get up there ten minutes later.  It does all my site backups at a specific time.

I’m trying to find more energy efficient uses of the pc.  If anyone has any ideas, I’d love to know.

03 Jul 2009

What Twitter is becoming

No Comments Blogging, Social Media

I enjoy Twitter.  It’s easy to update.  The low character limit, rather than being a hindrance, encourages people to start using it who would never think of started a self-serving blog.  It’s easy to put off a quick statement without having to think too much about it.  I find I update Twitter far more than this blog.

I’m getting lots of followers.  This is good for the ego until I look at who they are.  On any given day, I will get a few email like the following:

SomebodyYouDontKnow is following you on Twitter.
Followers: 300
Status Updates: 121
Following: 1421

Now, I ask you . . . how can someone follow the status updates of over 1400 people?  How is it even possible?  Why would someone want to do it?

I get two or three of these type of followers a day.

I’m also seeing a lot of articles on the web titled “How to increase you followers in Twitter”.  It’s like the new SEO.  There are people now calling themselves “Social Media Consultants”.

I suspect that people follow thousands of people so that those people will in turn follow them.  It makes sense I guess– you send more mail when you want to get more mail.  However, there is just something spammy about this.  Maybe they are looking for the top spot in the Twitter stats.

Twitter is not like Facebook where you have to give permission to people so they can see your status.  You can search all tweets (unless the author specifically selects to option to make it private)– so there is no reason to follow 14k or more people. 

A few years ago, I kept getting contacted by SEO charlatans saying things like “I can get your company in the top 10 on Google.”  It was a ridiculous statement.  I asked if they knew what my business did or what keywords I wanted, but they didn’t. 

I now soon expect to be told, “I can get you 20k followers on Twitter. “  But who wants that?

02 Jul 2009

UKTI “Doing Business in China and Hong Kong” seminar

No Comments China

Today I attended the half-day “Doing Business in China and Hong Kong” seminar given by the Southeast UK Trade & Investment organisation.  It was a decent presentation which discussed some of the aspects of doing business with China.  It focused more on Guangzhou, Shanghai and Hong Kong than on the Northeaster areas I’m interested in, but it was very interesting all the same.

My trip to Dalian was supposed to happen a few weeks ago, but do to the bureaucracy of the UK Home Office, I had to cancel it.  I’m planning to make the trip within in the next few months.