Wednesday, October 15, 2008

Mess around with Wifi and SkyHook

I recently had some spare time (and inspiration) to mess around with the SkyHook API (which you would already know if you follow me on twitter!). SkyHook invested the time and money to drive around the USA and Europe to map the location of wireless access points by MAC address. Note the vast majority of wireless access points can be easily identified by anyone within range using software such as NetStumbler or inSSIDer. SkyHook have got both my access point at home and at Shelley’s parents in their database so it looks like they’ve done a pretty good job at coverage!

Making use of both the DotNet Managed Wifi library and the SkyHook API, I wrote a quick C# console application that identifiers the MAC address of local access points and queries the SkyHook API for a location. If a location is found then a KML file is saved and opened with the default handler (such as Google Earth).

If you want to have a play, the Visual Studio 2008 solution can be downloaded here. Be sure to let me know if you come up with any other interesting applications.

This little project also helped to prove how useful Stack Overflow is for getting answers to programming problems. I asked 1, 2, 3 questions that were all answered pretty quickly. Sometimes even if you know the answer it’s useful to ask the question incase someone has a better answer!

Saturday, September 20, 2008

Photosynths from Scotland

Dani and I created some more photosynths on a recent trip to the west coast of Scotland.

First up is St Columba's Chapel on the Mull of Kintrye:

Followed by a tour around Campbeltown Loch:

Sunday, August 31, 2008

Photosynth

Prompted by Steveeeee's comment that this place is like a desert, I thought I better post something...

Microsoft released Photosynth to the public recently. Photosynth is photo stitching (see every post of mine tagged pan) but in 3D. Very Cool!

They haven't come out very well but be sure that next time I go somewhere photo-worthy there will be Photosynth mania.

Here you go... Click the "three dots" to switch between clusters.

Saturday, April 05, 2008

Overclocking Core 2 Duo

Did some experimenting with overclocking my computer today. It's running an Intel Core 2 Duo E6420 which runs at 2.1GHz by default (bus speed of 266MHz with x8 multiplier). Upped the bus speed to 299MHz and now it's running at 2.4GHz. My Windows Experience Index for my processor went from 5.1 to 5.3. Idle temperature is now ~50 degrees Celsius using the stock cooler. Hopefully it'll be stable when playing COD4 and COH!

These processors are very easy to overclock and squeeze a little extra performance out of them. Now if only we weren't saving to move house (not to mention some wedding I've got to go to) I could justify an upgrade to one of those nice Core 2 Quad Q6600s!

Tuesday, March 18, 2008

BizUnit 3.0 Api

Lately I've been working heavily with the BizUnit 3.0 beta for testing a number of different projects. In particular I'm consuming the new object model API in order to programmatically invoke tests using a variety of test sources. The purpose of this post is to provide an introduction to the new API and it's usage. Prior to 3.0, BizUnit needed to be invoked using XML such as the following (an example borrowed from the CodePlex site):

<TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileValidateStep">
  <Timeout>3000</Timeout>
  <Directory>..\..\..\Rec_03\</Directory>
  <SearchPattern>TransactionId_*.xml</SearchPattern>
  <DeleteFile>true</DeleteFile>
 
  <ValidationStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.XmlValidationStep">
      <XmlSchemaPath>..\..\..\TestData\PurchaseOrder.xsd</XmlSchemaPath>
      <XmlSchemaNameSpace>http://SendMail.PurchaseOrder</XmlSchemaNameSpace>
      <XPathList>
          <XPathValidation query=
              "/*[local-name()='PurchaseOrder' and namespace-uri()='http://SendMail.PurchaseOrder']
              /*[local-name()='PONumber' and namespace-uri()='']">PONumber_0</XPathValidation>
      </XPathList>
  </ValidationStep>  
</TestStep>

BizUnit could then be invoked with something like the following (where BizUnitAPI is the BizUnit class in the BizUnit namespace):

string myConfigFile = "c:\path\to\test.xml"; BizUnitAPI bizUnit = new BizUnitAPI(myConfigFile); bizUnit.RunTest();

This is great because we can easily generate XML to represent a set of Test Cases and Test Steps to run in series. However, this doesn't give you the control you might need. Enter the BizUnit.BizUnitOM namespace and it's new classes:

  • BizUnitTestCase : Encapsulates a set of test steps.
  • TestStepBuilder : Builds a test step instance.
  • ITestStepOM : Test step classes must implement this to work with the new API.

Our usage of the API can be written as follows:

  1. Create a BizUnitTestCase.
  2. For each step:
    1. Create a TestStepBuilder.
    2. Set each of the properties of the test step to ensure the step behaves as we want.
    3. Add the TestStepBuilder to our test case.
  3. Create a BizUnit instance using the BizUnitTestCase.
  4. Run the test.

The following is a trivial example of creating a test case to delete all the TXT files in a specified path.

BizUnitTestCase testCase = new BizUnitTestCase("My First Test Case");

TestStepBuilder testStepBuilder = new TestStepBuilder("BizUnit.FileDeleteStep");

object[] args = new object[1] {@"c:\my\path\*.txt"};

testStepBuilder.SetProperty("FilesToDeletePath", args);

testCase.AddTestStep(testStepBuilder, TestStage.Execution);

BizUnitAPI bizUnit = new BizUnitAPI(testCase);

bizUnit.RunTest();

If the test step were to require multiple arguments to be set, then the SetProperty method can be called as many times is required. Also, a TestStepBuilder needs to be generated for each test step in our test case.

If the required implementation of ITestStepOM is not included with BizUnit, then the TestStepBuilder can be invoked to load an external assembly:

TestStepBuilder testStepBuilder = new TestStepBuilder("MyAssembly.MyTestStep", "c:\path\to\MyAssembly.dll");

Note that, out of the box, only certain property types are supported as test step properties. These are:

  • double
  • bool
  • short
  • int
  • long
  • string
  • IList<string>
  • IList<Pair>

Other types can be supported but they require a custom implementation of ITestStepParameterFormatter. The implementation of which I'll save for another post.

Any questions or comments? I recommend the CodePlex Discussions Page.

Friday, March 14, 2008

Keeping Track

One of the problems of using a variety of online services is how do your friends keeping track of what you are doing. Facebook solves this, for people that haven't discovered RSS, in it's News Feed feature. However, I'd much rather read in the comfort of my familiar RSS reader than on Facebook. This is where FriendFeed comes in. FriendFeed aggregates the feeds from all the services you use. Short-form updates from Twitter, long form updates from your blog, favourite tracks from Last.FM, shared links on del.icio.us are all combined into a single feed. Users can choose to read the feed on FriendFeed.com or can subscribe to the aggregated feed in their RSS reader. As long as you keep your services in FriendFeed up-to-date, your friends will only ever need to subscribe to 1 feed for all of your online activity. Give it a try. You can find my feed here.

Sunday, February 17, 2008

User Interface Design

If you are going to ask me a question then give me the information I need to provide an answer.

Thursday, February 07, 2008