<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>agile &amp; kayak coach, Enabler, lean projects, organiser of Magrails, buddhist, father, musician, writer, kayak</description><title>Francis Fish</title><generator>Tumblr (3.0; @fjfish)</generator><link>http://www.francisfish.com/</link><item><title>"Laurie Penny’s Saudade

There are more of us than you think, kicking off our high-heeled shoes to..."</title><description>“&lt;p&gt;Laurie Penny’s Saudade&lt;/p&gt;

&lt;p&gt;There are more of us than you think, kicking off our high-heeled shoes to run and being told not so fast&lt;/p&gt;

&lt;p&gt;The best minds of my generation consumed by craving, furious half naked starving-&lt;/p&gt;

&lt;p&gt;Who ripped tights and dripping make up smoked alone in bedsits bare mattresses waiting for transfiguration.&lt;/p&gt;

&lt;p&gt;Who ran half dressed out of department stores yelling that we didn’t want to be good and beautiful&lt;/p&gt;

&lt;p&gt;Who glowing high and hopeful were the last to leave the gig our skin crackling with lust and sweat and pure music&lt;/p&gt;

&lt;p&gt;Who wrote poetry on each other’s arms and cared more about fucking than being fuckable&lt;/p&gt;

&lt;p&gt;Who worked until our backs stiffened and our limbs sang with the memory of misbehaviour that was what it was to be a woman&lt;/p&gt;

&lt;p&gt;Who dared to dance until dawn and were drugged and raped by men in clean T-shirts and woke up scared and sore to be told it was our fault&lt;/p&gt;

&lt;p&gt;Who swallowed bosses’ patronizing side-eyes stole away from violent broken boys in the middle of the night and vowed never again to try to fix the world one man at a time&lt;/p&gt;

&lt;p&gt;Who slammed down the tray of drinks and tore off our aprons and aching smiles and went scowling out into the streets looking for change&lt;/p&gt;

&lt;p&gt;Who stripped in dark rooms for strangers’ anodyne dollars because we wanted education and were told we were traitors&lt;/p&gt;

&lt;p&gt;Who sat faces upturned to the glow of the network searching searching for strangers who would call us pretty&lt;/p&gt;

&lt;p&gt;Who bared our breasts to hidden cameras and fought and fought and fought to be human&lt;/p&gt;

&lt;p&gt;Who waited in grim hallways with synth-pop crackling over the speaker system for the doctor to call us clutching fistfuls of pamphlets calling us sluts whores murderers&lt;/p&gt;

&lt;p&gt;Who crossed continents alone with knapsacks full of books bare limbs clear-eyed vision running running from the homes that held our mothers down&lt;/p&gt;

&lt;p&gt;Who filled notebooks with gibberish philosophy and scraps of stories and cameras to prove we were there keeping our novels and the name of out children close to our hearts&lt;/p&gt;

&lt;p&gt;Who were told all our lives that we were too loud too tisky too fat too ugly too scruffy too selfish too much too and refused to take up less space refused to be still refused refused refused to be tame&lt;/p&gt;

&lt;p&gt;Who would never be still. Who would never shut up. Who were punished for it and spat and snarled and they shook the bars of our cages until they snapped and they called us wild and crazy and we laughed with mouths open hearts open hands open and would never not ever be tame.&lt;/p&gt;

&lt;p&gt;Sara, I’m with you in hospital, in the narroe rooms where you have put off your veil to count your ribs through your T-shirt, short hair and secrets and quiet defiance crying together that we don’t know how to be perfect-&lt;/p&gt;

&lt;p&gt;Lara, I’m with you in mandatory art therapy, where we draw pictures of weeping cocks and are told we are not making progress-&lt;/p&gt;

&lt;p&gt;Lila, I’m with you in a north London bathdroom, watchhing unreal maggots crawl in the cuts in your arms and listening to your girlfriend drunk and raging through the wall-&lt;/p&gt;

&lt;p&gt;Andy, I’m with you in Bethnal Green where you love ambitious angry women with heart brain pen fingers tongue and you have a line from Nietzche tattooed over your cunt-&lt;/p&gt;

&lt;p&gt;Adele, I’m with you in the student occupation, with your lipstick and cloche hat and teenage lisp drawling that there’s not enough fucking in this revolution and we must take action-&lt;/p&gt;

&lt;p&gt;Kay, I’m with you on the night bus, half drunk and high dragging bright-eyed boys home to our bed, where we watch them worn out sleeping and whisper that we will never be married-&lt;/p&gt;

&lt;p&gt;Katie, I’m with you in Zuccotti Park, where a broken heart is less important than a broken laptop is less important than a broken future and we watch the cops beating kids bloody on the pavement for daring to ask for more-&lt;/p&gt;

&lt;p&gt;Tara, I’m with you in Islington where you have thrown all your pretty dresses out of the window and flushed your medication so you can write and write-&lt;/p&gt;

&lt;p&gt;Alex, I’m with you and a bottle of Scotch at two in the morning when you tell me that no man will make us live for ever and we must seduce the city the country the world-&lt;/p&gt;

&lt;p&gt;We are always hungry.&lt;/p&gt;

