<?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>I like writing code for the good of society, particularly around climate change and democracy. I’m currently Platform Evangelist for AMEE.</description><title>James Smith</title><generator>Tumblr (3.0; @floppy)</generator><link>http://floppy.org.uk/</link><item><title>Fixing the life support</title><description>&lt;p&gt;Somehow, this year feels different.&lt;/p&gt;
&lt;p&gt;Maybe it’s because of the increase in public awareness of the problems with the world at the end of 2011. A greater understanding that governments and people don’t run the world any more, that we have given money too much power, that we are running full tilt at a cliff-edge; it feels like it’s adding up.&lt;/p&gt;
&lt;p&gt;Charlie Brooker said recently that 2011 &lt;a href="http://www.guardian.co.uk/commentisfree/2011/dec/11/charlie-brooker-2011-season-finale"&gt;felt like a series finale&lt;/a&gt;; I’m not sure about that, it felt to me more like the buildup in the penultimate episode. 2012 seems like the actual last episode when the big events will happen (probably with a few cliff-hangers left over for 2013).&lt;/p&gt;
&lt;p&gt;This impending feeling that big events are coming could be imaginary of course, but I hope not. We &lt;em&gt;need&lt;/em&gt; big events now (and I don’t mean the obvious 2012 fake-apocalypse fantasy). We are racing so fast towards collapse that we have to do something &lt;em&gt;now&lt;/em&gt;, or we will be a cautionary tale in the Cockroach Book Of Ancient Civilisations. We still have the ability to save ourselves (just); I hope that this year brings the will to engage with the problem.&lt;/p&gt;
&lt;p&gt;We need to grow up, realise the full-spectrum danger we are in, and do something about it. We need to &lt;em&gt;mature&lt;/em&gt; as a species, and fast. We need to get over our selfish approach and make a better society for the future, together.&lt;/p&gt;
&lt;p&gt;I am a software engineer; that makes me next to useless in a collapsed society. My daughter quite literally &lt;em&gt;needs&lt;/em&gt; a functioning, liberal, caring society to keep her alive. Moving to a farmhouse, becoming self-sufficient and letting everyone else collapse is no good for me. A functioning technological society is an essential life support system.&lt;/p&gt;
&lt;p&gt;With all that in mind, I am going into this year with an objective to make best use of the skills I have to attack the big problems where I can, and if it doesn’t work out, to fail magnificently having &lt;em&gt;done my best&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;I hope you’ll join me. We’ve got a hell of a job to do.&lt;/p&gt;</description><link>http://floppy.org.uk/post/15346987781</link><guid>http://floppy.org.uk/post/15346987781</guid><pubDate>Thu, 05 Jan 2012 15:28:11 +0000</pubDate><category>society</category><category>politics</category><category>climate change</category><category>collapse</category></item><item><title>Hohm and Powermeter</title><description>&lt;p&gt;The last week has been an interesting one for online energy  monitoring. Not content with deprecating Powermeter a few weeks ago,  Google decided to &lt;a href="http://gigaom.com/cleantech/google-pulls-the-plug-on-powermeter-energy-tool"&gt;properly kill it off.&lt;/a&gt; And then, as if to say ‘us too!’ (as they did with the initial launch), Microsoft &lt;a href="http://blog.microsoft-hohm.com/news/11-06-30/Microsoft_Hohm_Service_Discontinuation.aspx"&gt;killed Hohm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Both these efforts were unsuccessful because the companies that put  them out weren’t serious about them. There is a place for  experimentation, but if you’re a massive company, even your small  experiments seem larger than other people’s entire companies. By  half-heartedly grabbing the attention around energy monitoring, these  experiments crowded out the people who are building a business around  this, like &lt;a href="http://www.currentcost.com"&gt;Currentcost&lt;/a&gt;, &lt;a href="http://www.enio.co.uk"&gt;Enio&lt;/a&gt;, &lt;a href="http://pachube.com"&gt;Pachube&lt;/a&gt; and many more.&lt;/p&gt;
&lt;p&gt;The fact is that online energy monitoring is not dead - the demise of  these services will simply provide more room for other companies to  innovate without being stepped on. Neither Powermeter or Hohm were doing  anything particularly innovative that hadn’t been done many times  before anyway! Powermeter also suffered from being a silo of data, not a  hub. You could put data in, but not get it out, which is a bit  pointless. A truly useful service in this space needs to act as an  aggregator, letting data flow through it so that other innovations can  cluster around it, like the &lt;a href="http://floppy.org.uk/post/4990055777/the-social-meter"&gt;Social Meter&lt;/a&gt; project, for instance.&lt;/p&gt;
&lt;p&gt;Innovation needs openness, and by smothering a potentially innovative  space with their distinctly non-innovative services, MS and Google did  nobody any favours. We are better off without them.&lt;/p&gt;</description><link>http://floppy.org.uk/post/7116328612</link><guid>http://floppy.org.uk/post/7116328612</guid><pubDate>Fri, 01 Jul 2011 11:50:44 +0100</pubDate><category>hohm</category><category>powermeter</category><category>energy monitoring</category><category>currentcost</category><category>pachube</category><category>innovation</category></item><item><title>Resolving a method_missing fight</title><description>&lt;p&gt;Recently, I was writing tests for a piece of code, and came up against some strange problems. The code talks to an external web service using RestClient (1.6.1), so of course the web service is mocked for the tests, in this case using Mocha (0.9.8).&lt;/p&gt;
&lt;p class="western"&gt;The problem came when I tried to test failure modes; for instance, what happens when the service comes back with a 401 due to bad credentials? RestClient raises an exception for this containing the response, so the mock has to do the same.&lt;/p&gt;

