<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-gb" xmlns="http://www.w3.org/2005/Atom">
  <title>Barry Carr</title>
  <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/" />
  <link rel="self" href="http://www.benericht.co.uk/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-05-05T23:42:13.1495+01:00</updated>
  <author>
    <name>Barry Carr</name>
  </author>
  <subtitle>(Ben Ericht) Slightly faster than a speeding glacier</subtitle>
  <id>http://www.benericht.co.uk/</id>
  <generator uri="http://www.dasblog.net" version="2.0.7180.0">DasBlog</generator>
  <entry>
    <title>DDD Ireland '08 - Thanks Very Much</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,5596ef2c-a52a-44c3-8d2a-896dfb0784ea.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,5596ef2c-a52a-44c3-8d2a-896dfb0784ea.aspx</id>
    <published>2008-05-05T23:36:46.646+01:00</published>
    <updated>2008-05-05T23:42:13.1495+01:00</updated>
    <category term="Speaking Engagements" label="Speaking Engagements" scheme="http://www.benericht.co.uk/CategoryView,category,Speaking%2BEngagements.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I Just wanted to say thanks to all those
people who attended my presentation on Regular Expressions at DDD Ireland in Galway;
I hope you all found it useful. I'd also like to thank the organiser for giving me
an opportunity to speak at a DDD event. 
<br /><br />
See you next week at DDD Scotland.<br /><p></p><img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=5596ef2c-a52a-44c3-8d2a-896dfb0784ea" /></div>
    </content>
  </entry>
  <entry>
    <title>Speaking Engagements</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,5a6c48a0-d324-44cd-9911-e171202694cf.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,5a6c48a0-d324-44cd-9911-e171202694cf.aspx</id>
    <published>2008-04-24T19:06:25.455+01:00</published>
    <updated>2008-04-24T19:12:41.252375+01:00</updated>
    <category term="Speaking Engagements" label="Speaking Engagements" scheme="http://www.benericht.co.uk/CategoryView,category,Speaking%2BEngagements.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I'm please to announce that I've asked to
speak at DDD Ireland and DDD Scotland. I'll be doing a session introducing regular
expressions. Full details for each event can be found here:<br /><br /><a href="http://www.ireland.com">http://www.dddireland.com </a><br /><br />
and here:<br /><br /><a href="http://developerdayscotland.com/main/Default.aspx">http://developerdayscotland.com/main/Default.aspx</a><br /><br />
See you there.<br /><a href="http://www.ireland.com"></a><p></p><img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=5a6c48a0-d324-44cd-9911-e171202694cf" /></div>
    </content>
  </entry>
  <entry>
    <title>Using a Unit Test Runner with Chrome</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,530f602a-a5dd-42af-9adb-3e7ca0ee6dce.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,530f602a-a5dd-42af-9adb-3e7ca0ee6dce.aspx</id>
    <published>2007-09-12T18:25:15.33125+01:00</published>
    <updated>2007-09-12T18:25:42.89375+01:00</updated>
    <category term="Chrome" label="Chrome" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome.aspx" />
    <content type="html">&lt;p&gt;