&lt;p&gt;There are more of us than you think.&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;p&gt;Laurie Penny’s Saudade, from &lt;em&gt;Fifty Shades of Feminism&lt;/em&gt; (via &lt;a class="tumblr_blog" href="http://mollycrabapple.tumblr.com/"&gt;mollycrabapple&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;So good.&lt;/p&gt;
&lt;p&gt;(via &lt;a class="tumblr_blog" href="http://neil-gaiman.tumblr.com/"&gt;neil-gaiman&lt;/a&gt;)&lt;/p&gt;&lt;/em&gt;</description><link>http://www.francisfish.com/post/50720410493</link><guid>http://www.francisfish.com/post/50720410493</guid><pubDate>Sat, 18 May 2013 12:00:49 +0100</pubDate></item><item><title>Imagine you're reincarnated as a unicode character.  Which one?</title><description>&lt;p&gt;That’s really hard. If there was one for emptiness it would be easy. Not space though - that one’s really annoying :)&lt;/p&gt;</description><link>http://www.francisfish.com/post/50408870532</link><guid>http://www.francisfish.com/post/50408870532</guid><pubDate>Tue, 14 May 2013 09:18:53 +0100</pubDate></item><item><title>Unicorns in the mist published at last</title><description>&lt;p&gt;I&amp;#8217;ve been working on &lt;a href="https://leanpub.com/unicorns" target="_blank"&gt;Unicorns in the Mist&lt;/a&gt; for a while and, because I was ill, decided to get it out of scrivener and into the wider world.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s my take on applying systems thinking to getting projects and &lt;em&gt;stuff&lt;/em&gt; done and is assembled roughly 50/50 from old blog posts and new material.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s free to download if you want to have a look at it.&lt;/p&gt;</description><link>http://www.francisfish.com/post/48786182493</link><guid>http://www.francisfish.com/post/48786182493</guid><pubDate>Wed, 24 Apr 2013 19:09:00 +0100</pubDate></item><item><title>Review of Why Most Things Fail: Evolution, Extinction and Economics by Paul Ormerod</title><description>&lt;p&gt;&lt;a href="http://www.goodreads.com/book/show/676586.Why_Most_Things_Fail"&gt;&lt;img alt="Why Most Things Fail: Evolution, Extinction and Economics" src="http://d.gr-assets.com/books/1320484743m/676586.jpg"/&gt;&lt;/a&gt;&lt;a href="http://www.goodreads.com/book/show/676586.Why_Most_Things_Fail"&gt;Why Most Things Fail: Evolution, Extinction and Economics&lt;/a&gt; by &lt;a href="http://www.goodreads.com/author/show/182463.Paul_Ormerod"&gt;Paul Ormerod&lt;/a&gt;&lt;br/&gt; My rating: &lt;a href="http://www.goodreads.com/review/show/556383049"&gt;5  of 5 stars&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; I think this is an important book, and I also think its message might be difficult for some people to reconcile their world view with. Ormerod sets his stall out to show that economists have presumed that the economy (and lots of other systems we think of all day every day) actually is a steady state, that markets exist as a relationship between buyers and sellers, with supply and demand following perfect curves that come from perfect knowledge.&lt;br/&gt;&lt;br/&gt;Of course, as he points out, this is nonsense. Markets don&amp;#8217;t exist in a steady state, there are too many factors that cause change. Ormerod cites work done that shows even if the steady state were to occur any kind of shock to it could take as long as a hundred years before it would stabilise again.&lt;br/&gt;&lt;br/&gt;The classical view that comes all the way from Adam Smith assumes perfect knowledge, actors in the system need to know what every other actor is doing. This doesn&amp;#8217;t happen, the textbook view that makes assumptions around marginal costs is bogus, a lot of the time businesses don&amp;#8217;t know what they are, a lot of the time they don&amp;#8217;t know what their competitors are doing, and as you can&amp;#8217;t see into the future, even if they did it probably wouldn&amp;#8217;t help because you still don&amp;#8217;t know what your customers may want that you don&amp;#8217;t do. Most businesses of any size or complexity tend to work using rules of thumb, and the MBA spreadsheets don&amp;#8217;t help because they assume perfect information. Also, your customers might just not like what you have to offer this season.&lt;br/&gt;&lt;br/&gt;He looks at work done on evolution. In particular work done by Raup shows that there is a power series relationship between the frequency of extinction events and their size. Other people have discovered that you can draw almost exactly the same curve if you look at business failures. This has some interesting consequences - if you play with these models and look at an arbitrary measure of &amp;#8216;fitness&amp;#8217; in the Darwinian sense then a degree of cooperation is actually good for the long term viability of the system as a whole. Ultra competition forces prices down and isn&amp;#8217;t good in the long run - neither is cost cutting.&lt;br/&gt;&lt;br/&gt;The problem of perfect information is also addressed by looking at simple games, such as the Prisoner&amp;#8217;s dilemma, played over many iterations and looking at what strategies win over the long term. As well as an arbitrary game involving where on a line you might place your ice cream stand to get the most customers. As soon as you have more than two players, and more than one time of entry into an existing market it becomes almost impossible to do more than work out what the graph of possible solutions to the problem is and understand the shape of it. If you are one of the players it&amp;#8217;s hard to work out what to do.&lt;br/&gt;&lt;br/&gt;Interestingly we have two extinction models - one is external shocks (the asteroid of dyno extinction fame), another is that a niche closes because of some other factor in the competition and a species dies out. Species are competing and cooperating (predators stop prey eating all of the available food and destroying the environment which means both species survive), so there could be a cascade from what looks like a relatively small cause. In fact, both happen, there is no either/or. But modelling this, predicting the future, becomes impossible. All you can do is look at the shape and work out how to cope with what may happen.&lt;br/&gt;&lt;br/&gt;Ormerod concludes by giving an overview of the work of Schumpter and Hayek, that is often ignored. &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;span&gt;The visions of the world articulated by orthodox economists and by Hayek are fundamentally different. Conventional theory describes a highly structured mechanical system. Both the economy and society are in essence gigantic machines, whose behaviour can be controlled and predicted. Hayek&amp;#8217;s view is much more rooted in biology. Individual behaviour is not fixed, like a screw or cog in a machine is, but evolves in response to the behaviour of others. Control and prediction of the system as a whole is simply not possible.&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;Ormerod quotes several examples of systems coming up with robust solutions to problems (even the origins of the mighty US dollar) that weren&amp;#8217;t obvious until they were left alone to find solutions themselves. A good example of this is the hub and spoke architecture of US domestic airlines that appeared after deregulation. It serves customer needs but no-one could have foreseen it at the time.&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;The central argument is that central planning doesn&amp;#8217;t work and solutions that are workable and human come from creating environments where the actors can work together on solutions that benefit them. Essentially. &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;span&gt;&amp;#8230; it is innovation, evolution and competition which are the hallmarks of a successful system &amp;#8230;&lt;/span&gt;&lt;br/&gt;Schumpter coined the phrase &amp;#8216;gales of creative destruction&amp;#8217;. He argued that innovation led to such gales that the caused old ideas, technologies, skills and equipment to become obsolete. The question &amp;#8230; was not &amp;#8216;how capitalism administers existing structures &amp;#8230; [but] how it creates and destroys them&amp;#8217;. Creative destruction, he believed, caused continuous progress and improved standards of living for everyone.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;This has serious and interesting consequences for policy makers - the models show that forcing too much competition between actors hurts the overall fitness of the system, and also protection does too. So most of the time they must resist the urge to exhort and fiddle - this comes right back to the work that Deming did all those years ago that no-one remembers and everyone should read. &lt;a href="http://www.goodreads.com/search/search?q=Four%20days%20with%20Doctor%20Deming" title="Four days with Doctor Deming"&gt;Four days with Doctor Deming&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;But if they resist the temptation to exhort and fiddle without enough information, if they don&amp;#8217;t listen to lobbyists and make sure decisions are made locally by the people who know what&amp;#8217;s needed. If they do all these things, we don&amp;#8217;t need that many them and they don&amp;#8217;t need to do much to keep things steady. &lt;br/&gt;&lt;br/&gt;I&amp;#8217;ve just started reading &lt;a href="http://www.goodreads.com/book/show/13530973.Antifragile" title="Antifragile by Nassim Nicholas Taleb"&gt;Antifragile&lt;/a&gt;, which addresses the other side of this equation, given that the world is very unpredictable isn&amp;#8217;t it better to create institutions and systems that aren&amp;#8217;t brittle from so much command and control mania and even benefit from small shocks and changes. I will return to this subject again in my next review. I think that I have accidentally stumbled on two books that complement each other. Ormerod&amp;#8217;s work gives a mathematical, scientific background that looks across many disciplines to say some very similar things.&lt;br/&gt;&lt;br/&gt;So, read this book, it will surprise you and leave you thinking about how we should do things so that failure is part of what happens but isn&amp;#8217;t a catastrophe. &lt;br/&gt;&lt;br/&gt;&lt;a href="http://www.goodreads.com/review/list/3602145-francis-fish"&gt;View all my reviews&lt;/a&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/44955287459</link><guid>http://www.francisfish.com/post/44955287459</guid><pubDate>Sat, 09 Mar 2013 18:40:00 +0000</pubDate></item><item><title>Now I are Python koder too</title><description>&lt;p&gt;I&amp;#8217;ve recently taken on a gig where I am writing Python code because the work is mostly done in Python and they want it to be maintainable by the original team members.&lt;/p&gt;
&lt;p&gt;I have to confess that Python was my gateway language into the world of non-rigid Java nastiness but this is the first time I&amp;#8217;ve ever used it proper hard in earnest for money.&lt;/p&gt;
&lt;p&gt;In my Ruby practice I&amp;#8217;ve recently changed the way I write code pretty radically. I now&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span&gt;tend to write very small methods that just do one thing, I write tests that test those one things. I usually write the tests first. &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;I&amp;#8217;ve also started using little lambda functions and passing them into other wrapper methods that just need to call the processing hidden in the lambda.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Every time I see lots of assignments one after the other I&amp;#8217;ve started using tap or returning to protect me from my own stupidity.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;When I see case statements I tend to create a little helper class&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;I will create little classes inside the current class so I can just ask them about things instead of writing procedural code. I can also test them too if I need to.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Really getting away from writing long methods full of procedural code. They are a sod to test and confusing to read.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;span&gt;Now I&amp;#8217;ve done some Python I&amp;#8217;ve realised that there are a few things I like:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Files are modules, and namespaced. This is a little odd at first but I like it. It means you could do without classes if you wanted, maybe.&lt;/li&gt;
&lt;li&gt;I&amp;#8217;m on the fence with objects needing to have &lt;em&gt;self&lt;/em&gt; typed everywhere. I can see how it&amp;#8217;s easier to create an OO style quickly if you force the coder to put &lt;em&gt;self&lt;/em&gt; everywhere, but it feels heavy. It also feels right because you can&amp;#8217;t do stupid assignment bugs like you can in Ruby, or rather the bug shouts out at you when you have.&lt;/li&gt;
&lt;li&gt;I like list comprehensions, but they seem really heavy after using blocks for years.&lt;/li&gt;
&lt;li&gt;I like how (like Ruby) you can pass references to functions around, and I think the syntax is superior.&lt;/li&gt;
&lt;li&gt;I like the built in help. Ruby&amp;#8217;s is not built into the classes the way Python&amp;#8217;s is and you often find yourself digging round on the web for a while when a couple of commands in the Python interpreter and you&amp;#8217;re away.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I don&amp;#8217;t like (as in &amp;#8230; why?):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;I don&amp;#8217;t like procedural-style conversion functions polluting the top level namespace, but I have understood that (for example) &lt;em&gt;list&lt;/em&gt; is really a class that you initialise and isn&amp;#8217;t really a function. It just looks like one.&lt;/li&gt;
&lt;li&gt;Ruby enforces a convention that classes (i.e. constants) all begin with a capital letter. It seems silly, but not having an enforced convention makes unpicking code harder than it needs to be. I think the first point would have been easier to get my head around if I&amp;#8217;d been able to see that these conversion functions were actually class constructors. Java has the convention of upper case classes but doesn&amp;#8217;t enforce it - this is a major pain, or can be.&lt;/li&gt;
&lt;li&gt;Python has a built in complex number type, but &lt;em&gt;doesn&amp;#8217;t&lt;/em&gt; have any native syntax for regexp. I was looking in the Python docs and there was some nonsense about not needing syntax because you don&amp;#8217;t use regexp much and typing strings is fine. Utter crap, I use them way more than complex numbers. Plus if you want a complex type in Ruby it&amp;#8217;s really easy to make one and just drop it in. Always having to screw around with strings is one of the things that makes Java so unbearable. I like syntactic sugar and syntactic checking, makes life easier and it&amp;#8217;s relatively trivial to add in. Just lazy not to, and it shouldn&amp;#8217;t be dressed up.&lt;/li&gt;
&lt;li&gt;Overriding methods like + and so on is a bit hard, because of the method naming. Not too bad, just irritating. &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;I got a copy of Learning Python, and I&amp;#8217;m about 40% of the way through it. No significant mention of objects at all yet. I mean, the &lt;em&gt;word&lt;/em&gt; has been used, but not the thing. Just loads of procedural code examples. I&amp;#8217;m beginning to think that this is a function of how the language grew. It was picked up by a lot of folk who were moving from hoary old procedural environments, like Fortran, and who were used to thinking in huge chunks of code. So it gets taught that way, and people pick up habits that are bad, and hard to improve upon. I&amp;#8217;m almost tempted to put together my own book that puts the objects first, but don&amp;#8217;t have enough time to do the things I need to do as it is. &lt;/p&gt;
&lt;p&gt;&lt;span&gt;So the first Python module I picked up as an example of how to do the work I&amp;#8217;m doing was 300 lines of procedural code. I ignored most of this and started with unittest and worked backwards into some simple classes that do a similar job in about half the code (not including tests). So it is possible to write nice clean BDD Python code, but doesn&amp;#8217;t seem to be part of the culture. The examples aren&amp;#8217;t very good.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think it&amp;#8217;s a good language and don&amp;#8217;t mind using it, but there is definitely a problem with object orientation and design being treated as something for the adults and maybe only later that I think needs to be addressed.&lt;/span&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/42860400745</link><guid>http://www.francisfish.com/post/42860400745</guid><pubDate>Mon, 11 Feb 2013 20:01:23 +0000</pubDate></item><item><title>Republished my novel Archive Fragments on Lean Pub</title><description>&lt;p&gt;I thought I&amp;#8217;d try out the Lean pub platform and put my novel &lt;a href="https://leanpub.com/archive-fragments" target="_blank"&gt;Archive Fragments&lt;/a&gt; up there. Over the next month or so most of my creative and technical work will appear there so that people can see it more easily.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s over 64,000 words long, and I hope an interesting read. &lt;/p&gt;
&lt;p&gt;Enjoy.&lt;/p&gt;</description><link>http://www.francisfish.com/post/40020843103</link><guid>http://www.francisfish.com/post/40020843103</guid><pubDate>Tue, 08 Jan 2013 17:26:30 +0000</pubDate></item><item><title>Running your Rails apps on a Mac</title><description>&lt;p&gt;I keep making the obviously false assumption that people know how to run Rails apps on a Mac.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re starting from scratch have a look here: &lt;a href="http://railsinstaller.org/#osx"&gt;&lt;a href="http://railsinstaller.org/#osx"&gt;http://railsinstaller.org/#osx&lt;/a&gt;&lt;/a&gt; - I haven&amp;#8217;t looked at it, but it looks like it will take a lot of pain away. This post is for people who have an existing app running on an old version.&lt;/p&gt;
&lt;p&gt;The following assumes that you have some kind of Ruby installed and some kind of Ruby gems that came with it.&lt;/p&gt;
&lt;p&gt;Also, you&amp;#8217;ve already got some Rails code, that may be running an old version of everything.&lt;/p&gt;
&lt;h2&gt;Install XCode if you need to&lt;/h2&gt;
&lt;p&gt;Start up a terminal and type&lt;/p&gt;
&lt;p&gt;cc&lt;/p&gt;
&lt;p&gt;If it gives you a command not found error then you need to download XCode from the App Store, fire it up, and then ask it to install the command line utilities. This can take a while, and google is your friend if you don&amp;#8217;t know where to find things.&lt;/p&gt;
&lt;p&gt;If you already have XCode then you just need to install the command line utilities, which are off on a menu somewhere.&lt;/p&gt;
&lt;h2&gt;Install RVM&lt;/h2&gt;
&lt;p&gt;gem install rvm&lt;/p&gt;
&lt;p&gt;when it gets to the end of the install it will tell you what to do to your shell environment to run rvm properly. DO IT. :) For reference see &lt;a href="https://rvm.io/"&gt;&lt;a href="https://rvm.io/"&gt;https://rvm.io/&lt;/a&gt;&lt;/a&gt; If you are unfamiliar with getting things to run in the active shell after altering the shell startup commands, just close the terminal and start a new one, life&amp;#8217;s too short.&lt;/p&gt;
&lt;h2&gt;Install the Ruby you need&lt;/h2&gt;
&lt;p&gt;In this exercise we want Ruby 1.8.7, so &amp;#8230;&lt;/p&gt;
&lt;p&gt;rvm install 1.8.7&lt;/p&gt;
&lt;p&gt;Eventually it will finish and tell you the version it installed, e.g. ruby-1.8.7-p352&lt;/p&gt;
&lt;p&gt;You may encounter some errors, where Apple have kindly set the default C compiler not to be the old GNU &amp;#8216;C&amp;#8217; compiler but their llvm one. Cut the error message out and paste it into Google, then do what it says. &lt;/p&gt;
&lt;p&gt;These instructions might say that it can&amp;#8217;t find the command that you put into the environment variable, in which case use &lt;em&gt;whereis cc&lt;/em&gt; to tell you where the cc command is.&lt;/p&gt;
&lt;p&gt;Any other problems, use the more command or an editor to browse the log file it says&lt;/p&gt;
&lt;h2&gt;Create a .rvmrc file in your Rails root&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s assume the Rails app is called brightstuff. In the root of your Rails app type&lt;/p&gt;
&lt;p&gt;ls .rvmrc&lt;/p&gt;
&lt;p&gt;If it finds something, have a look and see what it says, for the purposes of this exercise I&amp;#8217;m assuming the file isn&amp;#8217;t there. Type the command&lt;/p&gt;
&lt;p&gt;cat &amp;#8220;rvm use ruby-1.8.7-p334@brightstuff&amp;#8221; &amp;gt; .rvmrc&lt;/p&gt;
&lt;p&gt;Change &lt;em&gt;brightstuff &lt;/em&gt;to the name of your app.&lt;/p&gt;
&lt;p&gt;Now&lt;/p&gt;
&lt;p&gt;cd ..&lt;/p&gt;
&lt;p&gt;cd -&lt;/p&gt;
&lt;p&gt;This takes you up and then back to the directory you just added the rvmrc to. &lt;strong&gt;If you have installed RVM correctly it will ask you if you want to use the .rvmrc.&lt;/strong&gt; Say yes.&lt;/p&gt;
&lt;p&gt;Now&lt;/p&gt;
&lt;p&gt;gem install bundler&lt;/p&gt;
&lt;p&gt;bundle install&lt;/p&gt;
&lt;p&gt;This will set all the gems up for you in this version of Ruby, in a group named after your app.&lt;/p&gt;
&lt;p&gt;Some people don&amp;#8217;t use the gemset (which we have named brightstuff) and rely on bundle exec, but I&amp;#8217;ve found this to be pretty bomb proof.&lt;/p&gt;
&lt;p&gt;You can also install gems independently of the Gemfile used by bundler, I typically install things like powder (see below) like this, because they aren&amp;#8217;t needed in any context other than development.&lt;/p&gt;
&lt;h2&gt;Start the Rails app&lt;/h2&gt;
&lt;p&gt;As is standard, you can start a development version of the app with:&lt;/p&gt;
&lt;p&gt;bundle exec script/server&lt;/p&gt;
&lt;p&gt;This will start the app on &lt;a href="http://localhost:3000"&gt;http://localhost:3000&lt;/a&gt;, you can use /etc/hosts and various tools (go look for them) to alias them, and start things on different ports.&lt;/p&gt;
&lt;h2&gt;Other things&lt;/h2&gt;
&lt;p&gt;I use the pow utility and it&amp;#8217;s friend the powder gem to run my apps. &lt;a href="http://pow.cx/"&gt;&lt;a href="http://pow.cx/"&gt;http://pow.cx/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/36131865935</link><guid>http://www.francisfish.com/post/36131865935</guid><pubDate>Tue, 20 Nov 2012 10:30:00 +0000</pubDate><category>rails</category><category>ruby</category></item><item><title>Review of "Dancing with Dragons"</title><description>&lt;p&gt;&lt;a href="http://www.goodreads.com/book/show/12177850-george-r-r-martin-a-song-of-ice-and-fire-5-book-set-series-a-game-of"&gt;&lt;img alt="George R.R. Martin, A Song of Ice and Fire, 5 Book Set Series, A Game of Thrones, A Clash of Kings, A Storm of Swords, A Feast for Crows, A Dance with Dragons" border="0" src="http://photo.goodreads.com/books/1339340118m/12177850.jpg"/&gt;&lt;/a&gt;&lt;a href="http://www.goodreads.com/book/show/12177850-george-r-r-martin-a-song-of-ice-and-fire-5-book-set-series-a-game-of"&gt;George R.R. Martin, A Song of Ice and Fire, 5 Book Set Series, A Game of Thrones, A Clash of Kings, A Storm of Swords, A Feast for Crows, A Dance with Dragons&lt;/a&gt; by &lt;a href="http://www.goodreads.com/author/show/346732.George_R_R_Martin"&gt;George R.R. Martin&lt;/a&gt;&lt;br/&gt; My rating: &lt;a href="http://www.goodreads.com/review/show/444096780"&gt;3 of 5 stars&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; I have enjoyed the Game of Thrones series right from the beginning, but this book was very disappointing. The writing was very laboured in places, with characters repeating themselves, and there weren&amp;#8217;t enough dragons in it for me. It also seemed to take far too long for anything interesting to happen, and when something happened it took a long time to actually effect anything.&lt;br/&gt;&lt;br/&gt;The title is a reference to the various bits of royalty that have connections with the original Dragon Throne, but the dragons that Dany is bringing up don&amp;#8217;t do much for 90% of the book.&lt;br/&gt;&lt;br/&gt;I was also really interested in what was going to happen to Arya, but the answer was - &amp;#8220;not much&amp;#8221;.&lt;br/&gt;&lt;br/&gt;And we finally meet the three eyed raven but again what happens? &amp;#8220;not much&amp;#8221;.&lt;br/&gt;&lt;br/&gt;The book could have been 25% shorter and not lost anything, it needed an edit. Rather like the Harry Potter &amp;#8220;Order of the Phoenix&amp;#8221; it felt like it had been rushed and then left.&lt;br/&gt;&lt;br/&gt;The cliff hanger ending was really laboured, and I&amp;#8217;m not sure I can be bothered reading book 6. I also thought it was possibly the last book in the series and was irritated that a good number of plot lines are still dangling.&lt;br/&gt;&lt;br/&gt;Not sure I care enough to read the last book, assuming there aren&amp;#8217;t books 7 and 8 after it. &lt;br/&gt;&lt;br/&gt;&lt;a href="http://www.goodreads.com/review/list/3602145-francis-fish"&gt;View all my reviews&lt;/a&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/34569038740</link><guid>http://www.francisfish.com/post/34569038740</guid><pubDate>Mon, 29 Oct 2012 15:54:00 +0000</pubDate></item><item><title>Review of Better: A surgeons notes on performance</title><description>&lt;p&gt;&lt;a href="http://www.goodreads.com/book/show/213233.Better"&gt;&lt;img alt="Better: A Surgeon's Notes on Performance" border="0" src="http://photo.goodreads.com/books/1316728366m/213233.jpg"/&gt;&lt;/a&gt;&lt;a href="http://www.goodreads.com/book/show/213233.Better"&gt;Better: A Surgeon&amp;#8217;s Notes on Performance&lt;/a&gt; by &lt;a href="http://www.goodreads.com/author/show/3078.Atul_Gawande"&gt;Atul Gawande&lt;/a&gt;&lt;br/&gt; My rating: &lt;a href="http://www.goodreads.com/review/show/443970100"&gt;5 of 5 stars&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; This book is an easy read but very thought provoking.&lt;br/&gt;&lt;br/&gt;One of the most interesting bits was where he examines the difference between the average Cystic Fibrosis centres and the best ones. All human activity has a bell curve attached to it, but CF treatment is very well understood and systematic. So why does one centre have startlingly better results than another?&lt;br/&gt;&lt;br/&gt;In essence the better centre didn&amp;#8217;t compromise, they didn&amp;#8217;t think that (for example) 80% lung function was good enough, the patients under their care were expected to have 100% or better.&lt;br/&gt;&lt;br/&gt;It&amp;#8217;s the difference between 99.99% and 99.5% - we&amp;#8217;d all be happy with 99.5, but excellence is in the remaining fraction of a percent, because when you add this up over several years this tiny difference means a lot. The sums are simple 99.5 over 5 years will give 97%, 99.99 will still be 99.99 or thereabouts. If you take this up over a patient&amp;#8217;s life of 30 or 50 years the difference would be even more apparent.&lt;br/&gt;&lt;br/&gt;I&amp;#8217;ve hit this in other walks of life, for example project management, where you maybe have a 0.9 chance of finishing on time every iteration. This means that the chances of still being on track are as low as 0.6 after 5 iterations - it&amp;#8217;s just mathematics. When building software having a fire break every so often to deal down the technical debt and reset the projects is perfectly doable, but if you&amp;#8217;re looking for excellence in medical care or some other industry that could kill people then you have to become fanatical about getting higher scores &lt;br/&gt;&lt;br/&gt;There are plenty of other excellent articles in the book, the fight to eradicate polio and the crazy situation faced by doctors in India are really great articles, and I learned a lot about how we could really help the people in poor countries. I admire Gawande&amp;#8217;s honesty about his own shortcomings, this gives the writing a validity that it would otherwise lack. And the nutty unjust system that is the law based compensation for medical errors, that wrecks the chances of the poor to get help and helps no-one but the lawyers. &lt;br/&gt;&lt;br/&gt;&lt;a href="http://www.goodreads.com/review/list/3602145-francis-fish"&gt;View all my reviews&lt;/a&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/34558771172</link><guid>http://www.francisfish.com/post/34558771172</guid><pubDate>Mon, 29 Oct 2012 11:19:47 +0000</pubDate></item><item><title>Nearly midnight, again</title><description>&lt;p&gt;&lt;p class="p1"&gt;&lt;span class="s1"&gt;So here we are again, it&amp;#8217;s the middle of the night and I should be asleep. Instead I sit here waiting for the evening to be over. It&amp;#8217;s dark outside but for the street lights. I wonder which of the endless layers of me is writing this, what obscure trophism is pretending to be me right now, creating the narrative force that pretends to be I.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;I could be angry or frustrated, or so many things at once. The mind is an endless running brook split by rocks. The streams join together and I emerges out of the wreckage of all of the conflicting pieces, a pretence of a coherent whole. One never sees this sleight of hand except when you do bad things. The doing and the justification rarely hold up when you place them firmly under the microscope. So few people ever do, they just stumble from one moment to the next, thinking they are thinking and deciding things. But it&amp;#8217;s all the dance of chemical chimera.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;Longer ago than you can count stars exploded and made the matter you are made of. You sit at the bottom of a gravity well, perfectly adapted to what is in front of you, the chain of circumstances, of causes and conditions goes back beyond even those stars.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;They died for love, for love could never have existed without them. But they had no mind, no awareness to die for it. Just like sand accumulating on the beach, it is ineluctable and happens without a master plan. So too, this whirling of circumstances that manufactures I will be gone and never seen again. The Buddhist masters say that the lives connected with you are like bricks on top of one another, the wall would not stand without that connection: but I begin to feel that the bricks are just bricks, the connection is the connection behind everything - the fragile I just makes itself and leaves enough traces to allow another one to stand in its place with some of the same attributes.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;So let it go, now, and embrace it too. &lt;/span&gt;&lt;/p&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/31360393238</link><guid>http://www.francisfish.com/post/31360393238</guid><pubDate>Tue, 11 Sep 2012 23:40:00 +0100</pubDate></item><item><title>I made a T shirt</title><description>&lt;p&gt;&lt;div&gt;
&lt;div&gt;&lt;a href="http://www.vistaprint.co.uk/vp/gateway.aspx?s=5462298028&amp;amp;preurl=http%3a%2f%2fwww.vistaprint.co.uk%2fshare-design.aspx%3fdoc_id%3d2336391028%26shopper_id%3dQDHM5V0W0W6REU366VPP0RIDLD3R1E4U%26xnav%3dsharesource_4%26share_key%3de2801aa4-dd97-45c7-92e8-4c861c2eea09" target="blank"&gt;&lt;img src="http://www.vistaprint.co.uk/lp.aspx?alt_doc_id=9MNVZ-N1A37-0I8&amp;amp;width=250&amp;amp;shopper_id=QDHM5V0W0W6REU366VPP0RIDLD3R1E4U"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://vistaprint.co.uk/custom-t-shirts.aspx" target="_blank"&gt;Basic Men&amp;#8217;s T-Shirts&lt;/a&gt; by &lt;a href="http://vistaprint.co.uk" target="_blank"&gt;Vistaprint&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;Not sure if Vistaprint give me any readies for this, but what the hell.&lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</description><link>http://www.francisfish.com/post/29433211370</link><guid>http://www.francisfish.com/post/29433211370</guid><pubDate>Tue, 14 Aug 2012 22:49:19 +0100</pubDate></item><item><title>It's not a bug. It's a feature.</title><description>&lt;p&gt;I like Android development. But you go off the beaten path and, well &amp;#8230;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve written some custom ListView objects that get rendered depending on what kind of device is needed for a home automation app I&amp;#8217;m working on.&lt;/p&gt;
&lt;p&gt;So far so bad.&lt;/p&gt;
&lt;p&gt;Now you need to be able to turn that device on or off.&lt;/p&gt;
&lt;p&gt;Tricky.&lt;/p&gt;
&lt;p&gt;On the phone&amp;#8217;s screen there is a button for every item displayed, each showing the correct value. &lt;/p&gt;
&lt;p&gt;BUT &amp;#8230; inside it reuses the object that has been created. I have attached listeners to the button that mean when you toggle it off or on it sends a message to the underlying device.&lt;/p&gt;
&lt;p&gt;It does. But then it sends messages to ALL the devices of the same type, because I&amp;#8217;ve attached the listeners to what is basically the same GUI over and over again. So it looks right on the screen, but underneath all that happened was things were set in the right order so they display correctly. Right at the end of the call chain it sets the value back just for fun.&lt;/p&gt;
&lt;p&gt;OK - let&amp;#8217;s get it to tell me the ID of whichever row was tapped and only allow commands to be sent to that device. Nope. The button has the focus and won&amp;#8217;t tell it&amp;#8217;s container there was a tap and I&amp;#8217;ve tried all the suggestions google could find for me. So the listener doesn&amp;#8217;t ever get fired.&lt;/p&gt;
&lt;p&gt;I think I&amp;#8217;m going to have to short circuit the views and create them by hand, so each is a separate object with its own button etc. defined with its own listeners.&lt;/p&gt;
&lt;p&gt;List View is designed to work with thousands of elements of homogenous data that can be tapped on and treated as a unit. But actually, for the case where there&amp;#8217;s only a few that might have other things on them, it just doesn&amp;#8217;t work.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll have another look on line tomorrow.&lt;/p&gt;
&lt;p&gt;By the way - I&amp;#8217;d lay money that iOS Table View has similar problems, before people start doing the fanboi thing.&lt;/p&gt;</description><link>http://www.francisfish.com/post/27647296875</link><guid>http://www.francisfish.com/post/27647296875</guid><pubDate>Fri, 20 Jul 2012 21:32:00 +0100</pubDate></item><item><title>Take what the defence gives you - coding</title><description>&lt;p&gt;I&amp;#8217;ve recently listened to Steven Pressfield&amp;#8217;s &lt;em&gt;&lt;a href="http://www.blackirishbooks.com/store/turning-pro/" target="_blank"&gt;Turning Pro&lt;/a&gt;&lt;/em&gt; about 10 times driving up and down the motorways. I can&amp;#8217;t recommend it highly enough. One of the things he talks about are the things that get in the way of getting things done, of pursing your art and doing what you have to do when you turn pro.&lt;/p&gt;
&lt;p&gt;So, some days you just can&amp;#8217;t get your mojo on. The pro doesn&amp;#8217;t let this stop the work happening. So you take whatever you can get today and work with it. In sporting terms you&amp;#8217;re having a day where you can&amp;#8217;t make progress against your opponent. So you take what the defence gives you and push on. &lt;/p&gt;
&lt;p&gt;So when you look at what you need to get written today and don&amp;#8217;t know how to start do the little things you &lt;em&gt;can&lt;/em&gt; do and let the ideas percolate through your head. This is similar to the technique where writers just start writing anything that comes into their heads. When you do this it gets you moving and when you are moving you are not stuck any more.&lt;/p&gt;
&lt;p&gt;So take what the defence gives you, take the steps you can take. You can&amp;#8217;t do the big stuff all the time. But &lt;em&gt;keep moving&lt;/em&gt;, that&amp;#8217;s what works.&lt;/p&gt;</description><link>http://www.francisfish.com/post/26924956142</link><guid>http://www.francisfish.com/post/26924956142</guid><pubDate>Tue, 10 Jul 2012 21:28:29 +0100</pubDate></item><item><title>Android and mobile, purity, who cares?</title><description>&lt;p&gt;Been doing Android dev full time for a few weeks now. I have to say I&amp;#8217;m enjoying it. I also put myself through iOS training and have been doing some of that. Really enjoying that too.&lt;/p&gt;
&lt;p&gt;I think I&amp;#8217;m fed up with web apps, and all the arsing about you have to do to get things going and stoping useless bastards breaking your site. I can just fire up an IDE, and I&amp;#8217;m there with mobile.&lt;/p&gt;
&lt;p&gt;Beginning to think that the web will become the cloud (ha ha) sooner or later and most things will generally run as native mobile apps talking to servers (that used to be web servers). This will also take web apps away from the current Jesus-it&amp;#8217;s-JavaScript-with-bouncy-shit car crash, the (web) interfaces will become simple again, because most of the time you&amp;#8217;ll only go onto a site where a phone screen is too small to do something complicated.&lt;/p&gt;
&lt;p&gt;I have to confess that I&amp;#8217;m not missing Scottish Ruby either. I&amp;#8217;d like to be there, but I&amp;#8217;m enjoying writing apps in Objective-C and Java. I like the feel of this. Rails is becoming an over-complicated PITA to install and run. I mean, WTF, we replace JavaScript with something we can&amp;#8217;t even debug? Please!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve also discovered that my hatred of Java is really a hatred of J2EE and all that shoot yourself in the head dependency injection crap. For putting GUI components together in a coherent way it&amp;#8217;s fine. But this makes sense, as it was originally designed to run set top boxes, and build desk top GUIs with Swing. It was only because it was the new kid in town and the web was new at the same time that it ever got popular, i.e. it was the only place to go for corporates who didn&amp;#8217;t want to go the Microsoft route. But it was designed by a committee of computer scientists who&amp;#8217;d didn&amp;#8217;t understand what real people need, so it was always going to suck as much as the MS stuff. Sigh.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not missing Ruby. I&amp;#8217;m not missing BDD. I&amp;#8217;m writing simple apps with a much faster turn around. Fuck me. I&amp;#8217;m having FUN. Who&amp;#8217;d a thunk it? Ruby was fun, it was radical. Rails made the web much easier and quicker. But now? I&amp;#8217;m just bored by it, dunno why. I like to get things in the hands of folk who need them. Don&amp;#8217;t care about the pedantic stuff. In fact the computer science types have taken over again. Sigh.&lt;/p&gt;
&lt;p&gt;If you want to create a ListView adapter that searches on the string arbitrarily I&amp;#8217;ve created a gist &lt;a href="https://gist.github.com/3024308" target="_blank"&gt;here&lt;/a&gt;, by the way. Enjoy.&lt;/p&gt;</description><link>http://www.francisfish.com/post/26214964442</link><guid>http://www.francisfish.com/post/26214964442</guid><pubDate>Sat, 30 Jun 2012 17:09:00 +0100</pubDate></item><item><title>error: Permission denied sending UDP broadcast packets </title><description>&lt;p&gt;Sorry, gentle reader, this one&amp;#8217;s a bit technical.&lt;/p&gt;
&lt;p&gt;I was reusing some of the code Apple supply for sending UDP packets between servers, but the system I&amp;#8217;m working with listens for broadcast packets. I set it up to use the address 255.255.255.255, but got the EACCESS error: Permission denied&lt;/p&gt;
&lt;p&gt;I found an example that did work (without using Apple&amp;#8217;s CFSocket class) and did a line by line what&amp;#8217;s different. You need this to do broadcast&lt;/p&gt;
&lt;p&gt;int broadcastEnable=1;&lt;/p&gt;
&lt;p&gt;int ret=setsockopt(sd, SOL_SOCKET, SO_BROADCAST, &amp;amp;broadcastEnable, sizeof(broadcastEnable));&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;if (ret) {&lt;/div&gt;
&lt;div&gt;    NSLog(@&amp;#8221;Error: Could not open set socket to broadcast mode&amp;#8221;);&lt;/div&gt;
&lt;div&gt;    close(sd);&lt;/div&gt;
&lt;div&gt;    return;&lt;/div&gt;
&lt;div&gt;}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;If you edit this into Apple&amp;#8217;s UDP echo project then it will allow broadcast. Give thanks and praise at &lt;a href="http://splinter.com.au/sending-a-udp-broadcast-packet-in-c-objective" target="_blank"&gt;&lt;a href="http://splinter.com.au/sending-a-udp-broadcast-packet-in-c-objective"&gt;http://splinter.com.au/sending-a-udp-broadcast-packet-in-c-objective&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;</description><link>http://www.francisfish.com/post/23548552337</link><guid>http://www.francisfish.com/post/23548552337</guid><pubDate>Tue, 22 May 2012 17:25:00 +0100</pubDate></item><item><title>LoadError: OpenSSL::SSL requires the jruby-openssl gem</title><description>&lt;p&gt;I had to hack the bundler executable to load the jruby-openssl gem before it tried to load bundler. Then it worked.&lt;/p&gt;
&lt;p&gt;I think the gem command uses openssl, which is built into the MRI version of Ruby, but has to be included as a gem by JRuby and therefore it happens too late.&lt;/p&gt;</description><link>http://www.francisfish.com/post/19645514319</link><guid>http://www.francisfish.com/post/19645514319</guid><pubDate>Tue, 20 Mar 2012 22:19:00 +0000</pubDate></item><item><title>Laments to the 10 years of Agile</title><description>&lt;a href="http://flowchainsensei.wordpress.com/2012/03/04/tom-gilb-laments-the-10-wasted-years-of-agile"&gt;Laments to the 10 years of Agile&lt;/a&gt;: &lt;p&gt;(Click the link above to see the original article - this is a comment I left there)&lt;/p&gt;
&lt;p&gt;The IT project failure rate is a direct result of people ignoring (or plain removing) contingency, usually for political reasons (the Dilbert “pointy haired boss” kind). So a fail is being unable to deliver to a Waterfall-style objectives set at some remove from delivering the projects that were only possible if absolutely nothing went wrong. It goes straight back to Deming’s point about MBO vs MBP – the O’s still have it! If each iteration is an management-forced aspiration rather than based on what is possible (so the chance of “hitting” the story points is even as high as 90%) then you will soon run into trouble (in this example the chance of still being on target after 5 iterations is only around 50%). Of course, in this all to common scenario, everybody gets demotivated too and productivity starts to bomb anyway.&lt;/p&gt;
&lt;p&gt;I agree that many people “do agile” rather than “be agile” – they see it as process rather than mind set, and so throw out all sorts of sea anchors around “doing it right”, as in being obsessed with process, rather than (and this is a point made in the quote) “doing the right thing”. As you’ve said yourself, the process-driven, analytical mind set is a much easier place to be than an open Chaordic one, particularly if you learned you craft in a process driven environment, such as an educational institution and just don’t have the models to do things any other way.&lt;/p&gt;
&lt;p&gt;I see it as a crisis of models, of education, of plain old fear, not principles. It does seem to be getting worse, though. I think we might need a new Manifesto – somewhat less narrow than the craftsmanship movement because it needs to include people who aren’t coders but want to “do the right thing”. In fact, coding is the last thing in this, but it’s the first that everyone looks at because it’s easier to see.&lt;/p&gt;
&lt;p&gt;It’s a great source of frustration and sadness for me that we have all the tools now, we have Deming’s insights, we have agile methods, we have methods for managing uncertainty, blah blah blah – but people still carry on doing the same old stuff assuming the results will be different next time. I think it was Einstein that said that this is a sign of madness.&lt;/p&gt;</description><link>http://www.francisfish.com/post/18719897806</link><guid>http://www.francisfish.com/post/18719897806</guid><pubDate>Sun, 04 Mar 2012 10:21:00 +0000</pubDate></item><item><title>PGError: ERROR: date out of range for timestamp</title><description>&lt;p&gt;Note - this assumes you&amp;#8217;ve enabled the pgbackup plugin in Heroku - as it does the full database backup for you for free - &lt;a href="http://addons.heroku.com/pgbackups" target="_blank"&gt;I suggest you do it right now&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Oh, the fun I just had with this one. One of my clients&amp;#8217; systems started throwing this message over the last week or so.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m lazy so I was using sqlite for my development database and Heroku&amp;#8217;s Postgres for live.&lt;/p&gt;
&lt;p&gt;So, thinks I, time to switch to using Postgres in my development environment, &lt;em&gt;because it must be the database, mustn&amp;#8217;t it?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d installed it on my Macbook ages ago but hadn&amp;#8217;t actually used it with Rails. So I found a couple of blog posts and changed things around. I had already told Postgres to use passwords for validation.&lt;/p&gt;
&lt;p&gt;It took me ages to realise I needed to set a password for the postgres Unix user - this was the password I needed to connect to the database. &lt;a href="http://whatcodecraves.com/articles/2008/02/05/setup_rails_with_postgresql/" target="_blank"&gt;Then I followed these instructions&lt;/a&gt; and got my dev database set up.&lt;/p&gt;
&lt;p&gt;So - &lt;a href="http://addons.heroku.com/pgbackups" target="_blank"&gt;pull stuff down from heroku&lt;/a&gt; and then import it to my dev environment.&lt;/p&gt;
&lt;p&gt;Right - everything works perfectly - right!&lt;/p&gt;
&lt;p&gt;So where is the error? &lt;/p&gt;
&lt;p&gt;I googled for it and found a forum posting suggesting that you could have a date stamp that is outside the range of time stamps and the coercion of date stamps is going boom. Did a lot of messing around in the heroku console to no avail, trying to issue commands like &lt;em&gt;analyze table &lt;/em&gt;and count things.&lt;/p&gt;
&lt;p&gt;Also, the column is a timestamp anyway, so you can&amp;#8217;t store nonsense in it in the first place.&lt;/p&gt;
&lt;p&gt;So, I put the app into maintenance mode, took another backup, restored that backup over the existing database, and all was well.&lt;/p&gt;
&lt;p&gt;This might be a better solution than trying to rescue the database in any event, because all of the statistics will have been reset too.&lt;/p&gt;
&lt;p&gt;I was a little bit hampered by heroku not letting you connect to a shared database because I was trying to issue commands using Active Record - but hey - it&amp;#8217;s free. I do wish that heroku console was slightly more informative than &lt;em&gt;server error&lt;/em&gt;. &lt;/p&gt;</description><link>http://www.francisfish.com/post/17033903107</link><guid>http://www.francisfish.com/post/17033903107</guid><pubDate>Sat, 04 Feb 2012 16:12:00 +0000</pubDate></item><item><title>Rails for Designers</title><description>&lt;p&gt;This is a short post to help designers who aren&amp;#8217;t familiar with Rails understand their way around it enough to change things and work with developers. It assumes that you know CSS and HTML and aren&amp;#8217;t scared of HTML that has embedded code in it.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;p&gt;&lt;strong&gt;The structure of a Rails app&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Rails is a Model/View/Controller system. &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Models are business logic, and storing things in databases&lt;/li&gt;
&lt;li&gt;Views are displaying the contents of the models&lt;/li&gt;
&lt;li&gt;Controllers co-ordinate the Model and the View&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Here is a picture of the directory structure of a Rails app:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lyk3gq3Xe31r26464.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;The files you care about live under app and public:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lyk3m4FDmD1r26464.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;And views also breaks down like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lyk3p83My81r26464.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;This application has an extra top-level directory, &lt;em&gt;artwork&lt;/em&gt;, that isn&amp;#8217;t standard. I used it to keep the artwork and design files under version control.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the directories do:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Public. This is where the root of the application is for static content like CSS and JavaScript files.&lt;/li&gt;
&lt;li&gt;App/Views. This is where the files are stored for rendering dynamic content from the application.&lt;/li&gt;
&lt;li&gt;App/Views/Layouts. This is where the templates that surround the dynamic content are stored.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The example we show here is from before Rails introduced the performance enhancement of the asset pipeline, it complicates things a little and I will discuss it later. What I want do do first is explain the principles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What things do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A layout file looks something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;html&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;head&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;title&amp;gt;Favorbite&amp;lt;/title&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;%= stylesheet_link_tag :all %&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;%= javascript_include_tag :defaults %&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;%= csrf_meta_tag %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/head&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;body&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;div id=&amp;#8221;header&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;div class=&amp;#8221;span8 offset8&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;      &amp;lt;h1&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;a href=&amp;#8221;/&amp;#8221;&amp;gt;&amp;lt;img src=&amp;#8221;/images/favorbite-logo.png&amp;#8221; alt=&amp;#8221;Favorbite logo&amp;#8221;&amp;gt;&amp;lt;/a&amp;gt;&lt;/p&gt;
&lt;p&gt;      &amp;lt;/h1&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;   &amp;lt;%= yield :header %&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;    &amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;  &amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;    &amp;lt;%= yield %&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/body&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a very simple wrapper. It&amp;#8217;s HTML 5, of course. The &amp;lt;%= %&amp;gt; tags are used to embed code. The :all in stylesheet link tag lets us include all of the files in the public/stylesheets directory without having to specify them individually, or you can include them one by one if you need to. This changes with the asset pipleline (but let&amp;#8217;s not worry about that now).&lt;/p&gt;
&lt;p&gt;You can also just put in plain old HTML code to include whatever CSS you like, the helpers are a convenience and also help with cacheing and other wondrous magic web things. &lt;/p&gt;
&lt;p&gt;You can see two lines that I have made bold. Each contains the word &lt;em&gt;yield&lt;/em&gt;. This is a Ruby construct that you can find out more about if you&amp;#8217;re interested. The one that doesn&amp;#8217;t have any arguments will render the appropriate dynamic content file. The one with :header will render any content that is in a block that has that name. For example&lt;/p&gt;
&lt;div&gt;
&lt;blockquote&gt;Hello, this is ordinary content&lt;br/&gt;&lt;br/&gt;&amp;lt;% content_for :header do %&amp;gt;&lt;br/&gt;   This will appear where the yield :header tag tag is, or not appear at all if there isn&amp;#8217;t one.&lt;br/&gt;This is how you define a block, using &amp;#8216;do&amp;#8217;&lt;br/&gt;&amp;lt;% end %&amp;gt;&lt;br/&gt;If we carry on here it will just add into the main text.&lt;br/&gt;&lt;br/&gt;&amp;lt;%= &amp;#8220;the string here will show in the text, without the = sign nothing will happen, the results of any Ruby code need %= to show&amp;#8221; %&amp;gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Working out what gets displayed&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Rails apps have routes go to controllers, and from there to the view depending on what the controller decides to do to render the request. The surrounding layout is set by the controller. For example &lt;strong&gt;&lt;a href="http://myapp.com/chickens/1/edit"&gt;http://myapp.com/chickens/1/edit&lt;/a&gt;&lt;/strong&gt; is asking the router to find a controller called &lt;em&gt;chickens&lt;/em&gt;, and call the method &lt;em&gt;edit&lt;/em&gt; in it. This will then find the chicken with ID 1 and render it to be edited if all goes well.&lt;/p&gt;
&lt;p&gt;The dynamic code for the edit will be in &lt;em&gt;app/views/chickens/edit.html.erb&lt;/em&gt; (ERB being a way of embedding Ruby code), inside that file you may find code that looks like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;%= render :partial =&amp;gt; &amp;#8220;form&amp;#8221; %&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Partials a little chunks of reusable code, because no directory was given it will be assumed to be in the same directory as the other chickens code, here &lt;em&gt;app/views/chickens/_form.html.erb&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The convention for a partial is it has a leading underscore in its name. If the controller doesn&amp;#8217;t explicitly say what dynamic content to render the file that matches the route will be used:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&amp;#8230;/chickens - This will go to index method and will look for a file called index&lt;/li&gt;
&lt;li&gt;&amp;#8230;/chickens/1 - This will try and show the chicken with ID 1 - method/view called show&lt;/li&gt;
&lt;li&gt;&amp;#8230;/chickens/new This will render a form where you can create a new chicken&lt;/li&gt;
&lt;li&gt;&amp;#8230;/chickens/1/edit Guess!&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;When you save a new chicken you land in the method &lt;em&gt;create&lt;/em&gt;, when you update an existing chicken you land in the method &lt;em&gt;update&lt;/em&gt;. If these methods succeed the convention is that it puts a flash message saying it succeeded and takes you to the &lt;em&gt;show&lt;/em&gt; method. Sometimes you will need to look in the controller code to unpick this.&lt;/p&gt;
&lt;p&gt;For example if you see:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;render :action =&amp;gt; &amp;#8220;edit&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It will use the edit file to render, rather than whatever the default one would be for the method you are in.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Picking the layout&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the controller doesn&amp;#8217;t explicitly set a layout it will use the one defined in &lt;em&gt;app/views/layouts/application.html.erb&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuration by convention&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As you can see Rails uses &lt;em&gt;convention&lt;/em&gt; to say where things are and you don&amp;#8217;t have trawl through configuration files (Java) or wade through heaps of confusing code where it&amp;#8217;s hard to work out where the application ends and the data begins (PHP guys, looking at you here). &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The asset pipleline&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This was introduced in Rails 3.2. There is an extra directory under &lt;em&gt;app &lt;/em&gt;called &lt;em&gt;assets&lt;/em&gt;. Rather than repeat the documentation I suggest you go &lt;a href="http://guides.rubyonrails.org/asset_pipeline.html" title="Asset Pipeline" target="_blank"&gt;here&lt;/a&gt; to find out how it works.&lt;/p&gt;
&lt;p&gt;I hope this helps. As always if I have erred or not explained things to your satisfaction, please contact me and I will do my best to explain it better or correct any mistakes.&lt;/p&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;</description><link>http://www.francisfish.com/post/16693579575</link><guid>http://www.francisfish.com/post/16693579575</guid><pubDate>Sun, 29 Jan 2012 13:17:00 +0000</pubDate><category>Rails</category><category>designer</category><category>ruby</category></item><item><title>Neil Gaiman: Another bit from an ancient blog</title><description>&lt;a href="http://neil-gaiman.tumblr.com/post/15405249507/another-bit-from-an-ancient-blog"&gt;Neil Gaiman: Another bit from an ancient blog&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;One of the drawbacks of the World’s Best Porridge Recipe for those purposes is that it’s slightly chewy, which is part of the charm. &lt;br/&gt;&lt;br/&gt;Having experimented with porridge recipes for years now, this one sort of came together in a bunch of “what if I tried…”s that actually worked. &lt;br/&gt;&lt;br/&gt;You need two…&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://www.francisfish.com/post/15407507527</link><guid>http://www.francisfish.com/post/15407507527</guid><pubDate>Fri, 06 Jan 2012 19:08:45 +0000</pubDate></item></channel></rss>
