<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;CUUHR3g8fip7ImA9WhRVEUo.&quot;"><id>tag:blogger.com,1999:blog-5879087</id><updated>2012-01-10T05:27:16.676Z</updated><title>My Imaginary Friend</title><subtitle type="html">Paul Bartlett's ramblings on software development, technology, and the world...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/pdbartlett" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="pdbartlett" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">pdbartlett</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;AkYHQXk6eCp7ImA9Wx9bEEg.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-1112805001221638030</id><published>2011-02-18T19:42:00.000Z</published><updated>2011-02-18T19:42:10.710Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-18T19:42:10.710Z</app:edited><title>Abseiling for ECHO</title><content type="html">Well, I think I've finally gone mad :)&lt;br /&gt;
&lt;br /&gt;
Despite the fact that I'm more than a little scared of heights, I shall be abseiling off Guy's Tower (at 469ft the tallest hospital in the world!) on May 2nd. It's in aid of &lt;a href="http://www.echo-evelina.org.uk/"&gt;ECHO&lt;/a&gt; (Evelina Children's Heart Organisation) who have been such a great support to us given my daughter, Sophie's, heart condition.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-biPDZolqui0/TV7KyMtF4dI/AAAAAAAAD18/uLEgTO4s45M/s1600/Guys_hospital_tower.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-biPDZolqui0/TV7KyMtF4dI/AAAAAAAAD18/uLEgTO4s45M/s320/Guys_hospital_tower.jpg" width="223" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
So wish me luck, and if you'd like to support ECHO by sponsoring me then you can do so &lt;a href="http://www.justgiving.com/pdbartlett/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-1112805001221638030?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/1112805001221638030/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=1112805001221638030" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/1112805001221638030?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/1112805001221638030?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2011/02/abseiling-for-echo.html" title="Abseiling for ECHO" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-biPDZolqui0/TV7KyMtF4dI/AAAAAAAAD18/uLEgTO4s45M/s72-c/Guys_hospital_tower.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUIHSXg6fSp7ImA9Wx5bF04.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-5668491421016859882</id><published>2010-11-02T22:38:00.001Z</published><updated>2010-11-02T22:38:58.615Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-02T22:38:58.615Z</app:edited><title>Yay! Got to Level 1 on Project Euler</title><content type="html">&lt;p&gt;As you may have guessed from the title, I've been hacking away at problems on &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;, and in fact have now managed to complete the first 25.&lt;/p&gt;&lt;p&gt;Much of my recent "acceleration" seems to have come from using &lt;a href="http://www.scala-lang.org"&gt;Scala&lt;/a&gt;, as with these "one-off" coding exercises it's very helpful to have powerful functional constructs available when it makes sense to use them, but also to be able to fall back on a "normal" imperative style when it's more convenient.&lt;/p&gt;&lt;p&gt;Which will be first, though... reaching Level 2 or coming up with some "proper" code in Scala to really get a feel for how good it is?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-5668491421016859882?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/5668491421016859882/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=5668491421016859882" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5668491421016859882?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5668491421016859882?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/11/yay-got-to-level-1-on-project-euler.html" title="Yay! Got to Level 1 on Project Euler" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DE4MRHkzeyp7ImA9Wx5UEEg.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-9002502510847333043</id><published>2010-10-14T12:49:00.001+01:00</published><updated>2010-10-14T12:49:45.783+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-14T12:49:45.783+01:00</app:edited><title>Dependency injection in Scala</title><content type="html">&lt;p&gt;Here are a few thoughts and code snippets from my admittedly brief experiments with dependency injection in Scala. Comments &lt;strong&gt;most&lt;/strong&gt; welcome, as always!&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Option 0: Use your favourite Java framework&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;I only know Guice, but I imagine the pros and cons are pretty much the same for any other framework. Porting Java annotations to Scala takes some getting used to, and occasionally it's a bit tricky to get right. And, of course, and it might not quite &lt;em&gt;feel&lt;/em&gt; like Scala, but at least you'll know the framework and any quirks it may have.&lt;/p&gt;&lt;p&gt;Plenty of tutorials exist already for this option, so I'm sure your favourite search engine can help you find some. Any links I post here are sure to become stale pretty quickly given the rate at which Scala is developing.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Option 1: Just use &lt;code&gt;implicit&lt;/code&gt;s&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Scala &lt;code&gt;implicit&lt;/code&gt; parameters can easily cope with simple cases of DI, and have the added advantage that the code is somewhat more idiomatic Scala than would generally result from &lt;em&gt;Option 0&lt;/em&gt;. For example, try pasting the following into an interactive Scala session:&lt;/p&gt;&lt;pre&gt;trait Logger {
  def log(msg: String)
}

object StdOutLogger extends Logger {
  override def log(msg: String) { println(msg) }
}

object Config {
  implicit def provideLogger = StdOutLogger
}

import Config._

def logTest(msg: String)(implicit logger: Logger) {
  logger.log(msg)
}

logTest("Hello world")
&lt;/pre&gt;&lt;p&gt;One thing to note is that &lt;code&gt;implicit&lt;/code&gt;s operate at the function level, whereas DI is normally at the object level (via either constructors or setters). The former can easily be achieved via implicit parameters to an class's constructor, though. Following on from the code above:&lt;/p&gt;&lt;pre&gt;class Test(implicit private val logger: Logger) {
  def doSomething {
    logger.log("Doing something...")
  }
}

(new Test).doSomething
&lt;/pre&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Option 2: Adding annotations to &lt;code&gt;implicit&lt;/code&gt;s&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;The approach above works fine when you're injecting fairly specific, single-purpose objects. But what if you wanted to inject a string or an integer. Typically DI frameworks use some form of annotation in these circumstances, so let's see if we can come up with a version for Scala &lt;code&gt;implicit&lt;/code&gt;s (again this should work if pasted into a Scala REPL):&amp;nbsp;&lt;/p&gt;&lt;pre&gt;class Annotated[A, T](private val t: T) {
  def value = t
}

