5-4-3-2-1-1… Happy New Year!

Tuesday 30 December 2008

The announcement of a ‘leap second’ to be added to Coordinated Universal Time (UTC) at the end of 2008 reminded me to double-check that we’re using Network Time Protocol (NTP) on all of our servers to keep our clocks accurate. Here are a couple of links to instructions for configuring this on Windows Server and Ubuntu linux:

http://support.microsoft.com/kb/816042

https://help.ubuntu.com/8.04/serverguide/C/NTP.html

Nokia N95 as a 3G modem for MacBook

Saturday 27 September 2008

I needed to get an internet connection on my MacBook earlier today, but with no wireless access points available the only option was using my Nokia N95 as a 3G modem. Unfortunately getting a connection using the O2 network wasn’t quite as straightforward as hoped. Here’s how it’s done:

First off, I connected the MacBook and N95 over bluetooth using the wizard in the Bluetooth section of System Preferences. The wizard will automatically configure the modem connection if given the appropriate settings. For an O2 contract with Mobile Web enabled these settings are APN ‘mobile.o2.co.uk’, username ‘mobileweb’, password ‘password’, and CID ‘1′.

At this point it should be possible to get online, but instead the connection immediately terminates on every attempt. This is caused by a default setting in Leopard that is not compatible with many mobile networks, and can’t be configured via the UI. The solution is to manually modify the file ‘/Library/Preferences/SystemConfiguration/preferences.plist’. Search for the string ‘Bluetooth-Modem’, then scroll down to the entry for ‘CCPEnabled’ and change the value from 1 to 0. Everything should now be good to go, although a reboot may be needed.

Dancing digger

Friday 26 September 2008

Just passing Devonshire Green earlier and caught a Cultural Olympiad event - Transports Exceptionnels – a dance duet between a man and a 13 tonne digger! Whatever next?

Does Ruby rock?

Tuesday 22 July 2008

I want to write a method that collates the string descriptions of a collection of items, separating them with a HTML link break, and returns the result in a form I can output on a webpage.

In Ruby I can write the whole method with one concise line:

def to_formatted_string

  collection.map {|item| ERB::Util.html_escape(item.to_string) + '<br />'}

end

In C# the solution is somewhat less elegant:

public string ToFormattedString()
{
  StringBuilder output = new StringBuilder();

  foreach (string item in collection)
  {
    output.Append(HttpUtility.HtmlEncode(item.ToString()) + "<br />");
  }

  return output.ToString();
}

Conclusion: Ruby rocks!

Adding value to stories

Tuesday 8 July 2008

Over the last few days I have been looking at how epiGenesys uses stories and where we can make improvements that add value to provide a better resource for development. After much research on the web looking at how others use stories I have a few changes in mind.

Firstly, I plan to add more structure to our stories by replacing the open description field with a template. The intention is to make it easier to extract specific information which can be redisplayed in alternative formats better suited to other purposes. An example might be the extraction of a list of performance needs to be referenced when generating tests. The template will also encourage the capture of all the requested information.

I also plan to require the inclusion of information on the business value of a story. This will enable us to more effectively consider client objectives when planning and prioritising work. It should also encourage a stronger focus on developing business value rather than just developing functions. In addition, I am interested in the possibility of generating marketing information for an application (such as feature-benefit summaries) directly from stories. Thus the template I propose is:

In order to

<achieve a benefit / mitigate a risk / satisfy an obligation> (from a business perspective)

as a

<type(s) of user>

I want to

<perform a task>

and I require

<performance need(s)>

In addition, I plan to replace the testing information captured in our stories with structured operational requirements in the form of scenarios. These capture the outcome expected by the client from a piece of functionality for a set of contexts, and passing all the scenarios for a story indicates that business value has been delivered. The intention is that we can use this information to demonstrate progress and to assist with automation of client acceptance testing. The scenarios should also help with our planning; a large set of scenarios for a single story indicates that the story should be broken down into smaller stories so that progress can be demonstrated by the delivery of each. The template for this is:

Given

<context condition(s)> (do not specify anything that is not required, but do not assume anything that is required)

when

<event> (story user(s) attempt(s) story task)

then

<outcome expectation(s)> (if there are alternative outcomes then the context is ambiguous)

Connecting Nokia N95 8GB to eduroam wireless

Monday 7 July 2008

Having finally got hold of a Nokia N95 8GB last week, my first task was to connect it to the eduroam wireless network at The University of Sheffield. This proved to be much easier said than done, so for the sanity of everyone else here is the procedure:

First off, connect to the Unishef network and start the web browser. You will be able to connect immediately to this open network, and will be redirected to the device registration page. Here you need to use your usual computer account details to complete and submit the registration form. Once you’ve submitted the form close the browser and disconnect from ‘Unishef’. Whilst the registration is being processed (takes 10 minutes or so) you can configure the eduroam connection…

