Updates from linal RSS Toggle Comment Threads | Keyboard Shortcuts

  • John 10:06 pm on June 16, 2010 Permalink | Reply
    Tags: triathlon   

    My First Triathlon 

    So last Sunday I did my first sprint triathlon, the Mid Sussex Triathlon. The day started at 5.00 when me and Tom woke up to a quick breakfast and a cup of tea. A short drive to the Triangle Leisure Centre in Burgess Hill and we were set to have our numbers draw on us in the strongest permanent marker in the world (Which took 3 days to wash off). After registration we took our carefully packed tri boxes and bikes to the transition area.

    After laying out my foot towel in the perfect foot drying position and my helmet, shades and top in the most efficient way possible. All this in the vein hope that when it came to the actual transition I would have some clue what the hell I was supposed to be doing.

    Stuff sorted we waiting casually chatting with the other competitors about the course and general pre-race banter. Ranging from our kit to subtle ways to psych one another out. After the race briefing the first swimmer started at 7.00. Me and my brother took a walk to the observation deck in the pool to watch the starters. This was when the nerves started to kick in.

    More and more of the swimmers started my start time neared and my position in the line grew shorter. With only four competitors I turned to my brother, now feeling really nervous, and said “Whose stupid idea was this?”

    Swimming Section

    There was no one in front of me and I was in the pool. Three. Two. One. I was off. Nothing quite prepared myself from going from full of nerves to race mode. Halfway down the first length my body woke up and all the training I had done kicked in. No longer nervous. A single thought in my mind. Swim straight, don’t drown don’t waste to much energy.

    The final length of the swim drew to a close and it was time to get out of the pool. Using the steps, as not to make a tit of myself if i fell over, I pulled myself out and started the run to the transition area to get ready for the bike ride. I had no idea what the hell I was supposed to be doing. I got to the transition area remembering only one thing. Make sure you helmet is on before you touch your bike. I stand on the towel, move my top out of the way and put my helmet on it. Pick up top and realise that I need to take my helmet off, put my top on, put my helmet on and step into my shoes. Now its time to pick up my bike and run with it to the mounting area. Enter the mounting area mounting my bike and start to ride narrowly missing a woman trying to get her bike into gear. A luck escape as I don’t think she would have been too happy if I had ridden into her. Exiting the leisure centre the race portion begins.

    Section Two - The Ride

    For the majority of the bike ride there was nothing to worry about. A side from needing to practice on gear changes on the hills it all went fairly well. I was taken back a few times as the more experienced competitors, on really expensive bikes, wizzed past me closer than I expected. But after the first couple of times that happened I started to check behind me more often so that I knew who was behind me, and so that I wasn’t causing an obstruction people who were clearly better than me. Like the people who overtook me on the steep up hill sections.

    With the bike section drawing to a close I changed down gears to try and warm up my legs ready for the run. In my haste I changed down to many gears and was left coasting with my legs spinning around aimlessly. Coasting into the dismount area I jump off my bike and run it back to my place in the transition area to rack it up. Throwing my helmet into my box and picking up a bottle of water I head out for the final section, the run.

    Leaving the transition area water bottle in hand I start the run. My legs feeling heavy from the cycle I knew it would only be a little longer before they would feel normal again. The run went fine with brownies lining the route with list of everyone’s names and numbers ready to cheer you on just when you need it. With the final stretch drawing to a close, the cheers from the brownies getting louder and the finished line getting closer it was time to muster the last of my energy. It was time for a sprint finish. My legs where not quite feeling up to the job. Then I spy my bother, who had already finished waiting on the finish straight. I hold my arms out for a high five. High five received I now have the energy, pulled from the ether, to sprint the last little bit to the finish. Crossing the line and stopping my watch. Covered in sweat and in dire need for a shower and a cup of tea I look down at the time. 1:19:55. Happy that my first triathlon went better than my first marathon.

    The Finish Line

    Photos of Me and Tom

     
  • John 11:26 pm on April 26, 2010 Permalink | Reply
    Tags: bzr, , ontime, ,   

    Bazaar Plugin for OnTime Integration 

    I was playing around with bazaar, whilst reviewing distributed version control systems (DVCS), and created a simple plugin for use with axosoft’s ontime. The plugin parses the commit message and links the files to the related task, defect or feature.

    Install

    Download the tar file from [download id="3"]
    Extract and run the installer using the following:

    tar -vxzf bzr-ontime-0.0.1.tar.gz
    cd bzr-ontime-0.0.1
    sudo python setup.py install
    


    Configure

    Setup the database connection information.
    /etc/bzr-ontime.conf

    [ontime]
    server=your-mssql-server
    username=sa
    password=p4ssw0rd
    database=ontime
    


    Confirm Installation

    bzr hooks
    

    If the plugin is installed correct you should see the plugin listed under the post_commit section.

    Related Reading

     
  • John 12:34 am on March 28, 2010 Permalink | Reply
    Tags: , Castle, Medium Trust, NHibernate   

    Running NHibernate in Medium Trust 

    After deploying a NHibernate to a shared host I started running into a number of issues. Whilst developing we were running in full trust not in medium trust whilst the majority of shared hosts use. After hours and hours of searching I finally come across a post on the Castle Project mailing list which detailed how to get a nhibernate working under medium trust. Here is the steps I followed to get it working.

    I am using NHibernate 2.1.2 and C# .NET 3.5 in Visual Studio 2008.

    Step 1

    Download Castle.Core from gitbhub
    git://github.com/castleproject/Castle.Core.git

    Step 2

    Enable Castle to allow partially trusted callers.
    Open buildscripts/CommonAssemblyInfo.cs and enable the library to enable partially trusted callers

    Step 3

    Disable generation of debug information for the projects Castle.Core and Castle.DynamicProxy.

    Step 4

    Build the projects

    Step 5

    Download Nhibernate source code from source forge.

    http://sourceforge.net/projects/nhibernate/files/

    Step 6

    Open Nhibernate.Everything.sln and update the references for the NHibernate.ByteCode.Castle project so that the references for Castle.Core and Castle.DynamicProxy2 are the libraries build in step 4. Disable generation of debug information for the projects NHibernate, Iesi.Collections and NHibernate.ByteCode.Castle, similar to what was done in step 3.

    Step 7

    Copy the outputted library files from NHibernate.ByteCode/bin/Release to your shared libs folder of your project.

    Step 8

    Update the references in your project to point to the new libraries. Next turn off reflection optimization. This needs to be done in code before you create the configuration object. Configuring this in the hibernate.cfg.xml does not work. Update all your projects assemblies to set allow partially trusted callers, similar to step 2. Update your web.config to set requirePermission=”false” in the nhibernate section delceration

    NHibernate.Cfg.Environment.UseReflectionOptimizer = false;
    Configuration = new Configuration();
    Configuration.Configure();
    
    
    

    You can now run your site in medium trust using lay loading.

    Links

    Related Reading

     
  • John 11:59 pm on January 3, 2010 Permalink | Reply
    Tags: , nautilus,   

    Upload Image to Imgur.com 

    I was looking for an easy way to upload images from my laptop to imgur.com without having to open my browser up. I found a post explaining how to upload an image from nautilus. The script worked well enough however I didn’t like the information it displayed to you at the end. So I rewrote the script in python so that it displays a dialog with link buttons for the available options for the image.

    upload to imgur screenshot

    The code is hosted at google.

    Update

    Thanks to the people over at reddit the script now supports automatically copies the url to the clipboard, and also correctly loads the glade file.

     
  • John 8:02 pm on January 1, 2010 Permalink | Reply
    Tags: , , NAnt   

    NAnt.ToDo a NAnt Plugin 

    This simple plugin for NAnt parses your source code and creates a report of all the TODO and comment tags in your source code. The code is hosted over at google code.

    Comments

    The task automatically identify comments in the following style

    //TODO: First Test to do Item
    //FIXME: First Fix me Item
    //HACK: First Hack Item
    

    Additional matches can be made by adding in Token elements to the NAnt task.

    Sample

    <ToDo source="path/to/source" output="report.xml" searchpattern="*.cs;*.txt">
     <Tokens>
     <Tokens Value="BUGFIX" />
     </Tokens>
    </ToDo>
    

    Output

    <ToDo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <Items>
     <Item>
     <Message>First Test to do Item</Message>
     <File>NAnt.ToDo\ToDoTask.cs</File>
     <Line>0</Line>
     <Type>TODO</Type>
     </Item>
     <Item>
     <Message>First Hack Item</Message>
     <File>NAnt.ToDo\ToDoTask.cs</File>
     <Line>0</Line>
     <Type>HACK</Type>
     </Item>
     <Item>
     <Message>First Fix me Item</Message>
     <File>NAnt.ToDo\ToDoTask.cs</File>
     <Line>0</Line>
     <Type>FIXME</Type>
     </Item>
     </Items>
    </ToDo>
    

    Cruise Control Xsl

    Below is a basic xsl style sheet that can be used with CruiseControl.NET to display the output from NAnt.ToDo.

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
     <xsl:output method="html"/>
     <xsl:param name="applicationPath"/>
     <xsl:template match="/">
     <div id="ToDo">
     <h1>ToDo List</h1>
     <div id="Summary">
     <h3>To Do</h3>
     <table>
     <tbody>
     <xsl:for-each select="//ToDo/Items/Item">
     <tr>
     <td>
     <xsl:value-of select="Type/text()"/>
     </td>
     <td>
     <xsl:value-of select="Message/text()"/>
     </td>
     <td>
     <xsl:value-of select="File/text()"/>
     </td>
     </tr>
     </xsl:for-each>
     </tbody>
     </table>
     </div>    
     </div>
     </xsl:template>
    </xsl:stylesheet>
    
     
  • John 12:45 am on October 5, 2009 Permalink | Reply
    Tags: , ,   

    SVN Notify by Email 

    Svn hook to email you information in post commit hook.

    Install svnnotify which will be used to send the email

    yum install perl-CPAN
    perl -MCPAN -e 'install SVN::Notify'
    perl -MCPAN -e 'install SVN::Notify::HTML::ColorDiff'
    

    The post-commit script

    #!/bin/sh
    for i in 'email1@domain.co.uk' 'email2@domain.com'
    do
    	svnnotify --repos-path "$1" \
    		--revision "$2" \
    		--to $i \
    		--from account@example.co.uk \
    		--handler HTML::ColorDiff -d \
    done
    
     
    • SonPhan 3:20 am on November 28, 2009 Permalink | Reply

      Hi , Please help me , How can i configure my svn server auto send mail with SVN-Notify modules?
      I have did as you show, but it can’t send mail.
      :(

  • John 10:06 pm on September 26, 2009 Permalink | Reply
    Tags: , , , , ,   

    jqRunner Snapshot – Running Javascript Unit test with NUnit 

    One of the nice things about unit tests is that you can use continuous integration so that you don’t have to run them yourself. At work we use CruiseControl.NET to automate our builds and run our unit tests. Now as a number of our projects are web based we use a fair amount of javascript, mainly jQuery, though in-house plugins. In order to test these we use jqunit, this works great and allows us to use TDD when writing javascript. However as development goes on the unit tests get forgotten about as they are not automatically ran.

    In order so solve this I decided to experiment to find a method of getting cruise control to run our jqunit tests for me. To run the tests I looked at wrapping the jqunit tests with nunit tests.

    jqRunner

    jqRunner is designed so that you can us your existing jqunit tests in their existing location without changing them. jqRunner required that all the scripts that are needed to run are registered. The full path to the file is required. jqRunner then executes the tests and returns the results, which are then parsed by nunit as tests using the TestCaseSource attribute.

    var sampleTestCase = new jqUnit.TestCase('Sample Test Case', function() {
        /*setup*/
        // this.yep(1);
    }, function() {
        /*teardown*/
        // this.ok(1)
    });
    sampleTestCase.test('Sample Test 1', function() {
        this.ok(1);
    });
    sampleTestCase.test('Sample Test 2', function() {
        this.ok(0);
    });
    
    using System;
    using System.Collections.Generic;
    using NUnit.Framework;
    using jqRunner;
    using System.IO;
    using System.Reflection;
    
    namespace jqRunner.Tests
    {
        [TestFixture,RequiresSTA]
        public class TestCaseSourceTests
        {
            [Test, TestCaseSource("GetTestResults"), RequiresSTA]
            public void CheckTest(ITestResult result)
            {
                Assert.IsTrue(result.Pass, result.Name);
            }
    
            private static ITestResult[] GetTestResults()
            {
                string jsFile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + @"\jqUnitTests\SampleUnitTest.js";
                TestBed target = new TestBed();
                target.RegisterScript(jsFile);
                return target.Execute().ToArray();
            }
        }
    }
    

    This is an initial development snapshot and is bound to have plenty of problems.

    Download
    http://static.yeticode.co.uk/blog/downloads/jqRunner-snapshot.zip

    Related Reading

     
  • John 12:18 am on September 17, 2009 Permalink | Reply
    Tags: pirate, ,   

    Pirate Day! Arr 

    So talk like a pirate day is coming around soon and saw a brilliant method of converting web pages from boring English to cool Pirate talk. So having nothing better to do at the moment I knocked up a small plugin that will convert your blog posts to pirate talk on the 19th, to give your readers something nice to look at.

    Plugin can be found at http://wordpress.org/extend/plugins/pirate-talk/

    Feel free to make it better.

     
    • Li-An 9:40 pm on September 17, 2009 Permalink | Reply

      Too bad it does not work in french…

    • BigAl 2:42 am on September 18, 2009 Permalink | Reply

      I was checking out your plug-in on wordpress, and while trying to check out the link to the yahoo thing it uses, the link leads to a 404 page. Is this going to still work or not?

    • Admiral Piratepants 9:55 am on September 18, 2009 Permalink | Reply

      Yar! This be a piratetastic site, avast!
      http://www.play-and-stay.co.uk/

      Some translation (though not the whole site), games and general piratical shenanigans.

    • JArrrrrrr 6:33 pm on September 18, 2009 Permalink | Reply

      I installed the WordPress plugin and activated it, but it doesn’t seem to be working. Is there some trick I’m missing?

    • Kelly Robinson 10:57 pm on September 18, 2009 Permalink | Reply

      I also activated this today to test it out and… nothing. Clearing my cache didn’t seem to help either.
      Any hints?

      • John 11:48 pm on September 18, 2009 Permalink | Reply

        Should only work on the 19th. If you want it to work all year round just comment out the if statement.

    • BandonRandon 7:07 am on September 20, 2009 Permalink | Reply

      Thanks for this plugin, I modified to to support local timezones and to have an option to always be on. If you would like to modify the plug in or just see what I did I posted the code on http://pastebin.com/f5c75048e
      Brooke.

    • Kelly Robinson 8:13 am on September 20, 2009 Permalink | Reply

      Thanks very much – worked like a charm. Arrrgh!

  • John 8:37 pm on September 14, 2009 Permalink | Reply  

    Epic Fail, but with a good note. 

    So last Sunday was the 2009 Yorkshireman Off Road Marathon. Everything was going great, even though the course was nothing like I had run on before, but it was not meant to be. I injured my knee running down a hill and had to drop out at 18 mile mark. Although I failed Tom managed to man it up and complete it with enough energy at the end to call me gay whilst running up the last hill towards the finish line. So the entire event was not a complete waste of time.

    Although I didn’t complete it, I did however run further and for longer than previously. If I hadn’t injured myself I’m absolutely positive that I would have completed the race. The course did give me areas that I need to work on, such as running off road more. And finding some really big ass hills to run up and down.

    The failure to complete this marathon has certainly given me more than enough drive to enter the Brighton marathon and fully prepare myself for it so that I will be able to complete it without issue.

     
    • Tom 12:31 pm on September 15, 2009 Permalink | Reply

      Don’t forget that as well as the furthest and longest run you have ever done, it was also the highest, most northern and most awesome.

  • John 8:34 pm on August 24, 2009 Permalink | Reply
    Tags: , , , ,   

    More Django Plugin Stuff 

    MonoDevelop Django

    So I’ve been working more on the support for django within monodevelop. Heres some screenshots of it.

    MonoDevelop Django

    MonoDevelop Django

     
    • Aledr 8:47 pm on December 16, 2009 Permalink | Reply

      I’ve just installed MonoDevelop 2.2 and started a new Django project but is no option to create a new App there. Is your code already integrated?

      Thanks.

      • John 11:11 am on December 17, 2009 Permalink | Reply

        I never got round to getting the code into a stable state, and submittting a patch. However I have a couple of weeks of work so I’ll see if have anytime to look at it again.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel

Powered by Web Design Company Plugins