&lt;pre&gt;request.stubs(:put).raises(RestClient::Unauthorized.new(&lt;br/&gt;  stub(:code =&gt; 401, :body =&gt; nil)&lt;br/&gt;)&lt;/pre&gt;
&lt;p class="western"&gt;So far so good. The exception is raised, and all is well. The problem comes when we try to access the response code later on in our error-handling code:&lt;/p&gt;

&lt;pre&gt;rescue RestClient::Exception =&gt; e
  puts e.response.code
&lt;/pre&gt;
&lt;p class="western"&gt;Seems reasonable, right? The response object should be a Mocha::Mock that responds to #code and gives back 401. Unfortunately not. We get a ‘stack too deep’ error thrown inside a recursive method_missing call. Huh?&lt;/p&gt;
&lt;p class="western"&gt;This really should work, so let’s take a look inside the gems. It turns out that RestClient mixes something special into the response object (in this case the mock) for compatibility. The gem used to return Net::HTTP::Response objects, not RestClient::Response objects, so in order to retain compatibility with old code, it mixes in the behaviour of the Net::HTTP class to responses contained inside exceptions. This is taken from restclient/exceptions.rb:&lt;/p&gt;

&lt;pre&gt;# Compatibility : make the Response act like a &lt;br/&gt;# Net::HTTPResponse when needed
module ResponseForException
  def method_missing symbol, *args
    if net_http_res.respond_to?(symbol)
      warn "[warning] ..."
      net_http_res.send symbol, *args
    else
      super
    end
  end
end

class Exception &lt; RuntimeError
  attr_accessor :message, :response

  def initialize response = nil, initial_response_code = nil
    @response = response
    @initial_response_code = initial_response_code
    # compatibility: this make the exception behave like &lt;br/&gt;    # a Net::HTTPResponse
    response.extend ResponseForException if response
  end
end
&lt;/pre&gt;
&lt;p class="western"&gt;As you can see, it does this by adding its own method_missing, which accesses the &lt;strong&gt;net_http_res&lt;/strong&gt; function of the response. In our mock, that doesn’t exist, so of course method_missing is called ad infinitum. So, let’s add it:&lt;/p&gt;

&lt;pre&gt;request.stubs(:put).raises(RestClient::Unauthorized.new(&lt;br/&gt;  stub(:code =&gt; 401, :body =&gt; nil, :net_http_res =&gt; nil)&lt;br/&gt;)&lt;/pre&gt;
&lt;p class="western"&gt;Better. Does it work now? Hm. No. It’s still digging a method_missing hole to the Earth’s core.&lt;/p&gt;
&lt;p class="western"&gt;The &lt;strong&gt;real&lt;/strong&gt; problem is that the method_missing that is mixed in by RestClient::Exception is masking the one in Mocha::Mock, and that one is what does the actual handling of the stub code that we pass in. So, even though we added net_http_res up there, the bit of code that handles it is never called, so we’re still stuffed.&lt;/p&gt;
&lt;p class="western"&gt;Now, there’s not a lot we can do about that without rewriting the gems. If I &lt;strong&gt;was&lt;/strong&gt; going to do that, I’d try to make sure that RestClient::Exception doesn’t mask existing method_missing functions, but instead aliases them and makes sure they are still called. Not sure how easy that would be, I’ve not tried it, but it would be worth a shot.&lt;/p&gt;
&lt;p class="western"&gt;I would try to make some general rule here about making sure your code plays nice with other code, but to be honest, I doubt you can consider every case where someone might be subverting your code by giving it things like mock objects (which could implement the mocking in any number of ways) instead of real ones. I guess there will always be a gap somewhere.&lt;/p&gt;
&lt;p class="western"&gt;The solution I hit upon in the end was to change the stub. Instead of using Mocha, which relies on method_missing to implement its stubbing, I changed to OpenStruct, which doesn’t, and is sufficient in this case.&lt;/p&gt;

&lt;pre&gt;request.stubs(:put).raises(RestClient::Unauthorized.new(&lt;br/&gt;  OpenStruct.new(:code =&gt; 401, :body =&gt; nil, :net_http_res =&gt; nil)&lt;br/&gt;)&lt;/pre&gt;
&lt;p class="western"&gt;Yay, by using a stub that doesn’t require method_missing to operate, it all works nicely now! My tests are saved and I can get on with some real work… about time.&lt;/p&gt;</description><link>http://floppy.org.uk/post/6323050452</link><guid>http://floppy.org.uk/post/6323050452</guid><pubDate>Wed, 08 Jun 2011 17:40:00 +0100</pubDate></item><item><title>Last year, I went to the Rewired State Carbon &amp; Energy hack...</title><description>&lt;iframe src="http://player.vimeo.com/video/22657011" width="400" height="300" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Last year, I went to the Rewired State Carbon &amp; Energy hack day (#rscarbon), which was a great event. I went along with &lt;a href="http://www.floppy.org.uk/2010/10/25/rewired-state-a-social-energy-monitor"&gt;an idea&lt;/a&gt;,  and even better actually got to build it! We got a great team together,  and despite initial technical teething problems, had a demo running in  time for the show and tell at the end (by the skin of our teeth). I’ve  been meaning to write it up for ages, but instead, I decided to make a  video.&lt;/p&gt;
&lt;p&gt;The code is, as ever, available on &lt;a href="http://github.com/Floppy/socialmeter"&gt;Github&lt;/a&gt;, and there are other writeups on &lt;a href="http://www.e-ssociation.net/blog/?p=59"&gt;Paul Tanner’s blog&lt;/a&gt; and the &lt;a href="http://rewiredstate.org/projects/social-meter"&gt;Rewired State site&lt;/a&gt;.&lt;/p&gt;</description><link>http://floppy.org.uk/post/4990055777</link><guid>http://floppy.org.uk/post/4990055777</guid><pubDate>Wed, 20 Apr 2011 00:00:00 +0100</pubDate><category>amee</category><category>joggler</category><category>pachube</category><category>rscarbon</category><category>socialmeter</category><category>twitter</category></item><item><title>Francis Maude on the LRRA</title><description>&lt;p&gt;
In 2006, I wrote to my MP about the Legislative and Regulator Reform Bill (now Act). The bill contained extremely dangerous powers for Ministers to change anything they liked, giving them the ability to get away with pretty much anything without a proper vote. I campaigned against it, with many others, through &lt;a href="http://saveparliament.org.uk"&gt;Save Parliament&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Anyway, my MP happens to be Francis Maude, who is now Minister for the Cabinet Office. It turns out that his government is now advancing a bill with similar powers, the &lt;a href="http://www.guardian.co.uk/law/afua-hirsch-law-blog/2010/nov/09/lords-quangos"&gt;Public Bodies Bill&lt;/a&gt;. Now, I admit I’ve not had chance to follow this in detail, so I &lt;b&gt;don’t&lt;/b&gt; know if it’s as bad, or if it’s more limited. However, others who know more might be interested to know what Francis Maude had to say about those sort of powers four years ago.
&lt;/p&gt;

&lt;blockquote&gt;
“I am particularly concerned at the potential for Parliament to be bypassed by the order-making powers contained in Part 1 of the Billl. These powers are extremely constitutionally significant.”
&lt;/blockquote&gt;

&lt;blockquote&gt;
“It is imperative that the circumstances in which these powers can be used are limited and clearly set out in the Bill.”
&lt;/blockquote&gt;

&lt;p&gt;
&lt;a href="http://www.flickr.com/photos/r-j-smith/sets/72157625471474192/detail/"&gt;The full scans&lt;/a&gt; are available on my Flickr stream, for anyone who is interested.
&lt;/p&gt;

&lt;p style="text-align:center"&gt;
&lt;a href="http://www.flickr.com/photos/r-j-smith/5208470529/in/set-72157625471474192/"&gt;&lt;img src="http://farm5.static.flickr.com/4107/5208470529_56cec99d52_m.jpg"/&gt;&lt;/a&gt;
&lt;a href="http://www.flickr.com/photos/r-j-smith/5208441831/in/set-72157625471474192/"&gt;&lt;img src="http://farm5.static.flickr.com/4132/5208441831_2d53fcd63e_m.jpg"/&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Maybe the PBB is consistent with what he said 4 years ago, but maybe not. I’d be interested to know.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010044047</link><guid>http://floppy.org.uk/post/5010044047</guid><pubDate>Fri, 26 Nov 2010 12:38:00 +0000</pubDate><category>lrrb</category><category>pbb</category><category>politics</category><category>saveparliament</category></item><item><title>Rewired State: A Social Energy Monitor</title><description>&lt;p&gt;
The &lt;a href="http://rewiredstate.org/events/carbon-and-energy"&gt;Rewired State Carbon &amp; Energy hack weekend&lt;/a&gt; is coming up this weekend, and I’ve got a proposal for a hack I’d like to build (by kind permission of AMEE, my employer). I’m after a team to help, so if you’re interested, please get in touch.
&lt;/p&gt;

&lt;p&gt;
Energy monitors are useful, but lack a certain something to keep people coming back to them. The web excels at social and game mechanics, but is ‘out there’, not present in the normal home environment. The idea is to bring the two together by building a system that takes realtime energy data from a home and displays similarly realtime social context for that data.
&lt;/p&gt;

&lt;p&gt;
The end product is a simple display that shows not only current energy usage, but how that usage compares to other users of the system, &lt;em&gt;in real time&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;
How it works: each home (probably just one in the initial hack, with the rest mocked up) has a CurrentCost meter. This, via a script or bridge device, submits 5-minute energy usage readings into AMEE, where it’s stored and its carbon equivalent calculated. A website is then created to take that information from all registered devices and do some simple stats. It will calculate a realtime league table, position for each user, realtime average power usage, and so on. This, along with the user’s own data, is then displayed on a screen in the home - I have an O2 Joggler touchscreen which would do the trick, either through a browser or via a native OpenPeak app.
&lt;/p&gt;

&lt;p&gt;
The panel continuously shows the home user their energy usage, but also what their usage is compared to other users &lt;em&gt;right now&lt;/em&gt;. It might display chart position, whether usage is going up or down, and other simple stats perhaps aggregated over time. This will bring some essential social context into the home energy monitoring space, and demonstrate the sort of innovation that can take place if smart metering systems are kept open.
&lt;/p&gt;

&lt;p&gt;
Many parts of the system exist already, so I think this is buildable in a weekend at least as a prototype. Like I say, if you want to help me build it, get in touch in the comments or via Twitter (#rscarbon).
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010043692</link><guid>http://floppy.org.uk/post/5010043692</guid><pubDate>Mon, 25 Oct 2010 13:03:00 +0100</pubDate><category>hacks</category><category>rscarbon</category></item><item><title>What did you do in the election, Daddy?</title><description>&lt;p&gt;
One wondeful thing about the 2010 General Election is that so many great projects have happened online; Francis Irving covers them in a &lt;a href="http://blog.okfn.org/2010/05/05/election-data/"&gt;post on the OKFN blog&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
I was personally lucky enough to find the time to use these services to build something. I couldn’t find election hustings in my area, so I decided to make a site to crowdsource and open up that information properly. Enter &lt;a href="http://questionyourcandidates.org.uk"&gt;QuestionYourCandidates&lt;/a&gt;.
&lt;/p&gt;

&lt;p style="text-align:center"&gt;
&lt;img src="http://s3.amazonaws.com/twitpic/photos/large/89425316.png?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&amp;Expires=1273159187&amp;Signature=ERA7Bsv2Xe57mOGIPoCZ7QCUQjo%3D"/&gt;&lt;/p&gt;

&lt;p&gt;
The site allows anyone to enter details of hustings in their area, basically, and link to them in a reliable way. It’s made from:
&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Rails 2.3.5 - this reminded me how excellent Rails is for rapid development&lt;/li&gt;
&lt;li&gt;Constituency &amp; candidate data from &lt;a href="http://yournextmp.com"&gt;YourNextMP&lt;/a&gt; through their API.&lt;/li&gt;
&lt;li&gt;Postcode search via the &lt;a href="http://theyworkforyou.com"&gt;TheyWorkForYou&lt;/a&gt; API.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Both these APIs were incredibly easy to use, and because they use canonical names for both constituencies and candidates, it was easy to then link the site across to other services like &lt;a href="http://democracyclub.org.uk"&gt;Democracy Club&lt;/a&gt; and &lt;a href="http://thestraightchoice.org"&gt;The Straight Choice&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The main dilemma while coding I had was whether to have user accounts. I decided against it in the end, just protecting the edit pages with a captcha. User accounts would have just added another layer of complexity, for really no extra functionality or security.
&lt;/p&gt;

&lt;p&gt;
The whole thing took around 6 hours from start to deploy, and I’m pretty proud of it. Unfortunately I did it a bit late to really be useful for this election, but I will try to generalise it to is can continue to be used for future elections. And, as always, it’s open source. Code is on &lt;a href="http://github.com/Floppy/questionyourcandidates"&gt;Github&lt;/a&gt;.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010043324</link><guid>http://floppy.org.uk/post/5010043324</guid><pubDate>Thu, 06 May 2010 14:51:00 +0100</pubDate><category>api</category><category>election</category><category>hustings</category><category>open source</category></item><item><title>In early September, Betavine organised a 24-hour hack event...</title><description>&lt;iframe src="http://player.vimeo.com/video/6907428" width="400" height="300" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;In early September, &lt;a href="http://www.betavine.net/bvportal/community/sustainability"&gt;Betavine&lt;/a&gt; organised a 24-hour hack event called &lt;a href="http://www.vimeo.com/6623187"&gt;EcoMo09&lt;/a&gt;, with an environmental theme. Unfortunately I couldn’t stay the whole time, but I went along as an &lt;a href="http://www.amee.com"&gt;AMEE&lt;/a&gt; representative to support other people using our API during the event.  In the quiet periods, I managed to come up with my own hack, which used  GreaseMonkey and AMEE to add carbon emissions to Google Maps.&lt;/p&gt;
&lt;p&gt;You can even &lt;a href="http://gist.github.com/185744"&gt;get the code&lt;/a&gt; and try it yourself. It’s very basic, and actually most of the work was  dealing with Google Maps and making Greasemonkey behave properly - the  AMEE bit, getting the carbon value, was dead easy.&lt;/p&gt;</description><link>http://floppy.org.uk/post/5013349497</link><guid>http://floppy.org.uk/post/5013349497</guid><pubDate>Thu, 17 Dec 2009 14:17:00 +0000</pubDate><category>greasemonkey,</category><category>amee</category><category>ecomo09</category><category>javascript</category></item><item><title>The Activist Geek Philosophy</title><description>&lt;p&gt;
So, first, let’s have a stab at identifying the community I’m talking about - this in itself is a pretty hard problem. I guess I’m talking about “activist geeks”, in a way. The sort of people who are involved in the work of &lt;a href="http://mysociety.org"&gt;MySociety&lt;/a&gt;, or &lt;a href="http://www.sicamp.org/"&gt;Social Innovation Camp&lt;/a&gt;. The people who go along to events like &lt;a href="http://www.geekyoto.com/"&gt;geeKyoto&lt;/a&gt;, or perhaps &lt;a href="http://russelldavies.typepad.com/planning/2009/08/interesting-speakers.html"&gt;Interesting&lt;/a&gt;. They are the people that go out and create innovative things that make the world better. I can’t put any names on a list here, though there are some obvious ones of course, but you will probably know if this is your sort of community or not.
&lt;/p&gt;

&lt;p&gt;
So having made a (very) vague stab at who I’m talking about, what are the core philosophies that come out of that? One caveat: obviously this is  my own personal viewpoint, and implies absolutely nothing on behalf of those examples linked above. I could be completely wrong on all of this (though I’d invite comment). I think I am what would traditionally be called “left wing”, so my please note that my views may be coloured by that.
&lt;/p&gt;

&lt;p&gt;
Firstly, I think that while there are certain things that do unite the community, they often don’t fit along traditional political lines. You cannot say that this community is left-wing for instance; there are certainly members of all political parties involved. We’ll come back to some of the things that &lt;em&gt;don’t&lt;/em&gt; unite us later on, but let’s find some common ground first.
&lt;/p&gt;

&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Privacy&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
Even though many of us share vast amounts of information on various social networks, we have a strong belief in privacy of personal data. Perhaps this is better phrased as belief in &lt;em&gt;control&lt;/em&gt; of personal data. I can delete my social network accounts at any time, and can decide who can see them, so I remain in control (as long as I trust the site). On the other side, I will not be able to remove my record from the ID card database or decide who accesses it, so I am not in control of that. This is part of a more fundamental belief in &lt;a href="http://www.un.org/en/documents/udhr/"&gt;universal human rights.&lt;/a&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Transparency&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
While personal information should be kept tightly controlled by its owner, information about (and generated by) government and public services should be fully transparent and open. The MP expenses scandal was an example of further erosion of trust in government because of an opaque system that was open to abuse. As they say (I think), sunlight is the best disinfectant. Government operations should be open to public scrutiny, and assets produced by that system (OS maps anyone?) should be freely available to the taxpayers who have paid for them.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Tolerance&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
I don’t think we give a monkeys where someone is from, what their background is, or about their religion, sexuality, or favourite colour. It’s just not relevant. The rest of you, get over it.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Anti-authoritarian&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
It always confuses me that a criticism of the left is that it wants to control people. Maybe that’s true, in which case I need to recalibrate my open personal compass a little, but my belief is that the community is very much about freedom of the individual. There is a strong anti-authoritarian streak - none of us want to end up in a police state.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Social Conscience&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
However, the above freedom of the individual does not lead to blind self-interest. I believe that the community is not one of self-interested people with no care for others, but of a group of empowered individuals who actively engage in and make society better.
&lt;/dd&gt;
&lt;dt&gt;&lt;b&gt;Engagement&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;
My final point is that the above lead to a community that is engaged with the world around them. We engage on issues of importance, such as my own personal focus, climate change, and they are interested in the way their society is governed. I believe that those qualities are fundamental for a functioning democracy, and we see that currently most of society does not measure up to that standard (a situation which we try to improve of course).
&lt;/dd&gt;
&lt;/dl&gt;&lt;p&gt;
On the other hand, I seriously doubt we are all united on things like &lt;a href="http://s.wsj.net/public/resources/images/OB-AO890_invisi_20070824192939.jpg"&gt;economics&lt;/a&gt; (I love that picture), the role of corporations, how to deal with climate change, foreign policy, and so on.
&lt;/p&gt;

&lt;p&gt;
I’m sure there is more that can be said, but I will let it play out in the comments (if anyone wants to add to this). My final question is - if there is a central theme emerging, does that mean we should do something with it in these days when so many of the above viewpoints are rather missing from general society?
&lt;/p&gt;

&lt;p&gt;
Discuss.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010042590</link><guid>http://floppy.org.uk/post/5010042590</guid><pubDate>Tue, 10 Nov 2009 09:37:00 +0000</pubDate><category>activism</category><category>geeks</category><category>philosophy</category></item><item><title>IBM DeveloperWorks articles</title><description>&lt;p&gt;
Over the summer, I was asked to write an article for the IBM &lt;a href="http://www.ibm.com/developerworks/"&gt;DeveloperWorks&lt;/a&gt; site about energy monitoring and so on. Eventually, that turned into a series of articles centered around &lt;a href="http://www.amee.com"&gt;AMEE&lt;/a&gt; and how you can track energy consumption and calculate carbon emissions with it.
&lt;/p&gt;

&lt;p&gt;
So, now that they’re all published, here’s a bit of a linkdump to the various articles and other things that came out of them.
&lt;/p&gt;

&lt;dl&gt;&lt;dt&gt;
&lt;a href="http://www.ibm.com/developerworks/xml/library/x-ameeintro/"&gt;Introduction to AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This is a technical introduction to the AMEE platform, how it works, and what you can do with it. It covers things like signing up, creating profiles, storing data, and getting results. It was also adapted into a screencast for the &lt;a href="http://my.amee.com/developers"&gt;AMEE developer site&lt;/a&gt;.
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href="http://www.ibm.com/developerworks/opensource/library/os-green-ict/index.html?S_TACT=105AGX44&amp;S_CMP=HP"&gt;Calculate your computer’s carbon footprint using AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This one is an introduction to the wide variety of ways in which you can track energy data using AMEE, using the monitoring of computer energy use as a case study. It also shows some code examples for the &lt;a href="http://github.com/Floppy/amee-ruby"&gt;AMEE ruby gem&lt;/a&gt;.
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href="http://www.ibm.com/developerworks/xml/tutorials/x-ameetut/index.html"&gt;Monitor home energy with AMEE&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
This is my favourite of the three - a long tutorial, with lots of code, which shows a complete implementation of an online energy-monitoring system, using a &lt;a href="http://www.currentcost.com"&gt;CurrentCost&lt;/a&gt; display, AMEE, and a little Rails code. This uses a lot of the open source software I’ve been writing over the last year, which regular readers will have seen in previous posts, but it’s really nice to tie it all together and tell the world how it works!
&lt;/dd&gt;
&lt;dt&gt;
&lt;a href="https://www.ibm.com/developerworks/mydeveloperworks/blogs/scott/entry/james_smith_on_embedding_environmental_intelligence"&gt;James Smith on embedding environmental intelligence&lt;/a&gt;
&lt;/dt&gt;
&lt;dd&gt;
Scott Laningham was nice enough to interview me for the DeveloperWorks podcast when the first article went out, so if you want to hear me blathering on about it in person, you can do so!
&lt;/dd&gt;
&lt;/dl&gt;</description><link>http://floppy.org.uk/post/5010036247</link><guid>http://floppy.org.uk/post/5010036247</guid><pubDate>Wed, 28 Oct 2009 17:58:00 +0000</pubDate><category>amee</category><category>articles</category><category>currentcost</category><category>developerworks</category></item><item><title>Reboot Britain</title><description>&lt;p&gt;
I was lucky enough to be invited to talk at the &lt;a href="http://www.rebootbritain.com"&gt;Reboot Britain&lt;/a&gt; conference on Monday. It was a fascinating day, with lots of inspiring moments. It left me with a feeling that we can make the world a better place if we all get out there and &lt;b&gt;make&lt;/b&gt; things. It’s something I already believed, but it’s great to have a recharge every now and again.
&lt;/p&gt;

&lt;p&gt;
My session was on hacking energy data, kind of a &lt;a href="http://homecamp.org.uk"&gt;Homecamp&lt;/a&gt; intro for the uninitiated. My slides are up on &lt;a href="http://www.slideshare.net/Furtive"&gt;Slideshare&lt;/a&gt;, and embedded here for your viewing pleasure. Hopefully at some point I’ll get to re-record the audio and add it in.
&lt;/p&gt;

&lt;div style="width:425px;text-align:left" id="__ss_1687179"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/Furtive/if-you-can-see-it-you-can-change-it" title="If you can see it, you can change it"&gt;If you can see it, you can change it&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=reboot-090706103726-phpapp01&amp;stripped_title=if-you-can-see-it-you-can-change-it"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=reboot-090706103726-phpapp01&amp;stripped_title=if-you-can-see-it-you-can-change-it" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View more &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/"&gt;documents&lt;/a&gt; from &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/Furtive"&gt;James Smith&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</description><link>http://floppy.org.uk/post/5010035835</link><guid>http://floppy.org.uk/post/5010035835</guid><pubDate>Wed, 08 Jul 2009 09:17:00 +0100</pubDate><category>currentcost</category><category>energy</category><category>homecamp</category><category>reboot britain</category><category>slides</category><category>talks</category></item><item><title>The Carbon Diet goes open source</title><description>&lt;p&gt;
Well, I finally got round to it. I started developing &lt;a href="http://www.carbondiet.org"&gt;The Carbon Diet&lt;/a&gt; 2 years ago (had the idea 3 years ago!), and it’s finally spread it’s wings and joined the world of open source. 
&lt;/p&gt;

&lt;p&gt;
After I’d been developing it for a few months, it became obvious that it was never going to be a commercial proposition, so it’s been my intention to open it up for a very long time now. However, I was putting it off until “after I get it finished”, or “after I tidy up the code”, or any number of other reasons. Having a small child puts paid to all those plans, so I’ve finally bitten the bullet and released my dodgy code to the world as it is, warts and all.
&lt;/p&gt;

&lt;p&gt;
The site is built in Rails, but it’s pretty creaky. It was originally written in version 1.2 as I was learning, and a lot of the old-style controller and route code is still hanging around, waiting to be improved. I’ve started, but there is a long way to go to bring it up to a decent standard.
&lt;/p&gt;

&lt;p&gt;
Anyway, if you use the site (or not!) and fancy improving it, now you can. Head on over to &lt;a href="http://github.com/Floppy/carbon-diet"&gt;github&lt;/a&gt; to grab the code and join in. I hope to see you there!
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010035484</link><guid>http://floppy.org.uk/post/5010035484</guid><pubDate>Thu, 21 May 2009 20:38:00 +0100</pubDate><category>carbondiet</category><category>github</category><category>open source</category></item><item><title>Publishing CurrentCost data to the world</title><description>&lt;p&gt;
A while ago, I started hacking around with a &lt;a href="http://www.currentcost.co.uk"&gt;CurrentCost&lt;/a&gt; real-time energy monitor. This is a very nice little device that measures your electricity use, but more importantly has a serial output on the bottom so you can get data out of it.
&lt;/p&gt;

&lt;p&gt;
Well, eventually I decided that while being able to get data off the meter was nice, it would be better if I could publish it somewhere. So, I wrote a program in Ruby to do exactly that. It reads data from the meter, and sticks it on the web. I’ll go into a bit more detail in a minute, but first, you can download it (and get the source code) from &lt;a href="http://github.com/Floppy/currentcost-daemon/"&gt;github&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The program operates as a system daemon, which runs in the background on your Linux box (Mac should work as well) and uploads to various places. Adding new publishers is dead easy, so if you want to publish your data somewhere else, you can easily add it.
&lt;/p&gt;

&lt;h3&gt;The Carbon Diet&lt;/h3&gt;

&lt;p&gt;
First up, my own site, &lt;a href="http://www.carbondiet.org"&gt;The Carbon Diet&lt;/a&gt;. This uploads your daily usage history from the meter into your carbon diet account so that you don’t have to take so many meter readings to get an accurate graph. This is still pretty experimental and needs more work, but it’s pretty useful already. You can see how it looks on &lt;a href="http://www.carbondiet.org/profile/james"&gt;my profile&lt;/a&gt;.
&lt;/p&gt;

&lt;h3&gt;AMEE&lt;/h3&gt;

&lt;p&gt;
Next, what I think of as the important one. &lt;a href="http://www.amee.com"&gt;AMEE&lt;/a&gt;, if you’re not aware, AMEE is a neutral aggregation platform for sharing energy data and carbon calculations (disclaimer: I work for them these days). Think OpenID for your energy identity. Anyway, we have a nice “smart meter” demo which uses my currentcost app as the data source. Every minute, it uploads into an AMEE profile, and then another app &lt;a href="http://my.amee.com/demo/1"&gt;makes a nice graph&lt;/a&gt; of the CO2 produced. In theory, the Carbon Diet could pull that data from AMEE instead of me publishing it directly, but that’s still to come.
&lt;/p&gt;

&lt;h3&gt;Pachube&lt;/h3&gt;

&lt;p&gt;
Another energy data sharing service is &lt;a href="http://www.pachube.com"&gt;Pachube&lt;/a&gt; (pronounced “patch bay”). As far as I can tell, this is more geared at art and design than rigorous data, but it’s fun to play with. They’ve done a bunch of stuff with the CurrentCost, and now my app joins the throng. My &lt;a href="http://www.pachube.com/feeds/488"&gt;pachube feed&lt;/a&gt; updates every 6 seconds - every time the meter sends data out.
&lt;/p&gt;

&lt;h3&gt;Twitter&lt;/h3&gt;

&lt;p&gt;
Finally, what would be the point of a web energy publisher if it couldn’t tweet? If you really want to, you can see my minute-by-minute energy usage on Twitter by visiting &lt;a href="http://twitter.com/james_energy"&gt;@james_energy&lt;/a&gt;.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010035138</link><guid>http://floppy.org.uk/post/5010035138</guid><pubDate>Sat, 28 Mar 2009 16:18:00 +0000</pubDate><category>amee</category><category>carbondiet</category><category>currentcost</category><category>pachube</category><category>ruby</category><category>twitter</category></item><item><title>Running Mephisto on Ruby 1.8.7</title><description>&lt;p&gt;
My server runs Ubuntu, and seeing as 8.10 (Intrepid Ibex) is out, I thought “woo, let’s upgrade”. Bad idea. Well, partly. Most of the upgrade went fine, but there was one problem. Intrepid comes with Ruby 1,8.7, which works fine with Rails &gt;=2.1, but doesn’t work with anything lower. Mephisto, on the other hand, doesn’t work with Rails 2.1 yet, and is only usable with Rails 

&lt;/p&gt;&lt;p&gt;&lt;code lang="text" theme="zenburnesque"&gt;
NoMethodError (undefined method `[]' for #&lt;:enumerator:0x2aaaad5f7a58&gt;)
&lt;/:enumerator:0x2aaaad5f7a58&gt;&lt;/code&gt;
&lt;/p&gt;&lt;p&gt;
So, I was faced with having to downgrade to Ruby 1.8.6 (a royal pain as Intrepid doesn’t provide packages for it), or “fix” Mephisto to work with 2.1 (oh my god, don’t even get me started). Fortunately, another solution presented itself.
&lt;/p&gt;
&lt;p&gt;
I came across &lt;a href="http://bicosyes.com/rails-2-1-con-ruby-1-8-7-broken/"&gt;this blog post&lt;/a&gt; which describes the problem I was having. The gist (it’s in Spanish) is that the main problem with Rails 2.0.2 and Ruby 1.8.7 is that Ruby 1.8.7 has added a String#chars function to the core language. Rails also adds this function, but the two have different return types, hence causing much breakage. The solution? Remove Ruby’s String#chars and let Rails do its thing. Add this code to an initializer in your Rails 2.0.2 app, and it will work (better, at least) with Ruby 1.8.7.
&lt;/p&gt;
&lt;p&gt;
&lt;code lang="ruby" theme="zenburnesque"&gt;
begin
  String.class_eval { remove_method :chars }
rescue NameError
end
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
As you can tell by the fact that you’re reading this blog, it works a treat. Hurrah!
&lt;/p&gt;
&lt;p&gt;
EDIT: Another solution, which I only just worked out, would be to install the very badly-named &lt;a href="http://www.rubyenterpriseedition.com/"&gt;Ruby Enterprise Edition&lt;/a&gt;, which sits alongside the system’s Ruby and is call-compatible with 1.8.6. This makes a lot of sense if you’re using passenger (mod_rails), as well.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010034771</link><guid>http://floppy.org.uk/post/5010034771</guid><pubDate>Tue, 04 Nov 2008 22:52:00 +0000</pubDate><category>mephisto</category><category>rails</category><category>ruby</category></item><item><title>Gems, Bookmarks, and Sandwiches</title><description>&lt;p&gt;
I’ve been crazy busy for a while, but what little spare time I have grabbed here and there has been used investigating some areas of Rails I hadn’t played with before, like route globbing and running without a database. The results are a couple of tools, one useful, one most definitely not.
&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img.skitch.com/20081010-dy86i2ny1rbu91b995nt6r5hrj.png" style="float:right"/&gt;&lt;/p&gt;

&lt;p&gt;
The first (and most useful) is &lt;a href="http://hasmygembuiltyet.org"&gt;Has My Gem Built Yet?&lt;/a&gt;. I have a bunch of ruby gems on GitHub and get annoyed that I have to keep running “gem update” while waiting for GitHub to build the gem once I’ve pushed the code. Well, no more. Just put in the details, and the page checks for you and pops up a message when the gem is done. Nice. It got picked up on &lt;a href="http://github.com/blog/177-has-my-gem-built-yet"&gt;the GitHub blog&lt;/a&gt;, and I’ve even had some patches sent in. It’s a nice feeling :)
&lt;/p&gt;

&lt;p&gt;
The second app is somewhat less useful (though still entertaining). After a suggestion on Twitter by &lt;a href="http://tomtaylor.co.uk"&gt;Tom Taylor&lt;/a&gt;, I built a website which lets you bookmark &lt;a href="http://s.andwi.ch"&gt;sandwich&lt;/a&gt; combinations. There are a couple of interesting bits in this though - first is route globbing, which is the Rails way of using arbitrary bits of the URL as parameters to an action. Not something you use in every project, but still. More importantly, I’ve used it to test out &lt;a href="http://github.com/Floppy/rubymarks"&gt;rubymarks&lt;/a&gt;, a Rails plugin for generating links for social bookmarking services.
&lt;/p&gt;

&lt;p&gt;
I love Rails for this sort of thing. I can’t think of other system I’ve used that would let me create such fun things in the tiny snippets of spare time I have at the moment. And of course, everything above is open source and available on &lt;a href="http://github.com/Floppy"&gt;Github&lt;/a&gt;.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010028322</link><guid>http://floppy.org.uk/post/5010028322</guid><pubDate>Mon, 13 Oct 2008 20:31:00 +0100</pubDate><category>gems</category><category>github</category><category>rubymarks</category><category>sandwiches</category></item><item><title>Mocking Kernel#require</title><description>&lt;p&gt;
The other day, I remembered to add coverage analysis to my &lt;a href="http://github.com/Floppy/amee-ruby"&gt;AMEE-Ruby&lt;/a&gt; tests, using &lt;a href="http://"&gt;rcov&lt;/a&gt;. The results were pretty good - most of the code was already tested, except a few failure cases, and I quickly wrote some new tests to make sure those were working properly. One little bit of code stood out though. Because AMEE talks XML and JSON, my gem can use JSON, but only if the JSON gem is available on the system (XML support is built into core Ruby). Problem is, require calls throw errors if they fail, so I had to write some code to handle the load failure and carry on regardless. This is the code inside amee.rb:
&lt;/p&gt;

&lt;p&gt;
&lt;code lang="ruby" theme="zenburnesque"&gt;
begin
  require 'json'
rescue LoadError
  nil
end
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
Problem with this is that the gem is installed on my system, so the require never fails, and the rescue is never used. Rcov notices, and I can’t get to 100% coverage, which is &lt;em&gt;annoying&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;
So, mocking to the rescue. We have to make Kernel#rescue throw an error if we try to require ‘json’, even if the gem is installed. At first, I tried to use flexmock to do this, but couldn’t make it work - if anyone knows how, &lt;em&gt;please&lt;/em&gt; tell me. My final approach was to monkeypatch Kernel#require inside my test so that require ‘json’ (and only json) would fail:
&lt;/p&gt;

&lt;p&gt;
&lt;code lang="ruby" theme="zenburnesque"&gt;
it "should cope if json gem isn't available" do
  # Monkeypatch Kernel#require to make sure that require 'json'
  # raises a LoadError
  module Kernel
    def require_with_mock(string)
      raise LoadError.new if string == 'json' 
      require_without_mock(string)
    end
    alias_method :require_without_mock, :require 
    alias_method :require, :require_with_mock
  end
  # Remove amee.rb from required file list so we can load it again
  $".delete_if{|x| x.include? 'amee.rb'}
  # Require file - require 'json' should throw a LoadError,
  # but we should cope with it OK.
  lambda {
    require 'amee'
  }.should_not raise_error
end
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
We have to make a new require function, then use alias_method to rename the old one and install our new one in it’s place. Rails includes alias_method_chain to make this easier, but that’s not available in pure Ruby. Never mind. Once we’ve done the monkeypatch, we take amee.rb out of the $” array, which lists all the currently-required files, to make sure we can require it again, then simply run the require and make sure it catches the error that is thrown by our patched require. And the most satisfying part? The rescue is executed, the test works, and we get to 100% coverage. I’ve got a nice warm fuzzy feeling inside… mmmmmm.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010027868</link><guid>http://floppy.org.uk/post/5010027868</guid><pubDate>Sun, 31 Aug 2008 10:15:00 +0100</pubDate><category>amee</category><category>json</category><category>monkeypatching</category><category>ruby</category></item><item><title>CurrentCost data live on Pachube</title><description>&lt;p&gt;
So, the other day I got a nice little &lt;a href="http://"&gt;tray icon&lt;/a&gt; working for my CurrentCost power monitor. That’s great, but data is only really gets fun when it’s mashable, so the next step was to get it online somehow.
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://pachube.com"&gt;Pachube&lt;/a&gt; is a site which aggregates data feeds from real-world (and virtual-world) devices, shows them on a map, makes graphs, things like that, so it seemed like a good first attempt at putting my power data online. My first thought was to get my app to post data at regular intervals to the service, but unfortunately Pachube doesn’t work like that. Instead, it acts more like a news reader, not a publishing platform - Google Reader instead of Blogger, if that makes sense. So, I had to publish my feed live on the web and point Pachube at the URL.
&lt;/p&gt;

&lt;p&gt;
First step: EEML. This is an XML-based format which Pachube reads which can contain not only multiple data feeds, but tags and other metadata. So (as seems to be the fashion), I wrapped it up in a Ruby gem, &lt;a href="http://github.com/Floppy/eeml-ruby/tree/master"&gt;available from GitHub&lt;/a&gt; as ever. The gem simply provides utility classes to build an EEML feed and convert it to the XML-based format for delivery over the web.
&lt;/p&gt;

&lt;p&gt;
Then, the final step was to publish the data on the web. For that, we need a web server. However, having a full web server for just one feed seemed overkill, and I didn’t want to publish to yet another intermediate server, so we need to serve the data directly. Ruby to the rescue once again. WEBrick is a simple web server which is part of the core Ruby libraries. You create a server, write simple servlet classes, and mount them at particular locations. For instance:
&lt;/p&gt;

&lt;p&gt;
&lt;code lang="ruby_on_rails" theme="zenburnesque"&gt;
# Create WEBrick server
s = WEBrick::HTTPServer.new( :Port =&gt; 50000 )
# A simple "hello world" servlet 
class HelloServlet 
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;
Now, http://localhost:50000/ will say “hello world”. From here it’s a simple modification to publish the EEML feed. EEML-Ruby includes a &lt;a href="http://github.com/Floppy/eeml-ruby/tree/master/examples/simple_server.rb"&gt;simple EEML server script&lt;/a&gt; as an example. So, after building this into the tray app, now whenever my CurrentCost is connected and the app is running, it serves up EEML data to the web. You can see the data feed (fairly intermittent, as obviously the meter isn’t always connected to my PC at the moment) &lt;a href="http://pachube.com/feeds/488"&gt;live on Pachube&lt;/a&gt;.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010027394</link><guid>http://floppy.org.uk/post/5010027394</guid><pubDate>Fri, 29 Aug 2008 09:56:00 +0100</pubDate><category>currentcost</category><category>eeml</category><category>github</category><category>pachube</category><category>ruby</category><category>webrick</category></item><item><title>Some successful CurrentCost hacking</title><description>&lt;p&gt;
After a bit of work, I’ve finally got my &lt;a href="http://www.currentcost.com"&gt;CurrentCost&lt;/a&gt; meter working in Ruby, and I now have a power monitor sitting in my system tray! There were a few stages involved…
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Serial comms:&lt;/strong&gt; The ruby-serialport library that already existed for Ruby was no good to me. Firstly, it didn’t seem to be in a working state, but more importantly, the license it is under (GPL) is no good to me. So, I had to write my own. I’ve created a nice simple serial library (including a gem) for Ruby called RB232, which is available on &lt;a href="http://github.com/Floppy/rb232"&gt;GitHub&lt;/a&gt;. It only supports reading at the moment, and only works on Linux systems, but it’s a start. Next!
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Reading CurrentCost data:&lt;/strong&gt; Once RB232 was in place, this was pretty easy. Just create a couple of classes to wrap up the process of getting data from the meter, and away you go. Easy. Also released as a Ruby gem on &lt;a href="http://github.com/Floppy/currentcost-ruby"&gt;Github&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.floppy.org.uk/assets/2008/8/22/currentcost-tray-monitor.png"/&gt;&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;User interface:&lt;/strong&gt; Last step was to make a simple user interface for the meter, which you can see in the picture above. It’s a simple tray icon that changes colour based on power usage. It’s based heavily on another very useful tool called &lt;a href="http://rubyforge.org/projects/cctrayrb/"&gt;cctrayrb&lt;/a&gt;, so many thanks to Daniel Parnell for doing the heavy GUI lifting there. The app is included as part of the currentcost-ruby gem mentioned above.
&lt;/p&gt;

&lt;p&gt;
Anyway, it’s all freely available, so if you have a CurrentCost meter and a serial cable for it, you can grab the code and get going. Enjoy :)
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010026949</link><guid>http://floppy.org.uk/post/5010026949</guid><pubDate>Fri, 22 Aug 2008 09:25:00 +0100</pubDate><category>currentcost</category><category>gem</category><category>github</category><category>ruby</category></item><item><title>Twitter support in JabberStatus</title><description>&lt;p&gt;
&lt;a href="http://floppy.github.com/jabberstatus"&gt;JabberStatus&lt;/a&gt; was originally inspired by Twitter’s facility to update your status via XMPP/Jabber. Unfortunately, Twitter’s Jabber interface has been down for months now, which is rather sucky. 
&lt;/p&gt;

&lt;p&gt;
The solution to this? Extend JabberStatus to work for Twitter as well as Facebook. It turned out to be very easy, so it’s online now. Just add twitterstatus@jabber.org to your contact list and it will talk you through the rest.
&lt;/p&gt;

&lt;p&gt;
The JabberStatus code has &lt;a href="http://github.com/Floppy/jabberstatus"&gt;moved to GitHub&lt;/a&gt; now, so you can grab it from there. The &lt;a href="http://github.com/Floppy/co2updates"&gt;code for the CO2Updates app&lt;/a&gt; has also moved there.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010026506</link><guid>http://floppy.org.uk/post/5010026506</guid><pubDate>Thu, 07 Aug 2008 21:10:00 +0100</pubDate><category>co2updates</category><category>facebook</category><category>github</category><category>jabber</category><category>twitter</category><category>xmpp</category></item><item><title>One Hundred Months</title><description>&lt;p&gt;
I just saw the &lt;a href="http://onehundredmonths.org/"&gt;One Hundred Months&lt;/a&gt; campaign, and decided it was ripe for a bit of automated Twittering. So, 5 minutes hacking and we have &lt;a href="http://twitter.com/100months"&gt;One Hundred Months on Twitter&lt;/a&gt;. Code (as ever these days) is available from &lt;a href="http://github.com/Floppy/onehundredmonths"&gt;GitHub&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
I’m amazed by what computers can do sometimes. This one seriously took me longer to publish to the world than to write.
&lt;/p&gt;</description><link>http://floppy.org.uk/post/5010020218</link><guid>http://floppy.org.uk/post/5010020218</guid><pubDate>Wed, 06 Aug 2008 09:56:00 +0100</pubDate><category>carbon</category><category>github</category><category>ruby</category><category>twitter</category></item></channel></rss>