object DeepBlue {
  def answer(implicit annotated: Annotated[DeepBlue.type, Int]) {
    println(annotated.value)
  }
}

object Config {
  implicit def provideAnswer = new Annotated[DeepBlue.type, Int](42)
}

import Config._

DeepBlue.answer
&lt;/pre&gt;&lt;p&gt;Note that the example above, and the &lt;code&gt;Annotated&lt;/code&gt; class in particular, is the simplest possible thing I could come up with that would work, and could likely be improved upon in several ways:&lt;/p&gt;&lt;p&gt;1. I used the (generated) class of the &lt;code&gt;DeepBlue&lt;/code&gt; singleton object just because it was handy. Often you'd want to use a class or singleton object created specifically for the purpose. It might even be possible to use case classes or even enumerations to good effect here.&lt;/p&gt;&lt;p&gt;2. It doesn't do anything clever with the annotating type (&lt;code&gt;A&lt;/code&gt;). One or more factory methods in a companion object which restrict their arguments a bit more (and maybe the addition of an &lt;code&gt;Annotation&lt;/code&gt; trait to help with this) might lead to some nice type inferencing possibilities, especially with singleton objects as in the example. For instance, it would be nice to be able to write the RHS of the provider method as simply &lt;code&gt;Annotated(DeepBlue, 42)&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;3. I might also be possible to mark the value method as &lt;code&gt;implicit&lt;/code&gt;, and have the injection site implicitly convert from an &lt;code&gt;Annotated[A, T]&lt;/code&gt; to a &lt;code&gt;T&lt;/code&gt; when required. This might be one step too far, though, and just plain confusing rather than helpful (quite a common theme with &lt;code&gt;implicit&lt;/code&gt;s, unfortunately).&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Option 3: For more functionality, implicitly pass an injector&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;If you need more advanced DI functionality then you may well hit the (somewhat ironic) restriction that all &lt;code&gt;implicit&lt;/code&gt; functions (i.e. those that provide the values for &lt;code&gt;implicit&lt;/code&gt; parameters) must be explicitly coded, i.e. there's no way (that I know of at least) to programmatically influence the resolution of &lt;code&gt;implicit&lt;/code&gt; parameters. I've not spent too much time on this, but the obvious (to me, with my own unique set of influences/biases) way around this would be to build a Guice-like Binding/Module/Injector framework, and then implicitly pass the injector to functions which need injected instances of objects. It may even be possible to use Scala's flexible syntax to create a nice DSL for specifying the bindings. As a warning, though, I have not tried this (yet!) and I suspect it may involve quite a bit of reinventing the wheel, so at this point it may well be worth reverting to &lt;em&gt;Option 0&lt;/em&gt;, and using an existing framework.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;I hope this was useful, and happy coding!&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-9002502510847333043?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/9002502510847333043/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=9002502510847333043" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/9002502510847333043?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/9002502510847333043?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/10/dependency-injection-in-scala.html" title="Dependency injection in Scala" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D08GQHs_eSp7ImA9WxFXEkw.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-8068954906740161579</id><published>2010-05-18T21:50:00.001+01:00</published><updated>2010-05-18T21:50:21.541+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-18T21:50:21.541+01:00</app:edited><title>ScribeFire for Chrome now "official"</title><content type="html">Announcement &lt;a href="http://www.scribefire.com/2010/05/17/scribefire-officially-available-for-google-chrome/"&gt;here&lt;/a&gt;&amp;nbsp;- and I'm writing this post using it :)&lt;a href="http://www.scribefire.com/2010/05/17/scribefire-officially-available-for-google-chrome/"&gt;&lt;/a&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Now I've got even less excuse not to post more frequently, except maybe that I've also just discovered how addictive &lt;a href="http://stackoverflow.com"&gt;StackOverflow&lt;/a&gt; is.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-8068954906740161579?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/8068954906740161579/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=8068954906740161579" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8068954906740161579?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8068954906740161579?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/05/scribefire-for-chrome-now.html" title="ScribeFire for Chrome now &amp;quot;official&amp;quot;" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DUUCQ3YyfSp7ImA9WxFTEEs.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-3364917023221888457</id><published>2010-03-31T21:27:00.000+01:00</published><updated>2010-03-31T21:27:42.895+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-31T21:27:42.895+01:00</app:edited><title>It might not be the test that's flaky</title><content type="html">I have a feeling this was glaringly obvious to everyone but me, but late last week I had a bit of an "a-ha" moment.&lt;br /&gt;
&lt;br /&gt;
When we say "flaky test" we imply that the test itself, or the test environment, is somehow at fault. Although this may often be the case, it's just possible that the test itself is perfectly sound and the implementation is flaky.&lt;br /&gt;
&lt;br /&gt;
Nothing earth shattering, but I just thought I'd mention it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-3364917023221888457?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/3364917023221888457/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=3364917023221888457" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3364917023221888457?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3364917023221888457?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/03/it-might-not-be-test-thats-flaky.html" title="It might not be the test that's flaky" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEQHRnw4fSp7ImA9WxBaFE4.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-8373696485401817788</id><published>2010-03-24T13:12:00.000Z</published><updated>2010-03-24T13:12:17.235Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-24T13:12:17.235Z</app:edited><title>Kojo - Scala for Kids</title><content type="html">&lt;i&gt;Via: &lt;/i&gt;&lt;a href="http://www.scala-lang.org/node/5624"&gt;&lt;i&gt;www.scala-lang.org&lt;/i&gt;&lt;/a&gt;&lt;i&gt;:&lt;/i&gt;&lt;br /&gt;
&lt;blockquote&gt;Kids love computers and many would love to learn how to program them too. Lalit Pant, volunteer Math teacher at&amp;nbsp;&lt;a href="http://www.himjyotischool.org/" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;Himjyoti School for under-privileged girls&lt;/span&gt;&lt;/a&gt;&amp;nbsp;in Dehradun, developed Kojo in his 'free' time.&amp;nbsp;&lt;a href="http://www.kogics.net/sf:kojo" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;Kojo&lt;/span&gt;&lt;/a&gt;&amp;nbsp;is a very polished, easy to install, cool IDE in which children, (or even grown ups) can learn to program using Scala. Lots of examples, a turtle to drive, good documentation and interactive geometry for those budding mathematicians. If you have kids then Kojo could be a fun experience to share with them. On the other hand if you have some 'free' time Lalit would welcome help to develop Kojo, an Open Source project, further.&lt;/blockquote&gt;Just in time for the Easter holidays :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-8373696485401817788?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/8373696485401817788/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=8373696485401817788" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8373696485401817788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8373696485401817788?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/03/kojo-scala-for-kids.html" title="Kojo - Scala for Kids" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0cCSX88cSp7ImA9WhRTEE0.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-5235774570138617066</id><published>2010-03-17T10:00:00.000Z</published><updated>2011-10-30T21:11:08.179Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-30T21:11:08.179Z</app:edited><title>Using abstract type fields instead of parameterised types in Scala</title><content type="html">I've been continuing my exploration of &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; by writing some code to do&amp;nbsp;multi-dimensional measure calculations (something with which I'm quite&amp;nbsp;familiar after about 5 years of doing it "as a day job" in the past, but&amp;nbsp;which I've never been quite happy with a representation for). This can be&amp;nbsp;found at &lt;a href="http://code.google.com/p/lascala"&gt;http://code.google.com/p/lascala&lt;/a&gt;&amp;nbsp;if you're interested, and any comments (especially on making it more&amp;nbsp;idiomatic in its use of the language) would be much appreciated.&lt;br /&gt;
&lt;br /&gt;
However, the main point of the post was to note that I've found, a little&amp;nbsp;to my surprise, that when building type hierarchies using abstract type&amp;nbsp;fields is often cleaner (less verbose, more DRY) than using parameterised&amp;nbsp;types. When I first saw them mentioned I was sceptical about their&amp;nbsp;usefulness, as I couldn't see why I'd prefer:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trait Base {
  type T
  ...
}

