<feed xmlns="http://www.w3.org/2005/Atom"><title>DarkTrojan</title><link rel="alternate" type="text/html" href="http://www.darktrojan.net/news/" /><link rel="self" type="application/atom+xml" href="http://www.darktrojan.net/news/?atom" /><entry><title>End of the road?</title><link rel="alternate" type="text/html" href="/news/2010-09/end-of-the-road" /><published>2010-09-03T11:59:53+12:00</published><updated>2010-09-03T11:59:53+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I think that both of my add-ons Open With and Shrunked have one, maybe two, more releases in them. They've achieved all I ever set out to do, and a lot more - if it wasn't for thousands of users I would've stopped developing them ages ago. Here's what's left to do (probably not until closer to the release of Firefox 4):</p>
<p>The Shrunked options dialog needs to take advantage of some of the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=458299">first code I ever wrote for Mozilla</a>. This will make it incompatible with Firefox 3.5, but that doesn't really matter any more.</p>
<p>I'd also like to be able to remove the resampling code introduced in Shrunked 2.5, but Mozilla needs to do a better job of image resampling themselves first.</p>
<p>Open With has a fancy new options tab, replacing the cramped dialog box. I'm waiting to see how things pan out with the new about:addons page before I make final decisions on releasing that.</p>
<p>As always, thanks for using my software, and don't forget to send me some appreciation in <a href="https://addons.mozilla.org/addon/11097/contribute/installed/">currency form</a>.</p></div></content></entry><entry><title>5 reasons I like Python</title><link rel="alternate" type="text/html" href="/news/2010-09/5-reasons-i-like-python" /><published>2010-09-01T23:11:10+12:00</published><updated>2010-09-01T23:15:10+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I've been faffing about in <a href="http://www.python.org/">Python</a> for about a week now and I quite like it! Here are 5 reasons why:</p>
<ol>
<li>It's functional. I hate having to write classes when they're unnecessary.</li>
<li>The interpreter is really handy. I like that I can test out code snippets and get instant feedback without opening a text editor.</li>
<li>There are plenty of <a href="http://docs.python.org/library/index.html">built-in libraries</a>, including for odd things like reading and writing the config-file format (extremely easily!). And yet, they all come pre-packed and the download is still small. All except MySQL, that is, but it's easy enough to get.</li>
<li>References to dead parrots in the documentation. I also recommend the <a href="http://docs.python.org/tutorial/">tutorial</a>.</li>
<li>It's simple enough that it could (and should) be taught in COMPSCI 101. When I did 101 (9 years ago), we learned Java, and it was far too complicated for teaching the basics of programming. I still hate it.</li>
</ol>
<p>I hope you try Python and like it too. Maybe soon I'll create something funky and post it here with all the C# and the Javascript and PHP.</p></div></content></entry><entry><title>PHP portability lessons</title><link rel="alternate" type="text/html" href="/news/2010-08/php-portability-lessons" /><published>2010-08-29T15:24:10+12:00</published><updated>2010-08-29T15:52:53+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I want my code to be able to run in as many different environments as possible, so last week I upgraded from PHP 5.2 to 5.3. I also installed it on my sister's Mac, which is really poorly configured (this is handy). Here's what I learnt:</p>
<ul>
<li>5.3 introduces some new types of <a href="http://www.php.net/manual/en/errorfunc.constants.php">errors</a> (E_DEPRECATED and co.) and since my code wasn't set up to ignore them, I got error messages everywhere. For portable code it's a bad idea to take E_ALL and subtract the errors you <em>don't</em> want to see, especially as you can't use E_DEPRECATED in code when it's not defined (5.2). I'm now using <code>error_reporting(1015)</code>, which is the sum of all the errors I <em>do</em> want to see.</li>
<li>Sometimes PHP ignores settings in .htaccess files, and sometimes it ignores your code if there's an .htaccess setting. This is particularly irritating if you can't figure out what's going on.</li>
<li><a href="http://www.php.net/manual/en/function.ereg.php"><code>ereg</code></a> and friends are deprecated in 5.3. I don't know why, and I'm sure there's a good reason, but I use <code>ereg</code> a lot. Still going through one's code and removing uses of a commonly used function is good for code review.</li>
<li>PHP has a function called <a href="http://www.php.net/manual/en/function.idate.php"><code>idate</code></a>. I did not know that.</li>
<li>Mac Finder is a pain in the behind. And I thought Windows Explorer was bad.</li>
<li>If it works fine in one place, that's not an indication that it'll work fine in another.</li>
</ul>
<p>Apart from that (and only the first two actually required me to do anything), my code is actually in really good shape. I must be getting better at this.</p></div></content></entry><entry><title>How's that "blogging more" going then?</title><link rel="alternate" type="text/html" href="/news/2010-08/how-s-that-blogging-more-going-then" /><published>2010-08-25T10:48:59+12:00</published><updated>2010-08-25T10:48:59+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Not very well, apparently.</p>
<p>I have however implemented both the features I wanted (changing font size in the editor, and saving posts for later), and they are working well. I've also made some major progress on the CMS software, which is almost ready to be released into the wild:</p>
<ul>
<li>A big UI tidy-up, the admin pages are looking much tidier and less buggy than before.</li>
<li>The install code now exists and works. It's not very pretty though.</li>
<li>I've got bitbucket trained to tell my website when there's new stuff available, which in turn gets and packages the new stuff ready for download. It's quite clever.</li>
</ul>
<p>And in other news, I've joined <a href="https://twitter.com/geoff_lankow">Twitter</a>, am learning <a href="http://www.python.org/">Python</a>, and I've been messing about with <a href="http://www.intertwingly.net/code/venus/">Planet Venus</a>. So quite busy then.</p></div></content></entry><entry><title>Starting your own Mercurial repository</title><link rel="alternate" type="text/html" href="/news/2010-08/starting-your-own-mercurial-repository" /><published>2010-08-16T15:24:50+12:00</published><updated>2010-08-16T15:24:50+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>For various reasons, a few weeks ago I began to put some of my code into Mercurial repositories. Here are a few things I've discovered along the way that may be of some use to you if you're doing the same:</p>
<ul>
<li><strong>Your initial commit is very hard to get right.</strong> If you're working with existing code, which is quite likely, working out what should and shouldn't be managed by Mercurial is difficult. It's not often a case of 'just add everything'. You'll probably need to have a few goes to get it right.</li>
<li><strong>Start by making a backup copy.</strong> This gun is loaded. If you find something in the repository that you want, but just don't want managed and you casually type <em>hg remove</em>, it's gone. And rather messy to get back (assuming you don't make another mistake and end up losing it forever).</li>
<li><strong>Once it's in a changeset, it's there forever.</strong> This might be ok if you're just using Mercurial for yourself as a versioning system, you can add or remove stuff as it takes your fancy, but if your repository ever goes public, remember this: <em>hg clone</em> fetches the entire repository. Everything that was ever in it. Media files you don't use. Scraps of old code that are still around. <em>Your passwords.</em> And speaking as someone who has a limited amount of internet bandwidth, people don't want to have to download megabytes of icon libraries which you accidentally added even though you only use four icons from it. So think, before you add.</li>
<li><strong>.hgignore is your friend.</strong> Learn to use it well. And importantly, decide early whether it's a part of your repository or not (I recommend not), and stick with your decision. Things can get very messy if you try and unwind mistakes.</li>
<li><strong>Mercurial Queues extension is your friend.</strong> Make every distinct change in a changeset of its own. It becomes a lot easier to manage five things at once if you can take them apart and put them back together again knowing it's all being looked after somewhere. Plus, you can keep your own specific changes to a public repository in a queued patch, and apply and remove it as necessary.</li>
<li><strong>Let code incubate.</strong> Read your changesets after you think you've finished them. Keep patches in the queue for a few days before you commit them. You'll always find a bit you missed. Keep them in your local tree for a while before you push them. It's much easier to recall things and fix them before they go public.</li>
</ul>
<p>So there you have it. Six things I've learnt that could save you some pain. I've also found that preparing to open-source code takes a lot longer than you expect, and Mercurial actually helps you notice things that have been in your code for years that you've just been ignoring, like files you once wrote but never finished.</p>
<p>Stay tuned for more fascinating insights (yeah, right).</p></div></content></entry><entry><title>Why this blog sucks.</title><link rel="alternate" type="text/html" href="/news/2010-08/why-this-blog-sucks" /><published>2010-08-14T20:31:51+12:00</published><updated>2010-08-14T20:31:51+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>(warning: ramble)</p>
<p>I have decided (again) to try to blog more on a regular basis. The trouble with this is that as soon as I've written the first sentence, everything else that I wanted to say has either been said, or completely escaped my mind. Like what happened just now.</p>
<p>There must be an easier way to unjumble one's thoughts into a written format.</p>
<p>It's possible that the user interface I'm using right now is not very conducive to meaningful blogging. But I wrote it, so I have no-one to blame but myself. The trouble is, I don't know how to improve it. (Incidentally, I've just opened Firebug and changed the font size from really quite small into a little bit oversized. I <em>think</em> I like it.)</p>
<p>I have tried to blog offline using Word, so that I've got somewhere to save what I'm writing and come back to it when that pesky second sentence pops back into my head. Perhaps that's something I should implement here, it wouldn't be too hard.</p>
<h4>Why I want to blog more</h4>
<p>(the real reason for this post, now that I've remembered)</p>
<p>I live a rather odd life out on my own at the far end of the branch (in CompSci terms I suppose you'd call me a leaf node) - I'm a qualified software engineer, and I spend a fair chunk of my time engineering software, but I don't have any significant connections to other people in that world. There are people in Mozilla whose name I keep tripping over because they seem to work on all the same parts of the code that I do, but beyond Bugzilla comments they're really just names to me.</p>
<p>I live in other worlds too, of course - in particular the youth ministry scene - where the people are lovely and for the most part care, but often they drive the introvert in me crazy and I don't have many people I can really relate my twisted mental model to.</p>
<p>My mind is a mess of idealism, counter-culturalism (and counter-counter-culturalism, etc., etc.), logic, frustration and all sorts of fun things like those going around in circles. I want to express somehow what's going on in my head, and having to articulate it in English could be helpful for that. I had some good chats with people today which forced me to do just that, and it was okay.</p>
<p>So I turn to you, dear anonymous reader (yes, all one of you), who has at least the option of not reading this page. Quite frankly if you've made it this far you're doing well. I'm not even sure it bothers me if anyone reads this, for me the benefit is in the writing.</p>
<h4>Maybe I should just get a life.</h4>
<p>Yeah, probably. But I'm having enough trouble with the one I've got, thanks.</p></div></content></entry><entry><title>Free things!</title><link rel="alternate" type="text/html" href="/news/2010-07/free-things" /><published>2010-07-24T15:23:28+12:00</published><updated>2010-07-24T15:23:28+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I've updated the <a href="/software/">software page</a> of this here website and added links to some more free things. You can now get hold of my Extend library, updated drag and drop stuff, and my extremely good-looking LightBox clone, DarkBox.</p>
<p>Enjoy.</p></div></content></entry><entry><title>Sunday development has been discontinued</title><link rel="alternate" type="text/html" href="/news/2010-07/sunday-development-has-been-discontinued" /><published>2010-07-24T15:21:06+12:00</published><updated>2010-07-24T15:21:06+12:00</updated><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Due to a complete lack of interest, development of Sunday has stopped.</p>
<p>If you're interested in getting a copy, <a href="mailto:geoff@darktrojan.net">email me</a> - I might even chop the price for you if I'm in a good mood.</p></div></content></entry></feed>