One of the&amp;nbsp;disadvantages&amp;nbsp;of using non-mainstream .NET languages, like &lt;a href="http://www.remobjects.com/product/?id={38861650-4B7D-434B-8764-2AE18254649A}" target="_blank"&gt;Chrome&lt;/a&gt;, &lt;a href="http://research.microsoft.com/fsharp/fsharp.aspx" target="_blank"&gt;F#&lt;/a&gt; and &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython" target="_blank"&gt;IronPython&lt;/a&gt; is
that the most of the popular and most useful VS.NET add-ins tend not to support them.
I can live with this for most things (although its getting harder as these add-ins
get better), however, one thing that I can't live without is not being able to run
my unit tests without leaving Visual Studio.&lt;br /&gt;
&lt;br /&gt;
I'm using Chrome in my current project, I also use JetBrains &lt;a href="http://www.jetbrains.com/resharper/" target="_blank"&gt;ReSharper&lt;/a&gt;.
ReSharper currently supports C# and VB.NET (JetBrains say that they have no plans
to support Chrome&lt;span class="moz-smiley-s2"&gt;&lt;span&gt; :-( &lt;/span&gt;&lt;/span&gt;). Its a marvalous
refactoring tool and it also comes with a built in unit test runner*. This built in
test runner&amp;nbsp;will allow you run or debug a test&amp;nbsp;by clicking on an icon in
the left-hand gutter of the editor.&amp;nbsp;Or, you can run&amp;nbsp;your tests via a dockable&amp;nbsp;test
browser window that lists all of your test fixtures and tests in the current solution.
As you can imagine, this is really convenient; so much so, that with a little imagination
you can almost use VS.NET like an interactive IDE similar to a Smalltalk workspace. 
&lt;/p&gt;
&lt;p&gt;
Unfortunately, ReSharper's unit test runner doesn't understand Chrome and this put
me on a&amp;nbsp;search&amp;nbsp;to try and find a unit test runner that did. At the very
least I was hoping for an add-in that would find the tests in a compiled assembly,
like&amp;nbsp;&lt;a href="http://www.nunit.org/" target="_blank"&gt;NUnit&lt;/a&gt; does,&amp;nbsp;and
let me run them all the tests by a key-stroke or mouse click, if not individually.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I could only&amp;nbsp;find two&amp;nbsp;other in-IDE unit test runners for Visual Studio.&amp;nbsp;Of
the two I found I tried &lt;a href="http://www.testdriven.net/" target="_blank"&gt;TestDriven.NET&lt;/a&gt; -
nada; then I tried ExactMagic&amp;rsquo;s &lt;a href="http://www.exactmagic.com/" target="_blank"&gt;TestMatrix&lt;/a&gt; -
zilch. I wasn't surprise&amp;nbsp;by this and in a way I was sort of relieved, I&amp;nbsp;was
reluctant&amp;nbsp;to install yet another VS.NET add-in just to run some tests when I
already had a perfectly good add-in that could do just that.&lt;br /&gt;
&lt;br /&gt;
At this point I had a brain wave &amp;ndash; perhaps I&amp;nbsp;could&amp;nbsp;run my&amp;nbsp;tests
via C#.&amp;nbsp; To try this I added a C# project to my Solution and created a class
in the new C# project. I then added the necessary NUnit assembly and using references
to the new project and then marked the new C# class as a TestFixture.&amp;nbsp; Then I
inherited the C# class from by Chrome test fixture class (see below).
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; using NUnit.Framework; namespace GeoMEM.NETandCF.Maths.Tests { [TestFixture]
public class GMatrixTestWrapper : GMatrixTests { } }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
The Chrome test fixture is declared as follows:
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; uses GeoMEM.NETandCF.Maths, Nunit.framework, NUnit.Framework.SyntaxHelpers;
type [TestFixture] GMatrixTests = public class( AssertionHelper ) ... public ... Lots
of tests .... end; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
I built the new test wrapper project and then ran the tests via the gutter icon. Sure
enough, all my Chrome tests duly appeared in ReSharpers unit test browser (and passed,
of course). I can even run tests individually and debug them via the test browser.
The only thing I don't get is the ability to run tests straight from the editor, but
I can live without that.&amp;nbsp;The other thing that I&amp;rsquo;ve noticed is that&amp;nbsp;if
make changes to either your test code or the code under test you have to make sure
that you compile the code via C# test wrapper project. Otherwise&amp;nbsp;the wrapper
project doesn&amp;rsquo;t get recompiled and you end up running &amp;ldquo;stale&amp;rdquo; tests. 
&lt;/p&gt;
&lt;p&gt;
So, to summarise; if you practice TDD and work in a language other than C# or VB.NET
then chances are you can use an in-IDE unit test runner if you create a C# project
and derive a C# test fixture from each of other languages test fixtures. You will
get virtually all the advantages of a in-IDE test runner with perhaps one or two minor
niggles. 
&lt;/p&gt;
&lt;p&gt;
*&lt;em&gt;JetBrains also do a freebie unit test runner called UnitRun, you can get from
here: &lt;a href="http://www.jetbrains.com/unitrun/" target="_blank"&gt;http://www.jetbrains.com/unitrun/&lt;/a&gt;&amp;nbsp;and
what I&amp;rsquo;ve described here should also work with UnitRun too.&lt;br /&gt;
&lt;/p&gt;
&gt;
&lt;div class="bjtags"&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/TDD"&gt;TDD&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/Chrome"&gt;Chrome&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/ReSharper"&gt;ReSharper&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/UnitRun"&gt;UnitRun&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/F#"&gt;F#&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/IronPython"&gt;IronPython&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=530f602a-a5dd-42af-9adb-3e7ca0ee6dce" /&gt;</content>
  </entry>
  <entry>
    <title>Using a Mac for Ruby on Rails Development</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,9b47678c-f828-46cb-a8c2-d324415512b5.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,9b47678c-f828-46cb-a8c2-d324415512b5.aspx</id>
    <published>2007-06-08T21:13:38.96+01:00</published>
    <updated>2007-06-08T21:27:36.43775+01:00</updated>
    <category term="eXtreme Tayside" label="eXtreme Tayside" scheme="http://www.benericht.co.uk/CategoryView,category,eXtreme%2BTayside.aspx" />
    <category term="Ruby" label="Ruby" scheme="http://www.benericht.co.uk/CategoryView,category,Ruby.aspx" />
    <category term="Ruby On Rails" label="Ruby On Rails" scheme="http://www.benericht.co.uk/CategoryView,category,Ruby%2BOn%2BRails.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'll be giving a talk on Rail development using an Apple Mac this Wednesday (13th