trait Super extends Base {
  type T = String
  ...
}&lt;/pre&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trait Base[T] {
  ...
}

trait Super extends Base[String] {
  ...
}&lt;/pre&gt;
&lt;br /&gt;
And while in such a simple case there is no particular reason to, when building&amp;nbsp;more complex hierarchies it can in fact save some repitition. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trait Measure {
  type K
  type V
  def aggData: Iterable[(K, V)]
}

trait Measure1[U, T1] extends Measure {
  type V = U
  type D1 = T1
  type K = T1
}

trait Measure2[U, T1, T2] extends Measure {
  type V = U
  type D1 = T1
  type D2 = T2
  type K = (D1, D2)
}

trait PreAggregated extends Measure {
  def data: Iterable[(K, V)]
  def aggData = data
}

object ExampleMeasure1 extends Measure1[Int, String] with PreAggregated {
  data = ...
}

object ExampleMeasure2 extends Measure2[Int, String, String] with PreAggregated {
  data = ...
}&lt;/pre&gt;
&lt;br /&gt;
This is already appreciably less verbose than the following, especially in the use&amp;nbsp;of the classes which is arguably more important than in their definitions:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trait Measure[K, V] {
  def aggData: Iterable[(K, V)]
}

trait Measure1[V, D1] extends Measure[D1, K]

trait Measure2[V, D1, D2] extends Measure[(D1, D2), K]

trait PreAggregated[K, V] extends Measure[K, V] {
  def data: Iterable[(K, V)]
  def aggData = data
}

object ExampleMeasure1 extends Measure1[Int, String] with PreAggregated[String, Int] {
  data = ...
}

object ExampleMeasure2 extends Measure2[Int, String, String] with PreAggregated[(String, String), Int] {
  data = ...
}&lt;/pre&gt;
&lt;br /&gt;
Some of the duplication could be avoided by having a series of PreAggregated traits mirroring&amp;nbsp;the dimensional &lt;code&gt;Measure&lt;em&gt;N&lt;/em&gt;&lt;/code&gt; ones, but this can get bloated very quickly,&amp;nbsp;especially as it's likely that I'll need to support at least six dimensions. And repition also&amp;nbsp;reappears when traits are stacked (e.g. to encapsulate storage and caching behaviours):&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trait Measure[K, V] {
  def aggData:Iterable[(K, V)]
}

trait Measure1[V, D1] extends Measure[D1, K]

trait Measure2[V, D1, D2] extends Measure[(D1, D2), K]

trait PreAggregatedMeasure1[V, D1] extends Measure1[V, D1] {
  def data: Iterable[(D1, V)]
  def aggData = data
}

trait PreAggregatedMeasure2[V, D1, D2] extends Measure2[V, D1, D2] {
  def data: Iterable[((D1, D2), V)]
  def aggData = data
}

object ExampleMeasure1 extends PreAggregatedMeasure1[Int, String] {
  data = ...
}

