<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Engineering the world</title>
	<atom:link href="http://hgomersall.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hgomersall.wordpress.com</link>
	<description>One line of code at a time...</description>
	<lastBuildDate>Mon, 13 May 2013 13:29:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hgomersall.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Engineering the world</title>
		<link>http://hgomersall.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hgomersall.wordpress.com/osd.xml" title="Engineering the world" />
	<atom:link rel='hub' href='http://hgomersall.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Squishing Matlab mex files into Octave</title>
		<link>http://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/</link>
		<comments>http://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 13:14:16 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=296</guid>
		<description><![CDATA[Common wisdom says that the mex files that Matlab builds are good for Matlab, and Matlab only. Not having trivial access to an installation of Matlab and needing to access the very neat and useful Field II package, this was &#8230; <a href="http://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=296&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Common wisdom says that the mex files that Matlab builds are good for Matlab, and Matlab only. Not having trivial access to an installation of Matlab and needing to access the very neat and useful <a href="http://field-ii.dk/">Field II</a> package, this was not wholly satisfactory for me.</p>
<p>Field II is a package for simulating an ultrasound field. It doesn&#8217;t matter what it does really, except that it only comes with precompiled mex files (no source <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ). These mex files (in my case, the 64-bit version with extension .mexa64) are really just poorly disguised elf shared libraries so all the usual library inspection tools work &#8211; ldd, nm, objdump, as well as all manner of nefarious library hacking.</p>
<p>It turns out that it actually wasn&#8217;t that big a deal to get the library to work. Octave handily provides a matlab API, so implicitly has a chunk of code that does the right stuff, the only problem then is one of ABI compatibility. Now, a quick glance through the Mex documentation seems to suggest that only standard types, or <em>pointers</em> to exotic types are passed around on the stack, and also dictates that the Matlab internal objects are opaque, so the ABI for the Octave library is probably going to be compatible (another learning point for me, be nice to <em>all</em> potential users and keep function parameters clean of exotic types that aren&#8217;t references &#8211; thank you Mathworks!).</p>
<p>Before we even have a hope of linking the library though, we must first find out what&#8217;s <em></em>missing. A peer into the distributed mex file tells us what we need to worry about:</p>
<pre class="brush: plain; collapse: false; gutter: false; title: ; notranslate">
$ ldd Mat_field.mexa64
</pre>
<p>gives us, among other things, the missing libraries (Mat_field.mexa64 is the mex file of interest):</p>
<pre class="brush: plain; collapse: false; gutter: false; title: ; notranslate">
libmx.so =&gt; not found
libmex.so =&gt; not found
libmat.so =&gt; not found

</pre>
<p>We can easily create a set of dummy libraries to keep the linker happy with these:</p>
<pre class="brush: bash; collapse: false; gutter: false; title: ; notranslate">
gcc -shared -lc -o libmx.so
gcc -shared -lc -o libmex.so
gcc -shared -lc -o libmat.so

</pre>
<p>Now we only need to tie it all together with the octave libs whence the missing symbols will come. You can see what octave is doing when it builds an oct file by passing the -v (verbose) flag to mkoctfile. Since we don&#8217;t actually need to compile everything, we just want to relink, so we hope the following will work (fortunately, none of the distributed mex files had the .mex extension, so I could claim it myself, otherwise there might well be a name collision that needs working around)&#8230;</p>
<pre class="brush: bash; collapse: false; gutter: false; title: ; notranslate">

# Create usual .so file name
ln -s Mat_field.mexa64 libMatfield.so

ld -shared -Bsymbolic -Bsymbolic-functions -o Mat_field.mex -L/usr/lib/x86_64-linux-gnu/octave/3.6.2 -L. -loctinterp -lMatfield -rpath `pwd`
</pre>
<p>Unfortunately, the distributed mex file uses a couple of symbols to functions that are not documented by Mathworks. These functions seemed to be version specific implementations of documented functions, so I just reimplemented them as wrappers of the documented functions (and by extension, those that are implemented in Octave). In my case, the missing functions were mxCreateDoubleMatrix_700 and mxGetString_700 (octave tells you the missing symbols when you try to use the library). The following code did the trick:</p>
<pre class="brush: cpp; collapse: false; gutter: false; title: ; notranslate">
#include &quot;mex.h&quot;

int mxGetString_700(const mxArray *pm, char *str, mwSize strlen)
{
    return mxGetString(pm, str, strlen);
}

mxArray *mxCreateDoubleMatrix_700(mwSize m, mwSize n, mxComplexity ComplexFlag)
{
    return mxCreateDoubleMatrix(m, n, ComplexFlag);
}
</pre>
<p>Saving that file as undocumented_funcs.c, this can be compiled using the mkoctfile helper program, and then linked in as before.</p>
<pre class="brush: bash; collapse: false; gutter: false; title: ; notranslate">
mkoctfile -c undocumented_funcs.c
ld -shared -Bsymbolic -Bsymbolic-functions -o Mat_field.mex -L/usr/lib/x86_64-linux-gnu/octave/3.6.2 -L. -loctinterp -lMatfield -rpath `pwd` undocumented_funcs.o
</pre>
<p>Success! You use it exactly as you would the original mex file. The `pwd` argument to -rpath means you can twiddle the paths in Octave and it all works fine.</p>
<p>All this was under Linux. I&#8217;ve no idea what happens if you try something similar under Windows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/296/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=296&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>Speedy fast 1D convolution with SSE</title>
		<link>http://hgomersall.wordpress.com/2012/11/02/speedy-fast-1d-convolution-with-sse/</link>
		<comments>http://hgomersall.wordpress.com/2012/11/02/speedy-fast-1d-convolution-with-sse/#comments</comments>
		<pubDate>Fri, 02 Nov 2012 12:43:22 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=264</guid>
		<description><![CDATA[I&#8217;ve done a bit of coding in the past with SSE instructions and achieved quite a significant speedup. I&#8217;ve also been playing recently with OpenCL as a means of implementing a fast, cross-device version of the Dual-Tree Complex Wavelet Transform &#8230; <a href="http://hgomersall.wordpress.com/2012/11/02/speedy-fast-1d-convolution-with-sse/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=264&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve done a bit of coding in the past with <a href="http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions">SSE</a> instructions and achieved quite a significant speedup. I&#8217;ve also been playing recently with <a href="http://www.khronos.org/opencl/">OpenCL</a> as a means of implementing a fast, cross-device version of the <a href="http://en.wikipedia.org/wiki/Complex_wavelet_transform#Dual-tree_complex_wavelet_transform">Dual-Tree Complex Wavelet Transform</a> (DT-CWT).</p>
<p>Since I lack a GPU capable of supporting OpenCL, I&#8217;m rather limited to targetting the CPU. This is a useful task in itself, as I would like a DT-CWT library that is fast on any platform, making use of the whatever hardware exists.</p>
<p>OpenCL implements a vector datatype, which the CPU compilers will try to map to SSE instructions. If no vector instructions are available, the compiler should just unroll the vector and perform scalar operations on each element (as would likely happen on most GPUs).</p>
<p>At the core of the DT-CWT is a convolution. The faster the convolution can be done, the faster the DT-CWT is done. This means a good starting point for a DT-CWT implementation is producing an efficient implementation of a convolution.</p>
<p>Given the difficulty of writing and debugging OpenCL, and the need to initially target a CPU, it made sense to me to create, in the first instance, a pure C version of an efficient convolution.</p>
<p>All the code is included on a <a href="https://github.com/hgomersall/SSE-convolution">github repository</a>, with the meat in <a href="https://github.com/hgomersall/SSE-convolution/blob/master/convolve.c">convolve.c</a>.</p>
<p>As a starting point, we can write a basic naive convolution:</p>
<pre class="brush: cpp; collapse: false; title: ; notranslate">
int convolve_naive(float* in, float* out, int length,
        float* kernel, int kernel_length)
{
    for(int i=0; i&lt;=length-kernel_length; i++){

        out[i] = 0.0;
        for(int k=0; k&lt;kernel_length; k++){
            out[i] += in[i+k] * kernel[kernel_length - k - 1];
        }
    }

    return 0;
}
</pre>
<p>This is compiled with the following options:<br />
<code>gcc -std=c99 -Wall -O3 -msse3 -mtune=core2</code></p>
<p>Running this with a 1024 sample input vector and a 16 sample kernel, it takes about 24.5μs per loop (on my rather old Core2 Duo).</p>
<p>The first modification is to reimplement this with SSE instructions. We can do this by computing 4 output values in parallel. If the kernel is of length N, then we create N 4-vectors. We then copy each element of kernel into each element of the corresponding 4-vector. We can then compute 4 output values in parallel. For this, we require that the input vector is a multiple of 4.</p>
<p>Note that we need to compute the last value in the output separately as the output is not a multiple of 4. We could also extend this principle to inputs that are not a multiple of 4 (but I don&#8217;t here!).</p>
<p>I use the <a href="http://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/cpp-mac/index.htm#GUID-7478B278-2240-44D8-B396-1DC508E3656E.htm">SSE intrinsics</a> (specifically, SSE3), included with<br />
<code>#include &lt;pmmintrin.h&gt;<br />
#include &lt;xmmintrin.h&gt;</code></p>
<p>The <code>__m128</code> type is used to denote an SSE 4-vector that can be used with the intrinsics.</p>
<pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
int convolve_sse_simple(float* in, float* out, int length,
        float* kernel, int kernel_length)
{
    float kernel_block[4] __attribute__ ((aligned (16)));

    __m128 kernel_reverse[kernel_length] __attribute__ ((aligned (16)));
    __m128 data_block __attribute__ ((aligned (16)));

    __m128 prod __attribute__ ((aligned (16)));
    __m128 acc __attribute__ ((aligned (16)));

    // Reverse the kernel and repeat each value across a 4-vector
    for(int i=0; i&lt;kernel_length; i++){
        kernel_block[0] = kernel[kernel_length - i - 1];
        kernel_block[1] = kernel[kernel_length - i - 1];
        kernel_block[2] = kernel[kernel_length - i - 1];
        kernel_block[3] = kernel[kernel_length - i - 1];

        kernel_reverse[i] = _mm_load_ps(kernel_block);
    }

    for(int i=0; i&lt;length-kernel_length; i+=4){

        // Zero the accumulator
        acc = _mm_setzero_ps();

        /* After this loop, we have computed 4 output samples
         * for the price of one.
         * */
        for(int k=0; k&lt;kernel_length; k++){

            // Load 4-float data block. These needs to be an unaliged
            // load (_mm_loadu_ps) as we step one sample at a time.
            data_block = _mm_loadu_ps(in + i + k);
            prod = _mm_mul_ps(kernel_reverse[k], data_block);

            // Accumulate the 4 parallel values
            acc = _mm_add_ps(acc, prod);
        }
        _mm_storeu_ps(out+i, acc);

    }

    // Need to do the last value as a special case
    int i = length - kernel_length;
    out[i] = 0.0;
    for(int k=0; k&lt;kernel_length; k++){
        out[i] += in[i+k] * kernel[kernel_length - k - 1];
    }

    return 0;
}
</pre>
<p>We can easily verify that the output from this routine is identical to that from the naive implementation.</p>
<p>We&#8217;ve immediately achieved a substantial speedup, going from 24.4μs to 10.8μs (2.3x).</p>
<p>If we also impose a constraint on the size of the kernel, making it a multiple of 4, we can specify this with a literal, allowing the compiler to partially unroll the inner-most loop.</p>
<pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
    for(int i=0; i&lt;length-kernel_length; i+=4){

        acc = _mm_setzero_ps();

        for(int k=0; k&lt;kernel_length; k+=4){

            int data_offset = i + k;

            for (int l = 0; l &lt; 4; l++){

                data_block = _mm_loadu_ps(in + data_offset + l);
                prod = _mm_mul_ps(kernel_reverse[k+l], data_block);

                acc = _mm_add_ps(acc, prod);
            }
        }
        _mm_storeu_ps(out+i, acc);

    }
</pre>
<p>This tweaks the time a bit lower, down to about 9.9μs per loop.</p>
<p>We&#8217;re still not done though! Each load from the dataset is an unaligned load (<code>_mm_loadu_ps</code>). Aligned loads using SSE are significantly faster than unaligned loads. To make the load aligned, the address of the data to be copied in must be a multiple of 16 (with AVX, Intel&#8217;s latest vector instruction set incarnation, I believe this has been increased to 32).</p>
<p>Unaligned loads are a necessity in the code so far as we step over every sample, meaning we never know what the byte-alignment of any given block of 4 floats will be. By somehow persuading every load to be aligned, we might be able to get more speed.</p>
<p>We can do this by making 4 copies (well, almost whole copies) of the input array, each with a differing alignment, such that every possible set of 4 floats can be found on the crucial 16-byte alignment.</p>
<p>If we start with the original data, with the numbers showing the sample numbers:<br />
original: [0, 1, 2, 3, 4, 5, ...]</p>
<p>We can create 4 copies as follows:<br />
copy 1: [0, 1, 2, 3, 4, 5, ...]<br />
copy 2: [1, 2, 3, 4, 5, 6, ...]<br />
copy 3: [2, 3, 4, 5, 6, 7, ...]<br />
copy 4: [3, 4, 5, 6, 7, 8, ...]</p>
<p>Since a float is 4 bytes, this means every element in the array now lies on a 16-byte boundary.</p>
<p>It&#8217;s now a simple case of referencing the correct copy of the input array and switching to an aligned load (<code>_mm_load_ps</code>).</p>
<pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
int convolve_sse_in_aligned(float* in, float* out, int length,
        float* kernel, int kernel_length)
{
    float kernel_block[4] __attribute__ ((aligned (16)));
    float in_aligned[4][length] __attribute__ ((aligned (16)));

    __m128 kernel_reverse[kernel_length] __attribute__ ((aligned (16)));
    __m128 data_block __attribute__ ((aligned (16)));

    __m128 prod __attribute__ ((aligned (16)));
    __m128 acc __attribute__ ((aligned (16)));

    // Repeat the kernel across the vector
    for(int i=0; i&lt;kernel_length; i++){
        kernel_block[0] = kernel[kernel_length - i - 1];
        kernel_block[1] = kernel[kernel_length - i - 1];
        kernel_block[2] = kernel[kernel_length - i - 1];
        kernel_block[3] = kernel[kernel_length - i - 1];

        kernel_reverse[i] = _mm_load_ps(kernel_block);
    }

    /* Create a set of 4 aligned arrays
     * Each array is offset by one sample from the one before
     */
    for(int i=0; i&lt;4; i++){
        memcpy(in_aligned[i], (in+i), (length-i)*sizeof(float));
    }

    for(int i=0; i&lt;length-kernel_length; i+=4){

        acc = _mm_setzero_ps();

        for(int k=0; k&lt;kernel_length; k+=4){

            int data_offset = i + k;

            for (int l = 0; l &lt; 4; l++){

                data_block = _mm_load_ps(in_aligned[l] + data_offset);
                prod = _mm_mul_ps(kernel_reverse[k+l], data_block);

                acc = _mm_add_ps(acc, prod);
            }
        }
        _mm_storeu_ps(out+i, acc);

    }

    // Need to do the last value as a special case
    int i = length - kernel_length;
    out[i] = 0.0;
    for(int k=0; k&lt;kernel_length; k++){
        out[i] += in_aligned[0][i+k] * kernel[kernel_length - k - 1];
    }

    return 0;
}
</pre>
<p>A quick test demonstrates that the speed up from the aligned load overwhelms any increase in time due to extra copies being made.</p>
<p>The time with the same input and kernel is now about 5.4μs.</p>
<p>One final tweak is to fix the length of the kernel loop, replacing <code>kernel_length</code> with a constant. This allows the compiler to unroll the whole of the kernel loop and yields a time of about 4.0μs (<a href="https://github.com/hgomersall/SSE-convolution/blob/master/convolve.c">code here</a>).</p>
<p>Inspecting the yielded assembly of the inner loop suggests that we&#8217;ve pretty much reached the limit of what is possible, with most of the time being spent doing an aligned load, followed by a 4-vector multiplication, followed by a 4-vector add, the essence of a convolution.</p>
<p>Running on larger arrays suggests that speedup scales well across larger arrays (I tested up to 32,768). In the repository is a <a href="https://github.com/hgomersall/SSE-convolution/blob/master/py_test_convolve.py">python script</a> that you can play with to convince yourself.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=264&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2012/11/02/speedy-fast-1d-convolution-with-sse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>Science in policy, an engineer&#8217;s take</title>
		<link>http://hgomersall.wordpress.com/2012/05/20/science-in-policy-an-engineers-take/</link>
		<comments>http://hgomersall.wordpress.com/2012/05/20/science-in-policy-an-engineers-take/#comments</comments>
		<pubDate>Sun, 20 May 2012 14:56:24 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=228</guid>
		<description><![CDATA[I went to a talk on Thursday evening hosted by CSaP. It was Mark Henderson talking about his new book, The Geek Manifesto. The talk was interesting and Mark had lots of good points to make about science in government &#8230; <a href="http://hgomersall.wordpress.com/2012/05/20/science-in-policy-an-engineers-take/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=228&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I went to a talk on Thursday evening hosted by <a href="http://www.csap.cam.ac.uk/">CSaP</a>. It was Mark Henderson talking about his new book, <a href="http://geekmanifesto.wordpress.com/about/">The Geek Manifesto</a>. The talk was interesting and Mark had lots of good points to make about science in government policy (specifically, the lack of science in policy). His basic points boiled down to:</p>
<ol>
<li>Science should be better at promoting <em>itself</em> in government policy.</li>
<li>Policy creation should be more scientific in its process.</li>
</ol>
<p>At the end of the talk I tried to ask a question picking up on something that was raised during the discussion. Mark made the point that science should just be one of the factors that is invoked during policy making, the others being such things as voter wishes, human rights, ethics etc.</p>
<p>In the long and rambling question, I tried and failed to articulate the point that science should be the overarching framework for policy, and that these other factors are just parameters within that framework. Science <em></em>should not be subservient to other points, but these other points need to be made to fit within the scientific policy framework. The question was accompanied by lots of shaking heads and a response that reiterated Mark&#8217;s original point. This got me thinking about how better explain what I am talking about.</p>
<p>The basic point is that to talk about science as being one of several factors in decision making is rather missing the point about science. It is the <em>only</em> reliable way we have of building knowledge about the world. For this reason, it makes perfect sense that any mechanism that attempts to define the world needs to do some from an exclusively scientific perspective. Any attempts to do otherwise are misguided at best and dishonest at worst. Science makes no claims about the nature of the knowledge it discovers, and it makes no claim about the tractability of the discovery process.</p>
<p>The core of it though, and I think the point where I got lost initially, is that policy making isn&#8217;t really the acquisition of knowledge (and hence science) at all; at its heart, it is engineering. What we have is a massively multivariate optimisation problem with some poorly defined cost function. It is this cost function that needs to be debated, and it encapsulates all those issues that were argued need to be considered in parallel to science.</p>
<p>The dimensions of the optimisation problem correspond to policy parameters &#8211; laws, taxation, incentives etc. The cost function then reflects how those laws are translated into real world consequences, giving a metric of &#8220;goodness&#8221;. This means that ethics, maintenance of democracy, not locking everyone up etc are necessarily encapsulated in the cost function. I would argue this cost function is something akin to a utilitarian type total happiness metric.</p>
<p>Of course, such a cost function is something that is inordinately difficult to both define and measure in the most general sense, but I expect the problem can be considered as a whole set of subdomains with reasonable separation &#8211; e.g. the economy, social welfare, foreign policy etc</p>
<p>Science then <em>does</em> have something to say about measuring the cost function. A whole discipline will arise around honestly quantifying the impact of a given policy change. Done properly, slowly but surely a body of knowledge will develop around how certain outputs can be achieved through policy change, as well as a body of skills and knowledge about how to measure and trial policy changes.</p>
<p>Any attempt to say, trample on human rights, is prevented by a huge negative impact to the cost function.</p>
<p>Of course, the real problem, and the essence I think of the political problem that underpins a lack of scientific scrutiny in policy making, is that there is a strong political will to not ever define the cost function carefully. Never properly defining what you&#8217;re trying to achieve is one sure way of stopping people telling you you haven&#8217;t achieved it.</p>
<p>This brings me to my final point &#8211; wouldn&#8217;t it be wonderful if politics became no longer about defining policy, but about defining that cost function. Civil servants could then go away and optimise policy to improve the cost function, drawing in new research and optimisation techniques as they become available.</p>
<p>I discussed this at length with my house mate and he made the point that the only cost function that matters is one&#8217;s own personal cost function. Whether politicians and civil servants can escape this trap would dictate whether such a utopia is possible.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=228&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2012/05/20/science-in-policy-an-engineers-take/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>The Wisdom of FFTW</title>
		<link>http://hgomersall.wordpress.com/2012/04/15/the-wisdom-of-fftw/</link>
		<comments>http://hgomersall.wordpress.com/2012/04/15/the-wisdom-of-fftw/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 08:22:32 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=221</guid>
		<description><![CDATA[Since the last post on my python wrappers for FFTW, I&#8217;ve advanced the code substantially. It now supports all the basic transforms using the same unified pythonic interface in which the transform is inferred from the dtype. In addition, I&#8217;ve &#8230; <a href="http://hgomersall.wordpress.com/2012/04/15/the-wisdom-of-fftw/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=221&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Since the last post on my python <a href="http://hgomersall.wordpress.com/2012/02/01/the-joys-of-cython-numpy-and-a-nice-fftw-api/">wrappers for FFTW</a>, I&#8217;ve advanced the code substantially.</p>
<p>It now supports all the basic transforms using the same unified pythonic interface in which the transform is inferred from the dtype. In addition, I&#8217;ve added support for importing and exporting wisdom. <a href="http://www.fftw.org/fftw3_doc/Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans">Wisdom</a> is FFTW&#8217;s way of remembering plans that have already been created, thereby speeding up the planning process in future. In particular, the slow planning routines like FFTW_MEASURE will benefit at the first running it the wisdom can be loaded from disk.</p>
<p>The wisdom routines don&#8217;t actually write to disk at present, this is because the nice api feature of FFTW that makes this trivial wasn&#8217;t added until FFTW 3.3 which is not widely distributed yet. I&#8217;ve written the code for this, but commented it out at present. The wisdom is exported as a tuple of strings, which can be pickled and saved as necessary. I suppose the strings could be saved too, but I&#8217;ve not tried this. There may be some problems with unicode conversions (which the output from FFTW is <strong>not</strong>), but I&#8217;m happy to be proven wrong on this.</p>
<p>My next goal is to implement the numpy fft interface, making pyfftw a drop in replacement for numpy.fft. The one small problem I&#8217;ve encountered so far is that numpy.fft will happily run over repeated axes, which FFTW doesn&#8217;t seem to like (at least, using my wrappers). I may just ignore this limitation &#8211; who is likely to use it anyway? (serious question!)</p>
<p>As usual, code on <a href="https://github.com/hgomersall/pyFFTW">github</a>, release on <a href="http://pypi.python.org/pypi/pyFFTW">python package index</a>, and docs <a href="http://hgomersall.github.com/pyFFTW/">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=221&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2012/04/15/the-wisdom-of-fftw/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>The joys of Cython, Numpy, and a nice FFTW api</title>
		<link>http://hgomersall.wordpress.com/2012/02/01/the-joys-of-cython-numpy-and-a-nice-fftw-api/</link>
		<comments>http://hgomersall.wordpress.com/2012/02/01/the-joys-of-cython-numpy-and-a-nice-fftw-api/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 12:57:48 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Cython]]></category>
		<category><![CDATA[FFTW]]></category>
		<category><![CDATA[math kernel library]]></category>
		<category><![CDATA[numpy]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[python wrapper]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=209</guid>
		<description><![CDATA[This is about my new FFTW python wrapper. The FFT routines shipped with Numpy are rather slow and have been the performance bottleneck in my code for some time. Last week I decided I needed to move to FFTW for &#8230; <a href="http://hgomersall.wordpress.com/2012/02/01/the-joys-of-cython-numpy-and-a-nice-fftw-api/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=209&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is about my new <a href="http://hgomersall.github.com/pyFFTW/">FFTW python wrapper</a>.</p>
<p>The <a href="http://docs.scipy.org/doc/numpy/reference/routines.fft.html">FFT routines</a> shipped with <a href="http://numpy.scipy.org/">Numpy</a> are rather slow and have been the performance bottleneck in my code for some time. Last week I decided I needed to move to <a href="http://www.fftw.org/">FFTW</a> for some of the new code I was writing, at least for the prototyping stage  &#8211; FFTW is GPL, which limits its use when it comes to distribution (though it is possible to buy a license, and apparently the <a href="http://software.intel.com/en-us/articles/intel-mkl/">Intel Math Kernel Library</a> uses the FFTW api, which means the code is more widely useful).</p>
<p>I looked at an <a href="http://pypi.python.org/pypi/PyFFTW3/0.2.1">existing set</a> of python wrappers, but didn&#8217;t really like the interface. The issues I had with it were as follows:</p>
<ol>
<li>It carried over the requirement of FFTW that a different library is used for each data type, so a different interface was used for complex64, complex128 and complex256.</li>
<li>It cannot handle arbitrary striding of arrays. This rather breaks the wonderful way in which Numpy can handle views into memory, in which sub-arrays can be created which look and work like a normal array, but the dimensions are not contiguous in memory.</li>
<li>There didn&#8217;t seem to be a way to choose arbitrary axes over which to take the DFT. Numpy&#8217;s fftn handles this with an axes argument (which is just a list of axes).</li>
</ol>
<p>Anyway, the upshot of my difficulties was that I decided to write my own set of wrappers. It also gave me a good little project for working with <a href="http://cython.org/">Cython</a>, which I needed to know about for some other things.</p>
<p>I had the core of what I needed written in a day, solving the second two of the issues above. This was in no small part down to just how fantastically nice Numpy is, as well as the neat fit is has to the <a href="http://www.fftw.org/fftw3_doc/Guru-Interface.html#Guru-Interface">guru interface</a> to FFTW. I can only assume that the other wrapper writers didn&#8217;t look in too much detail at that interface. Basically, there is a clear and simple translation to be made between the strides attribute of a Numpy array, and the arguments to the FFTW guru planner. I actually got too confused by the &#8216;lesser&#8217; advanced interface to do anything useful with it. I think the FFTW people are doing themselves a disservice by calling it the &#8216;guru&#8217; interface &#8211; it sounds hard then!</p>
<p>A bit more work later and I had the unified interface for all the complex Numpy types supported by FFTW (which happens to be all those supported by Numpy on my platform), as well as a pretty comprehensive test suite and documentation. So far, I only have the complex DFT enabled, but the code should be sufficiently flexible to extend easily to the real DFT and other FFTW routines.</p>
<p>The docs are <a href="http://hgomersall.github.com/pyFFTW/">here</a>, the code is <a href="https://github.com/hgomersall/pyFFTW">here</a>, and the python package index page is <a href="http://pypi.python.org/pypi/pyFFTW/">here</a>.</p>
<p>One final point&#8230; Cython is just wonderful. One can write in python, and C (ish) and python again all in the same file, and then compile it, and end up with a proper python module, all with fantastic distutils support. <em>That</em> is how extensions should be written. Why is anyone still using Matlab?</p>
<p>Edit: In case anyone was wondering, my crude benchmark puts FFTW about 5 times faster than the numpy fft functions.</p>
<p>Another edit: The wrappers are now somewhat more capable, supporting real transforms and multi-threaded mode.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=209&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2012/02/01/the-joys-of-cython-numpy-and-a-nice-fftw-api/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>How to peel a beetroot</title>
		<link>http://hgomersall.wordpress.com/2012/02/01/how-to-peel-a-beetroot/</link>
		<comments>http://hgomersall.wordpress.com/2012/02/01/how-to-peel-a-beetroot/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 11:39:36 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Food]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/2012/02/01/how-to-peel-a-beetroot/</guid>
		<description><![CDATA[After you&#8217;ve roasted it in foil for an hour, stick a fork in one end, hold it vertically up, and scrape it downwards with a teaspoon.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=203&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After you&#8217;ve roasted it in foil for an hour, stick a fork in one end, hold it vertically up, and scrape it downwards with a teaspoon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/203/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=203&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2012/02/01/how-to-peel-a-beetroot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>A Public Service Announcement on the Matter of the Tying of One&#8217;s Shoelaces</title>
		<link>http://hgomersall.wordpress.com/2011/12/30/a-public-service-announcement-on-the-matter-of-the-tying-of-ones-shoelaces/</link>
		<comments>http://hgomersall.wordpress.com/2011/12/30/a-public-service-announcement-on-the-matter-of-the-tying-of-ones-shoelaces/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 14:55:46 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=185</guid>
		<description><![CDATA[Earlier this week, my father was lamenting the fact that his boot laces keep coming undone. This is apparently a particular problem when the boot laces in question are under a pair of gaiters, but I personally think it must &#8230; <a href="http://hgomersall.wordpress.com/2011/12/30/a-public-service-announcement-on-the-matter-of-the-tying-of-ones-shoelaces/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=185&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Earlier this week, my father was lamenting the fact that his boot laces keep coming undone. This is apparently a particular problem when the boot laces in question are under a pair of gaiters, but I personally think it must be  mighty annoying at any time.</p>
<p>It turns out, after a swift inspection, that the man has been tying his laces incorrectly for the better part of 60 years. It reminded me of a similar situation during lab coffee in which a former colleague was expressing frustration over his new shoes (ostensibly the same as an old pair) with laces that came undone.</p>
<p>I here pass on that same information, with which I enlightened my dear father, my colleague and about half the others that happened to be present during that particular coffee break that were failing to tie their laces correctly, as a late Christmas present to any readers that may be about:</p>
<p><strong>The loops of your laces in the tied knot should be parallel with the lace as it enters the knot (or <em>balanced</em>), and not at an angle (or <em>unbalanced</em>).</strong></p>
<p>I came across this information at the marvellously geeky <a href="http://www.fieggen.com/shoelace/index.htm">Ian&#8217;s Shoelace Site</a>. The particular page in question is on <a href="http://www.fieggen.com/shoelace/slipping.htm">slipping shoelaces</a>, which will give you all the details and the photos describing what the problem is and how to get around it.</p>
<p>For all those that previously tied unbalanced shoelace knots, bask in your new found delight of shoelaces that don&#8217;t come undone.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=185&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2011/12/30/a-public-service-announcement-on-the-matter-of-the-tying-of-ones-shoelaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>The Innovation Agency site launches&#8230;</title>
		<link>http://hgomersall.wordpress.com/2011/12/08/the-innovation-agency-site-launches/</link>
		<comments>http://hgomersall.wordpress.com/2011/12/08/the-innovation-agency-site-launches/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 21:37:23 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[KED]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[The Innovation Agency]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=177</guid>
		<description><![CDATA[The Innovation Agency website has now launched officially. Be delighted by its greenness and its wordiness (and also by its content!). That is all.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=177&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.theinnovationagency.org">The Innovation Agency website</a> has now launched officially. Be delighted by its greenness and its wordiness (and also by its content!).</p>
<p>That is all.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=177&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2011/12/08/the-innovation-agency-site-launches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>What Push and Why Pull</title>
		<link>http://hgomersall.wordpress.com/2011/12/08/what-push-and-why-pull/</link>
		<comments>http://hgomersall.wordpress.com/2011/12/08/what-push-and-why-pull/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 21:24:10 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[KED]]></category>
		<category><![CDATA[The Innovation Agency]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=155</guid>
		<description><![CDATA[There is an oft presented dogma in business that it&#8217;s a Bad Thing when a venture is &#8220;technology push&#8221; rather than &#8220;market pull&#8221;. The rationale behind this is that you should understand the market before you attempt to solve the &#8230; <a href="http://hgomersall.wordpress.com/2011/12/08/what-push-and-why-pull/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=155&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>There is an oft presented dogma in business that it&#8217;s a Bad Thing when a venture is &#8220;technology push&#8221; rather than &#8220;market pull&#8221;. The rationale behind this is that you should understand the market before you attempt to solve the problem with a given piece of technology. If a piece of technology is driven by a clear market opportunity, then that is &#8220;market pull&#8221; and so is a much better way to proceed than if you start with a piece of technology and attempt to find a market for it. As a general idea, it makes perfect sense.</p>
<p>I&#8217;ve always been uncomfortable, however, when the dichotomy is taken to its logical conclusion. Clearly some technologies, which are developed first and foremost as a technology, have excellent market opportunities, once they have been discovered or developed (think almost any disruptive technology). It&#8217;s hard to argue that these weren&#8217;t technology push, and that investigating the market wasn&#8217;t a sensible thing to do in the situation, so how would typical business thinking rationalise this? Probably with some woolly discussion of how the entrepreneur possessed some market insight that drove the technology, giving it an implicit market pull &#8211; certainly that&#8217;s how I&#8217;ve been rationalising it to myself.</p>
<p>I had my big insight during a discussion I had a couple of days ago with a co-partner in <a href="http://www.theinnovationagency.org">The Innovation Agency</a>, Ian, in which we were planning a seminar we are running in several departments in the University of Cambridge. We are planning to structure the seminars around the idea of the Golden Circle, introduced by Simon Sinek during a TED talk:</p>
<div class="embed-"><iframe src="http://embed.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html" width="640" height="360" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
<p>It&#8217;s an excellent talk and well worth the time to watch it, but, in a nutshell, the idea of the Golden Circle is that we can consider a venture diagrammatically as a series of concentric circles with a &#8220;why&#8221; at its core, surrounded by a &#8220;how&#8221; and concluding at the edge with a &#8220;what&#8221;. The thing that really innovative businesses, organisations and individuals have in common is that they consider their activities from the inside to the outside of the circle. That is, they firstly consider <em>why</em> they are doing what that do, then the consider <em>how</em> they are going to do it, only then do they think about <em>what</em> it is they are going to do. Obviously, that&#8217;s somewhat of a simplification, but the idea is that <em>why</em> should be at the core of everything that is done. The <em>why </em>is the philosophy that drives everything and is the emotion behind the <em>how </em>and the <em>what</em>.</p>
<p>Conversely, many companies and organisations work the exact opposite way, thinking firstly of <em>what</em> they are doing, then perhaps <em>how</em> they are doing it, and, chances are, never arriving at the <em>why</em>. This means they can never fully engage with their customers on the decision making emotional level.</p>
<p>It was from this that my mental light bulb lit up regarding &#8220;technology push&#8221; and &#8220;market pull&#8221; ventures. The point is, is that distinction is the wrong way to look at it. A much better way to think about it is as &#8220;<em>what</em> push&#8221; and &#8220;<em>why</em> pull&#8221;. This means that an opportunity might be technology push but be driven by an overarching <em>why</em>.</p>
<p>This gives an interesting perspective on my current field of interest of commercialisation of academic research. Most scientific and technical academic research is strongly driven by a <em>why</em> &#8211; some real world question or problem that needs solving without any interest as to the <em>how</em> or <em>what.</em> Indeed, many an academic has failed by getting too hung up on the wrong <em>what</em>. It follows, therefore, that academic research and technology carries with it an implicit <em>why</em>. If that <em>why</em> can be paired with positive answers to the other <em>whys</em> of &#8220;why are <em>you</em> doing this?&#8221; and &#8220;why might this not work?&#8221; (which are always necessary, technology push <em>or</em> market pull), then it strikes me that the opportunity should be there.</p>
<p>The thing I take from this is that <em>every</em> piece of academic research should be investigated for its real world impact. That&#8217;s not to say that everything should be commercially exploited, but the <em>why</em> behind it should be pushed as far as it can go. For example, in the case of climate research, its important that as a society we understand and act upon the implications of the outcomes of the research, whatever they may be, because that satisfies the implicit <em>why</em>. Further to this, every academic funded through public money has a societal obligation to see this <em>why</em> pushed to its logical conclusion, so that we all may benefit.</p>
<p>The other interesting thing to think about is whether there are any market pull opportunities that aren&#8217;t <em>why</em> pull? I can&#8217;t immediately think of any, but there must be some&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=155&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2011/12/08/what-push-and-why-pull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
		<item>
		<title>New promises on open data from UK gov</title>
		<link>http://hgomersall.wordpress.com/2011/12/05/new-promises-on-open-data-from-uk-gov/</link>
		<comments>http://hgomersall.wordpress.com/2011/12/05/new-promises-on-open-data-from-uk-gov/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 17:44:39 +0000</pubDate>
		<dc:creator>Henry Gomersall</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[The Innovation Agency]]></category>

		<guid isPermaLink="false">http://hgomersall.wordpress.com/?p=150</guid>
		<description><![CDATA[This is seriously exciting. If I understand what it says correctly, the UK government is going to require that a whole raft of interesting and publicly relevant data is made available for public use, through dumps or APIs. It&#8217;s too &#8230; <a href="http://hgomersall.wordpress.com/2011/12/05/new-promises-on-open-data-from-uk-gov/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=150&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.cabinetoffice.gov.uk/news/open-data-measures-autumn-statement">This</a> is seriously exciting. If I understand what it says correctly, the UK government is going to require that a whole raft of interesting and publicly relevant data is made available for public use, through dumps or APIs.</p>
<p>It&#8217;s too soon I think to see what all the implications of the data release will be at this stage, but just consider the transport information. It seems that there will be enough publicly available information to do joined-up, real-time public transport planning. Your smart phone will cleverly work out that another train you could catch is a little late and that you should switch platforms to meet it, rather than stick with the one you&#8217;re on. You will immediately know the optimum route to cross the city by joining up knowledge of the buses and trains &#8211; no longer will you need to wait at bus stops. You&#8217;ll be able to tell your phone that, no, it doesn&#8217;t take 10 minutes to cross the platform and that you probably will catch that quick connection.</p>
<p>For all those thinking &#8220;but that&#8217;s possible now&#8221; &#8211; up until this point, we&#8217;ve been dependent on the goodwill of the Association of Train Operating Companies (ATOC) for the data, which is patchy, not universally available and expensive.</p>
<p>Those ideas solve just the low hanging fruit I can think of regarding my personal transport itches. There is data covering transport, weather (PDFs describing the rain probability anyone?) and health. If the data is as open as it seems, we should all applaud UK gov for taking a serious step in the right direction. I await with excitement the start-ups that will jump on this and make all our lives a little bit better.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hgomersall.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hgomersall.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hgomersall.wordpress.com&#038;blog=21735413&#038;post=150&#038;subd=hgomersall&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hgomersall.wordpress.com/2011/12/05/new-promises-on-open-data-from-uk-gov/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/bf402f309d40d607a369395e32a984fc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hgomersall</media:title>
		</media:content>
	</item>
	</channel>
</rss>