June 2007, 7-9pm) for <a href="http://www.extremetayside.org">eXtreme Tayside</a>.
We'll be in the Queen Mother building at Dundee University, more details can be found <a href="http://www.computing.dundee.ac.uk/usercentre/aboutus.asp">here</a>. 
</p>
        <p>
And whilst we're on the subject of the Mac; I composed this posting using the blogging
bundle that comes with <a href="http://macromates.com/">TextMate</a>. If you're interested
then there is a tutorial screen-cast <a href="http://macromates.com/screencast/blogging_take_two.mov">here</a> (requires
QuickTime). TextMate will feature predominately in my presentation.
</p>
See you on Wednesday.<br /><p></p><br /><img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=9b47678c-f828-46cb-a8c2-d324415512b5" /></div>
    </content>
  </entry>
  <entry>
    <title>Chrome Cookbook 1.2: Getting the numeric value of a character</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,d3a0f448-8a02-492d-a9e8-5e83b030a6cf.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,d3a0f448-8a02-492d-a9e8-5e83b030a6cf.aspx</id>
    <published>2007-03-14T20:58:53.32325+00:00</published>
    <updated>2007-03-14T20:58:53.32325+00:00</updated>
    <category term="Chrome" label="Chrome" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome.aspx" />
    <category term="Chrome Cookbook" label="Chrome Cookbook" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome%2BCookbook.aspx" />
    <category term="Cookbooks" label="Cookbooks" scheme="http://www.benericht.co.uk/CategoryView,category,Cookbooks.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem</strong>
        </p>
        <p>
You need to find the numeric code for a character (either ASCII or Unicode).
</p>
        <p>
          <strong>Solution</strong>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">namespace Cookbook1_2;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">interface</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">type<br />
  ConsoleApp = class<br />
  public<br />
    class method Main;<br />
  end;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">implementation</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">class method ConsoleApp.Main;<br />
begin<br />
  var ch      : char    := 'A';<br />
  var chAsInt : Integer := Integer(ch);<br />
  Console.WriteLine( chAsInt );<br />
end;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">end.</font>
        </p>
        <p>
The ASCII or Unicode value of character is obtained by casting the character to an
Integer. Also note that I have forgo Chromes type inference and explicitly declared the
type for each variable.
</p>
        <p>
 
</p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/Chrome">Chrome</a>, <a rel="tag" href="http://technorati.com/tag/Chrome+Cookbook">Chrome+Cookbook</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=d3a0f448-8a02-492d-a9e8-5e83b030a6cf" />
      </div>
    </content>
  </entry>
  <entry>
    <title>D Cookbook No 1.2: Getting the numeric value of a character</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,6728c352-9e1e-4daa-a2ce-99038188d6bd.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,6728c352-9e1e-4daa-a2ce-99038188d6bd.aspx</id>
    <published>2007-03-14T20:02:01.009+00:00</published>
    <updated>2007-03-14T20:59:42.69825+00:00</updated>
    <category term="Cookbooks" label="Cookbooks" scheme="http://www.benericht.co.uk/CategoryView,category,Cookbooks.aspx" />
    <category term="D" label="D" scheme="http://www.benericht.co.uk/CategoryView,category,D.aspx" />
    <category term="D Cookbook" label="D Cookbook" scheme="http://www.benericht.co.uk/CategoryView,category,D%2BCookbook.aspx" />
    <content type="html">&lt;p&gt;