object ExampleMeasure2 extends PreAggregatedMeasure2[Int, String, String] {
  data = ...
}&lt;/pre&gt;
&lt;br /&gt;
Comments?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-5235774570138617066?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/5235774570138617066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=5235774570138617066" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5235774570138617066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5235774570138617066?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/03/using-abstract-type-fields-instead-of.html" title="Using abstract type fields instead of parameterised types in Scala" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DkQCRHs7eSp7ImA9WxBUE00.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-531287983291437233</id><published>2010-02-27T20:59:00.000Z</published><updated>2010-02-27T20:59:25.501Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-27T20:59:25.501Z</app:edited><title>Handy iGoogle gadget for good habit forming</title><content type="html">I recently found the &lt;a href="http://www.google.com/ig/adde?moduleurl=http://dayssince.googlecode.com/svn/trunk/dayssince.xml&amp;amp;source=imag"&gt;Days Since&lt;/a&gt; gadget, which seems to be a nice complement to to-do lists as a way to make sure I'm doing the right things. &lt;a href="http://sciral.com/consistency/"&gt;Sciral Consistency&lt;/a&gt; is a rather more full featured implementation of the idea, but at the moment I'm finding the fact it sits nicely in my home page as more of an advantage, rather than having yet somewhere else to check.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-531287983291437233?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/531287983291437233/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=531287983291437233" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/531287983291437233?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/531287983291437233?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/02/handy-igoogle-gadget-for-good-habit.html" title="Handy iGoogle gadget for good habit forming" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0YNQ3g5eSp7ImA9WxBUE00.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-8026870165074951169</id><published>2010-02-27T20:50:00.001Z</published><updated>2010-02-27T21:13:12.621Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-27T21:13:12.621Z</app:edited><title>My attempt at graph humour</title><content type="html">I've been enjoying &lt;a href="http://www.graphjam.com/"&gt;GraphJam&lt;/a&gt;&amp;nbsp;for quite some time, so thought I'd have a go myself:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://cheezburger.com/View.aspx?aid=3234912000"&gt;&lt;img alt="Distribution of question categories in Trivial Pursuit" id="_r_a_3234912000" src="http://images.cheezburger.com/completestore/2010/2/27/129117768328831367.png" title="Distribution of question categories in Trivial Pursuit" /&gt;&lt;/a&gt;&lt;br /&gt;
moar &lt;a href="http://icanhascheezburger.com/"&gt;funny pictures&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-8026870165074951169?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/8026870165074951169/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=8026870165074951169" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8026870165074951169?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8026870165074951169?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/02/my-attempt-at-graph-humour.html" title="My attempt at graph humour" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEIDQ3s6eip7ImA9WxBVFEU.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-4753129329137599190</id><published>2010-02-17T21:22:00.003Z</published><updated>2010-02-18T09:49:32.512Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-18T09:49:32.512Z</app:edited><title>Playing with Scala again...</title><content type="html">Bought PDF version of &lt;a href="http://www.artima.com/shop/programming_in_scala"&gt;Programming in Scala&lt;/a&gt; today, and seems pretty good so far. Definitely a step up from the already good (and free!) &lt;a href="http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaByExample.pdf"&gt;Scala by Example&lt;/a&gt;.  Have just hacked the following to check my understanding of currying and by name functions:&lt;br /&gt;
&lt;pre&gt;scala&gt; def times(n: Int)(op: =&gt; Unit) = { (1 to n).foreach(_ =&gt; op) }
times: (Int)(=&gt; Unit)Unit

