tag:blogger.com,1999:blog-144887402024-03-07T15:16:53.247-08:00Musings from OxfordNick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.comBlogger39125tag:blogger.com,1999:blog-14488740.post-25684276442125958942010-12-23T08:02:00.001-08:002010-12-23T08:21:46.447-08:00Getting JSR 308 Type Annotations Compiler working under Maven<div>Carrying on with the JSR 308 Type Annotations compiler, the <a href="http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#maven-plugin">instructions are out of date for Maven</a> too.</div><div>I finally got it working after a fashion. I think the plugin is irredeemably about of date without editing it and recompiling. Hopefully this will get done at some point in the future, but until then I got it working by making the following changes.</div><div>Firstly, the groupId has changed to <b>types.checkers</b> in the repository, so the dependencies should be:</div><br /><pre><br /><dependency><br /> <groupid>types.checkers</groupid><br /> <artifactid>checkers-quals</artifactid><br /> <version>1.1.1</version><br /></dependency><br /></pre>Next as the plugin is broken you need to put an explicit link to the jsr308-all.jar location (which isn't very maven-like, but works).<div><br /><pre><br /> <build><br /> <plugins><br /> <plugin><br /> <groupid>org.apache.maven.plugins</groupid><br /> <artifactid>maven-compiler-plugin</artifactid><br /> <version>2.3.2</version><br /> <configuration><br /> <source>1.6</source><br /> <target>1.6</target><br /> <fork>true</fork><br /> <executable>C:\Program Files\Java\jdk1.7.0\bin\javac.exe</executable><br /> <compilerargument>-Xbootclasspath/p:C:\Projects\units\checker-framework\checkers\binary\jsr308-all.jar</compilerargument><br /> <compilerarguments><br /> <processor>checkers.nullness.NullnessChecker</processor><br /> </compilerarguments><br /> </configuration><br /> </plugin><br /> </plugins><br /> </build><br /></pre><br /></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com2tag:blogger.com,1999:blog-14488740.post-6254817665422853012010-12-23T03:37:00.000-08:002010-12-23T04:02:14.722-08:00JSR308 Type Annotations Compiler working in IntelliJ IDEA 10I struggled to get IntelliJ IDEA 10 working with JSR-308 type annotations. The<a href="http://blogs.jetbrains.com/idea/2009/07/type-annotations-jsr-308-support/#comment-157470"> instructions at Jetbrains</a> and at <a href="http://types.cs.washington.edu/checker-framework/current/README-jsr308.html">the JSR site</a> were both out of date. I've reported the problem to Jetbrains (as a comment on that post) and <a href="http://code.google.com/p/jsr308-langtools/issues/detail?id=25">to the JSR 308 team</a> but while they work on it here is a workaround I've found.<div><br /></div><div>By the way, if Java 8 is out, that will include type annotations and this post will be obselete.</div><div><br /></div><div>The alternation proceeds in two stages - first modifying the compiler, and secondly enabling the annotations processor you are going to use.<br /><div><br /></div><div><h2>Modifying the compiler</h2></div><div><ol><li>Download the checkers framework as described in <a href="http://types.cs.washington.edu/checker-framework/#example-use">step 1 of the installation here</a>.</li><li>Unzip it. For the sake of this post I'll assume you are on Windows and you unzipped it to c:/checker-framework</li><li>Install an OpenJDK 7 that you are willing to alter for type annotations.<a href="http://dlc.sun.com.edgesuite.net/jdk7/binaries/index.html"> Download from here.</a> I'll assume you install it to C:\Program Files\Java\jdk1.7.0</li><li>In C:\Program Files\Java\jdk1.7.0\lib\ rename tools.jar to oldtools.jar (so you have it around in case you want to use it again).</li><li>Copy C:\checker-framework\checkers\binary\jsr308-all.jar to C:\Program Files\Java\jdk1.7.0\lib\tools.jar</li></ol><div><h2>Enabling the Annotations Processor</h2></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" >In this case we are going to enable to nullness annotations processor, from the checkers framework. If you write your own, replace the jsr308-all.jar with your own processor.</span></div><ol><li>Open your IntelliJ project you want to use Annotations.</li><li>Go to <b>Project Structure</b>, Project, and select the JDK 7 you just installed.</li><li>Set language level to 8.</li><li>Go to Libraries and add the jsr308-all.jar (from C:\checker-framework\checkers\binary)</li><li>Go to <b>Project Settings</b>, Annotation Processors and tick Enable annotation processing</li><li>Under Annotation Processors click Add, and add checkers.nullness.NullnessChecker</li></ol><div>That should be it! Try compiling the following code, you should get "Error: (5, 31) incompatible types".</div></div></div><div><br /><code><br /><pre><br />import checkers.nullness.quals.*;<br /><br />public class GetStarted {<br /> void sample() {<br /> @NonNull Object ref = null;<br /> }<br />}<br /></pre><br /></code><br /></div><br /><div>It's all a bit complicated, but I'm sure Jetbrains will have it working in a much easier fashion soon - I thoroughly recommend IntelliJ IDEA.</div><div><br /></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-12594458903487060242010-08-28T02:56:00.000-07:002010-08-28T04:00:26.877-07:00Samsung Galaxy S Android Programming with Windows 7 64 bitI managed to get a program written on my computer running on my phone. Which might not sound much, but it was a lot more work than I thought, and I tried a lot of things that didn't work, so I thought I'd record what I did for the benefit of anyone else.<div><br /></div><div><b><span class="Apple-style-span" style="font-size:large;">My Setup</span></b></div><div><ul><li>Phone: Samsung Galaxy S, Android 2.1</li><li>Operating System: Windows 7 64bit</li><li>Development: Eclipse with Android plugin as described here: <a href="http://developer.android.com/guide/developing/eclipse-adt.html">http://developer.android.com/guide/developing/eclipse-adt.html</a></li></ul><div><span class="Apple-style-span" style="font-size:x-large;"><b>My Steps</b></span></div><div><br /></div><div>And now, here are the steps I followed. They might not all be necessary, but they worked. </div><div><br /></div><div><span class="Apple-style-span" style=" ;font-size:large;"><b>Precursors</b></span></div></div><div><ol><li>Get the hello world app working in eclipse in the emulator as described in the link above, before going anywhere near the phone. </li><li>Reboot. This was just because I gave up one evening, and started a few days later but had the side benefit of stopping the adb daemon.</li><li>Get the machine to a clean state. While trying to get this to work, I had tried and failed with quite a lot of methods. These included installing other apps in the hopes of getting drivers, downloading random driver files off the internet and so on. Since I didn't trust the driver state of the computer, I restored to a system restore point when I hadn't done anything with the phone. So now we probably have no samsung drivers.</li></ol></div><div>Now we are going to get the phone nicely connected to PC, pretending we are just a normal user, not worrying about being a developer.</div><div><ol><li>With the phone disconnected from the USB cable, under Settings, Applications, Development, turn OFF USB debugging.</li><li>Under Settings, About Phone, USB Settings, change to "Ask on connection". This will give you some control.</li></ol><div><span class="Apple-style-span" style="font-size:large;"><b>Installing Kies to get drivers</b></span></div><ol><li>Now we want the proper Samsung drivers, and we are going to rely on Samsung Kies to do it. Download Samsung Kies from the Samsung website: <a href="http://www.samsungapps.com/about/onPc.as">http://www.samsungapps.com/about/onPc.as</a>. Install it, and reboot if it requests. Now whenever your phone connects in whatever mode Kies will try and take over.</li><li>Start up Kies manually. Connect your phone, and when it asks you choose mode choose Kies. Windows should install some drivers, then Kies should detect it and show it in the top left corner.</li><li>Eject the phone from Kies, and unplug the cable. </li><li>In the Kies tray menu, turn off Auto-start, and quit Kies.</li></ol><div><span class="Apple-style-span" style="font-size:large;"><b>Install as a USB drive to get drivers</b></span></div><ol><li>Now we want to make sure using the phone as a USB drive works. </li><li>Plug the phone in. Kies shouldn't start. Choose "Mass storage" on the phone. Windows should install some more drivers. It won't show yet as a working drive. </li><li>On the phone you have pull down the notification screen, which should say "USB connected". </li><li>Click on this, and will give you the option to Mount as a drive. Select Mount. </li><li>Check you can copy a file back and forth.</li><li>Eject the USB drives from Windows and disconnect the phone.</li></ol></div><div>Now you should have a nicely working phone like a normal user, and hopefully all the drivers installed you will need. If you can't get here, don't vene bother with the next steps, you've got to get the phone working first. Try uninstalling Kies and reinstalling, or uninstalling any 3rd party software for use with your phone. </div><div><br /></div><div><span class="Apple-style-span" style="font-size:large;"><b>Being a developer</b></span></div><div><br /></div><div>Next we are going reveal our true identity as developers. </div><div><ol><li>IGNORE everything it says at <a href="http://developer.android.com/sdk/win-usb.html">http://developer.android.com/sdk/win-usb.html</a>. Having the package provides drives for a few specific phones. Having it installed won't hurt - I've got it installed, but don't expect it to help. You've got a Samsung Galaxy S, and the package doesn't support this at all.</li><li>On the phone, with it disconnected, under Settings, Applications, Development, turn ON USB debugging.</li><li>Connect the phone. Windows says it is installing device driver software - a good sign. However, on my machine it then says Device driver software was not successfully installed - a bad sign! But DON'T PANIC. </li><li>Go to Control Panel, Devices, Hardward and Sound. The phone should appear as SAMSUNG_Android with a list of all the things it can be. This is good. It appears Windows was lying.</li><li>Now as it says on <a href="http://developer.android.com/guide/developing/device.html#setting-up">http://developer.android.com/guide/developing/device.html#setting-up</a> you can check to see if it is connected with adb.</li><li>Start a command prompt (run cmd.exe from the Start menu). </li><li>Change to wherever you installed the Android SDK, and into the tools directory.</li><li>Run "<span class="Apple-style-span" style="font-family:'courier new';">adb devices</span>" at the command prompt. My machine said:</li></ol></div><code> D:\Program Files\android-sdk-windows\tools>adb devices<br />* daemon not running. starting it now *<br />* daemon started successfully *<br />List of devices attached<br />900012345678 device</code><div><br /></div><div><code></code>Hooray - we are all connected and working. Now just follow the instructions on: <a href="http://developer.android.com/guide/developing/eclipse-adt.html#RunningOnDevice">http://developer.android.com/guide/developing/eclipse-adt.html#RunningOnDevice</a> - just use Run on the eclipse menu and your device should appear, and eclipse will install and run it on your phone. Result!</div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com3tag:blogger.com,1999:blog-14488740.post-55143226284837718902010-02-21T01:22:00.000-08:002010-02-21T01:37:19.935-08:00What sort of questions should I ask on Aardvark?In a curious caseof self-referral, I've now been asked the same question twice on<a href="http://vark.com/"> Aardvark (www.vark.com)</a>. "What sort of questions should I ask on Aardvark?"<div><b>You should ask questions that need a person to answer, that you won't find just googling. For example, things specific to a particular area, or very time-specific (relevant here and now). A personal opinion or a very detailed query that maybe no-one has come up with before is another possibility.</b></div><div>I suspect I've been asked this question a lot is that Google has just taken over Aardvark, so it is in the news. So both journalists and curious new users are trying it out, not knowing what to ask, and so asking meta-questions. Aardvark themselves answer this question on their <a href="http://vark.com/public_faq">public FAQ</a> but possibly they don't phrase it well enough to hit the top of the google results.</div><div>There is a good reason why I say don't answer questions you could google. Doing so would be a bit rude. The person answering the question will then google, find the answer and send it back to you - you've just made them do something you could have done yourself. If someone does this to you and you are frustrated, may I suggest <a href="http://www.lmgtfy.com">www.lmgtfy.com</a> - like <a href="http://www.lmgtfy.com/?q=What+sort+of+questions+should+I+ask+on+Aardvark">this</a>! It's a bit cheeky but in my opinion not too rude, and gets the message across in a gentle and humorous way.</div><div>I've found static web seaches don't work too well for time sensitive searches. For example "What is the highest mega-pixel digital camera?" or "What is the fastest computer?" relies on the page pointed to being updated. If you happen to hit an old article as top result you might not know the answer is out of date.</div><div>Aardvark is also good for opinions, but remember while checking out why you should listen to an opinion on the web is hard, checking the authority of an Aardvark answer is even harder!</div><div><br /></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-17551991564924494682010-02-20T08:18:00.000-08:002010-02-20T13:27:17.165-08:00Partner dancing in Oxford<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">Today a friend emailed me. His friend was interested in learning to to dance in Oxford - or in his words "a beginner's class in Ball room (sic) or something." I've been asked this a few times before, as I used to be a dance teacher.</span></span><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">Now I'm only really a social partner dancer. I haven't entered a competition for ages, and for me dancing means leading a girl around the floor. So if you want to know about street dance, belly dancing or ballet then I'm not really qualified to answer. So here is my answer for him, slightly edited. I hope others find it useful.</span></span></div><div><span class="Apple-style-span" style=" border-collapse: collapse; "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">Cheapest for ballroom is the Oxford University dance sport club (</span></span><a href="http://www.oudancesport.co.uk/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.oudancesport.<wbr>co.uk/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">)</span></span><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">. You don't have to be a member of the University, but most of the classes are in term time, though they do some out of term</span></span><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">. There is also dance rhythms (</span></span><a href="http://www.dancerhythms.com/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.dancerhythms.com/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">) who also teach good lessons</span></span><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">. Ballroom isn't the easiest to learn in my opinion. Neither are very sociable - dancesport tends to have loads of girls over so don't go without a partner if you are a girl, and Dance Rhythms tends to be an older crowd who come as couples. Again, I don't think I'd want to turn up without a partner.</span></span></span></div><div><span class="Apple-style-span" style=" border-collapse: collapse; "><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;"><a href="http://www.oudancesport.co.uk/" target="_blank" style="color: rgb(42, 93, 176); "></a>Easiest partner dance in my opinion to learn is Modern Jive AKA Ceroc, Leroc, MoJive ... There are two local companies: Ceroc Oxford (</span></span><a href="http://www.cerocoxford.com/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.<wbr>cerocoxford.com/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">)</span></span><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;"> and Jive Plus (</span></span><a href="http://www.jiveplus.com/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://<wbr>www.jiveplus.com/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">)</span></span><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">, and both of them give good lessons. Both are a really sociable night out, with a DJ afterward, so I think more fun than traditional ballroom lessons. Music a real mix from 40's to current chart stuff.</span></span></div><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">Salsa - there are loads in Oxford. Again the University society is cheaper and takes non-students: </span></span><a href="http://www.oxfordsalsasociety.co.uk/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.oxfordsalsasociety.co.uk/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">. I've also been to </span></span><a href="http://www.salsaoxford.com/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.salsaoxford.com/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;"><wbr> and they were pretty good too. Salsa is probably a bit harder than jive, but again usually pretty sociable. Music is always very Latin (unsurprisingly).</span></span></div><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">A bit more challenging but probably my favourite dance is swing/lindy hop. Two groups I'd recommend for a sociable night out:</span></span></div><div><a href="http://www.oxfordlindyhoppers.co.uk/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.oxfordlindyhoppers.<wbr>co.uk/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;"> and </span></span><a href="http://www.oxfordswingdance.co.uk/" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.oxfordswingdance.<wbr>co.uk/</span></span></a><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">. Especially good if you already like big band/swing/jazz music, but fun whatever, it dancing got me into the music rather than the oter way round.</span></span></div><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">A newish one on the scene is West Coast Swing. Sexy Dancing style to RnB/chart type music. A lot of fun, and fairly easy, I guess a similar level to Salsa. Friday's in Bicester, which is only about 10 mins drive from Oxford </span></span><a href="http://www.danceswinguk.com/page3.html" target="_blank" style="color: rgb(42, 93, 176); "><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">http://www.<wbr>danceswinguk.com/page3.html</span></span></a></div></span></div><div><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family:arial;">So in summary in terms of difficulty: modern jive easier than salsa, which is about the same as west coast swing, which are both easier than Lindy Hop, which is probably about the same as ballroom. NB, this is difficulty to start to learn, not difficulty to master,</span></span></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-25335656272242947512010-02-17T07:05:00.000-08:002010-02-17T07:42:03.609-08:00What do I think of the Robin Hood tax?<div>A good friend of mine asked "Nick, as the only banker I know, what do you think of the <a href="http://robinhoodtax.org.uk/">Robin Hood Tax</a>? Does it make practical sense, or is it only supported by greenies like me who have no actual concept of how the system works?"</div><div>Well, I guess I have to start any response by saying I'm a very lowly employee at a very big bank. It is easy to find out which one, but I don't speak on behalf of them, or the banking industry as a whole. I'm writing as an individual. I don't want any media reports saying, "investment banker speaks out against Robin Hood tax"!</div><div>I've just been to the Robin Hood tax website, and as explained there the proposal seems to be:</div><div><ul><li> 0.05% tax on all bank transactions that do not involve an individual</li><li>50% of the revenue goes to domestic causes</li><li>50% goes to international eg poverty, climate change etc.</li></ul></div><div>Apparently this will raise £250 billion a year, which assuming a US billion (rather than traditional UK billion) is £250,000,000,000.</div><div>The first thing to say is the use is irrelevant. The way the tax system works is a government raises money, and then chooses what to spend it on. So saying this will raise the money for climate change, or reducing poverty, or anything else specific is silly. You could say it will raise money to pay for benefits, or pay for the military, or pay for ministers cars. The money is just money.</div><div>So there are three separate issues here:</div><div><ol><li> Should the UK government spend £250 billion more?</li><li>Should it raise this money in tax or reduce spending elsewhere, or some combination?</li><li>Is the right tax to introduce this tax on financial transactions?</li></ol></div><div>I don't have much to say on 1 or 2. Clearly there are many good things in the world to spend money on, and the government cannot spend on them all. Just because something is very good does not mean it should be paid for out of taxation. Some things cannot be funded, and some things are best supported by charities or the private sector rather than government. Which things these are is a matter for political debate and people differ on these - there isn't a correct answer.</div><div>However we have recently seen in the news <a href="http://news.bbc.co.uk/1/hi/business/8514767.stm">20 economists write an open letter saying the budget deficit should be reduced, and the right way to do it is to reduce spending rather than increase taxation</a>.</div><div>So back to 3. I just went to look at the <a href="http://www.hm-treasury.gov.uk/bud_bud09_repindex.htm">2009 budget</a> and apparently the total UK income from all sources will be £496 billion (<a href="http://www.hm-treasury.gov.uk/bud_bud09_repindex.htm">Budget 2009</a> page 12). This means that this tax will allegedly raise the same amount as one half of all uk taxation this year - or more than income tax and national insurance put together. On a related note, <a href="http://news.bbc.co.uk/1/hi/business/8517968.stm">Barclays just announced their profits for the year, and they were a record amount - 11.6 billion</a>.</div><div>The reason I quote these sums is that money does not come from nowhere. It doesn't magically appear out of thin air. If you tax me buying a chocolate bar, the tax either comes as extra money I spend, or money the shop does not receive. This money would have to come from the banks, as it is inter-bank transactions. If Barclays made 11.6 billion in profit, then all of their profit, and all the profit of other 23 banks of equal size would all go into paying this tax. This seems an impossible result. So I think amount of money quoted as being raised is completely unbelievable.</div><div>Now I will assume that the promoters of the tax have done their calculations right for the volume of world financial transactions. If this amount of money cannot be raised, then all that can happen is volume of financial transactions is reduced. Now, you might argue this is a good thing - but everyone should be aware that this will be the primary result, reducing the volume of world financial transactions, not raising the huge amounts of money quoted.</div><div>0.05% does not sound like much, but it is a lot. We might trade an instrument called an "Interest Rate Swap" and be aiming to make five basis points on a good trade, and making this much is difficult. Five basis points is five hundredths on one percent. So while 0.05% of a deal might not sound much, this would be our entire profit on the deal. The result would be we would make almost no deals, because it would be almost impossible to make enough to pay the tax.</div><div>Would it hurt the world economy if we stopped making deals? Well, it would certainly hurt the British economy. When Barclays announced it was paying £2.7 billion in bonuses, those bonuses are taxed at 50% by income tax, and a bit more for national insurance. So over half of it is already going in tax. The rest of it presumably is either spent, in case it provides jobs, or is invested, in which case it funds companies by being invested in their shares, which provides money to build more shops or factories, which in turn provides jobs.</div><div>Secondly you have to ask what was the point of the interest rate swap. Typically we might make such a trade because of supply and demand issues for money. Pension funds might want to invest some money for thirty years, so it covers their liabilities, whereas companies might only want to borrow money for 10 years because that is how long they think it will take them to pay back for a new factory they are building. If no-one wants to borrow money for thirty years the pension fund has to accept a low rate of interest. If no-one wants to lend money for 10 years the company has to pay a high rate of interest. By a bank swapping between these products it matches supply to demand, and means the pension fund gets a better rate of return, and the company pays a lower interest rate, which is good for everyone.</div><div>Also notice that if the tax came into effect, if this transaction was done, the bank would have to pass the tax on to the pension fund or the company.</div><div>So what is my conclusion?</div><div>Firstly, I don't think I am wise enough to comment on this question as to what the government should spend our money on, or whether they should raise money through taxes or reduce spending.</div><div>Secondly, numbers being talked about for the amount of revenue raised are ridiculous, and just will not happen.</div><div>Thirdly the primary effect of this tax will not be to raise the amounts of money talked about, it will be a huge reduction in the volume of financial transactions. This may or may not be a good result, but no-one proposing the tax is talking about this.</div><div>So I think the intended consequences of the tax will not happen, and the unintended consequences could be huge and harmful, and clearly have not been thought about properly by the people proposing it.</div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-43414378769961037602009-06-24T03:39:00.000-07:002009-06-24T04:36:17.862-07:00A coincidence?<div>This is the timeline leading to a result which shocked and delighted me. See what you make of it.</div><div><br /></div>October 28, 2008: Picture it. 6 months ago. <a href="http://www.buzzardblog.com/2008/10/28/year-of-the-bible/">October 28, 2008. Justin Buzzard, a pastor in San Francisco posts on his Blog about a plan for reading through the Bible in a year</a>. In Oxford, England, I was changing what I was doing in my personal bible reading at the time and decide to follow his plan, which gives certain readings for each day, and if you miss a day, you just skip them, you don't "catch up". I can't remember why I was even reading his blog.<div><br /></div><div>December 14, 2008: I start going out with a lovely girl called Cat. Now I should explain something to those of my friends who aren't Christian. If a Christian starts "going out" it should always mean they are coonsidering marriage - it is a time to get to know each other better, and considering if marriage is right.</div><div><br /></div><div>May 13, 2009: Justin Taylor, another American blogger posts about a book called <a href="http://theologica.blogspot.com/2009/05/praying-for-your-wife.html">"The Water of the Word" about praying for your wife (even if you don't have one).</a> I think it looks interesting so order a copy, but it is only available from Amazon in the US, so order it (and forget about it - shipping takes a long time).</div><div><br /></div><div>June 24th 2009 10.00: I start working on my to do list for the day. I'm expecting a courier delivery, and the buzzer to my flat is broken, so I leave a note on my letter box asking the courier to call my phone if he gets no response from the buzzer.</div><div><br /></div><div>June 24th 2009 11.00: The aforementioned lovely Cat sends me a txt message asking how my quiet time is going. Again, let me explain the jargon. It is common for Christians to spend some time each day on their own reading the Bible, and praying, in response to <a href="http://www.biblegateway.com/passage/?book_id=47&chapter=6&version=31">Jesus in Matt 6:6</a>. This is often called a "quiet time" as it is quicker to say than "personal time of bible reading and prayer".</div><div><br /></div><div><span class="Apple-style-span" style="font-size:large;"><b>All strands join together</b></span></div><div><span class="Apple-style-span" style="font-size:180%;"><span class="Apple-style-span" style="font-size:18px;"><br /></span></span></div><div>June 24th 2009 11.00: I had been slow in getting started so start reading. The verses for the day from the Bible in a Year plan are <a href="http://www.biblegateway.com/passage/?search=1%20Corinthians%207:1-19&version=31">1 Corinthians 7:1-19</a> and Psalms <a href="http://www.biblegateway.com/passage/?search=psalm%20116&version=31">116</a>, <a href="http://www.biblegateway.com/passage/?search=psalm%20117&version=31">117</a>, and <a href="http://www.biblegateway.com/passage/?search=psalm%20118&version=31">118</a>.</div><div><br /></div><div>I start reading the 1 Corinthians sections and it is a passage all about marriage. </div><div><br /></div><div>Just then the phone goes and it is the postman (not the courier, who I'm still waiting for). He has a parcel which won't fit in the letter box. I go down and get it, and it is the book I had ordered 6 weeks before, about praying for a wife (which you may or may not have). </div><div><br /></div><div>I decide to read a bit. I read the Preface, which is all about praying as you read through the Bible.</div><div><br /></div><div>I read the first prayer which is based on Psalms 116, 118, and 121, two of which are the very Psalms I was going to be reading that day.</div><div><br /></div><div>Coincidences (in the sense of the word meaning things which happened together):</div><div><ul><li>The book on prayer for a wife arrived on exactly the same day nas I was reading a bible passage about marriage.</li><li>In fact it happened at the same time, on the same day.</li><li>Which happened after Cat reminded me to spend time reading the bible and praying</li><li>And the first prayer was based on 2 of the three Psalms I was looking at, also on exactly the same day</li><li>And I was actually at home that day rather than out at work</li><li>And because I was expecting a courier, I had left a note out, so the book actually got delivered rather than going back to the sorting office</li><li>And I was expecting a courier because I was expecting a wedding gift for another couple to be delivered</li><li>And I hadn't chosen the passages, they were from going through the whole Bible linearly (Old Testament and New Testament) in a year, form a scheme starting 6 months before.</li></ul></div><div>I know a lot of my atheist friends will argue convincingly that I should look at all the coincidences that didn't happen, and it was nothing special. Now, I've got a degree in Mathematics and Computation from Oxford, and work in proprietary trading in investment banking, using Mathematical and Statistical market models. I'm fairly happy with statistics. And I know it could be a coincidence, I won't claim otherwise - but my response to it all? It has to be the Psalm that wasn't in the prayer, Psalm 117:</div><div><br /></div><div>Psalm 117 (in it's entirety)</div><div><span class="Apple-style-span" style=" ;font-family:'Charis SIL';"><p> <sup id="en-NIV-15869" class="versenum" value="1">1</sup> Praise the LORD, all you nations;<br /> extol him, all you peoples.</p><p> <sup id="en-NIV-15870" class="versenum" value="2">2</sup> For great is his love toward us,<br /> and the faithfulness of the LORD endures forever.<br /> Praise the LORD. </p></span><div><br /></div><div><br /></div></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-82003555521898376622009-04-02T08:02:00.000-07:002009-04-02T08:13:10.328-07:00How to spin in modern jiveI originally wrote this for a friend of a friend who was just starting at Ceroc. The mutual friend came back saying it was so helpful that the new dancer was almost spinning better than her, so I thought I would share it.<br /><br /><span style="font-size:130%;">How to spin in modern jive</span><br /><br />Spinning is one of the most common difficulties for ladies in Modern Jive (ceroc/leroc/mojive ...) but it often doesn't get taught in beginners classes, so a lot of people, both guys and girls have trouble with it. Here are a few suggestions that might help - they are put together from suggestions in classes over the years from a lot of teachers in dances including modern jive, street dance, jazz and swing. I've especially appreciated classes from Nina Daines and Nickely Burke on this in the past, so big thanks to them.<br /><br />The key to all the tips below is practice. My street dance teacher used to start every class with a warm up which included a sequence of left and right single and double spins. Getting it ingrained in your muscle memory, even for good dancers is the key.<br /><br />The first thing is to identify the problem that you are having. This might be:<br /><ol><li>Travelling (moving) when you don't intend to, rather than spinning on the spot</li><li>Wobbling when you spin</li><li>Getting really dizzy</li><li>Not being able to get round as often as you want to (for double, triple spins etc.)</li></ol><p><br />The most common mistake, which can cause wobbling, travelling and dizziness is looking down. When you do this, your head moves off centre, and your head is a really heavy part of your body. All of the weight being off centre starts you travelling, and if you try and correct can lead to wobbling. </p><p>So the most important thing you can do is practice keeping your head up. The best way of doing this is to pick a spot on a wall slightly above eye level and practice spinning while looking at the spot. This forces you to keep your head up, and your eyes open, which with practice solves a lot of problems. Ideally you want your head, neck, spine, hips, and the ball of the foot you are spinning on to all be in one completely vertical straight line. Keeping your head up will nearly always get you in this position.</p><p>The next most common mistake is trying too hard. People think they need to spin really quickly so throw themselves far too hard into it, which then throws them off balance. When you are practising, and even while dancing, try and spin gently. You normally have two beats for a spin, which is usually enough for a triple spin, so concentrate on making your single spins slow, smooth and controlled, rather than trying to whip around.</p><p>My little spinning exercise goes like this. First think about a spin to the right. </p><p><span style="font-size:130%;">The Preparation</span></p><p> (this is a lot easier to show than to explain in writing)</p><ol><li>Step forward with a small step onto your right foot, bending your knees slightly so your weight is down. </li><li>Bring your left arm straight out to the left, and your right arm bent in front of you to the left slightly below shoulder height (like a figure skater preparing to spin). </li><li>Then in one smooth movement bring your weight forward and up, as you slide your left foot together to your right foot, and bring your hands so they are central in front of you. At this point you should have your feet together, your head up, all the weight on the ball of your right foot, and your head and body in a nice straight line to a balanced position, with your hands palms down, slightly separate just in front of your chest. Don't spin yet - just practice this movement, making sure your feet slide together and you are balanced. The most common mistake here is lifting your left foot up your leg or leaving your leg sticking out. </li><li>Now try the same but mirror imaged onto your left foot. Practice both of these until you naturally move up into a balanced position on either foot.</li></ol><p><span style="font-size:130%;">The Spin</span></p><ol><li>Do exactly what you did for the preparation, but bring your left arm in a little bitfaster, and let the momentum start to carry you round. Concentrate on keeping your head up. For the moment, don't worry about getting all the way around, a half or even quarter turn is fine, smoothness and balance is the key. </li><li>When you start to stop turning, bend your knees (a little bit) again and lower your heel to stop. Check your feet are still together. </li><li>As you get more confident, bring your arm in faster, and spin a bit further round. If you ever get to where you are wobbling, slow down again, and spin less quickly and less far. </li><li>Once you are back on balance consistently speed it up again. </li></ol><p>Again, practice doing this taking turns on either foot. This will mean you'll be able to spin both ways, and will stop you getting too dizzy when you practice. </p><p><span style="font-size:130%;">Spotting</span></p><p>Once you are confident with single spins you want to practice spotting. This both stops you getting so dizzy, and lets your neck muscles give you extra momentum. </p><ol><li>To see what spotting is like, look at a single spot, just above eye height. </li><li>Now start to shuffle round a spin, keeping your head looking at that one spot. You should be able to shuffle your feet about half way round a turn, and your body slightly less while your head looks at the spot. </li><li>When you can't move any more, bring your head around a whole turn so you are looking back at the spot. So there is only a short time while your head is looking away. When you are dancing this spot will normally be your partner. </li><li>Do the spinning exercise as before, to the left and right, but a bit slower than you were before and with spotting this time. </li></ol><p><span style="font-size:130%;">Double, triple spins etc.</span></p><p>I'm not that great at these, but I have a couple of tips. </p><p>Firstly, to do doubles your singles need to be rock solid. If you can't do a single spin consistently with no wobble then by the time you get twice round you'll be half way across the room. So make sure your basics are really solid. </p><p>Secondly, sometimes it is just a confidence issue. This is likely to be the case if you can always get one and 3-quarter turns but can never get two. In this case, I recommend trying for a triple - often you will do a perfect double and fall over on the triple, but you got the double! Once you realise you can do doubles (or triples) or whatever, then it is just a matter of smoothing them out.<br /></p>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-50371239894578246652009-03-30T14:11:00.000-07:002009-03-30T14:50:15.460-07:00Gifts of knowledge and teaching are separateI was reading <a href="http://www.10ofthose.com/shop/index.php?act=view&pid=152">Systematic Theology[1]</a> and something struck me I have never seen before. Gifts of knowledge and gifts of speech are separate. Forgive my slowness, for it seems obvious in retrospect. Someone can have huge understanding, but no teaching ability, or huge teaching ability and no understanding. And unfortunately we tend to equate the two.<div><br /></div><div>Why unfortunately? This leads to problems when we assume that teaching ability is the same as understanding. Who have you learnt most from? It has probably been those with most teaching ability but not necessarily the most wisdom. We learn our understanding of God moderated through the most entertaining preachers (and now bloggers), and get our knowledge of cars and motoring from <a href="http://www.youtube.com/watch?v=DMuO-8S_0Wg">Jeremy Clarkson</a>. At the risk of invoking <a href="http://en.wikipedia.org/wiki/Godwin's_law">Godwin's Law</a>, the supreme example of someone who could teach without wisdom was Adolf Hitler. Or perhaps more controversially Plato <a href="http://www.imdb.com/title/tt0093779/quotes">(Moron)</a>. His arguments are weak enough every first year Philosophy student can find flaws in them, but he does write well.</div><div><br /></div><div>This led me to a deeper understanding of <a href="http://www.biblegateway.com/passage/?search=james%203:1-2&version=31">James 3:1-2</a>. Do pray for those with the gift of teaching. People (including me) will listen and believe almost whatever they teach, and if they lead little ones astray <a href="http://www.biblegateway.com/passage/?book_id=47&chapter=18&verse=6&version=31&context=verse">the consequences are severe</a>.<br /><div><div><br /></div><div>Now I wonder how do we find those who have gifts of wisdom without gifts of teaching? To learn about programming I read entertaining and informative programming blogs like <a href="http://www.codinghorror.com/blog/">Jeff Atwood's</a>, but if I want to find programmers gifted with knowledge who don't communicate well, then I look <a href="http://en.wikipedia.org/wiki/Charles_Simonyi">for impressive programs and find out who wrote them</a>. <a href="http://www.biblegateway.com/passage/?search=matthew%207:15-20;&version=31;">Know them by their fruit</a>.</div><div><br /></div><div>The same should happen in church. I should seek out those people whose godliness I admire, and if they aren't the best teachers I should just be a better learner.</div><div><br /></div><div>[1] Chapter 52, page 1021</div></div></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-40641051320583302172009-01-24T00:34:00.000-08:002009-01-24T01:29:50.729-08:00What I want ... a digital filing cabinetI have a dream. And so does <a href="http://www.markdalton.co.uk/?p=481">Mark Dalton</a>. And so do lots of people when you search for <a href="http://www.google.co.uk/search?hl=en&q=digital+filing+cabinet">this</a>. And hopefully by sharing it, someone will come to my rescue and make the world a better place. <div>What is this huge dream .... ? It's a filing cabinet that does everything for you. <div>I have too many old bills and letters that I don't want to throw away, but have no space in my filing cabinet. Having decided that keeping them in paper form was too inefficient I decided to scan them but this is so slow I put it off. Let me go through the process so you feel my pain.</div><div><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Plug in the</span></span><a href="http://www.itreviews.co.uk/hardware/h1030.htm"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;"> scanner</span></span></a><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;"> (I can't leave it plugged in because it seems to interfere with my boot sequence).</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Wait for the L</span></span><a href="http://www.lexmark.com/publications/pdfs/2007/5200/macxug/en/AIOCenterMainPage.html"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">exmark software</span></span></a><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;"> to notice it.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Pick up a bill (2 sheets).</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Open the lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Put sheet 1 on the scanner. </span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Carefully manually line it up with the glass.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Close the lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Go to "scan" in the software.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose advanced settings.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose "scan as A4".</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose "more than one page".</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose OCR.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Click OK.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose "send scanned image to file".</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Click Scan Now.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">In the file dialog choose type PDF (because it forgets this is what I always choose).</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose my USB drive (because it always defaults to "my documents" on the C drive)</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Click through to an appropriate directory.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Choose a file name (which probably involves taking off the scanner so I can check the date and add it to the file name). Put back on scanner, close lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Sit and wait while it scans (only 30s, but not much else I can do).</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Open lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Remove page, and place on the floor for recycling or shredding.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Place page 2 carefully on the glass.<br /></span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Close lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Click scan now.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Wait again. another 30s.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Open lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Remove page.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Close lid.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Click "No I don't want any more pages".</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Wait for OCR to complete.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Stop typing this blog post while </span></span><a href="http://www.abbyy.com/"><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Abbyy FineReader (OCR software)</span></span></a><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;"> steals my keyboard focus.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Hope I haven't typed anything that would interrupt the OCR process.</span></span></div><div><span class="Apple-style-span" style="font-size:small;"><span class="Apple-style-span" style="font-family: arial;">Breathe a sigh, and wish I had that 3 minutes of my life back, and decide I'll put off scanning the rest of a pile for another day.</span></span></div><div><br /></div><div>You probably didn't want to read that, but I didn't want to do it. Lots of these steps could be improved in small ways but let me dream the big dream.</div><div>Imagine a box the size of a laptop, with something like the lid of a professional photocopier on top, but it only needs to be A4 size. I walk up to it, put the document on the feeder, and hit a big green button. All the sheets feed through the feeder in a second or two, and I either walk away leaving it in the "to be recycled" pile or collect it and shred it.</div><div>The machine scans it both sides at maximum resolution and in colour, after all storage is free, and saves it to the hard drive as an incoming image. Maybe from my fingerprint on the button it knows it is me scanning it. Then in the background a number of things happen. After all, this box is idle most of the time. </div><div>It runs the document through OCR. It auto rotates it to the correct orientation, even sorting out pages I fed through upside down or back to front. </div><div>It works out from this if it seems to be more appropriate to be a photo (JPEG) or PDF. If JPEG it adds appropriate tags from the date of scanning, and maybe some image recognition. If a PDF, it merges the OCR text and image together and stores to the hard drive. </div><div>The built in google desktop like functionality in the box indexes it. It also does "more like this" analysis similar to google images and google web. </div><div>It then encrypts it to store it, so if the machine gets broken into I don't lose confidential information, like I would with a filing cabinet. They key is securely stored with my password, but optionally recoverable depending whether I think the risk of forgetting or the risk of the service being compromised is greater. The input queue is then securely wiped of the original.</div><div>It connects to a free <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dss">online digital signing service</a> (through it's wireless network connection to my home network) and signs the document with the date, so I can prove in court I had it when I scanned it.</div><div>Most importantly, I <span class="Apple-style-span" style="font-weight: bold;">don't have to wait</span>.</div><div>Later on I come back and want to find my bill. I connect to the machine from my laptop. Did I mention the cabinet connects wirelessly to my home network seamlessly. I go to its web interface (secured appropriately), and look for "gas bill". </div><div>It finds a number and presents them in chronological order, most recent first. </div><div>And also offers "more like these" functionality. However it does it I can always find my document. I can tag it with tags, like I can with my <a href="http://mail.google.com/">gmail</a> to make sorting easier, but I don't really need to.</div><div>If I'm worried about the hard drive, I can synchronize it with a directory on my laptop. Or stick a DVD-R or CD-R into the box's built in drive which automatically burns me a backup copy. Which I can restore from seamlessly if I need to replace the drive, and it merges in, not overwrites.</div><div><span class="Apple-style-span" style="font-weight: bold;">But most of the time all I do is stick in some sheets and press a button</span>.</div><div><a href="http://books.google.com/">Google</a>, Canon, Lexmark, Xerox, Apple - where are you? When can I have one? All of this functionality already exists, it just needs a <a href="http://www.designmuseum.org/design/jonathan-ive">good designer(are you listening Jonathan Ive?)</a> to stick it all together.</div><div><br /></div><div>P.S.</div><div>This post deserves a confession. I had a previous job working for a <a href="http://www.canon.co.uk/About_Us/News/Corporate_Releases/Reseach_and_Development.asp">Canon research lab</a> in Human Computer Interaction. Why didn't I think of this then? </div><div><br /></div><div><br /></div><div><div><br /></div></div></div>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com3tag:blogger.com,1999:blog-14488740.post-59763608408665402542008-02-05T04:57:00.001-08:002008-02-05T04:58:29.075-08:00Irony is ...Finally tidying your bedroom, which has needed doing for months, and finding at the bottom of the pile on the floor your "To-do list" notebook.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-66347779199865021852008-02-02T01:24:00.000-08:002008-02-02T01:39:29.023-08:00No Country for Old MenWarning ... spoilers below. Don't read on if you are worried about having the film ruined for you.<br /><br />I just went to see "<a href="http://www.imdb.com/title/tt0477348/">No Country for Old Men</a>", the latest Coen brothers film. I really enjoyed it, but we all came out looking a bit bewildered. I was thinking about it on the way home - mostly pondering "What was that all about then?" and I thought I'd jot down the thoughts, before I forgot them, or they could be influenced by anyone else's opinion.<br /><br />I've never read any <a href="http://en.wikipedia.org/wiki/Albert_Camus">Camus</a>, but I believe his early philosophy was that the world is meaningless and one tragedy is that humanity goes around trying to enforce meaning on the world. The film seems to have a lot of the same philosophy - a psychopathic killer goes around killing for no good reason, and there is no obvious conclusion to the film. The killer complains that people always say to him "you don't have to do this", which seems like an objection to people trying to attach meaning to his actions.<br /><br />A couple of times the killer gives someone the option of tossing a coin. The first time a shopkeeper calls the toss correctly and is not killed. The second time the person refuses to call it, and we do not find out if she lives or dies. At another point in the film someone asks "are you going to kill me" and is answered "that depends - did you see me?" All this is very reminiscent of <a href="http://en.wikipedia.org/wiki/Schr%C3%B6dinger">Schrödingers Cat</a>, where a cat lives or dies based on a random quantum event, and until that event is observed the cat is in a superposition of alive and dead.<br /><br />Agreements seem important - the killer goes to kill the hunter's wife merely because he said he would, which I think can be taken as a reference to physical laws. In combination with the quantum reference above, this seems to lead to a conclusion that our scientific world ruled by laws and quantum events is essentially meaningless.<br /><br />Further reinforcement comes from the character of the Sheriff. All through the film people are trying to stay alive, attaching meaning and value to life, but the one character who reaches old age and retires seems depressed and entirely unsure of the purpose, which may be a comment that atatching meaning to life is foolish.<br /><br />It reminds me a lot of the book of Ecclesiastes in the Bible. Firstly from the refrain that everything is meaningless. Later on in <a href="http://www.biblegateway.com/passage/?search=Ecclesiastes%202:24-26;&version=31;">Ecclesiastes (2:24-26) the Teacher says "A man can do nothing better than to eat and drink and find satisfaction in his work. This too, I see, is from the hand of God, for without him, who can eat or find enjoyment? To the man who pleases him, God gives wisdom, knowledge and happiness, but to the sinner he gives the task of gathering and storing up wealth to hand it over to the one who pleases God. This too is meaningless, a chasing after the wind."</a><br /><br />Many of the few areas of satisfaction we find in the film are when the Sheriff is eating, drinking, or finding satisfaction in his work. Interestingly though the one who gathers and stores up wealth to hand it over is the hunter, who we would assume to be the hero, and the one whom he hands the wealth over to is the psychopathic killer. So is the killer being set out as the one who pleases God, or even God himself? Perhaps the Coen brothers are saying that any God who constructs a random universe where people live or die by quantum events can be equated to a psychopathic killer.<br /><br />We also see one other character who gets a happy ending - a boy who helps the serial killer out of grace, and is given some money and does not die.<br /><a href="http://www.biblegateway.com/passage/?search=Eccl%2012;&version=31;">"Remember your Creator<br />in the days of your youth,<br />before the days of trouble come<br />and the years approach when you will say,<br />"I find no pleasure in them"" </a><br /><br />Throughout the film there is a recurring theme of dogs being killed or placed in similar situations to humans, reminiscent of <a href="http://www.biblegateway.com/passage/?search=Eccl%203:18-21;&version=31;">Ecclesiastes 3:18-21: "I also thought, "As for men, God tests them so that they may see that they are like the animals. Man's fate is like that of the animals; the same fate awaits them both: As one dies, so dies the other. All have the same breath; man has no advantage over the animal. Everything is meaningless. All go to the same place; all come from dust, and to dust all return. Who knows if the spirit of man rises upward and if the spirit of the animal goes down into the earth?"" </a><br /><br />And the hunter spends the film trying to protect the money, and fight death, only to inevitably fail. <a href="http://www.biblegateway.com/passage/?search=Eccl%209:11;&version=31;">Eccl 9:11 "I have seen something else under the sun:<br />The race is not to the swift<br />or the battle to the strong,<br />nor does food come to the wise<br />or wealth to the brilliant<br />or favor to the learned;<br />but time and chance happen to them all. "<br /></a><br />The film ends with the Sheriff saying "and then I woke up" and we are thrown bluntly into the final credits. Reminding us that it was a film, and despite the apparent meaningless it has an author - the Coen brothers. So maybe they are to be equated to God in the world of the film. For despite the apparent meaningless, everything in the film has been included by their careful design.<br /><br />I've just re-read Ecclesiastes looking for these quotes, and there is much more that seems to chime with the film. I think I'll let this book, one of my favourites in the Bible have the last word on what the film is about ...<br /><br /><a href="http://www.biblegateway.com/passage/?search=Ecclesiastes%208:14-17%20;&version=31;">"When I applied my mind to know wisdom and to observe man's labor on earth—his eyes not seeing sleep day or night- then I saw all that God has done. No one can comprehend what goes on under the sun. Despite all his efforts to search it out, man cannot discover its meaning. Even if a wise man claims he knows, he cannot really comprehend it."</a>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-63206823863509896952007-10-11T10:20:00.000-07:002007-10-11T11:20:32.233-07:00Cheating iLike on facebookSometimes my overcompetitive tendencies get the better of me. The latest time this happened was using <a href="http://www.ilike.com/">iLike</a> on Facebook. <br /><br />This little application has a game called the iLike challenge where you have to guess the artist, or the song title while the song plays. The quicker you do it, the more points you get. You keep a running total of points as you guess the answers correctly, and then if you get an answer wrong your running total is reset down to zero. The application shows your best run, and shows you how your best run compares to your facebook friends.<br /><br />I have a reasonable music knowledge, but not enough to make me top of my friends. Luckily, I've got the sort of hacker brain that likes breaking these sorts of puzzles.<br /><br />It turns out that because the whole application is web based the programmers had to decide what to do if you lose the connection before your time runs out. They decided to keep your running score, and take you back to a random question.<br /><br />This immediately gives you an advantage - if you get a question you don't know, just click away, then click back to iLike challenge. You will never get a question wrong, and can get as high a score as you like.<br /><br />However, this can still be a bit slow, as you might get a lot of questions you don't know. But there is another trick. The application seems to give you repeated questions fairly often when you click back, probably due to a weakness in the random number generator. So each time you get a song you don't know, remember some of the lyrics. Google the lyrics to get the song title or artist. Then have the answer ready when the question comes round again.<br /><br />I can't decide whether this is something I shouldn't be doing as a Christian. Do other people think this is dishonest? I enjoy finding these lateral thinking solutions to computer flaws more than I enjoy the original games, so it is a good form of entertainment for me. I think it only becomes dishonest if I boast I am the best at iLike, without saying how I did it.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com2tag:blogger.com,1999:blog-14488740.post-81173073034228846272007-08-03T10:20:00.000-07:002007-08-03T10:32:09.836-07:00Audio on FacebookYesterday I got back from a great week away, helping at a Christian Camp for teenagers. Everyone is on facebook nowadays, so of course a facebook groups was created, and I wanted to add all the talks that we had recorded to the facebook group so people could listen to them again if they wanted.<br /><br />Unfortunately, a few days before, <a href="http://venturebeat.com/2007/07/31/facebook-kills-audio-for-copyright-violations/">the facebook Audio application was removed for copyright violation reasons</a><br /><br />Now the simplest thing would just be to host them on my own server, and then, post a link on the discussion board, but I thought I'd be clever, and I thought I'd detail my adventures with this post.<br /><br />First I tried posting them as video - after all, audio is just video without pictures, right? Nope. Facebook video needs a recognised file type.<br /><br />Next I thought that I could create a video, by using a single photo, and the audio as background. I found a free application "<a href="http://www.joern-thiemann.de/tools/SSMM/index.html">Slide show movie maker</a>" which would do precisely this (it's designed for producing slide shows of pictures, with pretty music background), but in the end I could only get it to work with the PCM/WAV codec, so the movie was huge and it would have taken hours to upload to facebook video. Sigh.<br /><br />I suspect I could do it with a commercial Adobe flash video producer or similar, but I got bored. I uploaded the audio to my own server, and posted a link in the discussion group. <br /><br />Maybe facebook Audio will come back in a few days - before bandwidth/storage is too high on my host. Unless anyone has any better ideas?Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1826606418885548312007-06-14T01:48:00.000-07:002007-06-14T02:39:02.850-07:00Getting Boost Python working under CygwinHaving trouble getting Boost Python working under gcc/cygwin/windows? I did. And I found the documentation not that great, so here's a step by step guide to what I did to get it working. But for those of you in a hurry, here's the short method:<br /><br /><br /><ol><br /><li>Download boost from <a href="http://sourceforge.net/project/showfiles.php?group_id=7586">http://sourceforge.net/project/showfiles.php?group_id=7586</a>, decompress, and copy to whereever you want it</li><br /><li>Download boost jam (bjam) from <a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941">http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941</a>, decompress, and copy to whereever you want it</li><br /><li>Add bjam to your path (Start, Control Panel, System, Advanced, Environment Variables) from whereever you put it in step 2</li><br /><li>Make sure you have gcc and python installed from <a href="http://www.cygwin.com/setup.exe">cygwin setup</a>, not just windows python from the python website</li><br /><li>Edit /boost_1_34_0/tools/build/v2/user-config.jam from wherever you decompressed boost to in step 1. Add the line:<br /><pre>using python : 2.5 : c:\\cygwin\\bin\\python2.5 : : : <target-os>cygwin ;</pre></li><br /><li>Start a cygwin shell and change to where you put boost /libs/python/example/quickstart. In this directory type bjam toolset=gcc --verbose-test and everything should work</li></ol><br /><p>Now for how I did it, which will hopefully help a few people googling for the error messages that I got.</p><br /><p>I downloaded boost and decompressed, and following the instructions at <a href="http://www.boost.org/libs/python/doc/building.html#configuring-boost-build">http://www.boost.org/libs/python/doc/building.html#configuring-boost-build</a> i also downloaded and installed bjam. So far, so good. On trying "bjam toolset=gcc --verbose-test" in the /libs/python/example/quickstart directory I got the following message:</p><br /><br /><p><pre><br />$ bjam toolset=gcc --verbose-test<br /><br />Jamroot:17: in modules.load<br /><br />rule python-extension unknown in module Jamfile</N: quickstart example python libs st_1_34_0 boo boost Files Program NRSI>.<br /><br />~/boost_1_34_0/tools/build/v2/build\project.jam:312: in load-jamfile<br /><br />~/boost_1_34_0/tools/build/v2/build\project.jam:68: in load<br /><br />~/boost_1_34_0/tools/build/v2/build\project.jam:170: in project.find<br /><br />~/boost_1_34_0/tools/build/v2\build-system.jam:237: in load<br /><br />~/boost_1_34_0\libs\python\example\quickstart\..\..\..\tools\build\v2/kernel\modules.jam:261: in import ~\boost_1_34_0\libs\python\example\quickstart\..\..\..\..\tools\build\v2/kernel/bootstrap.jam:132: in boost-build<br /><br />~\boost_1_34_0\libs\python\example\quickstart\boost-build.jam:7: in module scope</pre><br /><br /><p>Oh dear. A bit of googling found this page <a href="http://svn.boost.org/trac/boost/ticket/986">http://svn.boost.org/trac/boost/ticket/986</a> which told me I needed to add the line "using python ;" to the user-config.jam file. On trying to build again, I hit lots of compiler errors which started like:</p><br /><br /><p><pre><br />In file included from C:/Python24/Include/Python.h:82,<br />from ../../../../boost/python/detail/wrap_python.hpp:142,<br />from ../../../../boost/python/detail/prefix.hpp:13,<br />from ../../../../boost/python/class.hpp:8,<br />from extending.cpp:5:<br />C:/Python24/Include/intobject.h:41: error: `__int64' does not name a type<br />In file included from C:/Python24/Include/Python.h:84,<br />from ../../../../boost/python/detail/wrap_python.hpp:142,<br />from ../../../../boost/python/detail/prefix.hpp:13,<br />from ../../../../boost/python/class.hpp:8,<br />from extending.cpp:5:<br />C:/Python24/Include/longobject.h:37: error: `__int64' was not declared in this s<br />cope<br />C:/Python24/Include/longobject.h:39: error: `__int64' does not name a type<br />C:/Python24/Include/longobject.h:40: error: `__int64' does not name a type<br />C:/Python24/Include/longobject.h:41: error: `__int64' does not name a type<br />In file included from ../../../../boost/python/converter/arg_to_python.hpp:17,<br />from ../../../../boost/python/call.hpp:15,<br />from ../../../../boost/python/object_core.hpp:12,<br />from ../../../../boost/python/object/class.hpp:10,<br />from ../../../../boost/python/class.hpp:13,<br />from extending.cpp:5:<br />../../../../boost/python/converter/builtin_converters.hpp:111: error: missing `><br />' to terminate the template argument list<br />../../../../boost/python/converter/builtin_converters.hpp:111: error: template a<br />rgument 1 is invalid<br /></pre></p><br /><br /><p>This was confusing.</p><br /><br /><p>Eventually <a href="http://lists.boost.org/boost-build/2006/05/13906.php">http://lists.boost.org/boost-build/2006/05/13906.php</a> gave me the hint I needed. I had a windows python 2.4 installation, and boost python seemed to need cygwin's python to work under cygwin. So using cygwin setup I installed python (and updated gcc) for good measure. Unfortunately still no luck. Finally the boost instructions at <a href="http://www.boost.org/libs/python/doc/building.html#configuring-boost-build">http://www.boost.org/libs/python/doc/building.html#configuring-boost-build</a> gave the final hint. </p><p><code>bjam toolset=gcc --debug-configuration --verbose-test</code> revealed that boost was still picking up my old python from the registry. By doing of expressly putting the new cygwin python in <code>/boost_1_34_0/tools/build/v2/user-config.jam</code> , by modifying my "using python ;" line so it read "using python : 2.5 : c:\\cygwin\\bin\\python2.5 : : : cygwin ;" everything started working.</p><p>A happy ending...</p><p> </p>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1144230956843067812006-04-05T01:53:00.000-07:002006-04-05T02:55:56.863-07:00Agents for Software EngineersWhat do glamorous movie stars, rock stars, professional sports players, and software engineers have in common? "Nothing" might be the first answer that comes into your head. After all sports people and movie stars are the modern heroes, the cool people that kids aspire to be when they grow up. Software engineers have a Dilbert like reputation for being geeks. So why compare them?<br /><br />Well they have a number of things in common.<br /><br />Firstly there is a huge range of talent and a huge differential for hiring the best. If you hire an A-list actor or actress it will boost the box-office returns of your movie. If you hire the best soccer player in the world, not only will it boost your teams results on the field far more than buying two medium level players, but also the merchandising potential. Similarly, <a href="http://www.joelonsoftware.com/articles/fog0000000050.html">anecdotal evidence </a>as well as <a href="http://www.joelonsoftware.com/articles/HighNotes.html">studies</a> suggest that hiring one great software engineer is far better value than hiring two good ones.<br /><br />Secondly the best can become very rich. Some Microsoft programmers are among the richest people in the world.<br /><br />Thirdly, job decisions tend not to be made just by money. For Rock stars it might be the fruit and flowers in the dressing room, or some claim to artistic independence. For movie stars, it might be the opportunity to work on a script which might win them an Oscar, or stops them being typecast. For programmers it might be a nice office, cool chairs, or toys to play with.<br /><br />Fourthly for all four groups, their talent does not necessarily lie in business or negotiating skills. Rock stars and actors are notorious for being arrogant, demanding and hard to work with. Programmers are renowned for having bad people skills.<br /><br />All of which leads me to something that has puzzled me for a while - why don't programmers have agents? If an actor is considering a role or a rock star is considering a record deal they have an agent who sits in the middle, helps them negotiate the best fee, and takes part of the money as a cut. The star doesn't have the stress of negotiating (and the producers can avoid some of the stress of negotiating with actors) and hopefully the star gets better compensation.<br /><br />If superstar programmers are really worth five times as much as mediocre ones, why aren't they getting agents to negotiate larger salaries for them? I'm sure there is a business opportunity here. This differs from the standard recruitment consultant. A recruitment consultant tries to fulfill the role, but differs in the major respect that there is no expectation of a long term relationship between the consultant and the programmer. Once a job is found, the relationship typically ends.<br /><br />I'd guess one reason for the lack of agents is that lack of talent or relative talent is much harder to judge quickly in a programmer than in an actor. Programmers don't usually work in the public eye, so it is harder for talent to be spotted by agents on the outside.<br /><br />Traditionally programming has been considered a full-time occupation whereas actors, sports stars and rock stars tend to be on much shorter contracts. However, with the growth in consulting, outsourcing, and shorter term contracts this may be becoming less true.<br /><br />Also to consider is the role of the IT consulting company. When you put together a sports team, you don't go to a baseball consultant and get all the players from one source. However in IT projects, it is common to hire more than one person at once and try and get the best quality team you can. The IT consulting organization plays the role of the agent, and takes the money. This is yet another byproduct of the programmer's name not being on the product in the public eye, rather the brand is the organization the programmer worked for.<br /><br />Finally worth mentioning is that whenever the phrase software agents is used, people think of the over-hyped AI definition.<br /><br />I don't know if programmers will ever be saying "Have your people call my people," but it remains for me an intriguing image.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com1tag:blogger.com,1999:blog-14488740.post-1143206761423769522006-03-24T05:10:00.000-08:002006-03-24T05:26:01.440-08:00A Little Security Protocol puzzleAs <a href="http://www.schneier.com/blog/">Bruce Schneier</a> is always talking about, sometimes real world security protocols are far more flawed and hackable than computer ones. Sometimes they are plain badly designed. And sometimes they are well designed, but reveal more about a companies priorities than they intend to.<br /><br />Before I went on holiday, I went to get some Swiss Francs from <a href="http://www.travelex.com/">Travelex</a>. When the lady behind the counter asked me how I'd like to pay, I said through debit card. She then told me I would need photographic id, which was a pain, because I didn't have any on me. She then told me that if I wanted to pay in cash, then she wouldn't need ID.<br /><br />So I didn't use my debit card in Travelex, and type in my PIN there (the UK now uses <a href="http://www.chipandpin.co.uk/">Chip and PIN </a>rather than signatures to authenticate purchases). Instead, I walked 400m to an ATM, used the same Debit card and same PIN to take out £100, walked back to Travelex with the £100, and then used the cash to get some £100 worth of Swiss francs.<br /><br />So the puzzle is this - given that I would have used the same card and same PIN in both situations, what possible reason was there for Travelex to be happy with doing this second method without ID, but not the first? Read on for my suspected answer, or think about it yourself for a minute...<br /><br /><span style="color:#ff0000;">SPOILER BELOW</span><br /><span style="color:#ff0000;"></span><br /><span style="color:#000000;">I think there was no added security, just an exchange of risk. Consider if it had been a stolen card and PIN. If I had just used the card at Travelex they would have taken some liability. By forcing me to walk to the ATM, if the card had been stolen, the ATM would have taken some liability. In order to take this risk of liability, they require photographic ID to reduce their risk. So instead, they gave me the risk of walking through the streets of London with a lot of cash. As a result, the transaction was far more anonymous, and so more vulnerable to money laundering, and I was at more risk of being mugged, but neither of those hurts Travelex.</span><br /><br />Of course, this is very sensible of them. The best solution is for me to carry photo ID.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1143028238091737902006-03-22T02:47:00.000-08:002006-03-22T03:50:38.103-08:00Writing is like UI designWriting documents is just another form of user interface design. Especially if those documents are examples or tutorials. That might be a bit of a geeky way of looking at the world but I think it is true.<br /><br />I was reading <a href="http://blogs.msdn.com/jensenh/archive/2006/03/20/555460.aspx">this post </a>from <a href="http://blogs.msdn.com/jensenh/default.aspx">Jensen Harris</a> on how difficult it is get users to criticise user interfaces. He calls it "Usability Stockholm Syndrome". Meanwhile, from his body language I could tell one of my co-workers was obviously not that happy with a document I had written on recovering if one of our systems has an error. However, I found it really hard to get him to tell me what could be improved about it. He kept saying "No it's fine." Or "It's adequate." I had to really emphasise I want to improve both my document and my writing abilities to get some useful feedback.<br /><br />This reminded me of reading <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0966994914/567/026-7750652-7389269">a great book on writing software manuals - the User Manual Manual </a>by Michael Bremer, who also wrote <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0966994906/">Untechnical Writing</a>. In it he looks a trying to document a user interface. Unfortunately accomplishing the simplest task requires paragraphs of difficult prose, operating 200 different GUI controls. He says it's often much better to fix the user interface so performing the task is easy, then writing the documentation will just be an easy to understand paragraph.<br /><br />There are other similarities between writing and developing user interfaces:<br /><ul><li>The end users don't always know how to improve them, but they know when they find them difficult to read or use</li><li>Important elements have to come to hand quickly, more obscure details can be left until later or put somewhere more obscure</li><li>Eat your own dogfood is necessary for quality but not sufficient</li><li><a href="http://www.joelonsoftware.com/articles/fog0000000043.html">Hallway usability tests</a> work for both</li></ul>There are probably a lot more, but these are the first few that come to mind. I'm not sure what benefit realising this similarity brings to the world, but when I look at articles about writing or user interface design in the future, I might try and transfer the ideas. After all, the best innovation comes from stealing ideas from other fields and applying them in a novel way.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1129998676793072812005-10-22T09:10:00.000-07:002005-10-22T09:31:16.806-07:00Daily devotions - getting startedI spent today getting started on my Daily Devotions software project, that I mentioned in my previous post. So much trial and error was involved for a PHP novice like me I decided to document it here.<br /><br />The first thing I decided was I would try and procede in an <a href="http://www.xprogramming.com/xpmag/whatisxp.htm">XP (eXtreme Programming)</a> style way. This involves many things, including writing stories on cards for what you want the software to do, and then proceeding forward in very small steps. This is ideal for a project like this I'm doing in my spare time. Unfortunately, some of the other practices like pair programming I will not be able to do as an individual, but we will see how it goes.<br /><br />The first story I started with was "show a web page with the correct 'Through the bible' reading for that day on it". So the first thing I needed was some webhosting. I found "<a href="http://www.pfwh.net/">Perfect Free Web Hosting</a>" (PFWH) which offes free MySQL and PHP as well as webhosting. Another option was <a href="http://www.myjavaserver.com/">MyJavaServer</a> which offers free Java as Hypersonic SQL. I decided to go with PFWH as:<br /><ul><li>it gave me an opportunity to learn PHP</li><li>it meant I was likely to resist the temptation to make things too complicated starting in Java</li><li>it was likely to be able to move the site to somewhere else fairly easily, as lots of people offer PHP and MySQL, including <a href="http://www.blackcatnetworks.co.uk/">BlackCat</a>, who I use to host this site</li><li>I thought I was going to need a database to store the lists of readings. I could have used a flat file, but I've learnt its usually better in the end to start with a database, you always want one ventually. And I couldn't find a flat file database that worked easily with PHP and Java, if I wanted to change languages in the future. If I use MySQL then I can swap to another language very easily.</li></ul><p>So having done this, the first step in XP is always to write a testcase. Now, I normally develop in Java where I am spoilt having <a href="http://www.jetbrains.com/idea/index.html">IntelliJ IDEA</a>, the best IDE I've ever come across for any language, with fantastic <a href="http://www.junit.org">JUnit</a> integration. I wanted something as similar as possible for PHP.</p><p>I spent all of today searching and to save you the effort, here is the configuration I ended up with. It turns out that if you are paying for an IDE for PHP then <a href="http://www.zend.com/store/products/zend-studio/">Zend Studio </a>seems like the only choice, but I'm a cheapskate, so couldn't go for that. After much trial and error I finished up with PHP-Eclipse, with a local copy of Apache and MySQL for development, before deployment to PFWH. I installed Apache, PHP and MySQL through XAMPP. This took quite a few tries to get it right. I'm sure there are lot's of other solutions to get a free PHP IDE with PHPUnit etc, but I recommend following <a href="http://www.plog4u.org/index.php/Using_PHPEclipse:Installation:XAMPP_Example_Installation">these instructions</a> exactly.</p><p>Make sure you follow just that page. Even following the other instructions on the PHP-Eclipse Wiki it is possible to get in a mess, with editing files etc. Use the page linked to above. That's why I haven't added any other links, as that page has all you need to get set up on it. And now I have an IDE which will create PHP that connects to a local MySQL and Apache, within the IDE.</p><p>It also gives me the benefit of gaining familiarity with Eclipse, which is something I've been meaning to do.</p>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com3tag:blogger.com,1999:blog-14488740.post-1129997404029915152005-10-22T08:50:00.000-07:002005-10-22T09:10:04.040-07:00Ideas Factory: Daily DevotionsWell, after an initial burst of enthusiasm, my blog petered out like so many others. My excuse for this is I just had my final exam for my <a href="http://www.open.ac.uk/about">Open University</a> <a href="http://www3.open.ac.uk/courses/bin/p12.dll?Q01B07_12_0">degree in psychology</a>. This has meant my spare time has been spent revising or feeling guilty about not revising. But now that's out of the way here's an idea which I've been meaning to post about for ages.<br /><br /><span style="font-size:130%;">Daily Devotions</span><br /><br />As a Christian I think it is good to spend part of each day in prayer and reading God's word - the Bible. This is not what gets you to heaven, only accepting Jesus as your Lord and Savoiur can do that. Christianity is all about having a relationship with God, and part of having a relationship is communicating. Prayer lets us talk to God, and reading the Bible lets God talk to us.<br /><br />Anyone who has tried to be dedicated in these two activities will know how hard it can be. If you are not a Christian, it can be similar to revising for an exam. You want to to do it, you know it is important, but unless you get into good habits it is possible for a million and one other things to distract you.<br /><br />Part of my day job is writing software tools which make the lives of me and my colleagues easier. This means my brain is trained to think in statements like "How can I automate that?" or "How can I get a computer to help me overcome my mistakes in that?". Automation of prayer has <a href="http://www.ctcvan.ca/docs/PrayerWheel.html">been tried by other religions</a>, but I do not believe in it. However, a tool to help in the discipline of daily reading the bible and prayer has been something I've looked for and haven't found.<br /><br />It would be nice if this tool had features similar to several other programs:<br /><ul><li>A Calendar/Diary program, so it would help you overcome apathy by giving you a reminder (maybe by email)</li><li>A collaborative information tool like a Wiki, so things like a Church prayer diary could be shared</li><li>A database of resources, so for example you could automatically get the <a href="http://hippocampusextensions.com/mcheyneplan.html">M' Cheyne reading </a>each day</li><li>An educational software tool, maybe testing you on memorisation of bible verses</li><li>A statistical/bug tracking/Business Intelligence tool so for accountability you could keep track of how you were doing</li></ul><p>There are several general tools which will do this job, for example, with a bit of hacking I'm sure you could get Lotus Notes to do a lot of it. But by creating a specific tool you could make it very easy to use for this one particular job, and that would mean people are more likely to use it.</p><p>I haven't managed to find anything which does this yet. I think this idea from the ideas factory I will start to do myself.</p>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com3tag:blogger.com,1999:blog-14488740.post-1125485945148381072005-08-31T03:44:00.000-07:002005-08-31T05:42:40.983-07:00An Incentive to LieIf there is one thing I really hate it is when a company creates a situation where lying to them makes everyones life easier, and hurts no one.<br /><br />As a Christian, I try not to lie, even with "white lies", mostly because of these passages in the Bible: <a href="http://www.biblegateway.com/passage/?book_id=47&chapter=5&verse=36&end_verse=38&version=31&context=context">Matthew 5:37</a>, <a href="http://www.biblegateway.com/passage/?book_id=66&chapter=5&verse=11&end_verse=13&version=31&context=context">James 5:12</a>, and <a href="http://www.biblegateway.com/quicksearch/?quicksearch=false+witness&qs_version=31">various false witness verses</a>. So as someone who tries to live honestly, it is very annoying when my life would be so much easier if I lied, for no good reason. I've come across two examples recently, but they seem to happen fairly regularly to me, so I'm sure I'll notice more.<br /><br />The first is the fault of the <a href="http://www.dvla.gov.uk/">DVLA (Driver and Vehicle Licensing Agency). </a>In England we have two parts to our driving licenses, a plastic credit card sized identity part, and a paper record part. This is a fairly silly design to start with, but let us ignore that for now. I recently lost (or had stolen) my wallet and in my wallet was the plastic part of the drivers license. I keep it there because it is a useful photographic ID with proof of age. I do not carry the paper part about because it is more bulky.<br /><br />It is a legal requirement to be able to produce your driving license, so I need to get a replacement. Now according to <a href="http://www.dvla.gov.uk/drivers/applydl.htm#dup_licence">their website</a>, if I had lost, or had stolen both parts I could just call up, pay the fee on my credit card, and get a replacement sent to me. But because I have only lost one part, I have to fill in a form, and post off the paper part back to them. So it is in my interest to lie and say I've lost both bits which saves me some hassle and doesn't hurt them. But if I'm honest my life is made harder for no good reason.<br /><br />A second example was similar from <a href="http://www.firstgroup.com/index.php">First trains</a>. My train season ticket wore out - it stopped working in the barriers at the station. If I was dishonest I could ring up, say it had been stolen, and get a replacement sent to me. But if I was honest I had to post them the ticket, wait for them to post me a replacement. While waiting I had to pay for daily tickets with my own money, save the receipts, and then post them all off to get a refund. A lot of work, for no real benefit, as if I wanted to cheat them, I could just lie and say it was stolen.<br /><br />Companies shouldn't be encouraging people to be dishonest to them.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com3tag:blogger.com,1999:blog-14488740.post-1124713467269390642005-08-22T01:13:00.000-07:002005-08-22T05:26:54.470-07:00Being User-Focused: More examplesRoyal Mail's feedback options just provide more examples of them not being user focused, but <a href="http://www.abel-cole.co.uk/">Abel & Cole</a> get it right.<br /><br />On Friday I was ranting a bit about how the redelivery service for Royal Mail's recorded delivery demonstrated a lack of user focus. I decided to try and be helpful, and send a copy of my comments to <a href="http://www.royalmail.com">the Royal Mail</a>. That is when I discovered the horror that is trying to give online feedback to the Royal Mail.<br /><br />Before I start criticising, let me add some mitigating comments. The number one priority for the Royal Mail has to be getting as many deliveries as possible to arrive, safely, and on time. Any other customer service issues will always be secondary to that, and if all of their energy is currently devoted to sorting out delivery problems then that is entirely reasonable.<br /><br />However, suppose you are a customer, who, like me, wanted to make a suggestion on improving their redelivery options, or make some other suggestion about Royal Mail service. So much about the process is horrible I cannot describe it, you have to experience it for yourself. The only reason I can think of is that they are trying to persuade you that writing letters is better than email! But in summary:<br /><ul><li>There is no contact email address</li><li>You can only give feedback on the website, not on anything else</li><li>You have to log in before giving feedback!</li><li>Before giving feedback, you don't merely relinquish any intellectual property claims to the idea, you assign all intellectual property to the royal mail</li><li>Feedback is limited to 255 characters at a time</li><li>You are limited in the number of pieces of feedback you can give, and you have to work through a horrible, slow customer service wizard</li><li>As part of the process you are shown everyone else's rude comments about Royal Mail</li></ul>The process is so bad it is almost funny. It leaves Royal Mail's customer service department looking like a shambles. Feedback should be sought out, not made as hard as possible to get.<br /><br /><span style="font-size:130%;">Abel & Cole</span><br /><br />In contrast, <a href="http://www.abel-cole.co.uk/">Abel & Cole</a> are incredibly user focused, and as a result I have recommended them to a huge number of my friends, and I recommend them to you all. They deliver boxes of organic fruit and vegetables, either irregularly or regularly. I have no interest in Abel & Cole besides being a satisfied customer.<br /><br />I cannot list all the things they do well, as there are probably many I have not discovered. However, a few highlights are:<br /><ul><li>You can contact them by email, telephone, fax or letter, with clearly presented addresses on a contact page. They explain clearly when the office is open, and what you can do if it is not</li><li>When you set up your account, not only do you give a delivery address, there is space for extra directions for the delivery man, and instructions on where to leave deliveries if you are out</li><li>When my wallet was stolen, I let them know, and they responded promptly, by telephone, to my daytime number as it was daytime, and said they were happy to delay the charge and keep delivering until I could register my new card with them.</li><li>They will deliver weekly, monthly, biweekly, or on irregular intervals or one-off orders</li><li>They provide recipes and descriptions for items you might not know what to do with</li><li>They allow you to list items as disliked, and they will never deliver them to you again</li></ul><p>Each of these clearly solves a specific problem that someone has had or could have had in a nice way that it easy for the user. As a result, it is easy for me to spend money with them regularly every week, and so I do, and we are both happy.</p>Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1124473005358156692005-08-19T09:54:00.000-07:002005-08-19T10:41:44.466-07:00Not User-focused: An Example from the Royal MailWhat happens when you are not at home for a delivery provides a good non-programming example about what it means not to be user focused.<br /><br />One day soon I'll write and article on being user-focused, which is something that a few programmers and software companies do really well, and as a result they do well, and a lot of programmers do badly. However, this week I came across a really good non-programming example which I thought I'd share.<br /><br />There are three classic symptoms of not being user focused:<br /><ol><li>It is possible to get the job done.</li><li>The way that would make it simplest for the user to get the job done does not happen, and often the user is made to feel stupid or awkward for wanting it done this way.</li><li>The job is done in a manner which seems most convenient for the people doing the job.</li></ol><p>I think this story illustrates all three.</p><p>The other day I ordered a <a href="http://www.eng.dmu.ac.uk/~mt96/pjb/pp/firewire.htm">firewire</a> card for my laptop, as the built in one has died. Normally I get parcels delivered to work, but the <a href="http://www.udiggit.com/">udiggit</a> would only deliver to the credit card address, so I had to get it sent to my home. Unfortunately, they sent it <a href="http://www.royalmail.com/portal/rm/jump2?mediaId=500201&catId=400028">Royal Mail Recorded Delivery</a>.<br /><br />A brief aside for those of you not in the UK. The Royal Mail are the UK's postal service. Recorded Delivery means it normally arrives within 24 hours and has to be signed for. And this is where the problems start.<br /><br />I am usually at work during weekdays, so I am not at home to sign for items. When the Royal Mail make an attempt to deliver a recorded delivery item the delivery does not happen. The item is taken back to the sorting office, and they will keep it for 1 week. A note is left with four options for how to get the item.<br /></p><ol><li>Go to the sorting office itself and collect it during the sorting office opening hours.</li><li>Get the letter redelivered to your home address.</li><li>Get the letter sent to another local address for free.</li><li>Get it sent to a local post office for you to collect.</li></ol><p>This seems very reasonable at first glance but it completely fails to meet user needs. I would guess that most failed deliveries happen because the person and their cohabitants are all out at school or work during the day when the attempted delivery happens. </p><ul><li>If you have a normal fulltime job getting it redelivered to your house (option 2) is no good as there is no guarantee on delivery time.</li><li>If you do not work in the local area, option 3 is no good, where are you supposed to get it delivered? </li><li>The local post office opening hours are basically office hours, so option 4 does not help.</li><li>The sorting office opening hours are weekdays 9am until 5.30pm, and Saturday 8 until 12. That information is from memory, because in another example of not being very user-friendly, I cannot find it using <a href="http://www.royalmail.com/">their website</a> or <a href="http://www.google.com/">google</a>. So for the typical person who fails to have something delivered, they are left with a four hour window on Saturday or the delivery fails.</li></ul><p>A user focused approach would think "Why has this not been delivered?" Then realise the answer was because the person was usually busy during the day. And then maybe offer some of the following options as well as or instead of the ones above:</p><ol><li>An evening redelivery to a local address or your address.</li><li>One or two days a week, open the sorting office counter from 1pm-9pm. No extra staff time is required, in fact it might offer some staff a choice of working hours they would value.</li><li>Allow an option to pay to redeliver to a non-local address.</li><li>Allow a letter to be sent to the sorting office to authorise a non-signed delivery, with the signature on the letter counting as the signature.</li></ol><p></p><p>So the three symptoms were met:</p><ol><li>It was possible for me to get the item</li><li>It was not easy or convenient for me</li><li>It was made very easy and convenient for the post office</li></ol>Interestingly, this isn't an example of not being customer focused. I was not directly the customer, udiggit were. I was a user. As such I have no monetary power to change things except indirectly, by not shopping with people who use special delivery, and insist on delivering to my home address. This is very similar to the software example, where the people choosing to buy the software, often the IT department, are different from the people who use it.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1124458951820903732005-08-19T06:07:00.000-07:002005-08-19T06:43:35.880-07:00Code is for readingCode is primarily written for programmers to read. Why don't people seem to realise that?<br /><br />This is a rant I've wanted to have for a while, and have finally been pricked into it by a friend, Andrew Ketley making a <a href="http://www.blogger.com/comment.g?blogID=14488740&postID=112369955075173990">comment about writing spreadsheets</a>. He said:<br /><blockquote><p>The modern spreadsheet is no longer a simple tabulating and adding machine - it'a a highly sophisticated construction kit for certain classes of corporate applications, and needs to be approached as such....Hardcoded constants, obscure naming, spaghetti logic - it's all there.<br /></p></blockquote><br />Code is primarily written for programmers to read. Often that programmer is you - 5 seconds, 5 days, 5 weeks or 5 years later. Sometimes it is other programmers. If code was not written to be read, then we would all be happily writing in <a href="http://emu8086.sunwave.com//vb/asm_samples/Calculator.asm.txt">assembler</a>, as the time to write assembler probably isn't that much slower that modern programming languages. What is slower is the time to test it, and modify it, whether those modifications are to add functionality, change functionality or remove bugs.<br /><br />This is one reason why I don't like <a href="http://www.perl.com/">Perl</a>, though many people love it. A motto of Perl is "<a href="http://www.thinkgeek.com/oreilly/tshirts/5bc2/back/">There's more than one way to do it</a>", and as a result people have a huge amount of freedom to develop different idioms in coding. And so reading the code is like understanding english spoken in lots of different accents. It might add to the richness of life, but it does not aid speed of understanding. A language with more constraints, like C, Java or C#, still allows personal style and idioms, but it tends to be much easier for one Java programmer just to pick up and read another's code.<br /><br />However, in any programming language it is possible to write <a href="http://www.thedailywtf.com/">code that is hard to read</a>, if you don't concentrate on readability. Readability is a very subtle thing, and something which is more readable for me might be less for you. It's analogous to spoken language again. If I am drunk, and mumble in a slurred voice everyone will find it harder to understand. However, with a southern English accent, another southerner might find me easier to understand than someone from Glasgow, whereas for someone from Glasgow it would be the other way around. Similarly, some code is just harder to read than other code. However, it is also true my colleague Jason might find my code easier to understand than <a href="http://www.panix.com/~spolsky/">Joel</a>'s, whereas one of the <a href="http://www.projectaardvark.com/">Aardvarks </a>might find Joel's easier - neither is necessarily better, it is just more familiar.<br /><br />So when you right code, you should try and make it more readable for everyone, and especially readable for the intended audience, for example, those on your project. This is one reason why coding standards are a good idea - which brace style to use does not matter, as long as everyone uses the same. This is one thing which heps cause the "<a href="http://www.joelonsoftware.com/articles/fog0000000007.html">Not Invented Here</a>" syndrome.<br /><br />So, I should get back to Andrew's point about spreadsheets. A spreadsheet is confusing because it presents two views to the world in one user interface. It presents a view to the user, who wants to use it to calculate something, and the programmer who wants to change how it does that calculation. And it can be good or bad at either. Normally the "user" user interface gets improved before the "developer" user interface, but I've written spreadsheets which were great to develop, but lousy to use. Normally the model-view-controller pattern will be helpful here for separating the two, but you could also use <a href="http://www.smartspread.com">Smartspread</a>, which provides a much better development environment, in my opinion, than Excel. But then I did write it, with Jason, so I'm biased.<br /><br />There's lots more I want to rant about readable code, and I want to give some examples, but that can wait for another time.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0tag:blogger.com,1999:blog-14488740.post-1124210972193700652005-08-16T09:29:00.000-07:002005-08-16T09:49:32.200-07:00Book Review: Better, Faster, Lighter Java<a href="http://www.amazon.co.uk/exec/obidos/ASIN/0596006764/">Better, Faster, Lighter Java</a><br /><a href="http://www.amazon.co.uk/exec/obidos/ASIN/0596006764/">Bruce A. Tate & Justin Gehtland</a><br /><a href="http://www.amazon.co.uk/exec/obidos/ASIN/0596006764/">ISBN 0596006764</a><br /><br />A great book for someone else - about the worst thing you could say for a book.<br /><br />The other week <a href="http://www.amazon.co.uk/exec/obidos/search-handle-url/index%3Dbooks-uk%26field-author%3DRoberts%2C%20Vaughan">Vaughan Roberts</a>, the rector of my church, was giving a sermon on the sermon on the mount. He was covering <a href="http://www.biblegateway.com/passage/?book_id=47&chapter=7&version=31">Matthew 7</a>, where it talks about not judging:<br /><blockquote>Do not judge, or you too will be judged. For in the same way you judge others,<br />you will be judged, and with the measure you use, it will be measured to you.<br />Why do you look at the speck of sawdust in your brother's eye and pay no attention to the plank in your own eye? How can you say to your brother, 'Let me take the speck out of your eye,' when all the time there is a plank in your own eye? You hypocrite, first take the plank out of your own eye, and then you will see clearly to remove the speck from your brother's eye. </blockquote><br />And he said that a very common reaction to this passage is to think "Well I know that, but I wish my friend Luke would read that"! (As far as I know, I don't have a friend called Luke.) Well on reading the Better, Faster, Lighter Java book, I had a very similar reaction.<br /><br />It was full of good stuff, but things that I wish that my colleagues could read, rather than new ideas for me. Concepts like doing the simplest thing that could work, and not doing too much up front were prominent, which will be familiar to anyone who has tried XP. Now that makes it useful, because the authors explain concepts better than I probably would. Also it showed me that I am not alone in my opinion on certain programming topics. Also, if you didn't know about <a href="http://www.hibernate.org">Hibernate</a> (I did) or <a href="http://www.springframework.org/">Spring</a> (I didn't) it's worth reading, but now I've told you about them.<br /><br />So I cannot give it a huge recommendation, as I cannot tell you much I learnt from it, it just made me feel self-righteous. I've lent it to one of my colleagues, and I await to hear what he thinks of it.Nick Fortescuehttp://www.blogger.com/profile/11154498742042292761noreply@blogger.com0