&lt;strong&gt;Problem&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Quite a common task in programming is the need to find the ASCII value of a character.
The code below demonstrates how to do this in D.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Bitstream Vera Sans Mono"&gt;int main(char[][] args) {&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Bitstream Vera Sans Mono"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; auto ch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= 'A';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp; charAsInt = ch;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf( "%d", charAsInt );&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Bitstream Vera Sans Mono"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
In D, getting the ASCII value of a character&amp;nbsp;a trivial task. Simply assign the
character to an integer and D will &amp;ldquo;promote&amp;rdquo; the character to reveal its
ASCII value. 
&lt;/p&gt;
&lt;p&gt;
Some other points to note about the above code are: 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
char values in D are UTF-8 by default; if you want UTF-16 or UTF-32 characters then
use the wchar or dchar types respectively. 
&lt;/li&gt;
&lt;li&gt;
Also note the use of the auto keyword when I declared the character variable, ch.
The auto keyword gives you access to D implicit type inference features.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="bjtags"&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/D"&gt;D&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/D+Cookbook"&gt;D+Cookbook&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=6728c352-9e1e-4daa-a2ce-99038188d6bd" /&gt;</content>
  </entry>
  <entry>
    <title>Chrome Cookbook No. 1.1: Accessing SubString</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,f05e9479-16ba-4d59-b9bb-e4ef2a767777.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,f05e9479-16ba-4d59-b9bb-e4ef2a767777.aspx</id>
    <published>2007-03-05T20:50:25.41+00:00</published>
    <updated>2007-03-05T22:31:56.854+00:00</updated>
    <category term="Chrome" label="Chrome" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome.aspx" />
    <category term="Cookbooks" label="Cookbooks" scheme="http://www.benericht.co.uk/CategoryView,category,Cookbooks.aspx" />
    <category term="Chrome Cookbook" label="Chrome Cookbook" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome%2BCookbook.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem</strong>
        </p>
        <p>
You want to break up a string into its individual tokens or words
</p>
        <p>
          <strong>Solution</strong>
        </p>
        <p>
I’ll present the solution in two forms; the first will use “traditional” Object Pascal
idiom, the second will make the most of Chrome’s features where appropriate. Both
solutions will use the FCL’s string.Split() method.
</p>
        <p>
          <strong>Object Pascal Version</strong>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">namespace Cookbook1_1a;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">interface</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">type<br />
  ConsoleApp = class<br />
  public<br />
    class method Main;<br />
  end;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">implementation</font>
        </p>
        <p>
          <font>
            <font face="Bitstream Vera Sans Mono">class method ConsoleApp.Main;<br />
const<br />
  Space : char = ' ';<br />
var<br />
  userRec    : String;<br />
  attributes : array of String;<br />
begin<br />
  userRec    := '01 Barry Carr 17/04/1964 </font>
            <a href="mailto:barry@notarealdomain.com%27">
              <font color="#000000" face="Bitstream Vera Sans Mono">barry@notarealdomain.com'</font>
            </a>
            <font face="Bitstream Vera Sans Mono">;<br />
  attributes := userRec.Split( Space );<br />
  
<br />
  for each token : String in attributes do 
<br />
      Console.WriteLine( token );<br />
end;</font>
          </font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">end.</font>
        </p>
        <p>
          <strong>Chrome Version</strong>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">namespace Cookbook1_1b;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">interface</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">type<br />
  ConsoleApp = class<br />
  public<br />
    class method Main;<br />
  end;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">implementation</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">class method ConsoleApp.Main;<br />
const<br />
  Space : char = ' ';<br />
begin<br />
  var userRec    := '01 Barry Carr 17/04/1964 </font>
          <a href="mailto:barry@notarealdomain.com%27">
            <font face="Bitstream Vera Sans Mono">barry@notarealdomain.com'</font>
          </a>
          <font face="Bitstream Vera Sans Mono">;<br />
  var attributes := userRec.Split( Space );<br />
  
<br />
  for each token in attributes do<br />
      Console.WriteLine( token );<br />
end;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">end.</font>
        </p>
        <p>
Notice how the Chrome version doesn’t have <strong>any</strong> type declarations,
Chrome’s type inference is doing all the work of figuring out what the types are at
compile time. One other point to note is that Chrome allows the developer to declare
their variables in-line, where they are needed and does not require all local variable
to be declared at the top of the method, procedure or function as classic object pascal
compilers do.
</p>
        <p>