You can not connect to eduroam using the wireless wizard, so you need to create the network manually. Open the main menu and navigate to Tools, Settings, Connection, Access points. Here select Options and New access point, then enter the following settings on this screen:

Connection name: eduroam

Data bearer: Wireless LAN

WLAN network name: eduroam

Network status: Public

WLAN network mode: Infrastructure

WLAN security mode: WPA/WPA2

Homepage: Whatever you like, but you might find http://wap.shef.ac.uk or http://m.google.co.uk useful…

Now select ‘WLAN security settings’ and on this screen enter:

WPA/WPA2: EAP

WPA2 only mode: Off

Now select ‘EAP plug-in settings’ and on this screen disable all options except ‘EAP-TTLS’. Then select ‘EAP-TTLS’ and on this screen enter:

Personal certificate: None

Authority certificate: GlobalSign Root CA

User name in use: User defined

User name: Your computer account username

Realm in use: User defined

Realm: shef.ac.uk

Move across to the EAPs tab and disable all options except ‘EAP-MSCHAPv2′. Then select ‘EAP-MSCHAPv2′ and enter:

User name: Your computer account username followed by ‘@shef.ac.uk’

Password: Your remote access (VPN) password

Finally, select Back until you exit the configuration screens and return to the main menu.

Now start the web browser, select the eduroam access point when prompted, and if everything goes well you will see your home page. Be very careful to select the eduroam access point and not any other data service or you may be charged by your network operator!

Integrating ASP.NET and Google Calendar

Tuesday 24 June 2008

We recently decided to store annual leave requests for epiGenesys staff in a Google Calendar. This makes it easy to share the information, and to visualise it against events in our other calendars. I decided this evening that it would also be useful to feed this information directly from the calendar into Project MART (our internal Project Management And Reporting Tool, custom built using ASP.NET).

Fortunately, Google have made the process of integrating their services with ASP.NET applications remarkably straightforward. Their developer’s guide outlines the various Google Calendar API functions available, and provides a link to the required DLLs to access the API from an ASP.NET application. Essentially all that’s needed is to create a service with appropriate credentials, pass it a query pointing at the correct calendar, and then parse the returned results feed (a collection of calendar entries) to extract the desired information.

Filtering the results by start and end dates is easily achieved by adding parameters to the query. As we record the initials of the staff member in each entry on the calendar, we can also filter by person by adding a text search parameter.

As an example I have included the following function, which sums the duration in days of all events on the leave requests calendar for a particular person:

public int CountLeaveDaysRequested()
{
CalendarService myService = new CalendarService("epigenesys-project-mart");

myService.setUserCredentials("username", "password");

EventQuery myQuery = new EventQuery("http://google_calendar_url");

myQuery.StartTime = new DateTime(2007, 12, 1);

myQuery.Query = FirstName.Substring(0, 1) + LastName.Substring(0, 1);

myQuery.UseSSL = true;

EventFeed myResultsFeed = myService.Query(myQuery);

int count = 0;

foreach (Google.GData.Calendar.EventEntry entry in myResultsFeed.Entries)
{
foreach (When when in entry.Times)
{
count += when.EndTime.Subtract(when.StartTime).Days;
}
}

return count;
}

This function is used by Project MART to calculate some of the most critical information in the business - how many days of leave we all have left to use!

Copyright code

Monday 23 June 2008

For many of our clients it is important that their website looks up to date at all times. There are various items that can be added to a website to help with this, for example a regularly updated ‘latest news’ feed on the home page. However, one item that is often overlooked is the copyright date, which is rarely updated once a website goes live.

epiGenesys always adds an automatically updating copyright date, which means that if the copyright notice looks like this when the website goes live:

© 2008 epiGenesys

Then the following year it will automatically look like this:

© 2008-2009 epiGenesys

And the following year:

© 2008-2010 epiGenesys

The code required to implement an automatically updating copyright date is very simple, and is provided below for each of the key languages preferred by epiGenesys. For ASP.NET:

<p>&copy; 2008<% if (DateTime.Now.Year > 2008) { %>
-<%= DateTime.Now.Year.ToString() %><% } %>
<a href="http://www.epigenesys.co.uk">epiGenesys</a></p>

And for PHP:

<p>&copy; 2008<?php if (date('Y') > 2008)
echo "-".date('Y'); ?>
<a href="http://www.epigenesys.co.uk">epiGenesys</a></p>

And finally for Ruby on Rails:

<p>&copy; 2008<% if Time.now.year > 2008 %>
<%= '-' + Time.now.strftime("%Y") %><% end %>
<%= link_to 'epiGenesys', 'http://www.epigenesys.co.uk' %></p>

So that’s all there is to it. With a little touch like the above we can help to ensure that a website always looks current, without requiring any effort from the website owner.