scala&gt; times(4) { println("Hello") }
Hello
Hello
Hello
Hello
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-4753129329137599190?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/4753129329137599190/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=4753129329137599190" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/4753129329137599190?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/4753129329137599190?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2010/02/playing-with-scala-again.html" title="Playing with Scala again..." /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUUFSXk5fyp7ImA9WxVWEkk.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-5269781550859319975</id><published>2009-02-21T20:10:00.002Z</published><updated>2009-02-21T20:13:38.727Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-21T20:13:38.727Z</app:edited><title>Sophie's fame just keeps on growing</title><content type="html">&lt;p&gt;Looks like we've been featured on &lt;a href="http://geekparenting.com"&gt;GeekParenting&lt;/a&gt;'s &amp;quot;&lt;a href="http://geekparenting.com/2009/02/20/lil-geeks-of-the-week.aspx"&gt;Lil' geeks of the week&lt;/a&gt;&amp;quot; spot. The photo's from a few year's back, I should point out...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-5269781550859319975?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/5269781550859319975/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=5269781550859319975" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5269781550859319975?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5269781550859319975?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/02/sophies-fame-just-keeps-on-growing.html" title="Sophie's fame just keeps on growing" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUQGR3c-eyp7ImA9WxVXGUg.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-5799394277240528809</id><published>2009-02-18T10:26:00.002Z</published><updated>2009-02-18T10:35:26.953Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-18T10:35:26.953Z</app:edited><title>RAND#33: The Twitter ecosystem</title><content type="html">&lt;p&gt;Or should that be the &lt;em&gt;Twitterverse&lt;/em&gt;, or even &lt;em&gt;Twittersphere&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;I've already blogged about &lt;a href="http://www.trackdailygoals.com"&gt;Track Daily Goals&lt;/a&gt;, and am now following some &amp;quot;corporate&amp;quot; users (&lt;em&gt;tworps&lt;/em&gt; instead of &lt;em&gt;tweeps&lt;/em&gt;?) such as &lt;a href="http://twitter.com/cnnbrk"&gt;CNN Breaking News&lt;/a&gt; and &lt;a href="http://twitter.com/BBCClick"&gt;BBC Click&lt;/a&gt;, and recently took a look at Twitter-based charting tool (&lt;em&gt;twool&lt;/em&gt;?) &lt;a href="http://uladoo.com/"&gt;Uladoo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Are there any others interesting bots, tools, etc. you've come across that are worth looking at?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-5799394277240528809?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/5799394277240528809/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=5799394277240528809" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5799394277240528809?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/5799394277240528809?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/02/rand33-twitter-ecosystem.html" title="RAND#33: The Twitter ecosystem" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0ANQHk6fip7ImA9WxVXFEs.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-1412885405681167326</id><published>2009-02-12T18:56:00.004Z</published><updated>2009-02-12T19:09:51.716Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-12T19:09:51.716Z</app:edited><title>RAND#32: This mobile life</title><content type="html">&lt;p&gt;Since getting a G1 for Christmas (thank you Google!) and then managing to pick up a good deal on a dataplan from T-Mobile, I've had far more reliable mobile Internet access than the "Will the coach have wifi?" situation before. &lt;/p&gt;
&lt;p&gt;So what have I been doing with it, you may ask? Well truth be told not that much for the first couple of weeks, mainly trying to keep on top of email and blog reading. However, in the last week I've rediscovered Twitter (catch me &lt;a href="http://twitter.com/pdbartlett"&gt;here&lt;/a&gt;), found the excellent &lt;a href="http://trackdailygoals.com"&gt;Track Daily Goals&lt;/a&gt; to give it a chance of having a net positive effect on my productivity, and even written a couple of blog posts.&lt;/p&gt;
&lt;p&gt;At first I thought Twitter would finally kill off my attempts to blog more frequently, given the obvious overlap between microblogging and my RAND#nn posts. However, at the moment the two seem to be synergistic, as Twitter gets me in the habit of writing more about what I'm up to, whilst the fact that not every subject fits in 140 chars means that at least some should end up as blog posts. Well that's the theory anyway - let's see how it turns out in practice. After all:&lt;/p&gt;
&lt;blockquote&gt;Q: What's the difference between theory and practice?
A: In theory nothing, but in practice plenty!&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-1412885405681167326?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/1412885405681167326/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=1412885405681167326" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/1412885405681167326?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/1412885405681167326?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/02/rand32-this-mobile-life.html" title="RAND#32: This mobile life" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;Ck4CQXo-eSp7ImA9WxVXFEw.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-3312115942826659492</id><published>2009-02-10T08:30:00.006Z</published><updated>2009-02-12T03:56:00.451Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-12T03:56:00.451Z</app:edited><title>RAND#31: C++, dialects and compilers vs. toddlers</title><content type="html">&lt;p&gt;&lt;em&gt;(Some fairly random thoughts, triggered by me doing some C++ at work recently)&lt;/em&gt;&lt;p&gt;
&lt;p&gt;C++ has many &amp;quot;dialects&amp;quot; and is often spoken with a very heavy accent. By this I mean that in most C/C++ code I've written, the density of macro calls and/or typedef usage is pretty high. The bulk of my (semi-)recent experience was with ATL/COM code, so seeing a new C++ codebase was kind of odd - it was recognisably C++, but it was a while before I actually knew what it was doing. And I'm pretty sure exchanging the codebases in question (i.e. showing some of my younger colleagues some ATL code) would have produced the same effect.&lt;/p&gt;
&lt;p&gt;Even compilers speak with different dialects; it was a good few minutes before I worked out what gcc was trying to tell me when it said &amp;quot;Incomplete type Foo used in nested type definition&amp;quot; or something similar. As an aside I noticed that compilers are very much like toddlers in such situations; you keep on asking questions in subtly different ways but keep getting the same (unsatisfactory) response. And although a compiler has never actually told me &amp;quot;No!&amp;quot; or &amp;quot;Why?&amp;quot; I'm sure that's what they normally mean :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-3312115942826659492?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/3312115942826659492/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=3312115942826659492" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3312115942826659492?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3312115942826659492?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/02/rand31-c-dialects-and-compilers-vs.html" title="RAND#31: C++, dialects and compilers vs. toddlers" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEACQnkyfip7ImA9WxVQFUQ.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-3227052918814206640</id><published>2009-02-02T17:37:00.002Z</published><updated>2009-02-02T17:46:03.796Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-02T17:46:03.796Z</app:edited><title>RAND#30: Snow!</title><content type="html">&lt;p&gt;I’m conscious of the fact that way, way back I was once &lt;a href="http://blogs.geekdojo.net/pdbartlett/archive/2004/01/08/548.aspx"&gt;rather dismissive&lt;/a&gt; about people blogging about the weather.&lt;/p&gt;  &lt;p&gt;I’m also rather embarrassed at how ill-prepared the UK always seems to be for &lt;em&gt;any &lt;/em&gt;type of weather.&lt;/p&gt;  &lt;p&gt;But it’s another excuse to post a couple of pictures, and try out the &lt;a href="http://gallery.live.com/liveItemDetail.aspx?li=6a125986-6550-4ce9-9c71-9a0fbbc3443f"&gt;Polaroid Picture Plugin&lt;/a&gt; for Windows Live Writer so here goes :)&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:464f4d86-14a0-462d-b600-fcd92443a3de" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;a href="http://lh4.ggpht.com/_kORXC-PcIL8/SYcvL3qNbKI/AAAAAAAACH0/teTseh4MW9c/2009-02-02-07h16m52-8x6.jpg?imgmax=800" title="View from window this morning" rel="thumbnail"&gt;&lt;img border="0" src="http://lh6.ggpht.com/_kORXC-PcIL8/SYcxVh9cMpI/AAAAAAAACIo/RwbiMY7brAM/2009-02-02-07h16m52%5B1%5D.png?imgmax=800" /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:54e76648-b79b-42fd-a63f-480ad0eb77e1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;a href="http://lh4.ggpht.com/_kORXC-PcIL8/SYcvODak3lI/AAAAAAAACII/1RjRrpaz58s/2009-02-02-10h34m34-8x6.jpg?imgmax=800" title="Sophie playing in the snow" rel="thumbnail"&gt;&lt;img border="0" src="http://lh5.ggpht.com/_kORXC-PcIL8/SYcxWrVrsnI/AAAAAAAACIw/p1wPd855mpw/2009-02-02-10h34m34.png?imgmax=800" /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-3227052918814206640?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/3227052918814206640/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=3227052918814206640" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3227052918814206640?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3227052918814206640?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/02/rand30-snow.html" title="RAND#30: Snow!" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_kORXC-PcIL8/SYcxVh9cMpI/AAAAAAAACIo/RwbiMY7brAM/s72-c/2009-02-02-07h16m52%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0YEQX46fyp7ImA9WxVQEEU.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-4215859089821786024</id><published>2009-01-27T18:23:00.003Z</published><updated>2009-01-27T18:31:40.017Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-27T18:31:40.017Z</app:edited><title>RAND#29: Coding update</title><content type="html">&lt;p&gt;&lt;em&gt;Aside: looks like I'm falling back to my old infrequent blogging ways. Must... try... harder... :)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Very quick summary:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sophie &lt;em&gt;&lt;strong&gt;loves&lt;/strong&gt;&lt;/em&gt; &lt;a href="http://www.alice.org/kelleher/storytelling/index.html"&gt;Storytelling Alice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I'm going to take a quick look at &lt;a href="http://processing.org/"&gt;Processing&lt;/a&gt; before deciding on what to do for my next mini-project (Or at least what I say I'll do, and then never quite get around to. Sigh...)&lt;/li&gt;
&lt;li&gt;I took a look at the Google &lt;a href="http://code.google.com/apis/ajax/playground/"&gt;AJAX APIs Playground&lt;/a&gt; last night - looks pretty neat!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;More updates soon - honest :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-4215859089821786024?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/4215859089821786024/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=4215859089821786024" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/4215859089821786024?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/4215859089821786024?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/01/rand29-coding-update.html" title="RAND#29: Coding update" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CE4DQ3c8fCp7ImA9WxVRE0U.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-7475547806452858330</id><published>2009-01-18T21:45:00.003Z</published><updated>2009-01-19T16:36:12.974Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-19T16:36:12.974Z</app:edited><title>RAND#28: More poetry</title><content type="html">&lt;p&gt;I started with some poetry, albeit in German, and it seems like time for some more...&lt;/p&gt;
&lt;p&gt;Josh Kaufman over at &lt;a href="http://personalmba.com/"&gt;The Personal MBA&lt;/a&gt; just posted about &lt;a href="http://personalmba.com/desiderata/"&gt;&amp;quot;Desiderata&amp;quot;&lt;/a&gt;, which got me thinking of one of my favourite poems, namely &lt;a href="http://www.kipling.org.uk/poems_if.htm"&gt;&amp;quot;If&amp;quot;&lt;/a&gt;. Though not actually a poem I also admire &amp;quot;The Serenity Prayer&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;God grant me the serenity to accept the things I cannot change,
courage to change the things I can,
and wisdom to know the difference.&lt;/blockquote&gt;
&lt;p&gt;Changing the last line to &amp;quot;the firepower to make a difference&amp;quot; seems to show up as an anonymous quote, though for some reason I though it was &amp;quot;The Minuteman's Prayer&amp;quot; -- not sure where I got that from! It does remind me of Jack Nicholson's line from &amp;quot;A Few Good Men&amp;quot; though (excellent film, so many &lt;a href="http://www.imdb.com/title/tt0104257/quotes"&gt;great quotes&lt;/a&gt; to choose from...):&lt;/p&gt;
&lt;blockquote&gt;Walk softly and carry an armored tank division, I always say.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-7475547806452858330?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/7475547806452858330/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=7475547806452858330" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7475547806452858330?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7475547806452858330?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/01/rand28-more-poetry.html" title="RAND#28: More poetry" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;Ck8ARX8yfip7ImA9WxVSGEU.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-2831111617769467082</id><published>2009-01-13T21:04:00.002Z</published><updated>2009-01-13T21:07:24.196Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-13T21:07:24.196Z</app:edited><title>RAND#27: Gaming keyboard for dev work?</title><content type="html">&lt;p&gt;Just seen the specs of &lt;a href="http://www.everythingusb.com/logitech-g19-gaming-keyboard-15952.html"&gt;the new Logitech G19 gaming keyboard&lt;/a&gt; and I can't help but think some of the LCD and programmable keys could be useful for a developer.&lt;/p&gt;
&lt;p&gt;Anyone tried using a gaming keyboard for dev work?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-2831111617769467082?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/2831111617769467082/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=2831111617769467082" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/2831111617769467082?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/2831111617769467082?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/01/rand27-gaming-keyboard-for-dev-work.html" title="RAND#27: Gaming keyboard for dev work?" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUUNRXs9eSp7ImA9WxVSFEk.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-8743499968402723513</id><published>2009-01-08T19:28:00.005Z</published><updated>2009-01-08T19:34:54.561Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-08T19:34:54.561Z</app:edited><title>RAND#26: A couple more kid-oriented programming ideas</title><content type="html">&lt;p&gt;A bit convoluted, but thanks to Harry &amp;quot;DevHawk&amp;quot; Pierson's &lt;a href="http://feeds.feedburner.com/~r/Devhawk/~3/506472836/Kid+Programming+With+Kodu+Coming+To+Xbox+360.aspx"&gt;post&lt;/a&gt; I found out about &lt;a href="http://research.microsoft.com/en-us/projects/kodu/default.aspx"&gt;Kodu&lt;/a&gt;. As this is for the XBox 360 it's not much use to us (Wii + PS2), but the team page mentioned &lt;a href="http://www.alice.org/"&gt;Alice&lt;/a&gt; which looks interesting, especially in its &lt;a href="http://www.alice.org/kelleher/storytelling/index.html"&gt;Storytelling Alice&lt;/a&gt; variant.&lt;/p&gt;
&lt;p&gt;Phew!!! Got all that? ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-8743499968402723513?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/8743499968402723513/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=8743499968402723513" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8743499968402723513?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/8743499968402723513?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/01/rand26-couple-more-kid-oriented.html" title="RAND#26: A couple more kid-oriented programming ideas" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0UDQ3c5cSp7ImA9WxVSEU0.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-7055235205678571429</id><published>2009-01-04T21:30:00.003Z</published><updated>2009-01-04T21:41:12.929Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-04T21:41:12.929Z</app:edited><title>RAND#25: What next?</title><content type="html">&lt;p&gt;OK, photo kit time... I have a Nikon D60 with 18-55 and 55-200 VR lenses, an Olympus FL-36R flash, a couple of cheap pan-and-tilt tripods, a wireless flash kit and a 5-in-1 reflector. I mainly shoot general family stuff, plus loads of portraits of my daughter (show-off that she is), and whatever compos are going on at any given time (esp. DPChallenge). So what should I buy next? My thinking is along the lines of:&lt;/p&gt;&lt;dl&gt;
&lt;dt&gt;Nikkor 50mm f/1.8 prime&lt;/dt&gt;&lt;dd&gt;But what about the AF-S 1.4?&lt;/dd&gt;
&lt;dt&gt;Backdrop of some sort&lt;/dt&gt;&lt;dd&gt;I have a T-bar stand already, which cuts down on the cost, but then again I also have a couple of sheets of A1 card that are fine for head shots&lt;/dd&gt;
&lt;dt&gt;Lighting stand(s)&lt;/dt&gt;&lt;dd&gt;But my flash currently fits OK on a tripod via the receiver end of the wireless kit&lt;/dd&gt;
&lt;dt&gt;Umbrella&lt;/dt&gt;&lt;dd&gt;Probably favourite currently, but will it need a lighting stand?&lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;Or maybe something I've not even thought of? Suggestions in the comments...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-7055235205678571429?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/7055235205678571429/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=7055235205678571429" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7055235205678571429?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7055235205678571429?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2009/01/rand25-what-next.html" title="RAND#25: What next?" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEMDQH07cCp7ImA9WxVTFEU.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-7805345087577214853</id><published>2008-12-28T16:27:00.004Z</published><updated>2008-12-28T16:41:11.308Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-28T16:41:11.308Z</app:edited><title>RAND#24: Merry Christmas</title><content type="html">&lt;p&gt;Hmmm... bit of break in posts, but things got just too hectic pre-Christmas...&lt;/p&gt;
&lt;p&gt;News is:&lt;ul&gt;
&lt;li&gt;&lt;b&gt;New toys:&lt;/b&gt; well, the wireless flash thing-a-me-bob arrived OK and seems to work fine, and I also completely went back on my plan and bought a Nikon D60 with a 18-55mm VR kit lens and also a 55-200mm VR one (was aiming to get th 50mm f/1/8, but doesn't seem to be available anywhere). Still, it does seem very nice, and I'm sure I'll be posting some shots here soon!&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Dolls house:&lt;/b&gt; wasn't quite finished in time for Christmas, but Sophie was nevertheless the very grateful recipient of a "dolls construction site". The sides and all internals walls were up, and all the channels cut for the lighting, so it's just a case of finishing off the wallpapering, attaching the back and front, then actually fitting the lights and running the cables. I'll post a photo or two when it's finished, no doubt.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I hope everyone's had a great Christmas, and that it continues into an excellent New Year!
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-7805345087577214853?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/7805345087577214853/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=7805345087577214853" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7805345087577214853?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/7805345087577214853?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2008/12/rand24-merry-christmas.html" title="RAND#24: Merry Christmas" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUUER38zfSp7ImA9WxRaE0s.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-3717670852483740080</id><published>2008-12-15T17:46:00.001Z</published><updated>2008-12-15T17:46:46.185Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-15T17:46:46.185Z</app:edited><title>RAND#23: Anyone playing Runes of Magic?</title><content type="html">&lt;p&gt;&lt;a href="http://www.runesofmagic.com/"&gt;It&lt;/a&gt;'s a new, free-to-play MMORPG that enters open beta today, so just wondered if anyone is either playing it already (maybe via the closed beta) or considering doing so?&lt;/p&gt;  &lt;p&gt;Personally I'll probably stick with &lt;a href="http://www.guildwars.com/"&gt;Guild Wars&lt;/a&gt; for a bit longer - I've just hit level 12 and am quite enjoying it when I get the time. Anyone reading here play, and need of E/W for their party? If so just leave a comment, or look out for &lt;em&gt;Edmund Luftmann&lt;/em&gt; in game.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-3717670852483740080?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/3717670852483740080/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=3717670852483740080" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3717670852483740080?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/3717670852483740080?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2008/12/rand23-anyone-playing-runes-of-magic.html" title="RAND#23: Anyone playing Runes of Magic?" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEIEQX4yeSp7ImA9WxRbGUw.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-6399201059858559567</id><published>2008-12-10T13:37:00.003Z</published><updated>2008-12-10T13:41:40.091Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-10T13:41:40.091Z</app:edited><title>RAND#22: LanguagesNow = [ "Erlang" | LanguagesBefore ].</title><content type="html">&lt;p&gt;Back to some coding :)&lt;/p&gt;  &lt;p&gt;Having gotten the hang of some basic &lt;a href="http://clojure.org/"&gt;Clojure&lt;/a&gt; it's time to start again with a new language, and this time it's &lt;a href="http://www.erlang.org/"&gt;Erlang&lt;/a&gt;'s turn. I've been meaning to give it a spin for a few months, ever since &lt;a href="http://www.tbray.org/ongoing/What/Technology/Erlang/"&gt;Tim Bray&lt;/a&gt; and others started looking at it.&lt;/p&gt;  &lt;p&gt;So here's my attempt at generating primes in Erlang:&lt;/p&gt;  &lt;pre&gt;-module(pdb).
-export([primesTo/1]).

primesTo(N) -&amp;gt; processSieve(N, makeSieve(N, []), []).

makeSieve(1, List) -&amp;gt; List;
makeSieve(X, List) -&amp;gt; makeSieve(X - 1, [{X, true} | List]).

processSieve(_, [], Primes) -&amp;gt; lists:reverse(Primes);
processSieve(N, [Head | Rest], Primes) -&amp;gt;
  Max = math:sqrt(N),
  case Head of
    {X, _} when X &amp;gt; Max -&amp;gt; copyRemaining([Head | Rest], Primes);
    {_, false} -&amp;gt; processSieve(N, Rest, Primes);
    {X, true} -&amp;gt; processSieve(N, markMultiples(X, Rest, []), [X | Primes])
  end.

markMultiples(_, [], Done) -&amp;gt; Done;
markMultiples(X, [Head | Rest], Done) -&amp;gt;
  case Head of
    {_, false} -&amp;gt; markMultiples(X, Rest, Done ++ [Head]);
    {N, true} when N rem X == 0 -&amp;gt; markMultiples(X, Rest, Done ++ [{N, false}]);
    {N, true} -&amp;gt; markMultiples(X, Rest, Done ++ [{N, true}])
  end.

copyRemaining([], Primes) -&amp;gt; lists:reverse(Primes);
copyRemaining([{X, B} | Rest], Primes) when B -&amp;gt; copyRemaining(Rest, [X | Primes]);
copyRemaining([_ | Rest], Primes) -&amp;gt; copyRemaining(Rest, Primes).&lt;/pre&gt;

&lt;p&gt;Because of it's famed concurrency capabilities I'm now playing with using it to run some &lt;a href="http://en.wikipedia.org/wiki/Mapreduce"&gt;MapReduce&lt;/a&gt;s. Here's my initial single-threaded version (with some functionality missing as well):&lt;/p&gt;

&lt;pre&gt;-module(mr).
-export([run/3, test/0]).

test() -&amp;gt; run(fun(X) -&amp;gt; [{X, 1}] end,
              fun({K, L}) -&amp;gt; {K, length(L)} end,
              [1, 2, 4, 2, 3, 1, 1, 4, 3, 4, 3, 2]).

run(M, R, Input) -&amp;gt;
  reduce(R, shuffle(map(M, Input))).

map(F, Data)    -&amp;gt; lists:flatmap(F, Data).
shuffle(Data)   -&amp;gt; do_shuffle(Data, []).
reduce(R, Data) -&amp;gt; lists:map(R, Data).

do_shuffle([], TL) -&amp;gt; TL;
do_shuffle([{K,V}|R], TL) -&amp;gt;
  Told = lists:keysearch(K, 1, TL),
  Tnew = case Told of
    {value, {K, L}} -&amp;gt; {K, [V|L]};
    false           -&amp;gt; {K, [V]}
  end,
  do_shuffle(R, lists:keystore(K, 1, TL, Tnew)).&lt;/pre&gt;

&lt;p&gt;Any Erlangers out there fancy tearing my code to pieces now, or would you rather wait until I add the concurrency bits? ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-6399201059858559567?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/6399201059858559567/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=6399201059858559567" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/6399201059858559567?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/6399201059858559567?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2008/12/rand22-languagesnow-languagesbefore.html" title="RAND#22: &lt;code&gt;LanguagesNow = [ &amp;quot;Erlang&amp;quot; | LanguagesBefore ].&lt;/code&gt;" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;AkQGRH0ycCp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-307169127081695088</id><published>2008-12-09T21:30:00.002Z</published><updated>2008-12-09T21:32:05.398Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:32:05.398Z</app:edited><title>RAND#21: More toys!</title><content type="html">&lt;p&gt;A few more photo-related items arrived today, courtesy of eBay:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;24 inch, 5-in-1 reflector &lt;/li&gt;    &lt;li&gt;3-way hot-shoe spirit level &lt;/li&gt;    &lt;li&gt;4x magnifying filter &lt;/li&gt;    &lt;li&gt;Circular polarizing filter &lt;/li&gt;    &lt;li&gt;8-point star filter &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here's a quick test shot from the last of these:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_kORXC-PcIL8/ST7jgdRzJGI/AAAAAAAAB0M/Sb4JerclDgQ/s1600-h/P1030223%5B2%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="184" alt="P1030223" src="http://lh5.ggpht.com/_kORXC-PcIL8/ST7jhEyCq1I/AAAAAAAAB0U/K7pEwHT_Y9U/P1030223_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now all I'm waiting for is my wireless flash transmitter/receiver...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-307169127081695088?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/307169127081695088/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=307169127081695088" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/307169127081695088?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/307169127081695088?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2008/12/rand21-more-toys.html" title="RAND#21: More toys!" /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_kORXC-PcIL8/ST7jhEyCq1I/AAAAAAAAB0U/K7pEwHT_Y9U/s72-c/P1030223_thumb.jpg?imgmax=800" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;AkUNSXY4eyp7ImA9WxRbGEg.&quot;"><id>tag:blogger.com,1999:blog-5879087.post-6828332786532064505</id><published>2008-12-05T21:20:00.002Z</published><updated>2008-12-09T21:31:38.833Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T21:31:38.833Z</app:edited><title>RAND#20: English is weird, but I love it. Most of the time...</title><content type="html">&lt;p&gt;On the coach into work this morning I was getting rather annoyed by the inane chatter from a couple behind me (how many times is it really worth noting that it's raining?) when I began to think about the word inane, or more particularly the non-existence of a word &amp;quot;ane&amp;quot;. Or &amp;quot;ept&amp;quot; for that matter. Though a former colleague of mine did like to use the non-word &amp;quot;tuitive&amp;quot; (Paul Leigh - where are you now?).&lt;/p&gt;  &lt;p&gt;Is there a name for words like this, that almost seem as if they're pre-negated? And what about their opposites? There's counter-intuitive, but what are the opposites of inane and inept? And don't get me started on how many people say disinterested when they really mean uninterested.&lt;/p&gt;  &lt;p&gt;Well, fast-forward to tonight for a little irony. The Live Writer spell checker has kindly highlight the above &amp;quot;non-words&amp;quot; which I intentionally used, but I've also been typing up a CV for a friend of my wife and happened to misspell &amp;quot;education&amp;quot; as &amp;quot;eduction&amp;quot;. But this didn't get flagged as it's actually a word. Surely it would useful to give warnings (orange squiggles, maybe) if it comes across rather uncommon words that are very similar to much more common ones? And for some meta-irony the spell checker in Live Writer &lt;u&gt;has&lt;/u&gt; flagged &amp;quot;eduction&amp;quot; as wrong, and also helped me out when I misspelled &amp;quot;misspell&amp;quot; as &amp;quot;mis-spell&amp;quot;!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5879087-6828332786532064505?l=pdbartlett.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://pdbartlett.blogspot.com/feeds/6828332786532064505/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5879087&amp;postID=6828332786532064505" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/6828332786532064505?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5879087/posts/default/6828332786532064505?v=2" /><link rel="alternate" type="text/html" href="http://pdbartlett.blogspot.com/2008/12/rand20-english-is-weird-but-i-love-it.html" title="RAND#20: English is weird, but I love it. Most of the time..." /><author><name>Paul Bartlett</name><uri>https://profiles.google.com/108007617377061195729</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-uhitoHHmEW4/AAAAAAAAAAI/AAAAAAAAD-I/Wssefbmw5Bo/s512-c/photo.jpg" /></author><thr:total>0</thr:total></entry></feed>