Finally, the loop at the bottom is there so that I can see that the string has been
split as I’d expect. A unit test would be better, however. 
</p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/Chrome">Chrome</a>, <a rel="tag" href="http://technorati.com/tag/Chrome+Cookbook">Chrome+Cookbook</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=f05e9479-16ba-4d59-b9bb-e4ef2a767777" />
      </div>
    </content>
  </entry>
  <entry>
    <title>D Cookbook  No. 1.1: Accessing Substring </title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,3b260919-6eb2-4a3f-b558-14224d8bd7bc.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,3b260919-6eb2-4a3f-b558-14224d8bd7bc.aspx</id>
    <published>2007-03-05T19:02:39+00:00</published>
    <updated>2007-03-05T22:32:23.525875+00:00</updated>
    <category term="Cookbooks" label="Cookbooks" scheme="http://www.benericht.co.uk/CategoryView,category,Cookbooks.aspx" />
    <category term="D" label="D" scheme="http://www.benericht.co.uk/CategoryView,category,D.aspx" />
    <category term="D Cookbook" label="D Cookbook" scheme="http://www.benericht.co.uk/CategoryView,category,D%2BCookbook.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="v">The sample was compiled using the latest version of D, 1.007 at the
time of writing. You can get the latest version of the D compiler </font>
          <a href="http://www.digitalmars.com/d/dcompiler.html" target="_blank">
            <font face="v">here</font>
          </a>
          <font face="v">.</font>
        </p>
        <p>
          <strong>
            <font face="v">Problem</font>
          </strong>
        </p>
        <p>
          <font face="v">You want to break up a string into its individual tokens
or words </font>
        </p>
        <p>
          <strong>
            <font face="v">Solution</font>
          </strong>
        </p>
        <p>
          <font face="v">Use the split() function from std.string, like so:</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">import std.stdio;<br />
import std.string;</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">void main(char[][] args)  {<br />
     char[]   record     = "01 Barry
Carr 17/04/1964 <a href="mailto:barry@notarealdomain.com">barry@notarealdomain.com</a>";<br />
     char[][] attributes = split(record);</font>
        </p>
        <p>
          <font face="Bitstream Vera Sans Mono">     foreach( char[] attribute;
attributes )<br />
        writefln( attribute );<br />
 }</font>
        </p>
        <p>
          <font face="v">There is on overloaded version of split() that allows you specify what characters
are to be used as delimiters. </font>
        </p>
        <p>
          <font face="v">The foreach statement at the end of the code above is there so that
the tokens can be displayed on the console.</font>
        </p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/D">D</a>, <a rel="tag" href="http://technorati.com/tag/D+Cookbook">D+Cookbook</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=3b260919-6eb2-4a3f-b558-14224d8bd7bc" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Cookbooks</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,bbf36ae6-12e4-48af-819d-1794fe5dc4f0.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,bbf36ae6-12e4-48af-819d-1794fe5dc4f0.aspx</id>
    <published>2007-03-04T20:06:44.443+00:00</published>
    <updated>2007-03-05T10:13:45.60675+00:00</updated>
    <category term="Chrome" label="Chrome" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome.aspx" />
    <category term="Cookbooks" label="Cookbooks" scheme="http://www.benericht.co.uk/CategoryView,category,Cookbooks.aspx" />
    <category term="D" label="D" scheme="http://www.benericht.co.uk/CategoryView,category,D.aspx" />
    <category term="F#" label="F#" scheme="http://www.benericht.co.uk/CategoryView,category,F%23.aspx" />
    <category term="OCaml" label="OCaml" scheme="http://www.benericht.co.uk/CategoryView,category,OCaml.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Taking a leaf out of <a href="http://www.garyshort.org/" target="_blank">Gary Short’s</a><font color="#810081"></font>(cook)book
and blatantly stealing his idea, I’m going to follow his example and start some programming
cookbooks of my own. Like Gary, my cookbooks will be based upon the items
featured in the <a href="http://www.oreilly.com/catalog/pythoncook2/" target="_blank">Python
Cookbook</a>. Gary is currently doing a cookbook for <a href="http://www.whysmalltalk.com/" target="_blank">Smalltalk</a>,
one of my favourite programming languages, so I’ll do cookbooks for <a href="http://www.digitalmars.com/d/index.html" target="_blank">D</a>, <a href="http://www.remobjects.com/page.asp?id=%7BC5B896C5-5C61-4C1C-A617-136711C07F46%7D" target="_blank">Chrome</a> and
possibly <a href="http://research.microsoft.com/fsharp/fsharp.aspx" target="_blank">F#</a> and <a href="http://caml.inria.fr/" target="_blank">OCaml</a>.
I’m interested in learning all of these languages so undertaking these cookbooks should
help me to gain a wider understanding of them and also enable me to share my experiences
with a wider audience.<br /></p>
        <p>
          <strong>The Languages</strong>
        </p>
        <p>
          <strong>
            <a href="http://www.digitalmars.com/d/index.html" target="_blank">D</a>
          </strong>is the
