<?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>Dirk&#039;s Page</title>
	<atom:link href="http://elazungu.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://elazungu.wordpress.com</link>
	<description>Create each day anew -- Morihei Ueshiba</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:16:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='elazungu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/dba234b9d7ea8614d457ed4f4a322b25?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Dirk&#039;s Page</title>
		<link>http://elazungu.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://elazungu.wordpress.com/osd.xml" title="Dirk&#039;s Page" />
	<atom:link rel='hub' href='http://elazungu.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Bridging Python and Matlab: Passing callbacks and optimization</title>
		<link>http://elazungu.wordpress.com/2012/02/06/bridging-python-and-matlab-passing-callbacks-and-optimization/</link>
		<comments>http://elazungu.wordpress.com/2012/02/06/bridging-python-and-matlab-passing-callbacks-and-optimization/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 15:16:47 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[decode]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[mex]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=370</guid>
		<description><![CDATA[This blog post is about a bridge I created that allows you to pass callbacks to Python functions directly to Matlab code without having to resort to things like sockets or COM. Background Designing our UAVs involves a number of &#8230; <a href="http://elazungu.wordpress.com/2012/02/06/bridging-python-and-matlab-passing-callbacks-and-optimization/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=370&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog post is about a bridge I created that allows you to pass callbacks to Python functions directly to Matlab code without having to resort to things like sockets or COM.</p>
<h2>Background</h2>
<p><a title="“Click here” to design and build your UAV" href="http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/">Designing our UAVs</a> involves a number of different codes that interact &amp; must be coordinated to solve what is essentially a <a href="http://en.wikipedia.org/wiki/Multidisciplinary_design_optimization">Multidisciplinary Design Optimization</a> (MDO) problem.  One of those codes is written in Python and involves a constrained optimization problem of the following kind:</p>
<p>Find the minimum of a problem specified by</p>
<p><img class="aligncenter" src="http://www.mathworks.co.uk/help/toolbox/optim/ug/eqn1184954223.gif" alt="" width="224" height="103" /></p>
<p><em>x</em>, <em>b</em>, <em>beq</em>, <em>lb</em>, and <em>ub</em> are vectors, <em>A</em> and <em>Aeq</em> are matrices, <em>c</em>(<em>x</em>) and <em>ceq</em>(<em>x</em>) are functions that return vectors, and <em>f</em>(<em>x</em>) is a function that returns a scalar. <em>f</em>(<em>x</em>), <em>c</em>(<em>x</em>), and <em>ceq</em>(<em>x</em>) can be nonlinear functions.</p>
<p>In our case we have 10 variables (x has length 10), 28 nonlinear constraint functions c(x), 4 nonlinear equality constraint functions ceq(x) and box constraints on most variables.  The objective function f(x) and all constraint functions are pure python functions.</p>
<p>Thus to optimize f(x) you need an optimizer that can handle python functions, and for that there is the excellent <a href="http://openopt.opg">openopt</a> library.  This is what I did and after trying out the different <a href="http://openopt.org/NLP#General_constrained">NLP solvers</a> I settled on the scipy_slsqp solver for most runs as it seemed to consistently give the best results.</p>
<p>However, as the optimization problem was tweaked and as we did more runs, we did run into cases where it would not solve and the aeronautical engineers I work with were not always happy with its robustness.  Also nobody had ever worked with the openopt library but everybody knew and trusted the various <a href="http://www.mathworks.com">Matlab</a> solvers.  Besides, us being part of the <a href="http://www.soton.ac.uk/engineering/research/groups/ced.page?">Computational Engineering Design Group</a>, a number of powerful in-house Matlab solvers had been developed and were available to me.  Thus, the least I could do was to try to use those and see if that improved anything.</p>
<h2>Python-Matlab bridge</h2>
<p>So I started searching the web for tools / libraries that allowed me to bridge python/Matlab, specifically tools that supported passing callbacks between the two languages.  A promising project seemed <a href="http://mlabwrap.sourceforge.net/">mlabwrap</a> but while it was great for evaluating Matlab expressions,  it does (at the time of writing) <a href="http://mlabwrap.sourceforge.net/">not support callbacks</a>.</p>
<p>In the end I decided to see if I could scratch my own itch.  I really did not want to deal with sockets or any kind of network protocol and I also wanted the solution to be crossplatform, so no COM.  Since both Python and Matlab have well documented interfaces with C/C++ code, that seemed to be the way to go.</p>
<p>So I sat down with the <a href="http://docs.python.org/library/ctypes.html">ctypes</a> &amp; <a href="http://www.mathworks.co.uk/help/toolbox/compiler/f2-972343.html#f2-1000836">mex</a> documentation and with a little help from Mathworks support was able to cobble together a simple example using <a href="http://www.mathworks.co.uk/help/techdoc/ref/fminsearch.html">fminsearch</a>.  By the way, I had never done any Python &#8211; C work before, but ctypes is awesome and a joy to use.  The little trick to make it all work is that you just have to treat the function handle as an integer (it&#8217;s just a memory address after all).  Then all you are really doing is passing an integer around which is straightforward.</p>
<p>With fminsearch working the goal was to extend to <a href="http://www.mathworks.co.uk/help/toolbox/optim/ug/fmincon.html">fmincon</a> since that would give us all the basic functionality needed.  This took a bit of debugging and deciphering Matlab crash dumps but I finally got it working.  The final flow of events looks like this:</p>
<p><a href="http://elazungu.files.wordpress.com/2012/02/pymatopt.png"><img class="aligncenter size-medium wp-image-378" title="pymatopt" src="http://elazungu.files.wordpress.com/2012/02/pymatopt.png?w=300&#038;h=147" alt="" width="300" height="147" /></a></p>
<p>You start off with writing a matlab file that wraps the optimizer you are interested in (in this case fmincon) and exposes its signature.  This m file forwards all function handle arguments to a mex file which converts the integer to a function pointer and calls it.  This is how we get the callback to a C function.  A simple bridge library is then needed which is loaded by ctypes and converts the arguments into something the Matlab shared library file understands.</p>
<p>From my initial tests I see it is finding the same optima as scipy_slsqp was using openopt. Now I just need to do more extensive testing to see if performance is any more robust. After that I can start looking into the other solvers provided by Matlabs optimization toolboxes as well as our own solvers.</p>
<h2>Source code</h2>
<p><a href="https://github.com/dgorissen/pymatopt">All the code is available on github</a>.  I hope it is useful to somebody and I&#8217;d be very happy to receive patches or improvements.  I guess this may even be of use to the mlabwrap / openopt projects.</p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=370&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2012/02/06/bridging-python-and-matlab-passing-callbacks-and-optimization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://www.mathworks.co.uk/help/toolbox/optim/ug/eqn1184954223.gif" medium="image" />

		<media:content url="http://elazungu.files.wordpress.com/2012/02/pymatopt.png?w=300" medium="image">
			<media:title type="html">pymatopt</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Javaprop in .net</title>
		<link>http://elazungu.wordpress.com/2012/02/06/using-javaprop-in-net/</link>
		<comments>http://elazungu.wordpress.com/2012/02/06/using-javaprop-in-net/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 10:38:24 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[decode]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[uav]]></category>
		<category><![CDATA[propellor design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[ikvm]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=367</guid>
		<description><![CDATA[JavaProp is tool for designing and analyzing propellers.  From the website: JavaProp is a relatively simple program, which is based on the blade element theory. The blade is divided into small sections, which are handled independently from each other. Each &#8230; <a href="http://elazungu.wordpress.com/2012/02/06/using-javaprop-in-net/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=367&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mh-aerotools.de/airfoils/javaprop.htm">JavaProp</a> is tool for designing and analyzing propellers.  From the website:</p>
<blockquote><p><em>JavaProp</em> is a relatively simple program, which is based on the blade element theory. The blade is divided into small sections, which are handled independently from each other. Each segment has a chord and a blade angle and associated airfoil characteristics. The theory makes no provision for three dimensional effects, like sweep angle or cross flow. But it is able to find the additional axial and circumferential velocity added to the incoming flow by each blade segment. This additional velocity results in an acceleration of the flow and thus thrust. Usually this simplified model works very well, when the power and thrust loading of the propeller (power per disk area) is relatively small, as it is the case for most aircraft propellers.</p></blockquote>
<p>It comes in the form of an applet that you can use through the website or as a jar file that you can link into your application.  While it seems like a small and simple program its actually quite powerful and get you a long way towards picking/sizing a propeller for your aircraft.</p>
<p>At some point there was the idea to integrate into Excel as a plugin that would link into our sizing equations.  Turns out that writing a java plugin for excel is actually a rather messy business and I really did not want to go down that route.  Instead I had the idea of trying to convert the java bytecode to bytecode that runs on the <a href="http://en.wikipedia.org/wiki/Common_Language_Runtime">CLR</a>.  This would make things a lot easier as the excel plugin can be written in C#, using all the bells and whistles that visual studio gives you.</p>
<p>Some googling led me to <a href="http://www.ikvm.net/">IKVM</a> and I have to say I was very pleasently surprised. I was expecting lots of strange errors but everything worked smoothly and out of the box.  It generated a dll which I could test on linux using mono as well as with Visual Studio on Windows. The excel plugin never materialized however, since the control flow JavaProp assumed did not match the flow used in our sizing equations but it was still fun to mess around with.  In case anybody wants to do the same simply downlad the JavaProp jar as well as the mhclasses dependency and use the following ikvm command to convert it to a dll:</p>
<p><pre class="brush: bash;">
ikvmc -target:library javaprop.jar mhclasses.jar
</pre></p>
<p>To include it in a .Net application you just have to make sure you also add the reference to IKVM.OpenJDK.Core.dll.</p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/367/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=367&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2012/02/06/using-javaprop-in-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>
	</item>
		<item>
		<title>What do you want to be when you grow up? Some personal reflections.</title>
		<link>http://elazungu.wordpress.com/2012/01/12/what-do-you-want/</link>
		<comments>http://elazungu.wordpress.com/2012/01/12/what-do-you-want/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 17:04:31 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[do what you love]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[setting goals]]></category>
		<category><![CDATA[what you want]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=350</guid>
		<description><![CDATA[Preamble At some point in life everybody reaches a stage where they have to decide what do with their professional, i.e., working, life. Some have it figured out during high school: they know what they want to do, they have &#8230; <a href="http://elazungu.wordpress.com/2012/01/12/what-do-you-want/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=350&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Preamble</h2>
<p><img class="alignright" style="border-color:initial;border-style:initial;border-width:0;" src="http://www.clch.org.uk/blog/wp-content/uploads/2011/10/What-do-you-want1.jpg" alt="" width="270" height="156" />At some point in life everybody reaches a stage where they have to decide what do with their professional, i.e., working, life. Some have it figured out during high school: they know what they want to do, they have a passion, and they pursue it head first. Others only really figure out what they want to do by the time they retire, yet others meander from goal to goal and never really settle on something. Baz Luhrmann&#8217;s song <a href="http://en.wikipedia.org/wiki/Wear_Sunscreen">&#8220;Wear Sunscreen&#8221;</a> comes to mind:</p>
<blockquote>
<p style="text-align:left;">Don’t feel guilty if you don’t know what you want to do with your life…</p>
<p style="text-align:left;">the most interesting people I know didn’t know at 22 what they wanted to do with their lives,</p>
<p style="text-align:left;">some of the most interesting 40 year olds I know still don’t.</p>
</blockquote>
<p>As with most things in life there really is no right or wrong answer, each brings its benefits and challenges.</p>
<p>This blog post is a personal reflection on this issue. Why post it publicly? Well, it forces you to think about the question in a coherent way, vs just scribbling some notes down on a piece of paper. Also, judging from the google results it&#8217;s a question many people grapple with. Sharing my thoughts may help somebody else think about theirs and, ideally, trigger some dialogue. In my case it was reading Paul Graham&#8217;s excellent essay on <a href="http://www.paulgraham.com/love.html">doing what you love</a> that gave me the final push.</p>
<h2>What makes you happy?</h2>
<p><img class="alignright" style="border-color:initial;border-style:initial;border-width:0;" src="http://www.xaguk.com/wp-content/uploads/2011/03/happy.jpg" alt="" width="240" height="216" /></p>
<p>I recently had another of these episodes where you take a step back and think &#8220;Do I like doing what I do? Will I still enjoy this 10 years down the line? Am I helping make the world a better place? Are there completely different things out there that I may want to do?&#8221;.</p>
<p>It was triggered by the fact that my contract for my current research project expires within a year. While I have the luxury of not worrying too much about becoming jobless, I did feel that, if I wanted to change something, then would be the time to do it, and now would be the time to think about it. Having recently become a dad and experiencing the responsibility that brings only strengthened that feeling. After all, I&#8217;m lucky to live in a prosperous part of world with many opportunities available to me. At the very least its something you should appreciate and reflect on instead of wandering through life on autopilot.</p>
<p>So I thought about the different things I could do in the future and tried to imagine how that would make me feel and how it would impact my personal &amp; family life. It turned out I found that rather difficult, it quickly boils down to the fundamental question: What do you want?. Solve that and it&#8217;s just a matter of connecting the dots. I found it easier to rephrase the question by making the reasonable assumption that what you want is whatever makes you happy. So then, what makes you happy?. Still a tricky question as there are so many variables involved, but easier to think about. There has been <a href="http://en.wikipedia.org/wiki/Happiness">plenty of research</a> into what constitutes happiness &amp; what makes people happy but that is a can of worms I&#8217;d rather avoid. At the end of the day its a question you, yourself have to answer. Knowing which boundary conditions tend to make people happier on average may be useful but not very satisfying or specific.</p>
<p>A useful side effect of looking at things from the perspective of happiness is that it should also give you a good indication of what you are good at. Since it&#8217;s generally unlikely that doing something you suck at makes you happy. (<em>Note: recall that I&#8217;m focusing on the professional and occupational instead of more personal and physical aspects like health, love, friends, etc.</em>)</p>
<h2>From interpolation to Extrapolation</h2>
<p><img class="alignright" src="http://imgs.xkcd.com/comics/extrapolating.png" alt="Extrapolating" width="277" height="177" />While that made things more concrete, I still found it quite difficult to think about the present moment and try to extrapolate to the future while weighing different options. Instead, I figured I would get a more objective, meaningful answer of what made me happy if I looked at the past, particularly during childhood. When you were a child, most of what you would do just came naturally, you didn&#8217;t worry whether it would pay off or could support your family. I find that, in my case, as you get older your decisions and actions come more from the brain than from the heart. Often with good reason, since as you gain responsibility and find your place within society you have to make more compromises. So instead of trying to extrapolate directly from the present into the future. I figured I should first interpolate over the past, discern one or more trends, and only then think about how they may shape the future or if I should ignore them and do a 180.</p>
<p>So I sat down and mentally thought about the decisions I made in the past and what I liked to spend my time on. Starting from my very earliest childhood memories up to now, writing things down as I went along. If you do this it&#8217;s very important just to stick to basic facts, and not try to infer anything, just think back to concrete things you liked doing and remembering which decisions you made and why. Only when you feel you have listed everything you can think of can you start going through your list to see if there are any common themes.</p>
<p>In my case I discovered the following recurring themes:</p>
<p><img class="alignright" style="border-color:initial;border-style:initial;border-width:0;" src="http://images.bidorbuy.co.za/user_images/097/923097_100627132046_j.jpg" alt="" width="144" height="192" /></p>
<p><strong>Science/Technology:</strong> I vividly remember having &#8220;The Giant Book of Facts&#8221; as my bible when I was around 8 as well as playing with a chemistry set I got for christmas, having an interest in astronomy, and becoming a big fan of <a href="http://www.mindtools.com/pages/article/newTED_05.htm">PMI</a> which was offered as an afternoon activity at some point. I also really enjoyed putting all kinds of random things under a microscope. Later this morphed into some, shall we say, &#8220;creative chemistry&#8221; in high school (for which I got into quite a lot of trouble actually) and an interest in computers/programming. The progression into computer science at university was only natural.</p>
<p>A subtheme here was that I always preferred building stuff or making stuff versus thinking or theorizing. I never was that good at mathematical puzzles or the more abstract stuff (<a href="http://en.wikipedia.org/wiki/Hilbert_space">like infinite Hilbert spaces</a> &amp; <a href="http://en.wikipedia.org/wiki/Ring_theory">ring theory</a>) we got at uni. In that sense I sympathize <a href="http://computinged.wordpress.com/2011/06/10/how-only-one-path-fails-to-help-everyone-succeed-at-learning-how-to-code/">with this blogger</a> and always felt more like an engineer than a scientist, particularly fascinated by things that could fly or float. This also motivated my topic choices for my masters and PhD theses later on.</p>
<p><img class="alignright size-full wp-image-385" style="border-color:initial;border-style:initial;border-width:0;" title="banff" src="http://elazungu.files.wordpress.com/2012/01/banff.jpeg?w=584" alt=""   /></p>
<p><strong>Nature</strong>: A second trend I discerned was one related to nature and the environment. From a very young age I always enjoyed being outside, taking walks in the forest &amp; exploring the hills behind our house on my own. The fact that I was lucky to spend my childhood growing up around east Africa probably played a big role here. As I got older this evolved into camping trips &amp; traveling to places where you could still venture into the bush or mountains. Even now I still love picking a random hill or mountain and trying to get to the top, whether there is a path or not.</p>
<p>A subtheme here was a particular interest in marine &amp; aquatic life. I could (and still can) spend hours snorkeling or pottering about rocky pools at low tide and was an active SCUBA diver for many years.</p>
<p><strong><a href="http://elazungu.files.wordpress.com/2012/01/bmisssoccer.jpeg"><img class="alignright size-medium wp-image-386" style="border-color:initial;border-style:initial;border-width:0;" title="bmisssoccer" src="http://elazungu.files.wordpress.com/2012/01/bmisssoccer.jpeg?w=300&#038;h=250" alt="" width="300" height="250" /></a>Sports/Teaching</strong>: most of my childhood was spent in British international schools where you had classes until 1pm and a range of activities to choose from in the afternoons. I always enjoyed sports and tried a lot of things over the years. From javelin to cricket, badminton and <a href="http://en.wikipedia.org/wiki/Orienteering">orienteering</a>. I was on the swimming, soccer, &amp; basketball teams in high school and ventured into squash and martial arts over my university years. Looking back I always was a good all-rounder without excelling in anything in particular.</p>
<p>The subtheme here was that I also enjoyed coaching &amp; teaching. Not only in sports (two friends and I coached the junior school basketball team for a year at some point) but also in class &amp; by helping out younger cousins with private lessons during my uni days. I ended up going through the teachers training program and really enjoyed the interaction with high school students during my internships. These days I still participate in outreach activities whenever I can, such as explaining the research we are doing to high school students or pensioners.</p>
<p>On the whole I have always been more of a &#8220;jack of all trades&#8221; than a &#8220;master of one&#8221;. Preferring to engage in different activities &amp; disciplines, instead of going all the way in one. I always found that double-edged sword. Sometimes you feel like you know a great deal, other times you realize you don&#8217;t really know anything. I was therefore happy to read in <a href="http://www.codefixes.com/2012/01/becoming-great">Mark Glen&#8217;s blog about Becoming Great</a> that there is still good value in flexibility.<br />
Secondly, I have always favoured pragmatism &amp; solving real problems, over speculative theorizing and always like to keep my options open. I did the <a href="http://en.wikipedia.org/wiki/Myers-Briggs_Type_Indicator">Myers-Briggs Type Indicator test</a> some time ago and it tells me I am an <a href="http://en.wikipedia.org/wiki/ENTJ">ENTJ</a>, which does not seem too far off base.</p>
<p>Reflecting on the above gives me a very good indication of what ingredients my perfect job should have: (1) multidisciplinary, (2) engineering: building stuff that has a connection with the physical world (vs writing financial software), (2) a connection to the environment and (3) a social dimension (outreach, teaching, &#8230;).</p>
<p>Interestingly, my current position as a research fellow already ticks quit a few of the boxes: I&#8217;m part of a multidisciplinary team in a University research group that designs and builds UAVs for civilian &amp; scientific missions (search and rescue, atmospheric measurements, etc.).</p>
<p>So where is the problem then?</p>
<h2>Thoughts on being an academic</h2>
<p><img class="alignright" src="http://www.phdcomics.com/comics/archive/phd022702s.gif" alt=" " width="420" height="190" />In many ways doing research at a university is the perfect job. The flexibility of managing your time and work rhythm is second to none, you get to attend conferences all over the globe &amp; you have pretty much total control over what you want to work on. In addition, the fact that you are surrounded by very intelligent people helps to push yourself further. In my case, the work we do on UAVs is really nice since its very tangible &amp; the first reaction of people is always &#8220;cool!&#8221;, even from Googlers (who are typically considered as working with cool tech/problems). We also have a great team &amp; great professors leading it. My peers in industry may be earning more &amp; driving a fancier car but have nowhere near the freedom and flexibility of university life. As you climb up the academic ladder things <a href="http://engineered.typepad.com/thoughts_on_business_engi/2011/01/industry-or-academia.html">can get more bogged down it seems</a>, but as of now, like I said, in many ways the perfect job.</p>
<p>So what&#8217;s the catch? Well if your ambition is to drive a big fancy car, you probably want to look outside academia. Pay scales are and your progression through them is typically a very controlled process and you can pretty much lookup how much you will earn in X years time. Personally, I think one of my main gripes with working in academia is the obsession with papers. I&#8217;ve written many papers that I know nobody will read (sometimes it seems you would even be lucky if the reviewers read them) and I&#8217;ve read many papers that add little value but manage to get published anyway. You could argue that you should focus on high quality journals and conferences where the quality is higher so you don&#8217;t have that problem. However, writing really good papers which contain a significant contribution &amp; get cited often is hard and something few can pull off consistently. From my experience and what I have been told by others is that as much as quality is important you may not neglect quantity. For every good paper you typically have several papers which are just variations of the same theme, the same techniques applied to a different problem, etc. And it is these papers that I hate writing. Sure, the fact that it is essentially a ticket to a nice conference where you can do some networking helps, but considering how much money it costs to register and attend the conference, I often doubt if the contribution is really worth it.</p>
<p>Secondly, it always annoyed me somewhat that there is generally little academic value in actually building stuff. You could put together a wonderful piece of software that is used by 100s or 1000s of people around the globe or build a beautiful, high performant aircraft that helps climate scientists do observations, but if you can&#8217;t monetize it in the form of publications it adds little to your academic track record. This of course brings us to the traditional <a href="http://www.jstor.org/pss/1174343">tension between applied and basic research</a> and you could argue that it is the university&#8217;s job to focus on the research side and for industry to focus on the monetization and application. Anyways, this is a whole debate in its own right and one I&#8217;m not going to get into here. I guess all I&#8217;m really saying is that it would be nice if the fact you actually built/created something that is actively being used counted as much as, say, a good journal paper. For actually putting your money where your mouth is by building something that others can use &amp; test, vs merely describing results or an algorithm in a paper, is not as trivial as you might think at first.</p>
<p><em>Sidenote</em>: Just to be clear, this is <em>not</em> a rant on academia, merely quibbles I have going through the system (which depends on your discipline).  While the whole scientific process of papers &amp; peer review has its inefficiencies and criticisms, it still is a great process which has brought us many great advances. It&#8217;s not like I have a 20 year track record in academia so what do I know? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I encourage you to share your constructive thoughts in the comments section <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Looking forward</h2>
<p><img class="alignright" style="border-color:initial;border-style:initial;border-width:0;" src="http://imagineghostwriting.com/wp-content/uploads/2011/07/Dream-Job.png" alt="" width="240" height="217" />Having done some thinking on what I like doing I have pinned down what aspects I am looking for professionally. It has also been a good exercise in reflection, understanding past decisions and visualizing a path onwards.</p>
<p>For now Im very happy with what I am doing and how things are going. While I recently got an offer to work for an established startup company I decided to stay at university for now (for various reasons). I have become more conscious, though, about how I spend my time and still plan to keep my options open. This is actually one of the reasons why I started blogging and <a href="https://twitter.com/#!/elazungu">joined twitter</a>. I also started following various podcasts &amp; blogs more consistently, as well as keeping track of interesting books and articles that refresh computer science fundamentals or give insightful commentary on new tools, techniques and languages.</p>
<p>Where family life allows it I try to attend hackathons, coding dojo&#8217;s, and other networking events where possible as they provide a great way to learn new things, meet new people, and benchmark your skills. I also find it interesting to talk to recruiters and companies at career fairs or other events. If you are not actively looking for a job these discussions are very informal and a great way to hear first hand &#8220;what&#8217;s out there&#8221;.</p>
<p>On the academic side I have decided to have a good think about what kind of project proposals/papers I could write that bring me closer to industry and &#8220;building stuff that people use and does not end with &#8216;just&#8217; a publication&#8221;. Some ideas floating around, we&#8217;ll see where it leads. As long as I feel I&#8217;m learning new stuff and pushing my boundaries I should be ok.</p>
<p>Additionally I plan to continue to volunteer for outreach activities where time allows. <a href="http://www.ewb-uk.org/">Engineers Without Borders</a> no longer have a branch in Southampton and I think it would be great fun (and a great challenge!) to set one up and organize some events. Similarly I have been involved with a couple of open source projects that arose from the hackathons I attended. It would be great to contribute more to them as well. However, I have to be very realistic about my available time. I still have my daily project work as well as a family and house to DIY, so my tinker time is severely limited.</p>
<p>In sum, while this whole process hasn&#8217;t given me a concrete destination, it has provided a good bearing that I can reevaluate in a years time. This is all you should expect really, one of my favorite quotes is still: &#8220;<em>If you want to make God laugh, tell him about your plans for the future</em>&#8220;.</p>
<p>Finally, remember to be aware that this whole thought process is an incredible luxury and very selfish in a way. We have the freedom of doing this exercise, many on this planet do not. Which should make you think: how can I help change that?</p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=350&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2012/01/12/what-do-you-want/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://www.clch.org.uk/blog/wp-content/uploads/2011/10/What-do-you-want1.jpg" medium="image" />

		<media:content url="http://www.xaguk.com/wp-content/uploads/2011/03/happy.jpg" medium="image" />

		<media:content url="http://imgs.xkcd.com/comics/extrapolating.png" medium="image">
			<media:title type="html">Extrapolating</media:title>
		</media:content>

		<media:content url="http://images.bidorbuy.co.za/user_images/097/923097_100627132046_j.jpg" medium="image" />

		<media:content url="http://elazungu.files.wordpress.com/2012/01/banff.jpeg" medium="image">
			<media:title type="html">banff</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2012/01/bmisssoccer.jpeg?w=300" medium="image">
			<media:title type="html">bmisssoccer</media:title>
		</media:content>

		<media:content url="http://www.phdcomics.com/comics/archive/phd022702s.gif" medium="image">
			<media:title type="html"> </media:title>
		</media:content>

		<media:content url="http://imagineghostwriting.com/wp-content/uploads/2011/07/Dream-Job.png" medium="image" />
	</item>
		<item>
		<title>Imperial College Robotics Society Talk</title>
		<link>http://elazungu.wordpress.com/2012/01/12/imperial-college-robotics-society-talk/</link>
		<comments>http://elazungu.wordpress.com/2012/01/12/imperial-college-robotics-society-talk/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 16:40:06 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[decode]]></category>
		<category><![CDATA[uav]]></category>
		<category><![CDATA[concept design]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[robotics society]]></category>
		<category><![CDATA[value driven design]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=343</guid>
		<description><![CDATA[I meant to post this some time ago but craziness at work and an overdose of family during the festive period intervened. Anyway, mid December I did a talk of our UAV work at the Imperial College Robotics society.  I &#8230; <a href="http://elazungu.wordpress.com/2012/01/12/imperial-college-robotics-society-talk/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=343&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I meant to post this some time ago but craziness at work and an overdose of family during the festive period intervened.</p>
<p>Anyway, mid December I did a talk of our UAV work at the <a href="http://www.icrobotics.co.uk/">Imperial College Robotics society</a>.  I had met Harry Eakins, founder and current president, at the last pyconuk conference in Coventry &amp; he invited me to give a similar talk at Imperial.</p>
<p>As usual, the slides are available on slideshare:</p>
<div id="__ss_10993556" style="width:425px;"><strong><a title="&quot;Click here&quot; to build your UAV" href="http://www.slideshare.net/dgorissen/click-here-to-build-your-uav" target="_blank">&#8220;Click here&#8221; to build your UAV</a></strong><iframe src='http://www.slideshare.net/slideshow/embed_code/10993556' width='425' height='348' scrolling='no'></iframe></p>
<div style="padding:5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/dgorissen" target="_blank">dgorissen</a></div>
<div style="padding:5px 0 12px;">
<p>In all I found it a great experience.  I tried to give a broad overview of the UAV related activity at the university as well as focus more on our research around DECODE.  Got a good audience with some great discussion during the reception afterwards.</p>
<p>On arrival I got a tour of their <a href="http://en.wikipedia.org/wiki/Hackerspace">hackerspace</a> and it was great seeing people hacking and soldering away on various projects, ranging from quadcopters to a robotic dustbin.  Thinking back to my university days I always regret not having gotten involved more in such things or set them up if they did not exist.  There are <a href="http://makezine.com/">so many cool things</a> you could do and the technology &amp; kit is very accessible.  These days my tinker time is very limited but Im optimistic in that will change <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>
<div style="padding:5px 0 12px;">&#8211;Dirk</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/343/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=343&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2012/01/12/imperial-college-robotics-society-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Click here&#8221; to design and build your UAV</title>
		<link>http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/</link>
		<comments>http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 12:35:37 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[decode]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[uav]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[design optimization]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mdo]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[rabbitmq]]></category>
		<category><![CDATA[software architecture]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=275</guid>
		<description><![CDATA[This blog post summarizes the work I have been doing the past 8 months or so on an automated design system for (civillian) UAVs.  Ive been meaning to do this post for a long time but wanted the tools to &#8230; <a href="http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=275&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog post summarizes the work I have been doing the past 8 months or so on an automated design system for (civillian) UAVs.  Ive been meaning to do this post for a long time but wanted the tools to be in a beta quality state before writing about them.  In good software engineering tradition there have been a few hiccups and detours along the way but Im happy to say beta stage has been reached.</p>
<p>I will go over the vision behind the system, its architecture, and the various tools I have used to put it together.  For the impatient, this is the idea: we need a system that allows us to rapidly go through this process:</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/concept-2-crash.jpg"><img class="aligncenter size-medium wp-image-323" title="concept-2-crash" src="http://elazungu.files.wordpress.com/2011/12/concept-2-crash.jpg?w=300&#038;h=117" alt="" width="300" height="117" /></a></p>
<p><a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a> UAV design if you want to call it that. Tools I will talk about include <a href="http://www.python.org">Python</a>, <a href="http://www.numpy.scipy.org">Numpy</a>, <a href="http://www.rabbitmq.com">RabbitMQ</a>, <a href="http://www.redis.io">Redis</a>, <a href="http://flask.pocoo.org/">Flask</a>, <a href="http://www.djangoproject.com">Django</a>, <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>,  <a href="http://www.knockoutjs.com">Knockout.js</a>, <a href="http://www.vagrantup.com">Vagrant</a> and how they link up with application specific codes such as <a href="http://www.ansys.com/Products/Simulation+Technology/Fluid+Dynamics/ANSYS+FLUENT">Ansys Fluent</a>, <a href="http://www.solidworks.com/">SolidWorks</a>, <a href="http://www.vanguardsw.com/products/vanguard-system/">Vanguard</a> and <a href="http://www.xjtek.com/">Anylogic</a>.</p>
<p>This post is an extension of <a title="Designing UAVs with Python, RabbitMQ and Redis" href="http://elazungu.wordpress.com/2011/09/26/designing-uavs-with-python-rabbitmq-and-redis/">the talk I gave at PyConUK 2011</a> a couple of months ago and is also what I will cover in my upcoming talk at<a href="http://www3.imperial.ac.uk/"> Imperial College</a> and at the upcoming <a href="http://www.aiaa.org/content.cfm?pageid=230&amp;lumeetingid=2414">AIAA conference in Honolulu</a> in April 2012.</p>
<h2>Background &amp; vision</h2>
<p>The system I going to talk about came about as part of the <a href="http://www.epsrc.ac.uk/">EPSRC</a> funded <a href="http://gow.epsrc.ac.uk/ViewGrant.aspx?GrantRef=EP/H007431/1">DECODE</a> project here at the <a href="http://www.southampton.ac.uk/engineering/index.page">University of Southampton</a> aerospace department. Many things were promised in the project proposal but the fundamental vision is phrased like this.</p>
<blockquote><p>DECODE addresses the design and integration of complex systems such where the problems of cost overruns, delays and performance shortfalls are particularly acute. The current value of an aerospace prime contract is now typically measured in £ Billions, yet surprisingly, many companies still use relatively traditional, ad-hoc and organic processes and design tools within their programmes.</p>
<p>The research to be undertaken under DECODE will investigate design decision making tools that provide holistic optimisation at a system level to maximise satisfaction of all the stakeholders associated with the system. Uniquely DECODE will provide active design exploration of systems level trade-offs between performance, unit cost and system life-cycle costs based on a “design mission control capability” .<br />
To do this an innovative design decision support environment that focuses on Value metrics is being built. This will allow a Value-Driven “mission control capability” for design decision making to be researched. It will integrate early concept design exploration with full resolution, geometry backed design computations and detailed manufacturing and operations models.</p></blockquote>
<p>So lets look what this means in a more practical sense. The traditional decision making process in aerospace design projects is that a group of engineers representing the different subsystems/domains sit together in a room and fire off powerpoint presentations and excel spreadsheets until consensus is reached.</p>
<p>The vision we are aiming for here is that you still put the same people in the same room, but you give them a flexible environment that they can query in real time and will allow them/give them access to:</p>
<ol>
<li><strong>Design rationale:</strong> quickly pull up the design rationale maps and drill down to the evidence behind a certain decision. For example: the rationale behind the decision to use a particular airfoil section may link to mission specification documents and CFD analysis.</li>
<li><strong>Live geometry</strong>: its much easier to debate the merits of a particular design decision (e.g., the need for structural reinforcement around the landing gear mounting) if you can easily pull up the relevant CAD geometry and manipulate in real time</li>
<li><strong>Probe the design &amp; its performance in real time</strong>: engineers are able to vary the parameters of the design &amp; get direct feedback on how they impact performance. They can opt for a rough answer now or an accurate later (e.g., over lunch, or over night). For example, <em>What if we decrease the wing span by 10%?</em></li>
<li><strong>Find out the value of a particular design choice</strong>: Essentially you want to answer the question &#8220;<em>Is it worth it</em>?&#8221;. We know a 10% increase of wing span will add to the weight/cost, allow us to land slower, etc. But is it worth it?</li>
</ol>
<p>Its this last point that is the main novelty of the DECODE project, though its also the most crucial to get right. Answering the &#8220;<em>is it worth it</em>?&#8221; question depends on the mission and thus depends on a trustworthy operational simulation and realistic value model.</p>
<p>Together this is quite an ambitious vision and requires a sizeable amount of architecting and software engineering to get right. There are about 7 people on the team, each responsible for different domain specific components that are plugged into the system. The team responsible for actually building the system and linking everything together is&#8230;err&#8230;me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>With about 18 months left on the project I doubt we will get all the way there. But we should definately have proved that you can get something working.  For the rest of the post I plan to focus more on the software system side of things.  I could talk at length about each of the 4 points above but that would lead us too far.</p>
<h2>Unmanned Aerial Vehicle&#8217;s (UAVs)</h2>
<p>The vision outlined above is very generic, it could apply to designing space shuttles or Volkswagen Polo&#8217;s. The focus of the project has been to use <a href="http://en.wikipedia.org/wiki/Unmanned_aerial_vehicle">UAVs</a> as the main use case.   Mainly because there is a lot of very cool and relevant technology around UAVs (<a href="http://www.youtube.com/watch?v=3CR5y8qZf0Y">like  Quadcopter ping pong</a>) but also since they are complex enough to be taken seriously as an application but simple enough to designed and built within a year with a university research group budget. Not to mention they are a great way to teach students about complex systems design.  We are a university after all.</p>
<p>So far our group has focused on sub 25kg fixed wing UAVs.  As soon as you go above 25kg the certification and authorization issues become hairy.  Other groups at the university &amp; <a href="http://noc.ac.uk/">NOC</a> are working with <a href="http://www.youtube.com/user/Multicopter100">Quadcopters</a> and <a href="http://www.noc.soton.ac.uk/hydrocarbon/brochures/autonomous_underwater_vehicles.php">Autonomous Underwater Vehicles</a>. Some of the aircraft we have designed and flown are:</p>
<p style="text-align:center;"><a href="http://elazungu.files.wordpress.com/2011/12/uav4.jpeg"><img class="size-thumbnail wp-image-288 alignnone" title="uav4" src="http://elazungu.files.wordpress.com/2011/12/uav4.jpeg?w=150&#038;h=107" alt="" width="150" height="107" /><img title="uav1" src="http://elazungu.files.wordpress.com/2011/12/uav1.jpeg?w=150&#038;h=106" alt="" width="150" height="106" /></a><br />
<a href="http://elazungu.files.wordpress.com/2011/12/uav3.jpeg"><img class="size-thumbnail wp-image-287 alignnone" title="uav3" src="http://elazungu.files.wordpress.com/2011/12/uav3.jpeg?w=150&#038;h=106" alt="" width="150" height="106" /><img class="size-thumbnail wp-image-287 alignnone" title="uav2" src="http://elazungu.files.wordpress.com/2011/12/uav2.jpeg?w=150&#038;h=106" alt="" width="150" height="106" /></a></p>
<p>The autopilot we use was developed at the NOC by one of our team members who has recently <a href="http://www.skycircuits.com/">setup a separate company</a>.</p>
<h2>Making decisions</h2>
<p>Given UAVs as the main use case the task of the Decode system is to help decide which UAV should be built and discrimintate between alternatives.  There are a bewildering number of decisions that have to be made when building a system like a UAV, ranging from obvious configuration choices (do we need an undercarriage?) to more obscure one like do we need square or round section tail booms.  Which ones are the important ones, which ones don&#8217;t matter, which ones are critical, etc.  The color of the paint you use may not seem like something important, but depending on the mission and flight conditions, it may very well be. This is a topic one of my colleagues is delving into and one which Im involved in from the sidelines.  The following figure illustrates the different geometry related decision variables on one of our airframes.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/decisions.png"><img class="aligncenter size-medium wp-image-322" title="decisions" src="http://elazungu.files.wordpress.com/2011/12/decisions.png?w=300&#038;h=135" alt="" width="300" height="135" /></a></p>
<p>At heart this is really a <a href="http://en.wikipedia.org/wiki/Multidisciplinary_design_optimization">multidisciplinary design optimization (MDO)</a> problem that revolves around solving conflicting requirements.  The following cartoon illustrating the tensions between requirements is a classic:</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/mdo.png"><img class="aligncenter size-medium wp-image-321" title="mdo" src="http://elazungu.files.wordpress.com/2011/12/mdo.png?w=300&#038;h=202" alt="" width="300" height="202" /></a></p>
<p>Similar tensions exist when building software, the memory-speed trade being the obvious one.  Luckily, in the engineering world, there are powerful mathematical techniques that can help you solve this trade-off and find an optimum.  A luxury that the software world, as far as I am aware, does not have.</p>
<h2>Dropping bombs vs saving lives</h2>
<p>As soon as you say UAV or drone people immediately think of <a href="http://en.wikipedia.org/wiki/General_Atomics_MQ-1_Predator">Predator</a> type aircraft and have visions of souless robots dropping bombs on civilians &amp; all things <a href="http://en.wikipedia.org/wiki/Orwellian">Orwellian</a>.  This is (rightfully) a <a href="http://www.spiegel.de/international/world/0,1518,682420,00.html">controversial topic</a> and one I&#8217;m not going to get into.  I would not feel comfortable working on military applications so I am very happy that all our work focuses on the civilian applications of UAVs.  As with any bit of science or technology UAVs can, and are, used for military &amp; law enforcement applications but people often don&#8217;t realize <a href="http://www.nasa.gov/centers/dryden/research/civuav/civ_uav_doc-n-ref.html">how</a> <a href="http://www.uavm.com/uavindustry.html">many</a> <a href="http://www.uavm.com/uavapplications.html">civilian</a> <a href="http://en.wikipedia.org/wiki/Unmanned_aerial_vehicle#Uses">applications</a> there are.  And this market is <a href="http://www.frost.com/prod/servlet/market-insight-top.pag?Src=RSS&amp;docid=236443867">only growing</a>.</p>
<p>The focus of DECODE is the use of UAV for search and rescue missions.  Using a helicopter to search for individuals lost at sea or in the mountains is extremely expensive, costing thousands of pounds per hour.  A fleet of UAVs should drastically be able to reduce the price and search time.  Not replacing helicopters and lifeboats, but complementing them.</p>
<p>As part of this we developed a detailed operational simulation model of the coast around Southampton (though it can be applied to any area) using the <a href="http://www.xjtek.com/">Anylogic</a> agent based simulator.  This can be used to simulate missions and get an idea of what kind of performance is needed from a UAV.  For example, it allows us to answer the question whether we are better off with 10 small, cheap UAVs, or 3 expensive, high performance UAVs.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/opsim.png"><img class="aligncenter size-medium wp-image-298" title="opsim" src="http://elazungu.files.wordpress.com/2011/12/opsim.png?w=300&#038;h=120" alt="" width="300" height="120" /></a></p>
<p>But lets not get ahead of ourselves just yet.  The question we should ask ourselves at this stage is, what does a good search and rescue UAV look like?</p>
<h2>System design drivers</h2>
<p>Designing an efficient and performant UAV is a multidisciplinary undertaking, requiring codes, solvers, &amp; expertise from varying domains.  The following figure illustrates the building blocks that are needed.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/blocks.png"><img class="aligncenter size-medium wp-image-299" title="blocks" src="http://elazungu.files.wordpress.com/2011/12/blocks.png?w=300&#038;h=165" alt="" width="300" height="165" /></a></p>
<p>Coming up with a good UAV design requires exercising these blocks in concert for every design decision and assessing the impact of changes.  Some blocks may be very simple web service calls which complete in less than a second.  While other blocks require many hours of computing time on high performance clusters.  A system is needed to  orchestrate all this and can be driven by the designer in an intuitive fashion.</p>
<p>We can come up with a a number of requirements for such a software system:</p>
<ul>
<li>the system should be pluggable and support a wide range of components/solvers on any platform</li>
<li>the system must be capable of running on high performance clusters, grids, and clouds</li>
<li>multiple users should be able to drive the system simultaneously, asking questions such as</li>
<ul>
<li>How many more lives can we save if the wing span is 10% longer?</li>
<li>What is the optimal propeller diameter?</li>
<li>Should we use a canard?</li>
<li>How does the parasitic drag vary with cruise speed?</li>
</ul>
<li>there must be a clear provenance record to track the flow of data through the system</li>
</ul>
<p>Which brings us to a number of desirable design principles:</p>
<ul>
<li>de-coupled and asynchronous</li>
<li>fault tolerant</li>
<li>horizontally scalable</li>
<li>cross platform and cross language</li>
<li>support multiple workflows</li>
<li>user friendly</li>
</ul>
<p>Which, in turn, can help us think about a suitable architecture for the system&#8230;.</p>
<h2>System Architecture</h2>
<p>I will not go into all the details but fundamentally the system follows a typical <a href="http://en.wikipedia.org/wiki/Multitier_architecture">3-tiered architecture</a>.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/layers.png"><img class="aligncenter size-medium wp-image-301" title="layers" src="http://elazungu.files.wordpress.com/2011/12/layers.png?w=300&#038;h=222" alt="" width="300" height="222" /></a></p>
<p>At the bottom there is a data layer which holds all the data related to a particular UAV design &amp; all the data generated as part of analyzing the design (e.g., CFD results, CAD geometry, &#8230;). This information is best stored in a proper data repository such as <a href="http://fedora-commons.org/">Fedora Commons</a> or similar.</p>
<p>Above that is the orchestration layer which is tasked with implementing the business logic.  In this case coordinating between the different solvers &amp; components in order to a  answer the various questions a designer has about the design.</p>
<p>Finally, there is the presentation layer which presents an intuitive user interface to the available workflows and the underlying data repositories.  There may be multiple client interfaces, at least one of them being a web based UI.</p>
<h2>Orchestration layer</h2>
<p>As most work so far has concentrated on the orchestration layer I shall primarily talk about it.  I chose to implement this layer as a series of lightweight &amp; independent components which interact with each other in a fully asynchronous and message based manner.  This automatically gives us flexibility over how we implement each component, performance (no blocking calls) and horizontal scalability (multiple components can feed from the same message queue).</p>
<p>I chose  python as the main implementation language as it seemed like a nice high level language to do such things.  Also, I was only starting off with it and wanted to learn more.  As messaging protocol I selected <a href="http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol">AMQP</a>, using <a href="http://www.rabbitmq.com">RabbitMQ</a> as the implmentation and broker. While <a href="http://www.imatix.com/articles:whats-wrong-with-amqp">not perfect</a>, I liked the concepts of queues, exchanges, acknowledgements,  it was easy to setup, it seems to be quite widely used and it had good support among all major programming languages.  As message format I selected <a href="http://code.google.com/p/protobuf/">protocol buffers</a>.  Again, good support among the major programming languages, easy to use, good documentation, and the type safety + utility methods it gives you over basic JSON come in handy at times.</p>
<p>A very important decision I made here was to avoid using a central database &amp; data model that every component relies on &amp; that I would have to keep in sync.  I wanted to have the individual components as lightweight and stateless as I could possibly have them.  (Note: Looking back at this it strikes me that what I essentially did was implement the <a href="http://en.wikipedia.org/wiki/Actor_model">Actor pattern</a>).</p>
<p>However, the only problem was that, yes, in an ideal world everything is stateless, but in reality you need to keep track of certain things.  For example, each component executes a part of the overall workflow.  But if one component dies you dont want to have to start all over again, you would like to continue where you left off, or at least let one of your peers continue if you cant.  Especially with long, expensive, CFD solves you want to avoid doing things twice.  Secondly, from a user/debugging perspective you would like to keep track of which components are available and what each is doing.</p>
<p>So some kind of persistent state is needed, and for that I chose <a href="http://redis.io">redis</a>, an open source and high performance data structure server.  I use it both as a registry to store information on the available components (the EXPIRE command can be used to implement a heartbeat) and as a way to store simple state information.  Lightweight is the key here.  I still want to avoid any kind of central data model, redis only stores simple JSON dictionaries and the system will not break if state information is suddenly lost (though a particular job may fail to complete).</p>
<p>The following figure illustrates all the components in the system and the communication between them:</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/decode-deploy.jpg"><img class="aligncenter size-medium wp-image-310" title="decode-deploy" src="http://elazungu.files.wordpress.com/2011/12/decode-deploy.jpg?w=300&#038;h=171" alt="" width="300" height="171" /></a></p>
<p>There are two types of components: relay components and analysis components.  Relay components (like the balancer and controller in the image) are responsible for the orchestration of analysis components, they implement the actual system logic.  Analysis components are less intelligent in that they essentially wrap a particular solver (e.g., Fluent for CFD or Vanguard for costing).  The balancing code is a bit of a special case since it acts like an analysis code but also plays an important role in the overall orchestration.  Together with the Balancer component it is responsible for  ensuring the aircraft is balanced, i.e., it is a feasible aircraft where lift = weight, the center of gravity is in the right place, etc. (Note: this is where the <a title="Pycel: Compiling Excel spreadsheets to Python and making pretty pictures" href="http://elazungu.wordpress.com/2011/10/19/pycel-compiling-excel-spreadsheets-to-python-and-making-pretty-pictures/">Excel -&gt; Python compilation code</a> I blogged about previously comes in).</p>
<p>Each component is thus a lightweight python process and has two queues at its disposal.  A direct input queue which is exclusive to that component, and an input queue which is shared between all components of the same type.  Each message received on either queue will be processed and returned to the component specified in the &#8220;reply-to&#8221; field of the message, so workflows are not hardwired.  A component also starts a small embedded HTTP server using <a href="http://flask.pocoo.org/">flask</a>, which gives you access to the local result directory and which I will probably use to add some simple monitoring and administration.</p>
<p>There can be an arbitrary number of instances of each component type running (horizontal scalability). Also, thanks to the semantics of AMQP acknowledgements, we can ensure we only acknowledge a message once we have successfully processed it and performed the next action in the overall workflow.  This leads to natural failover between different components.  To demonstrate components can really come and go as they please I wrote some proof of principle code linking the component lifetime with the local screensaver.</p>
<h2>Architecture weaknesses</h2>
<p>As with every solution, a decoupled, message based system also brings with it a number of weaknesses:</p>
<ul>
<li>Sometimes you may want synchronous, sequential behavior, emulating this in an asynchronous system is ugly</li>
<li>Ideally you want to &#8220;fire-and-forget&#8221; but often you do want somebody to reply.  So you need to detect the fact that nobody replies which requires extra monitoring.</li>
<li>Once you&#8217;ve sent out your messages you cannot simply recall them.  Cancelling an operation becomes tricky.</li>
<li>As soon as you have some shared state you have to worry about race conditions and deadlock.  Something you cannot really avoid without using a distributed transaction manager like <a href="http://zookeeper.apache.org/">zookeeper</a>.</li>
<li>The RabbitMQ broker and, to a lesser degree, redis are still central points of failure.  Both have high availability features with failover and persistence but its not as clean and robust as using something like <a href="http://www.zeromq.org/">0MQ</a> for example.</li>
<li>Loosely coupled systems are difficult to test since there are many moving parts.  You also have to beware of ending up in a message queue spaghetti.</li>
</ul>
<p>So far none of these are a real problem, it will depend on how the project evolves to see if that changes.  In any case I have taken care to abstract the interactions with Redis and RabbitMQ in order to make any transition or change not too painful.</p>
<h2>Clients</h2>
<p>Almost all the interaction with the system is through the Controller component.  All it requires is a protobuf Query message, which is a simple message representing a system query.  Among other things it contains: inputs (constraints) to set, aircraft configuration to use, required fidelity level (quick answer now, or accurate answer later) and some other options.  You can then have different client libraries that interface with the controller, as long as they can produce a protobuf Query message and send it to an AMQP broker.</p>
<p>So far I have implemented three clients: a Matlab client (using the java API),</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/matlab-client.png"><img class="aligncenter size-medium wp-image-315" title="matlab-client" src="http://elazungu.files.wordpress.com/2011/12/matlab-client.png?w=300&#038;h=232" alt="" width="300" height="232" /></a></p>
<p>an Excel client (using the C# API),</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/excelui.png"><img class="aligncenter size-medium wp-image-314" title="excelui" src="http://elazungu.files.wordpress.com/2011/12/excelui.png?w=300&#038;h=131" alt="" width="300" height="131" /></a></p>
<p>and a web client (using the native python API) built with <a href="https://www.djangoproject.com/">Django</a>, <a href="http://jquery.com/">jQuery</a>, <a href="http://knockoutjs.com/">Kockout.js</a>, and <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>.  More about my experiences with this in a next blog post.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/webui1.png"><img class="alignnone size-thumbnail wp-image-316" title="webui1" src="http://elazungu.files.wordpress.com/2011/12/webui1.png?w=150&#038;h=97" alt="" width="150" height="97" /></a><a href="http://elazungu.files.wordpress.com/2011/12/webui2.png"><img class="alignnone size-thumbnail wp-image-316" title="webui2" src="http://elazungu.files.wordpress.com/2011/12/webui2.png?w=150&#038;h=97" alt="" width="150" height="97" /></a><a href="http://elazungu.files.wordpress.com/2011/12/webui3.png"><img class="alignnone size-thumbnail wp-image-316" title="webui3" src="http://elazungu.files.wordpress.com/2011/12/webui3.png?w=150&#038;h=97" alt="" width="150" height="97" /></a></p>
<p>The Excel client is deprecated at the moment, though, as there seems to be little or no need for it.  It is quite cool to use though.  Simply drag down a formula with your mouse and kick of 100&#8242;s of number crunching jobs without even noticing.  The python interface is great for testing and scripting, while the web interface is easy to use for non techy people and for proving the concept.  The Matlab interface is great if you want to get all nitty gritty with parameter sweeps, response surface modeling and and optimization.  A topic that <a href="http://sumo.intec.ugent.be/files/2010_04_PhD_DirkGorissen.pdf">I devoted 4 years of my life</a> to previously.</p>
<h2>Where the code hits the runway</h2>
<p>So you now have this design system which allows you to explore the impact of various design decisions in a quick and intuitive manner.  By iterating through the system you can gradually pin down the UAV you want to build.  Then of course you actually have to build it.</p>
<p>Here we also try to stay agile by leveraging rapid manufacturing technologies such as <a href="http://en.wikipedia.org/wiki/3D_printing">3D printing</a> as much as possible.  Additive manufacturing has the great advantage that you can prototype things really quickly and you can have a lot of complexity in the design, essentially for free.  This is great for a designer since it gives him more freedom in designing complex CAD parts without having to worry too much about if it can be made.</p>
<p>The extreme case here is to build the whole airframe with rapid manufacturing.  This is what we did with our <a title="SULSA in the New Scientist – Printed UAVs" href="http://elazungu.wordpress.com/2011/07/28/decode-in-the-new-scientist-printed-uavs/">SULSA aircraft</a>, with which we gained <a title="SULSA publicity" href="http://elazungu.wordpress.com/2011/08/03/sulsa-publicity/">quite a lot of publicity</a> as we were the first in the world to do it and fly successfully.</p>
<span style="text-align:center; display: block;"><a href="http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/"><img src="http://img.youtube.com/vi/AJm_QlhT2mk/2.jpg" alt="" /></a></span>
<p>But its important to not get carried away.  Additive manufacturing is great but you have to be aware of the limits of the technique and the materials used.  Traditional materials such as aluminium, carbon, etc. still have their place.</p>
<p>From the point of view of the system, the ultimate goal here is to have a button on the web page like this:</p>
<p style="text-align:center;"><a href="http://elazungu.files.wordpress.com/2011/12/red-button.png"><img class="aligncenter  wp-image-330" title="red-button" src="http://elazungu.files.wordpress.com/2011/12/red-button.png?w=134&#038;h=131" alt="" width="134" height="131" /></a></p>
<p>And thats it, no more interaction needed, go straight from design to flying in the space of a couple of days.</p>
<p>Unfortunately, though that vision is not 100% possible (yet).  The main problem is that this requires a fully parametric CAD model.  This is something we are actively doing (maybe I will give a sneak peek in a future blog post) but unfortunately not everything can be parametrized.  Well you can try but either the tool breaks or you break from all the complexity.  The thing is that designing a CAD model that can be manufactured requires a very large amount of detail, for example: servo mounts and screw holes.  And this detailing will always require manual intervention.</p>
<p>However, that being said, you still are able to get a much shorter turnaround time than you would do traditionally, not too mention the savings in cost.</p>
<h2>Current status</h2>
<p>The obvious question now is, I want to try this out, where&#8217;s the github repo? Well, the current answer is that you&#8217;d have to be on the campus network to be able to use the system, and even then, you would have to ask me nicely <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   As I said at the beginning of this post, the system has just reached beta state.  Everything seems to work and we are starting to get useful and sensible results.  My main concern now is doing a proper deployment.  Currently I have most components running on my own machine with some of the more expensive ones automatically being farmed out over our 8000+ core Linux cluster (using ssh &amp; <a href="http://www.adaptivecomputing.com/products/torque.php">Torque</a>).</p>
<p>With <a href="http://en.wikipedia.org/wiki/Cloud_computing">cloud computing</a> being all cool these days I now want to setup an automated VM generation workflow using <a href="http://vagrantup.com/">Vagrant</a> and <a href="http://puppetlabs.com/">Puppet</a>. The goal being that I simply run a script and it will generate a nice clean VM, containing all the components &amp; which I can then easily deploy to one or more of our own servers or a public cloud.  Using something like <a href="http://supervisord.org/">supervisor</a> or, more likely <a href="http://saltstack.org/">Salt</a>, I can then remotely administer these instances, starting and stopping components when needed.</p>
<p>Such a deployment process will come in useful when more people, including students, will start using the system and break it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The plan is also to gradually open the system to the public, i.e., you, but that is still a couple of months away probably.  As for the system code itself, I hope that it may some day be open sourced and made publicly available.  But that will depend on how things evolve.</p>
<h2>Open issues</h2>
<p>The main open issue, especially when we come to public use, is related to security.  What I really need is an end-2-end single sign on system, across all components and all clients.  This is something I really need to think about.  Suggestions welcome <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Other open issues:</p>
<ul>
<li>Think about handling result files.  A CFD run easily generates a few GB of data, serving this through flask for multiple users  does not seem like a good idea <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Do I want to make the controller more intelligent (e.g., to handle sweeps or optimization&#8217;s) or do I keep that intelligence in the client.  Both have pro&#8217;s and cons.</li>
<li>Add support for sessions so you can have multiple clients active at the same time for the same user.</li>
<li>Think about how to deal with having different versions of components running at  the same time.  How and when to (dis)allow this.</li>
<li>Evolve the web client into a more powerful design exploration tool.  Initially we were going to use a third party tool for this but the company went bust.</li>
<li>Add support for automatically integrating flight test data recorded by the autopilot as a special type of &#8220;analysis code&#8221;</li>
<li>Possibly get involved in the parametric CAD side of things.</li>
</ul>
<h2>Future work</h2>
<p>The longer term vision is to explore different MDO paradigms, and extend this to more types of missions, and configurations, possibly including rotary aircraft such as <a href="http://en.wikipedia.org/wiki/Quadrotor">quadrocopters</a>.  However, these kind of things will require a brand new concept design tool and that is still a long way away.  In February we will know if we get EU funding to be involved in the <a href="http://www.2seastrade.eu/">2 Seas</a> project. If so, that will drive my activities as well.</p>
<p>Phew&#8230; while I haven&#8217;t been able to cover everything, this has become quite a lengthy post but should give a good overview of what has been going on.  Please <a href="https://twitter.com/#!/elazungu">follow me on Twitter</a> if you would like to keep up to date.</p>
<p>I would be very interested in any suggestions, comments, constructive criticisms, etc. So dont hold back <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;Dirk</p>
<div></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=275&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/12/08/click-here-to-design-and-build-your-uav/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/concept-2-crash.jpg?w=300" medium="image">
			<media:title type="html">concept-2-crash</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/uav4.jpeg?w=150" medium="image">
			<media:title type="html">uav4</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/uav1.jpeg?w=150" medium="image">
			<media:title type="html">uav1</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/uav3.jpeg?w=150" medium="image">
			<media:title type="html">uav3</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/uav2.jpeg?w=150" medium="image">
			<media:title type="html">uav2</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/decisions.png?w=300" medium="image">
			<media:title type="html">decisions</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/mdo.png?w=300" medium="image">
			<media:title type="html">mdo</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/opsim.png?w=300" medium="image">
			<media:title type="html">opsim</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/blocks.png?w=300" medium="image">
			<media:title type="html">blocks</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/layers.png?w=300" medium="image">
			<media:title type="html">layers</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/decode-deploy.jpg?w=300" medium="image">
			<media:title type="html">decode-deploy</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/matlab-client.png?w=300" medium="image">
			<media:title type="html">matlab-client</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/excelui.png?w=300" medium="image">
			<media:title type="html">excelui</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/webui1.png?w=150" medium="image">
			<media:title type="html">webui1</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/webui2.png?w=150" medium="image">
			<media:title type="html">webui2</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/webui3.png?w=150" medium="image">
			<media:title type="html">webui3</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/red-button.png" medium="image">
			<media:title type="html">red-button</media:title>
		</media:content>
	</item>
		<item>
		<title>RHOK 2011 in Oxford &#8211; NGO Clarity</title>
		<link>http://elazungu.wordpress.com/2011/12/06/rhok-2011-in-oxford-ngo-clarity/</link>
		<comments>http://elazungu.wordpress.com/2011/12/06/rhok-2011-in-oxford-ngo-clarity/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:03:25 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[hackathon]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[ngo]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rhok]]></category>
		<category><![CDATA[techsoup]]></category>
		<category><![CDATA[transparency]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=293</guid>
		<description><![CDATA[The past weekend I attended my second Random Hacks of Kindness event in the space of a few months.  I went to the Oxford event which was kindly organized by Oxfam and White October.  My initial plan was actually to &#8230; <a href="http://elazungu.wordpress.com/2011/12/06/rhok-2011-in-oxford-ngo-clarity/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=293&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="padding-left:20px;" src="http://t0.gstatic.com/images?q=tbn:ANd9GcQHs0Mal_IrGZ6zHsUjC5t8E5Juhe7cbVkehE4HilIXV6JhEzWP8A" alt="" width="239" height="76" /> The past weekend I attended my second <a href="http://www.rhok.org">Random Hacks of Kindness</a> event in the space of a few months.  I went to the Oxford event which was kindly organized by <a href="http://www.oxfam.org.uk/">Oxfam</a> and <a href="http://www.whiteoctober.co.uk/">White October</a>.  My initial plan was actually to go to the Belgium event which was organized in my old home town of Antwerp.  But my travel plans ended up being changed so Oxford it was.</p>
<p>The organization was the same as other hackathons I had been to: organizers welcome everybody, idea owners pitch their ideas, chaos, teams are formed.  I quickly settled on the <a href="http://wiki.rhok.org/RHoK_4.0_-_Oxford/Projects/NGO_Clarity">NGO Clarity</a> idea by <a href="http://www.techsoupglobal.org/">TechSoup Global</a> Data Acquisitions Manager <a href="https://twitter.com/#!/dinovenk">Dinesh Venkateswaran</a>. With the drive to increasing transparency in the aid sector, there is a lot of data made available on NGOs.  The problem is that the format and quality of the available data varies wildly between and within countries.  Standardization efforts like <a href="http://www.aidtransparency.net/">IATI</a> are trying to change this, but there is still a long way to go.</p>
<p>The goal of the NGO Clarity problem was to setup a system that would analyse the available data on a particular NGO and, depending on a set of rules, output a number of scores indicative of the quality of the provided data (<em>not</em>of the quality of the NGO itself). Such a system would allow a donor or organization like TechSoup quickly evaluate how much effort would be needed to evaluate an NGO.  Are there just a few small details missing or are there large gaping holes/inconsistencies in the data?  Solving this involved a three step process:</p>
<ol>
<li><strong>Data Aquisition:</strong> Dinesh had about 40000 records on Indian NGO&#8217;s with him that needed to be loaded and pre-processed</li>
<li><strong>Inference:</strong> using heuristics, predefined rules &amp; machine learning to assign scores to each NGO</li>
<li><strong>Presentation:</strong> presenting the results in an intuitive manner in the form of a website</li>
</ol>
<p>While we could not solve every step in detail, my hope was to at least setup an end to end proof of principle.</p>
<p>Our initial team consisted of 4 people, including Dinesh, but unfortunately one soon left to join another project.  After some discussion it was decided that all three steps would be implemented using <a href="http://en.wikipedia.org/wiki/XQuery">XPath/XQuery</a> &amp; the XML <a href="http://exist.sourceforge.net/">eXist</a> database.  Since this was the particular specialty of 3rd team member Chris Wallace.  By the first show and tell we had a prototype working, but unfortunately Chris had to leave by then and would not return the next day.  Two others (Russel and Tim) were then kind enough to join me to continue the work.</p>
<p>However, the problem was that none of us was particularly familiar with XQuery.  I setup the eXist database &amp; managed to run Chris&#8217; scripts but we were pretty much stuck trying to extend it in some meaningful manner.  Russel then gave up and left, &amp; Tim had another project to attend to, so it was essentially just me to continue.  After some more poking at the code I also decided to give up as well. Progress was just too slow and as nobody else at the event had any knowledge of XQuery or was willing to help pick it apart I would never get it finished.</p>
<p>Thus, on the train home I decided to start from scratch.  Since I&#8217;ve been doing a lot of python lately it was natural to use that.  Though if I were to start this from scratch as a hobby project I would have used <a href="http://rubyonrails.org/">Rails</a> or <a href="http://www.playframework.org/">Play</a>, just to get to know those as well. Anyways, I used Django on the backend and jQuery/Bootstrap on the frontend.  About 2 hours later, just when my train arrived I was at feature parity with the xquery stuff. Some more furious hacking the next morning, <a href="https://twitter.com/#!/benjaminbenben">Ben Foxall</a> helping out with the templates, and about 10 seconds before the presentation was due to start I pushed the <a href="https://github.com/dgorissen/ngoq">demo code to github</a>.  I tried to get a map view to work as wel (geocoding the NGO addresses &amp; plotting them using Google Maps) but couldn&#8217;t quite get it to work in time).</p>
<p>Our final presentaion, excellently prepared by Dinesh is up on slideshare:</p>
<div id="__ss_10483529" style="width:425px;"><strong><a title="Ngo Clarity" href="http://www.slideshare.net/dgorissen/ngo-clarity" target="_blank">Ngo Clarity</a></strong><iframe src='http://www.slideshare.net/slideshow/embed_code/10483529' width='425' height='348' scrolling='no'></iframe></p>
<div style="padding:5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/dgorissen" target="_blank">dgorissen</a></div>
</div>
<p>In sum, it was another great learning experience.  In good hackathon tradition the code is rather hairy so I plan to take some time to clean things up &amp; hopefully improve the rules &amp; structure.  I think its a great idea so I would like to continue working on it as there is much that still needs to be done (see slides).  Unfortunately time is in short supply these days, but let see how it goes&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=293&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/12/06/rhok-2011-in-oxford-ngo-clarity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://t0.gstatic.com/images?q=tbn:ANd9GcQHs0Mal_IrGZ6zHsUjC5t8E5Juhe7cbVkehE4HilIXV6JhEzWP8A" medium="image" />
	</item>
		<item>
		<title>Solving Boggle with Python</title>
		<link>http://elazungu.wordpress.com/2011/12/02/solving-boggle-with-python/</link>
		<comments>http://elazungu.wordpress.com/2011/12/02/solving-boggle-with-python/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 14:58:36 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=279</guid>
		<description><![CDATA[I attended my first Python Dojo in London last night and have to say it was great fun.  As I&#8217;ve said before these kinds of events are great to get to know people and learn something new. The challenge settled &#8230; <a href="http://elazungu.wordpress.com/2011/12/02/solving-boggle-with-python/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=279&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I attended my first Python Dojo in London last night and have to say it was great fun.  As I&#8217;ve said before these kinds of events are great to get to know people and learn something new.</p>
<p>The challenge settled on for last night was to solve a <a href="http://en.wikipedia.org/wiki/Boggle">Boggle</a> puzzle. For those not familiar with the game, the idea is that you get an n-by-n grid of letters and you have to form as many words as you can by &#8216;snaking&#8217; through the grid.  Every grid cell may only be used once for a word.  For example, this is how you would form the word MURALS, starting from M:</p>
<p><a href="http://elazungu.files.wordpress.com/2011/12/boggle2.png"><img class="aligncenter size-medium wp-image-280" title="Boggle2" src="http://elazungu.files.wordpress.com/2011/12/boggle2.png?w=296&#038;h=300" alt="" width="296" height="300" /></a></p>
<p>Everybody got about an hour to hack on a solution after which each team presented their code to the rest.  It was interesting to see the diversity of style and solution. There was a team that used 5 or 6 classes in their solution with extra facilities for caching, ours was more straightforward &amp; procedural, while another did the proper thing and used a <a href="http://en.wikipedia.org/wiki/Trie">Trie</a>.</p>
<p>Since our code did not quite work yet I finished it on the train home and then took some time this morning to clean it up.  For kicks I also used python&#8217;s multiprocessing module to have a version that would solve large grids in paralllel.</p>
<p>I pushed the <a href="https://github.com/dgorissen/bogglepy">code to github</a> and, while nothing fancy or super optimized, it should do the job.  As always, patches &amp; improvements are welcome <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Props to <a href="https://twitter.com/#!/ntoll">@ntoll</a> and <a href="https://twitter.com/#!/tjguk">@tjguk</a> for organizing the event and hopefully I can make the next one as well.</p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=279&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/12/02/solving-boggle-with-python/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/12/boggle2.png?w=296" medium="image">
			<media:title type="html">Boggle2</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery confirmation dialog with bootstrap</title>
		<link>http://elazungu.wordpress.com/2011/11/03/jquery-confirmation-dialog-with-bootstrap/</link>
		<comments>http://elazungu.wordpress.com/2011/11/03/jquery-confirmation-dialog-with-bootstrap/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 13:18:12 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=272</guid>
		<description><![CDATA[Ive been using Twitters Bootstrap for putting together a web UI for our UAV design system (that will be partially opened up to the general public at some point).  jQuery also plays a role in this and at some point &#8230; <a href="http://elazungu.wordpress.com/2011/11/03/jquery-confirmation-dialog-with-bootstrap/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=272&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ive been using Twitters <a href="http://twitter.github.com/bootstrap">Bootstrap</a> for putting together a web UI for our UAV design system (that will be partially opened up to the general public at some point).  jQuery also plays a role in this and at some point I needed an easy confirmation dialog.  I could easily have used <a href="http://jqueryui.com/">jQueryUI</a> as I have in the past, but <a href="http://damien.antipa.at/2011/10/jquery-plugin-confirmation/">I found this great plugin</a> by Damian Antipa that does exactly what I needed &amp; uses just jQuery and Bootstrap.</p>
<p style="text-align:center;"><a href="http://damien.antipa.at/2011/10/jquery-plugin-confirmation/"><img class="aligncenter" src="http://damien.antipa.at/wp-content/uploads/2011/10/jquery.popover.dialog-300x123.png" alt="" width="300" height="123" /></a></p>
<p>The only thing I needed to change was that I wanted the confirmation dialog (on ok) to trigger the original click() handle instead of redirecting to a different URL.  My basic patch is:</p>
<pre>@@ -52,6 +52,17 @@
                                var o = options;
                                var $elem = $(this)

+                               //is there an existing click handler registered
+                               if ($elem.data('events') &amp;&amp; $elem.data('events').click) {
+                                       //save the handler (TODO: assumes only one)
+                                       var targetClickFun = $elem.data('events').click[0].handler;
+                                       //unbind it to prevent it firing
+                                       $elem.unbind('click');
+                               }else{
+                                       //assume there is a href attribute to redirect to
+                                       var targetClickFun = function() {window.location.href = $elem.attr('href');};
+                               }
+
                                $elem.bind('click', function(e) {
                                        e.preventDefault();
                                        if(!$('#confirm-dialog').length) {
@@ -89,7 +100,8 @@
                                                $dialog.find('p.message').html(o.message);

                                                $dialog.find('a.btn:eq(0)').text($elem.text()).bind('click', function(e) {
-                                                       window.location.href = $elem.attr('href');
+                                                       $dialog.remove();
+                                                       targetClickFun();
                                                });

                                                $dialog.find('a.btn:eq(1)').text(o.cancelButton).bind('click', function(e) {</pre>
<p>Cleaner would be to add some options and what have you.  And maybe I will come to that.  For now I put the full code in a public <a href="https://gist.github.com/1336443">gist on github</a>.  So fork ahead <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=272&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/11/03/jquery-confirmation-dialog-with-bootstrap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://damien.antipa.at/wp-content/uploads/2011/10/jquery.popover.dialog-300x123.png" medium="image" />
	</item>
		<item>
		<title>Pycel as an Excel Addin</title>
		<link>http://elazungu.wordpress.com/2011/10/25/pycel-as-an-excel-addin/</link>
		<comments>http://elazungu.wordpress.com/2011/10/25/pycel-as-an-excel-addin/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 09:56:07 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[pycel]]></category>
		<category><![CDATA[addin]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=267</guid>
		<description><![CDATA[Thanks to the easy to use library PyXLL, I wrote a simple addin that integrates pycel into Excel. Code on github.  The real goal here is to replace the Excel solver plugin with a plugin based on pycel and openopt. &#8230; <a href="http://elazungu.wordpress.com/2011/10/25/pycel-as-an-excel-addin/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=267&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to the easy to use library <a href="http://www.pyxll.com">PyXLL</a>, I wrote a simple addin that integrates pycel into Excel.</p>
<p><a href="http://elazungu.files.wordpress.com/2011/10/pyceladdin.png"><img class="aligncenter size-medium wp-image-268" title="pyceladdin" src="http://elazungu.files.wordpress.com/2011/10/pyceladdin.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>Code <a href="https://github.com/dgorissen/pycel">on github</a>.  The real goal here is to replace the Excel solver plugin with a plugin based on pycel and openopt.  I have this working but its too specific to our own spreadsheet structure to release.</p>
<p>&#8211;Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=267&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/10/25/pycel-as-an-excel-addin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/10/pyceladdin.png?w=300" medium="image">
			<media:title type="html">pyceladdin</media:title>
		</media:content>
	</item>
		<item>
		<title>RHOK Water Hackathon &#8211; Team Tarifa Won!</title>
		<link>http://elazungu.wordpress.com/2011/10/25/rhok-water-hackathon-team-tarifa-won/</link>
		<comments>http://elazungu.wordpress.com/2011/10/25/rhok-water-hackathon-team-tarifa-won/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 08:17:25 +0000</pubDate>
		<dc:creator>dgorissen</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rhok]]></category>
		<category><![CDATA[ushahidi]]></category>
		<category><![CDATA[waterhack]]></category>

		<guid isPermaLink="false">http://elazungu.wordpress.com/?p=258</guid>
		<description><![CDATA[The past weekend I finally got the chance to attend one of the RHOK hackathon events. These events concentrate on using technology to solve humanitarian problems such as those related to draught, overpopulation, earthquakes, etc.  The current hackathon was the &#8230; <a href="http://elazungu.wordpress.com/2011/10/25/rhok-water-hackathon-team-tarifa-won/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=258&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="border-color:initial;border-style:initial;border-width:0;" src="http://www.rhok.org/sites/default/files/styles/large/public/logo_screen_1.jpg" alt="" width="291" height="111" />The past weekend I finally got the chance to attend one of the <a href="http://www.rhok.org/">RHOK</a> hackathon events. These events concentrate on using technology to solve humanitarian problems such as those related to draught, overpopulation, earthquakes, etc.  The current hackathon was the first to concentrate <a href="http://www.rhok.org/event/water-hackathon-2011">solely on water and sanitation</a> related problems.  Held in 9 cities across the world, I attended the London event, organized by fellow compatriate <a href="http://www.youtube.com/watch?v=aDzwPjDr6uA">Julian Harou</a>.</p>
<p>I was one of the first to arrive, and although there weren&#8217;t too many people we quickly had a good mix of water and tech people.  The event started with pizza and calling in to various countries around the globe so the problem submitters could briefly describe the motivation behind their problem statement.  There were quite a few problems, some with curious names such as &#8220;Map the crap&#8221;.  Initially my interest went out to a problem that involved writing a Google Earth plugin that would enable water management people &amp; researchers to quickly and automatically identify catchment areas for a given location.  A challenging algorithmic problem I figured.  Unfortunately I was one of the few (or only?) person interested in the problem &amp; the problem submitter was not physically available.  So progress would have been difficult &amp; slow.</p>
<p><img class="alignright size-medium wp-image-259" style="border-color:initial;border-style:initial;border-width:0;" title="ushu" src="http://elazungu.files.wordpress.com/2011/10/ushu.jpeg?w=300&#038;h=80" alt="" width="300" height="80" />Instead I decided to join fellow attendee and problem owner <a href="http://markiliffe.co.uk/">Mark Iliffe</a>.  Mark had just started working at the World Bank and his problem revolved around extending the <a href="http://www.ushahidi.com/">Ushahidi</a> platform to improve the reporting and feedback process of complaints.  If you have never heard of Ushahidi, dont worry, neither had I.  Turned out is quite a useful and <a href="http://en.wikipedia.org/wiki/Ushahidi">successful</a> <a href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> system that allows users to file reports about problems in their area (broken pipes, blocked public toilets, etc.).</p>
<p>From the start it was great to see how enthusiastic Mark was about his team (about 4 of us).  Quickly we were sketching out use case diagrams, sequence diagrams, flow charts, TODO lists, etc.  I think we pretty much filled up all the white boards available.  We were only about 20 minutes into this and our progress was already caught on the <a href="http://www.akvo.org/blog/?p=3723">akvo.org blog</a> by <a href="http://twitter.com/#!/charmermark">Mark Charmer</a>.  Great stuff.</p>
<p>As people were working stuff out Mark would bring on beer, biscuits, wine, and gently coerce other hackers in joining us (at peak we had about 12 people!).  Star of the team was probably Caz.  Ushahidi is written in php and my php foo is &#8230; well &#8230; not stellar <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   But no worries for Caz who did a great job of coding stuff up.  The hardest part about the whole exercise was understanding the code structure (Ushadhidi uses a custom framework based on <a href="http://codeigniter.com/">Codeigniter</a> and <a href="http://kohanaframework.org/">Kohana</a>).  I helped around with various bits and pieces and added support for geocoding sms messages by using a custom location code (Tanzania lacks an official postcode system).  We worked right up to the deadline, with our tweaked Android application only finally working during our presentation (props to Gitmeister Florian!).</p>
<p>Anyways, long story short.  We won <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   The other teams had some good stuff too but I think we had the edge with Marks mad selling skills and a very clear route to sustainability.  So what did we win?  Not quite sure yet.  Some gadgets from Google and a teleconference with some IBM guys next week.  Lets see what happens.  After a great social gathering at the local pub it was time to head home.</p>
<p>As I undertook the 2 hour journey back to Southampton it struck me again how important these kinds of events are.  First of all for meeting new and interesting people, secondly for learning new stuff and learning to get something together quickly.  I still have a long way to go but thats a great excuse for attending a next event <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://elazungu.files.wordpress.com/2011/10/waterhackathon-london.jpg"><img class="aligncenter size-medium wp-image-264" title="waterhackathon-london" src="http://elazungu.files.wordpress.com/2011/10/waterhackathon-london.jpg?w=225&#038;h=300" alt="" width="225" height="300" /></a></p>
<p><a href="http://www.flickr.com/photos/charmermrk/sets/72157627945357944/with/6269951027/">More pictures here.</a></p>
<p>-Dirk</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/elazungu.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/elazungu.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/elazungu.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=elazungu.wordpress.com&amp;blog=11080599&amp;post=258&amp;subd=elazungu&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://elazungu.wordpress.com/2011/10/25/rhok-water-hackathon-team-tarifa-won/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f02418c7a4a81ef302460438824f609?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dgorissen</media:title>
		</media:content>

		<media:content url="http://www.rhok.org/sites/default/files/styles/large/public/logo_screen_1.jpg" medium="image" />

		<media:content url="http://elazungu.files.wordpress.com/2011/10/ushu.jpeg?w=300" medium="image">
			<media:title type="html">ushu</media:title>
		</media:content>

		<media:content url="http://elazungu.files.wordpress.com/2011/10/waterhackathon-london.jpg?w=225" medium="image">
			<media:title type="html">waterhackathon-london</media:title>
		</media:content>
	</item>
	</channel>
</rss>
