tag:blogger.com,1999:blog-57335472317750302852009-07-13T11:53:22.190+10:00Mere CodeHacking, Software Collaboration, Testing and Diverse Other Topics of General Interest to the Practicing Programmerjmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.comBlogger85125tag:blogger.com,1999:blog-5733547231775030285.post-46290177113962558572009-07-13T11:53:00.001+10:002009-07-13T11:53:18.409+10:00New GPG keyI've published a new GPG key: 2048R/2A727997<br /><br />Details available here: http://static.mumak.net/jml-key-transition-2009-07-13.txt<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4629017711396255857?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-32627605680964091302009-07-07T17:03:00.003+10:002009-07-07T17:19:08.904+10:00Angle on code reviewYou're a core contributor to a Free Software project. Maybe you get paid to do it, maybe you don't. You get a patch from the outside: someone whose name you don't recognize has contributed a patch.<br /><br />You could ignore this patch, since you've got a lot of work to do already. Better, you could <a href="http://mumak.net/stuff/your-code-sucks.html">review</a> the patch and give the newbie some much needed feedback.<br /><br />Alternatively, you could <span style="font-style: italic;">champion</span> the change by making sure it gets the treatment that one of your own patches would. Review it or get it reviewed, help the newbie make the changes the reviewer wants, make sure it's managed using the best systems for managing patches in your project, keep track of its progress like you would one of your own patches, be eager to see it landed, pimp it in the changelog and the release announcement, get the newbie's name in lights.<br /><br />In practical terms: if you use a DVCS, get the patch out of whatever email attachment its in and put it in a branch; if you use a code review system like Launchpad, get it out of the bug tracker and into the code review tool; if you have a test suite, empower the newbie to write tests (normally that means knowing where to put them and how to run them).<br /><br />It's a matter of perspective: am I here to maintain the quality of the code base and prevent bugs from being introduced, or am I here to help others in my community. Am I just a reviewer or am I a champion?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-3262760568096409130?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-85366891097806236402009-07-01T01:18:00.002+10:002009-07-01T01:23:03.837+10:00Twisted huh?One of the hallway conversations I've had a few times so far at EuroPython goes like this:<br /><br />A: Twisted's got some good stuff going for it, but I don't like the way it forces me to use Zope interfaces. It's too heavyweight?<br />B: Huh? What do you mean? It doesn't make you do that.<br />C: Yeah, there's lots of deep inheritance, which just feels really wrong.<br />A: Right, I have to write too much code to get something simple working.<br />B: Sorry, I have no idea what you mean. Can you give a concrete example?<br />A, C: I can't think of one right now.<br /><br />To me, this is a very intriguing beginning to a real conversation. Do you know what A and C might mean here? I'd love to understand their points so that I can form an opinion.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-8536689109780623640?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com9tag:blogger.com,1999:blog-5733547231775030285.post-42046147890250750712009-06-25T16:47:00.001+10:002009-06-25T16:47:44.332+10:00Argh!I upgraded karmic, and now Do &amp; Banshee are broken. :(<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4204614789025075071?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com1tag:blogger.com,1999:blog-5733547231775030285.post-88470716792603475392009-06-04T07:58:00.003+10:002009-06-04T08:54:44.120+10:00pyflakes now warns about unused local variablesI finally got around to finishing my fix for <a href="http://divmod.org/trac">Divmod</a> bug <a href="http://divmod.org/trac/ticket/2718">#2718</a> -- Warn about unused variables in methods in <a href="http://www.divmod.org/trac/wiki/DivmodPyflakes">pyflakes</a>. Last night, the magnificent <a href="http://jcalderone.livejournal.com/">Jean-Paul Calderone</a> reviewed and landed my patch. This means that if you are using pyflakes trunk (either from Subversion <a href="http://divmod.org/svn/Divmod/trunk/">trunk</a> or from the Launchpad <a href="https://code.edge.launchpad.net/%7Evcs-imports/pyflakes/main">Bazaar import</a>), pyflakes will spot code like:<br /><pre><b><span class="code-lang">def</span></b> <b><span class="code-func">foo</span></b>(bar):<br />baz = bar + 2<br /><b><span class="code-lang">return</span></b> 12<br /></pre>and generate a warning like:<br /><pre>example.py:2: local variable 'baz' is assigned to but never used<br /></pre>I use pyflakes hooked up to <a href="http://www.emacswiki.org/emacs/FlyMake">flymake</a>, so it's always running all the time on every Python file I'm working on. Relying on it has become as second-nature as relying on syntax highlighting. There's a whole class of mistakes I don't make any more, simply because it's on.<br /><br />However, the <span style="font-style: italic;">main</span> way it helps me is when I'm refactoring code. When extracting a function or changing a variable name, pyflakes acts like a sort of todo list for me. Now that it shows unused local variables, it's getting dangerously close to perfect.<br /><br />To get pyflakes quickly, bzr branch <a href="https://code.edge.launchpad.net/%7Evcs-imports/pyflakes/main">lp:pyflakes</a>.<br /><br />(Edit: Grammar fix)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-8847071679260347539?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com2tag:blogger.com,1999:blog-5733547231775030285.post-13625645329620616352009-05-25T17:12:00.003+10:002009-05-25T17:15:40.054+10:00Landscape on Code ReviewThe Landscape guys mentioned three things that I've missed in <a href="http://mumak.net/stuff/your-code-sucks.html">Your Code Sucks and I Hate You</a>.<br /><br /><ul><li>The important thing about code reviews is that they are a conversation. Emphasise this in your team's code review culture.</li><li>Don't speak to the person, speak to the code. "Why does the code do this?" rather than "Why did you do this?".</li><li>Remember that the person who wrote the patch is an expert in that patch.</li></ul><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-1362564532962061635?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-55808450078234105692009-05-25T16:55:00.002+10:002009-05-25T17:01:25.552+10:00From the HandsJust starting at UDS after a week at Canonical's Allhands event. Allhands was great, but one of the highlights for me was the Landscape team's presentation on their development process:<br /><blockquote>We optimize for fun. If something works really well in theory but it makes things less fun, then we don't do it.<br /></blockquote><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-5580845007823410569?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-70694372665287939252009-04-09T08:54:00.003+10:002009-04-09T09:06:13.277+10:00Stealth featureLast release, Tim added a stealth feature to Launchpad. Since it's incomplete we didn't announce it on the official blog, but it's useful enough to share here.<br /><br />If you browse to https://code.launchpad.net/~$USERNAME/$PROJECT, you'll get a list of all the branches in $PROJECT owned by $USERNAME, e.g. <a href="https://code.launchpad.net/%7Eraof/do">Chris's Gnome Do branches</a> or <a href="https://code.edge.launchpad.net/%7Egmb/gwibber">Graham's Gwibber branches</a>. I use this mostly to track my own branches in a project so I can make sure I haven't let any slip through the cracks.<br /><br />We want to make it possible to get to these pages without URL hacking, of course. But if you use both Bazaar and Launchpad quite heavily then this trick is worth knowing about even as it is.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-7069437266528793925?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com2tag:blogger.com,1999:blog-5733547231775030285.post-3882409163497889772009-04-07T16:29:00.002+10:002009-04-07T16:33:59.245+10:00Truth (again)<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.presentationzen.com/.a/6a00d83451b64669e20105357bf39b970b-450wi"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 450px; height: 338px;" src="http://www.presentationzen.com/.a/6a00d83451b64669e20105357bf39b970b-450wi" alt="" border="0" /></a><br />I <a href="http://life.mumak.net/2008/10/truth.html">originally posted</a> this on <a href="http://life.mumak.net/">my other blog</a>. I saw it while digging up another post and thought I'd take it's advice.<br /><br />Originally found on <a href="http://www.presentationzen.com/">Presentation Zen</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-388240916349788977?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-18242227653192095602009-04-01T09:12:00.004+11:002009-04-01T09:24:00.006+11:00Time-based releases and loveI believe in time-based releases. I believe in frequent releases. I believe in a trunk branch that is always ready to be a release candidate. Many Free Software developers share my beliefs. For a long time I haven't questioned it. It's obviously good to release regularly and often.<br /><blockquote>"It is hard to argue that bzr isn't in a state of flux when a new stable version is available once a month." - Jason Earl, Bazaar mailing list.<br /></blockquote>Now I think I have to begin asking questions.<br /><br />Is it possible that time-based releases actually create negative impressions of software? Should regular releasers slow down their cadence? How should compatibility watersheds (format, API, whatever) affect a release cycle? What would Bazaar's format reputation be like if they released every six months instead of every month?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-1824222765319209560?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com6tag:blogger.com,1999:blog-5733547231775030285.post-36724938623331492892009-03-26T09:23:00.005+11:002009-03-26T12:53:00.461+11:00Team +junk branchesVery, very recently, we changed Launchpad to <a href="https://bugs.edge.launchpad.net/launchpad-bazaar/+bug/237465">support team +junk branches</a>. So recently, in fact, I don't think the change has hit the servers yet. Anyway, after the 2.2.3 release on April 1, you'll be able to push up &amp; create branches in lp:~your-team-here/+junk/some-branch.<br /><br />I have to confess I'm not a huge fan of this feature. Almost all of the time, if you've got some code in a branch and you want others to collaborate on it you should <a href="https://edge.launchpad.net/projects/+new-guided">create a new project</a>. That way you can file bugs, do code reviews and get easy branch stacking support.<br /><br />Still, the use case that <a href="https://edge.launchpad.net/%7Elaserjock">Jordan</a> mentions is a good one, and the fix fell out naturally from some of the work we've done for source package branches, so we decided to do it. You see, we actually do get a kick out of making our users happy. Really.<br /><br />I guess the moral of the story, if there is one at all, is to <a href="https://bugs.edge.launchpad.net/launchpad-bazaar/+filebug">file bug reports</a>. We don't want to build a website with <a href="http://upload.wikimedia.org/wikipedia/en/1/1b/The_Homer_by_Carlos_Bisquertt.jpg">separate bubble domes</a> and <a href="http://en.wikipedia.org/wiki/Oh_Brother,_Where_Art_Thou%3F">three horns that all play "La Cucaracha"</a> so we aren't going to mindlessly say "yes" to everything. But we do want to make something that will help you rock the Free Software world even harder, and to do that, we need to know what you want.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-3672493862333149289?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com3tag:blogger.com,1999:blog-5733547231775030285.post-46011965730145469472009-03-25T17:57:00.002+11:002009-03-25T18:06:15.672+11:00Trips me every time<a href="http://twitter.com/etrepum">etrepum</a> <a href="https://twitter.com/etrepum/status/1385947605">commented</a> on how hash functions need to be idempotent. I pretty much always interpret things about functions and <a href="http://en.wikipedia.org/wiki/Idempotent">idempotence</a> incorrectly.<br /><br />When used in computing, saying a function is idempotent generally means you can call it a hozillion times and the state of the system (&amp; thus the return value of the function) will be the same as if you called it once.<br /><br />When used in mathematics, a function <span style="font-style: italic;">f</span> is idempotent if <span style="font-style: italic;">f(f(x)) = f(x)</span> for all <span style="font-style: italic;">x</span>. The computing quality of idempotence isn't useful since <span style="font-style: italic;">f(x) = f(x)</span>.<br /><br />I would greatly appreciate it if we could all find a way to communicate that didn't involve language.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4601196573014546947?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com7tag:blogger.com,1999:blog-5733547231775030285.post-44787273522532885882009-03-23T09:29:00.002+11:002009-03-23T09:31:50.533+11:00brisbane-coreUp in Brisbane, while I was diligently working away on package branches in Launchpad, many of the Bazaar guys were working on their new "brisbane-core" format.<br /><br />I overheard one of them say in this new format 'log -v' is up to twenty times faster.<br /><br />Want more details? Well, perhaps someone else on Planet Bazaar can provide them.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4478727352253288588?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com1tag:blogger.com,1999:blog-5733547231775030285.post-30664961239311845992009-03-09T16:38:00.003+11:002009-03-09T17:41:47.696+11:00Firefox Smart Bookmark for BranchesYou might not know about Firefox smart bookmarks. They let you type something into your URL bar like "twisted 2345" and have Firefox load the Twisted bug page for bug #2345. Lifehacker explains <a href="http://lifehacker.com/387944/how-to-make-your-own-smart-bookmarks-in-firefox-3">how to create them</a>.<br /><br />Here's one to add for Launchpad branches:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://code.mumak.net/uploaded_images/Screenshot-Properties-for--759585"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 196px;" src="http://code.mumak.net/uploaded_images/Screenshot-Properties-for--759574" alt="" border="0" /></a>Once you've added this, you can type 'lp twisted' or 'lp python' into your Firefox location bar and get redirected to the branch page for Firefox. Anything that works as part of an lp: URL will work here. Right now, this only works on edge.<br /><br /><span style="font-weight: bold;">Update: </span>Firefox escapes any slashes you put into the URL bar, which makes this much less useful.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-3066496123931184599?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com2tag:blogger.com,1999:blog-5733547231775030285.post-73438767140157245272009-02-27T16:01:00.002+11:002009-02-27T16:10:52.738+11:00Fourteen MonthsesI've been waiting since November for this.<br /><br />Now, if you submit a branch for review on Launchpad, Launchpad will automatically generate the diff for you. For example, take a look at <a href="https://code.edge.launchpad.net/%7Elifeless/subunit/filter/+merge/4006">the review page for one of lifeless's subunit branches</a>.<br /><br />To take advantage of the feature, go to the page of a branch you want to land (you can use bzr lp-open to do this), then click on "Propose for merging into another branch". Select the branch you want to land it on (normally trunk, which is the default branch), then type some stuff explaining what the patch does. Hit "Submit", wait a minute or so, then refresh. Voila.<br /><br />We hope to tweak the page later so that it's obvious that a diff is being generated and so you don't have to refresh. Even so, I'm very pleased that we got this done. Thanks particularly to Aaron for getting this landed.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-7343876714015724527?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-36245102533296758712009-02-27T08:32:00.002+11:002009-02-27T08:36:55.328+11:00Why you should have a public location for your branchI asked this self-same question on the Bazaar mailing list the other day. Here's the answer:<br /><ul><li>Given that the place you push the branch to (its "push location") might be different from the place that others get the branch from, branch's have public locations.</li><li>Any tool that shares your branch with others (e.g. bzr send, a commit notifier or even lp-open) needs to have a public location to share with the world.</li></ul><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-3624510253329675871?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-41628699073521243822009-02-25T12:51:00.000+11:002009-02-25T12:52:22.628+11:00Betterer CloudThe <a href="https://code.edge.launchpad.net/">Launchpad branch cloud</a> has been tweaked. We got rid of the green (what does that mean anyway?) and added more variations in font size.<br /><br />Enjoy!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4162869907352124382?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com2tag:blogger.com,1999:blog-5733547231775030285.post-65872700571401652012009-02-25T11:06:00.003+11:002009-02-25T11:16:32.776+11:00Useful, unpolished Bazaar pluginI've just pushed <a href="http://code.edge.launchpad.net/%7Ejml/+junk/bzr-difftodo">lp:~jml/+junk/bzr-difftodo</a> to Launchpad. It's a Bazaar plugin that:<br /><ul><li>Finds the diff between your current branch and the submit branch</li><li>Looks in that diff for any Python comments that you've added or modified</li><li>Shows all the TODO or XXX items in Emacs "compile" format.</li></ul>So the output looks something like this:<br /><br />$ bzr todo<br />Using submit branch /home/jml/repos/someproject/trunk<br />lib/somefile.py:167:<br /> XXX: JonathanLange 2009-02-23: This matches the old search algorithm that used to live in foobar.py. It's not actually very good -- really it should match based on substrings of the unique name and sort based on relevance.<br /><br />lib/otherfile.py:680:<br /> XXX: This is using _cromulateSplonks -- a private method that no longer exists.<br /><br />lib/anotherfile:779:<br /> XXX: I think that this can be moved into IAmAwesome.<br /><br />Things to do: 3<br /><br />The branch comes with an Emacs module bzr-todo.el. If you load this module, you can just go "M-x branch-todo" in any file in a branch and have the todo list come up in a compile buffer. Then you can just click on any item to jump straight to it.<br /><br />The core code is pretty well tested, but everything around is really, really rough. It works for me.<br /><br />I'd love some patches for it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-6587270057140165201?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-86012869315808353692009-02-24T17:16:00.000+11:002009-02-24T17:16:29.431+11:00100% Pure DoingAs you might know, <a href="https://help.launchpad.net/Code/Review">Launchpad has a code review system</a>. You might have even given it a try a few months ago when it first came out. We, the Launchpad team, started using it almost right away and to be completely honest with you, we didn't like it very much. On the whole we are curmudgeonly engineers who would rather fix bugs or build features than fiddle with a silly website. However, now the much-feted power of <a href="http://www.joelonsoftware.com/articles/fog0000000012.html"><span style="font-weight: bold;">dogfood</span></a> was working for us.<br /><br />We've been improving the code review system for <span style="font-style: italic;">ages</span> now. It's<a href="https://bugs.edge.launchpad.net/launchpad-bazaar/+bugs?field.tag=code-review"> not perfect</a>, but is getting better rather quickly. Over the last cycle, it has started to become <span style="font-style: italic;">really good</span>. We've <a href="https://bugs.edge.launchpad.net/launchpad-bazaar/+bugs?field.searchtext=&amp;orderby=-importance&amp;search=Search&amp;field.status%3Alist=FIXCOMMITTED&amp;assignee_option=any&amp;field.assignee=&amp;field.bug_reporter=&amp;field.bug_supervisor=&amp;field.bug_commenter=&amp;field.subscriber=&amp;field.omit_dupes.used=&amp;field.omit_dupes=on&amp;field.has_patch.used=&amp;field.has_cve.used=&amp;field.tag=code-review&amp;field.tags_combinator=ANY">done a lot of things this cycle</a>, I want to focus on <a href="https://bugs.edge.launchpad.net/launchpad-bazaar/+bug/325985">one in particular</a>, since it's dear to my heart.<br /><br />On our <a href="https://edge.launchpad.net/">cutting edge servers</a>, and in the next release, the "active reviews" page for a project is tailored to you specifically. Instead of just showing you all the reviews, like it used to do, it shows you the following lists:<br /><ul><li>The reviews you <span style="font-style: italic;">must </span>do. That is, the reviews specifically requested of you that you haven't done.</li><li>The reviews you <span style="font-style: italic;">can</span> do. Reviews that have been requested of your team that no one else has done yet.</li><li>The reviews you are <span style="font-style: italic;">waiting on</span>. Reviews that you've requested that haven't been done yet.<br /></li><li>The reviews you have <span style="font-style: italic;">completed</span>. Reviews you've done that haven't been replied to yet.</li><li>Everything else.</li></ul>It's the first list that makes me happiest. At last, I have a list of reviews that I can churn through, knowing that I'm doing the right thing, not having to figure what state it's in or make decisions about how important it is. I simply <span style="font-style: italic;">do</span>.<br /><br />The second list is pretty awesome too. If ever I'm between branches or have a few minutes to spare during a lengthy test run, I have an already-prepared list of ways to make other people happy. That's the kind of software I like.<br /><br />And, well, actually, I like the third list too. It's great to be able to look at the things you are blocked on and see who you need to hassle. The "Waiting For" pattern comes from GTD, and is one of the best things about the system and deserves wider notoriety.<br /><br /><br /><span style="font-size:78%;">(Oh, and just wait for the release announcement!)</span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-8601286931580835369?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-46458967350211113862009-02-21T18:48:00.002+11:002009-02-21T18:48:46.594+11:00Server reinstalledNow running a beautiful instance of Ubuntu 8.04 LTS. Different passwords, no PHP, no Wordpress.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4645896735021111386?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-91698218945191334392009-02-21T14:47:00.003+11:002009-02-23T10:34:15.438+11:00One bird, two stones<a href="http://glyph.twistedmatrix.com/">Glyph</a> thinks that <a href="http://glyph.twistedmatrix.com/2009/02/explaining-why-interfaces-are-great.html">interfaces are great</a>, and he is right (although I haven't read the full post, I certainly agree with the title).<br /><br />One of the natural things you can do with interfaces is this: make a new class Bar that delegates all of the properties of IFoo to an instance of class Foo. This is the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">Decorator pattern</a> (not to be confused with Python's decorator syntax), and is also the Bird in this parable.<br /><br />We use interfaces a lot in Launchpad, and we need to Decorate classes quite a bit. So, we wrote something to make it easy and open sourced it. It's called <a href="https://launchpad.net/lazr.delegates">lazr.delegates</a>. This is Stone One, if you like.<br /><br />Stone Two was actually cast first, and is called <a href="http://twistedmatrix.com/documents/current/api/twisted.python.components.html#proxyForInterface">twisted.python.components.proxyForInterface</a>. It's distributed as a part of Twisted, and solves exactly the same problem. For those interested, here's the <a href="http://bazaar.launchpad.net/%7Evcs-imports/twisted/main/annotate/head%3A/twisted/python/components.py">Twisted implementation</a> (scroll to line 320ish) and here's the <a href="http://bazaar.launchpad.net/%7Elaunchpad-pqm/lazr.delegates/devel/annotate/head%3A/src/lazr/delegates/__init__.py">lazr implementation</a>.<br /><br />Both implementations are fairly simple, and yet it is perhaps a shame that there are two of them. If anyone is at fault, it's me, since I knew about proxyForInterface and watched lazr.delegate arrive in the Launchpad tree without even thinking that the two might actually be the same thing.<br /><br />But I wonder, is there a process bug here? Is there something Launchpad, Twisted, Zope or Guido could have done to avoid this?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-9169821894519133439?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com1tag:blogger.com,1999:blog-5733547231775030285.post-45642867785595369052009-02-21T14:02:00.001+11:002009-02-21T14:03:56.503+11:00Scheduled UnreliabilityThis blog will be available on and off this weekend as I upgrade the server it's on.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-4564286778559536905?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0tag:blogger.com,1999:blog-5733547231775030285.post-69597752032432947492009-02-21T11:08:00.003+11:002009-02-21T11:11:52.822+11:00Neat trickIn Argentina I hacked up a little command for the 'launchpad' Bazaar plugin. It's a command line tool to open the Launchpad page for your branch in your web browser.<br /><pre> $ cd ~/src/testresources/expose-reset-bug-271619<br /> $ bzr lp-open<br /> Opening https://code.edge.launchpad.net/~jml/testresources/expose-reset-bug-271619 in web browser<br /></pre>... and it works!<br /><br />Available in Bazaar 1.12. Due to an unfortunate oversight, the NEWS file doesn't mention it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-6959775203243294749?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com7tag:blogger.com,1999:blog-5733547231775030285.post-76905845004645648012009-02-20T17:30:00.002+11:002009-02-20T17:34:05.552+11:00Things every project needsI'm reviewing my checklists right now. I just came across one that I'd like some help with. It's called "Things every project needs", and it currently has this:<br /><ul><li>TODO system (e.g. specs, trackers, text file, bzr difftodo)</li><li>Version control</li><li>List of dependencies</li><li>One step build</li><li>One step build-and-run-tests</li><li>One step build-and-run<br /></li><li>One step build-docs (API, testdoc, general docs, sphinx)<br /></li><li>Version information</li><li>License<br /></li></ul>I hope you see the sort of thing I mean. I mean things you have to do (or at least think about) when starting any software project.<br /><br />Can you think of anything to add?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-7690584500464564801?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com3tag:blogger.com,1999:blog-5733547231775030285.post-37638277443035306702009-02-19T19:09:00.002+11:002009-02-20T10:19:59.039+11:00Everything I ever learned about programming...... I learned from <a href="http://twistedmatrix.com/">Twisted</a>.[1]<br /><br />Which reminds me, one of the Twisted guns is up for hire. His name is <a href="http://itamarst.org/resume.html">Itamar Shtull-Trauring</a> and he is very smart, wrote some of the best bits in Twisted and loses gracefully at <a href="http://www.sjgames.com/munchkin/game/">Munchkin</a>.<br /><br />If you want someone in to review your system, help you design out a network protocol or provide a thoughtful, independent perspective for your new application's architecture, you should hire him. Itamar's got bad RSI, so he can't type much, otherwise I'd be trying to poach him.<br /><br />Note: Itamar still works for <a href="http://www.itasoftware.com/">ITA Software</a>, so it's only short-term contracting.<br /><br /><br />[1] Well, <a href="http://mitpress.mit.edu/sicp/">SICP</a> gets a guernsey too.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5733547231775030285-3763827744303530670?l=code.mumak.net'/></div>jmlhttp://www.blogger.com/profile/11400080716012026985noreply@blogger.com0