creation of Walter Bright, the man that developed the worlds first C++ compiler
(before Walter, all C++ “compilers” were C preprocessors). D’s aim is to
overcome some of the short-coming of C++. D offers virtually all the features you’d
expect from a modern language, including: Templates (generics), <a href="http://en.wikipedia.org/wiki/Delegate_%28.NET%29" target="_blank">Delegates</a>,
Interfaces, <a href="http://en.wikipedia.org/wiki/Mixins" target="_blank">Mixins</a>,
(optional) Garbage Collection, <a href="http://en.wikipedia.org/wiki/Type_inference" target="_blank">Type
Inference</a>, <a href="http://en.wikipedia.org/wiki/Design_by_Contract" target="_blank">Design
by Contract</a>, <a href="http://en.wikipedia.org/wiki/Tail_recursion" target="_blank">Tail
Recursion</a> and much, much more. The D compiler is free to down load and use
and is available for Win32 and Linux.
</p>
        <p>
          <strong>
            <a href="http://www.remobjects.com/page.asp?id=%7BC5B896C5-5C61-4C1C-A617-136711C07F46%7D" target="_blank">Chrome</a>
          </strong> is
an Object Pascal implementation targeted at the .NET and Mono platforms. It’s being
developed by <a href="http://www.remobjects.com/" target="_blank">RemObjects</a>.
Chrome offers all the features of C# 2.0 as well as Design by Contract, Type Inference
and Virtual Constructors. It also improves on “classic” Object Pascal implementations
by improving the <strong>with</strong> statement and by adding the ability to declare
variables in-line, like the C family of languages. Chrome is a commercial product
but RemObjects do provide a free, command line compiler.
</p>
        <p>
          <strong>
            <a href="http://caml.inria.fr/" target="_blank">OCaml</a>
          </strong> is an Object-oriented functional/imperative
language hybrid developed and maintained by <a href="http://www.inria.fr/index.en.html" shape="rect">INRIA</a>,
France's national research institute for computer science. OCaml can be interpreted
or compiled very efficiently into native code. Like all the languages mentioned so
far, OCaml supports Type Inference, Garbage Collection and Generics. Also, as you
would expect from a functional language, OCaml supports: Tail Recursion, <a href="http://en.wikipedia.org/wiki/Pattern_matching" target="_blank">Pattern-matching</a> and <a href="http://en.wikipedia.org/wiki/Currying" target="_blank">Currying</a>.
</p>
        <p>
          <strong>
            <a href="http://research.microsoft.com/fsharp/fsharp.aspx" target="_blank">F#</a>
          </strong> is
an experimental functional language developed by Microsoft and, as you’d expect, F#
is targeted at the .NET platform. F# is based on OCaml.
</p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/D">D</a>, <a rel="tag" href="http://technorati.com/tag/Chrome">Chrome</a>, <a rel="tag" href="http://technorati.com/tag/OCaml">OCaml</a>, <a rel="tag" href="http://technorati.com/tag/F#">F#</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=bbf36ae6-12e4-48af-819d-1794fe5dc4f0" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Owl Bum of the week - In Absentia by Porcupine Tree</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,a5b80ba2-bd1a-4136-ba14-ba909e34db90.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,a5b80ba2-bd1a-4136-ba14-ba909e34db90.aspx</id>
    <published>2007-03-04T19:14:16+00:00</published>
    <updated>2007-03-04T14:00:40.167125+00:00</updated>
    <category term="Music" label="Music" scheme="http://www.benericht.co.uk/CategoryView,category,Music.aspx" />
    <content type="html">&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="Procupine Tree - In Absentia, album cover" hspace="2" src="http://www.benericht.co.uk/content/binary/InAbsentia.jpg" align="left" vspace="2" border="2" /&gt;"In
Absentia" is Porcupine Tree's (PT) 12th album, it was released in Sept 2002. I only
discovered PT about 12 months ago and I&amp;rsquo;ve snapping up all of their albums ever
since.
&lt;/p&gt;
&lt;p&gt;
PT are a&amp;nbsp;British &lt;a href="http://en.wikipedia.org/wiki/Progressive_Rock" target="_blank"&gt;Progressive
Rock&lt;/a&gt;&amp;nbsp;band that formed in the &amp;lsquo;90s&amp;nbsp;and it is the brain child of
Steve Wilson. It&amp;rsquo;s said that PT are&amp;nbsp;one of the principle bands&amp;nbsp;that&amp;nbsp;kept
Prog-Rock alive in&amp;nbsp;the UK. 
&lt;/p&gt;
&lt;p&gt;
I know Prog-Rock is a dirty word to a lot of people, but I can assure you that there
are no 20 minute drum solos on this album, just excellent tracks with good lyrics
played by talented musicians.&amp;nbsp;&amp;nbsp;A lot of the tracks are quite dark, not as
dark as, for instance,&amp;nbsp;Nine Inch Nails, but certainly not the usual &amp;ldquo;boy
meets girl&amp;rdquo; type of stuff. If you&amp;rsquo;re not into&amp;nbsp;darker themes then
PT probably isn&amp;rsquo;t for you, however, you&amp;rsquo;ll never know unless you give&amp;nbsp;them
a&amp;nbsp;spin. I&amp;rsquo;d recommend this ablum or their latest album, Deadwing. There
are some MP3 samples of Deadwing at PT&amp;rsquo;s website.
&lt;/p&gt;
&lt;p&gt;
You can&amp;nbsp;find out more about the band at &lt;a href="http://www.porcupinetree.com/"&gt;http://www.porcupinetree.com&lt;/a&gt;.
Or, you can have a look at&amp;nbsp;their Wikipedia entry here:&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Porcupine_Tree"&gt;http://en.wikipedia.org/wiki/Porcupine_Tree&lt;/a&gt;.
For the album lyrics of &amp;ldquo;In Absentia&amp;rdquo; go here: &lt;a href="http://www.porcupinetree.com/discography.details.cfm?albumid=12"&gt;http://www.porcupinetree.com/discography.details.cfm?albumid=12&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Enjoy.
&lt;/p&gt;
&lt;div class="bjtags"&gt;Tags: &lt;a rel="tag" href="http://technorati.com/tag/Prog+Rock"&gt;Prog+Rock&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/Porcupine+Tree"&gt;Porcupine+Tree&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=a5b80ba2-bd1a-4136-ba14-ba909e34db90" /&gt;</content>
  </entry>
  <entry>
    <title>Yet another WordPress exploit</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,9f42386a-6346-47a3-a3e1-d275b2fd118c.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,9f42386a-6346-47a3-a3e1-d275b2fd118c.aspx</id>
    <published>2007-03-03T12:19:01.448+00:00</published>
    <updated>2007-03-04T13:16:03.4595+00:00</updated>
    <category term="PHP" label="PHP" scheme="http://www.benericht.co.uk/CategoryView,category,PHP.aspx" />
    <category term="WordPress" label="WordPress" scheme="http://www.benericht.co.uk/CategoryView,category,WordPress.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It seems that the WordPress team have been having problems, again: <a title="http://wordpress.org/development/2007/03/upgrade-212/" href="http://wordpress.org/development/2007/03/upgrade-212/">http://wordpress.org/development/2007/03/upgrade-212/</a></p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/dasBlog">dasBlog</a>, <a rel="tag" href="http://technorati.com/tag/WordPress">WordPress</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=9f42386a-6346-47a3-a3e1-d275b2fd118c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Have these guys lost the plot?</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,6a26c08e-1f87-41c3-bca9-f6fe56ff13f5.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,6a26c08e-1f87-41c3-bca9-f6fe56ff13f5.aspx</id>
    <published>2007-02-22T16:25:04.985+00:00</published>
    <updated>2007-03-04T13:12:48.99075+00:00</updated>
    <category term="Chrome" label="Chrome" scheme="http://www.benericht.co.uk/CategoryView,category,Chrome.aspx" />
    <category term="PHP" label="PHP" scheme="http://www.benericht.co.uk/CategoryView,category,PHP.aspx" />
    <category term="Rant" label="Rant" scheme="http://www.benericht.co.uk/CategoryView,category,Rant.aspx" />
    <category term="Ruby on Rails" label="Ruby on Rails" scheme="http://www.benericht.co.uk/CategoryView,category,Ruby%2Bon%2BRails.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I can't believe that the people that brought us Delphi, JBuilder and C++Builder have
gone and done this: <a title="http://www.codegear.com/Products/Delphi/DelphiforPHP/tabid/237/Default.aspx" href="http://www.codegear.com/Products/Delphi/DelphiforPHP/tabid/237/Default.aspx">http://www.codegear.com/Products/Delphi/DelphiforPHP/tabid/237/Default.aspx</a></p>
        <p>
A PHP IDE! 
</p>
        <p>
It's no wonder that Delphi and the BDS is lagging behind the likes of <a href="http://www.remobjects.com/page.asp?id={C5B896C5-5C61-4C1C-A617-136711C07F46}" target="_blank">Chrome</a> and
Visual Studio when they are frittering their time away on nonsense like this. Why
didn't they expend their effort on something up-and-coming like <a href="http://www.rubyonrails.org/">Rails</a> and
not on a spent force like PHP?  A decent Rails IDE would have flown off the shelves. 
</p>
        <p>
It seems that my evil plan to eradicate PHP has taken a step back - curses <img src="http://www.benericht.co.uk/content/binary/smile7.gif" /></p>
        <div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/PHP">PHP</a>, <a rel="tag" href="http://technorati.com/tag/CodeGear">CodeGear</a>, <a rel="tag" href="http://technorati.com/tag/Delphi">Delphi</a>, <a rel="tag" href="http://technorati.com/tag/Chrome">Chrome</a>, <a rel="tag" href="http://technorati.com/tag/Ruby+on+Rails">Ruby+on+Rails</a></div>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=6a26c08e-1f87-41c3-bca9-f6fe56ff13f5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WordPress, sod that (or, PHP and my part in its downfall).</title>
    <link rel="alternate" type="text/html" href="http://www.benericht.co.uk/PermaLink,guid,e02e4d06-12e1-4ae4-941b-370ba5c5c94b.aspx" />
    <id>http://www.benericht.co.uk/PermaLink,guid,e02e4d06-12e1-4ae4-941b-370ba5c5c94b.aspx</id>
    <published>2007-02-20T15:03:20.035+00:00</published>
    <updated>2007-03-04T13:14:06.912625+00:00</updated>
    <category term="PHP" label="PHP" scheme="http://www.benericht.co.uk/CategoryView,category,PHP.aspx" />
    <category term="Rant" label="Rant" scheme="http://www.benericht.co.uk/CategoryView,category,Rant.aspx" />
    <category term="WordPress" label="WordPress" scheme="http://www.benericht.co.uk/CategoryView,category,WordPress.aspx" />
    <category term="dasBlog" label="dasBlog" scheme="http://www.benericht.co.uk/CategoryView,category,dasBlog.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
You may have noticed that this blog has changed. For a start, it looks different and
there are no postings on it. Thats because I've has some problems with WordPress,
my original blogging system, and was forced to get rid of it. A pain, but there you
go.
</p>
        <p>
I used this imposed change as an excuse to find a non-PHP based system. As a developer,
I really don't like PHP, I think its a fetid heap of parrot droppings - not so much
as a considered reaction, more of a viseral dislike. 
</p>
        <p>
Ideally, I would have liked to have found a <a href="http://www.rubyonrails.org/">Rails</a> based
solution, but sadly, my host doesn't yet support Rails hosting. So, being as I develop
it .NET most of the time and as ASP.NET is supported by my provider, I thought I'd
hunt out an ASP.NET based system blogging instead. And here it is, <a href="http://www.dasblog.info">dasBlog</a>,
an open-source ASP.NET blogging system.
</p>
        <p>
Admittedly, its not quite as easy to set up as WordPress, you may need to get your
hosting provider to set some permission for you, and you may also need to make
some changes to your sites web.config file, but once thats been done then you're good
to go. So far, dasBlog seems to be OK, time will tell.
</p>
        <p>
As there now seems to be a whole new generation of more grown-up web development systems
appearing on the scene we should hopefully start to see a sharp decline in the use
of PHP. And not a moment too soon in my view.  Bias aside, PHP is an insecure,
sloppy and inconsistent language that just encourages laziness (OK, that was biased).
Hopefully, the newer, more rational, better designed and enlightened frameworks
like: <a href="http://www.rubyonrails.org/">Ruby on Rails</a>; <a href="http://www.djangoproject.com/">Django</a>; <a href="http://www.turbogears.org/">TurboGears</a>; <a href="http://grails.codehaus.org/">Grails</a> and
even <a href="http://asp.net/">ASP.NET</a> will give PHP the kicking it so well and
truly deserves and punt into computing obscurity. 
</p>
        <p>
I hope I have contributed in a very small way to the demise of PHP by drawing
my own, faint, line in the sand. Remember people: PHP, together we can fight
it.
</p>
        <img width="0" height="0" src="http://www.benericht.co.uk/aggbug.ashx?id=e02e4d06-12e1-4ae4-941b-370ba5c5c94b" />
      </div>
    </content>
  </entry>
</feed>