2007

You are currently browsing the yearly archive for 2007.

Do My Invoice, my web-based, RESTful invoicing solution, has been live for a couple of months now. Admittedly there hasn’t yet been a large number of registrations, probably because I haven’t really promoted it other than through this low-traffic blog, and because I hope that word-of-mouth may eventually kick in and result in a few more paying customers.

Interestingly though, I’ve somehow made the second page of Google results (currently sitting at position 16) for the keywords “web based invoicing”.
However, for the term “web based invoice”, the site is either so far down the list it can’t be found, or it doesn’t appear at all.

Also interesting: 3 weeks ago, DMI was at position 83 for the search term “invoices”, yet I can’t find it anywhere in the first 100 pages now — obviously we hit a broken rung in the Google ladder and fell down a few hundred feet.

Completely off-topic, but one thing this has highlighted as a gap in Google’s toolset is “Search Within”. It would be really useful to enter a few search terms, then find exactly where another term sat in those results. In other words being able to enter something like: “domyinvoice within: web based invoicing“, which gave you the results found within a set of results, along with the index positions. Seems like a killer Google feature for web developers, marketers and the like.

YAK 1.0.2a

Yet another release of YAK — this one fixes a problem with activation. Basically the db tables weren’t being created on a new activation (i.e. the first time it’s installed). This wouldn’t have affected upgraders.

Apologies to anyone who had problems, and hopefully this release will work better.

A recent release of Do My Invoice was a minor update to add more documentation for the various resources used in the application. DMI is a REST application — well, at the very least, that was the initial design goal — so there are some basic access points for most system resources.

For example, you may call GET to request your user profile:

    http://www.domyinvoice.com/resources/[username]/profile

Using CURL the request:

curl -X GET -u joebloggs:password http://www.domyinvoice.com/resources/joebloggs/profile

…will return something like…

<profile>
    <username>joebloggs</username>
	<email_address>joe@bloggs.com</email_address>
	<first_name>Joe</first_name>
	<last_name>Bloggs</last_name>
</profile>

Resources in DMI are self-describing, thus with the addition of a single parameter, you can view the documentation for that resource. Thus the url…

http://www.domyinvoice.com/resources/joebloggs/profile?help

…returns a list of the HTTP verbs accepted by the resource, basic description and more detailed information about each verb. If you don’t have an account (it’s free for the first month, by the way), you can see a static version of this help information here.

Another example, is the clients resource. You can GET a list of clients:

curl -X GET -u joebloggs:password http://www.domyinvoice.com/resources/joebloggs/clients
<clients>
	<client id="76">
		<client-name>test company</client-name>
		<address1>address line 1</address1>
		<address2>address line 2</address2>
		<city>London</city>
		<postcode>sa1 sa2</postcode>
		<country>United Kingdom</country>
	</client>
</clients>

A client can be added with the use of an HTTP PUT:

curl -X PUT -u joebloggs:password http://www.domyinvoice.com/resources/joebloggs/clients/test+company+2 -d @-

address_1=23+Wrights+Lane&address_2=Kensington&city=London&postcode=W8+6TA&country=GB&currency_symbol=£&currency_format=1&sales_tax_label=VAT&sales_tax=0.175

Which also returns the created client (assuming nothing went wrong):

<clients>
	<client id="80">
		<client-name>test+company+2</client-name>
		<address1>23 Wrights Lane</address1>
		<address2>Kensington</address2>
		<city>London</city>
		<postcode>W8 6TA</postcode>
		<country>United Kingdom</country>
	</client>
</clients>

Said client could then be deleted with the use of the DELETE verb:

curl -X DELETE -u joebloggs:password http://www.domyinvoice.com/resources/joebloggs/clients/test+company+2

The obvious advantage of using RESTful resources internally is that I’m effectively providing an external API for free — in other words, without requiring any additional development effort.

YAK 1.0.2

Version 1.0.2 of YAK has been released.

This version is a slightly more involved upgrade than previous editions. Because WordPress’s automated build system creates a distribution from the subversion repository, the directory in the filename isn’t just “yak” — it’s “yak-for-wordpress”. This appears to cause problems when I’ve named my main plugin file: “yak.php”. As a consequence, the new name is “yak-for-wordpress.php”.

Thus, before upgrading, you should backup your wordpress installation, then deactivate and remove the old yak directory. Extract the contents of the new distribution and re-activate.

Changes in this release are included in the release notes here, but to summarise:

  1. order status is automatically set to STOCK SENT when all funds have been received for a PayPal order, if the order contains only downloadable items
  2. the ‘default’ category has been removed from the products drop down. This means you can still turn the drop-down on by default for products with more than one option, and the products that are tagged as ‘default’, won’t include the dropdown.
  3. fixed a problem with apostrophes in yak title, download and confirmation email
  4. fixed a problem with PayPal shipping with multiple items
  5. fixed a problem with PayPal verification (item names need to be properly encoded)
  6. tidied up the confirmation email and code

Any problems with this release, please let me know.

Anyone else noticed the suspicious similarity between Microsoft’s Volta logo, and that of Firefox?

Even down to the spiky tail.

Interesting…

Version 0.7

I’ve just uploaded the latest version of SWFK. This fixes a few issues with continuity (such as referring to functions before they were actually explained), adds a basic explanation about the use of brackets and order of operations (which I think was a serious omission given the context), and other minor grammatical and code fixes.

The only major change is to add a few exercises to the end of some of the chapters, plus a new appendix for the answers. This is a work in progress. Exercises are currently missing from Chapter 9, and possibly aren’t as detailed (nor fun) as they should be.

But they’re a start…

The latest version of “Snake Wrangling for Kids” has been uploaded, and is now available on the main page. This is the LaTeX conversion I mentioned in a previous post — but I’ve now applied a Python code checker to 99% of the example source code. Hence I’ve fixed up a few omissions, bugs, and so on.

Automating the testing of example code proved more challenging than expected. In the end, I failed miserably to get doctest working they way I wanted, and had to roll my own testing code which works for a majority of the examples. It’s not perfect, but picked up a few problems, so I’m reasonably happy with the end result… even if it is a complete hackjob.

I’ve finished the initial part of my conversion of SWFK from Word Processor format to LaTeX. Positive aspects? Looks much better than the original; I like working in a text-based format plus I’ll be able to automate the double-checking of my examples (not completed yet); and lastly the file size is a 3rd of what it was (hoorah for my bandwidth!). Negative aspects: the format is more obscure (not a big problem obviously) and the number of pages has significantly increased. LaTeX is a lot more liberal with whitespace than I was, plus I’ve probably accidentally increased the size of some of the images, which won’t have helped. So my apologies to anyone who wants to print it, and has to kill more trees as a consequence.

Download is available from this link, but I haven’t updated the main page yet. Note that this is a draft-draft. In other words, it already was a draft, and now it’s more of a draft… ;-) I still need to tidy up some of my layout ‘messes’, plus re-check all example code, and a few other bits and pieces. Another positive aspective of converting to LaTeX is that I found a bunch of naff typos that appeared in latter chapters (and appendices), where my editing prowess obviously rather severely tailed off…

Feedback on the new format/layout welcome.

I started learning C programming in, or around, 1991. Up until that point, I had been exposed to Basic, Pascal, Modula-2, and (I think) Prolog. C was… somewhat of an eye-opener. Anyone who has had to come to grips with pointers and memory management in C, will know what I mean (and thank goodness for the Borland C IDE help system - unparalleled as a learning tool).

At University, we had papers that required learning a functional language and assembler, but neither of these were like the screaming brick wall that I hit in my second year when I decided to learn C.

Actually, since then, I can’t think of a single technology where I’ve experienced a similarly steep learning curve.

Until LaTeX.

I knew what LaTeX was, of course. But neither had the need, nor in fact, the interest, in learning it before. But after deciding I needed to move SWFK out of the atrocious (and, from an automation perspective, useless) word processing format it’s in at the moment; and after a few aborted attempts to get some reasonable output from various docbook toolsets, I’ve been provided with just the incentive.

But the learning curve is excrutiating.

Get one thing working, and the next thing stops. Change this and effect that. It was all me, of course. There’s nothing wrong with LaTeX after you get used to how it works. But, oh that learning curve. I haven’t felt such a need to scream and yell at my computer in a decade.

This is not to say things are perfect now. I still can’t get the front cover to look centered (advice from a LaTeX guru would be greatly appreciated) and, at times, LaTeX seems to think it knows, better than I do, where to put figures. Working out how to put visible spaces in a \verbatim block is also proving a little challenging. But the overall result does look, in my opinion, much nicer.

Anyone interested in proofreading the new version, please let me know.

Sometime in the last 5 days, while I wasn’t paying attention, the number of downloads of SWFK jumped from just under 2000, to almost 5000 (about 16 downloads to go, to be exact).

To put it in perspective, my lowly WordPress plugin has yet to hit that number in a year or two.

Well… …I’ve hardly been slashdotted, or dugg, but I’m impressed. ;-)

I’ve partly changed my mind about the addition of WPForum. I’m leaving it there for YAK, but have decided that it’s not necessarily useful for the other projects (such as SWFK). Instead, I’m giving the wp-thread-comments plugin a try. At least you won’t necessarily have to register in order to comment.

Unless, of course, someone has a better idea…?

I’ve just added WP-Forum to my site, currently for YAK and SWFK. At 200+ comments, the YAK discussion is already too unwieldy to be useful, and the comments list on the SWFK page could probably use something a bit more ‘threadable’.

The URL can be found here. I’ll keep comments open on both pages, until any kinks have been ironed out. Here’s hoping it’s useful…

Version 0.5

The newest version of Snake Wrangling for Kids includes some minor corrections dotted throughout the book (thanks to commentors on the SWFK page and the Edu-Sig mailing list members, once again), as well as a basic clarification as to why floating point calculations don’t always result in the number you were quite expecting (not too detailed an explanation, of course, because that would be boring… ;-) ).

The inclusion of SWFK on Pythonware’s Daily Python URL (thanks guys!), resulted in a sudden flurry of downloads, and some really useful feedback.

As usual, the download is available in zipped, PDF format.

Spring has a rather nice scripting framework that I haven’t paid much attention to, more from a lack of need than any real lack of interest.

One thing I recently noticed, is that there are only 3 supported scripting languages: Beanshell, Groovy and JRuby. Now Beanshell (for myself at least) was interesting about 4 or 5 years ago (maybe longer… since I can’t quite recall when it was first released), and I have little interest in Groovy (read “little interest” as “no interest”).

A bit of googling only uncovered a brief discussion about adding Jython support back in 2004 (I haven’t been able to find any code to go with that discussion), and Rhino-in-Spring which, as far as I can tell, is aimed at the web tier. Interesting that 2 of the most popular (IMO) scripting languages are rather conspicious by their absence from the core Spring distribution. Or if not absent, then certainly not very visible.

I’ve been looking for a reason to hack around with Spring extensions for a while, so this seemed like the opportune moment. Following one of the comments in that 2004 discussion, I started with cloning GroovyScriptFactory and a few other classes from the scripting package, and then hacked away the bits I didn’t want or need.

GenericScriptFactory is my abstract base class, and contains most of the code from GroovyScriptFactory. Subclass JythonScriptFactory is the workhorse for Jython scripting, while RhinoScriptFactory is obviously for Javascript code.

The cool part — I’ve implemented a NamespaceHandler for both, so bean configuration looks like this for Jython:

<script:jython id="test1" script-source="test.py"
               bean-name="mytest" return-type="test.TestInterface"
               interpreter="pythonInterpreter">
    <script:property name="test" value="jython prop from spring" />
</script:jython>

and for Javascript (Rhino):

<script:rhino id="test2" script-source="test.js"
              bean-name="mytest" return-type="test.TestInterface"
              scope="jsScope">
    <script:property name="test" value="javascript prop from spring" />
</script:rhino>

You’ll note that in both cases the attributes are passed to the factory, but properties are injected after the bean (in whatever language) has been created. A distinction which is rather useful when you think about it. This is the same as the other scripting languages already built-in to Spring.

You can see the full configuration file here, which includes setting up a PythonInterpreter for Jython, and a global scope for Rhino.

The sweet spot is, of course, this configuration:

<script:jython id="test3" script-source="test.py" bean-name="mytest" return-type="test.TestInterface" interpreter="pythonInterpreter">
    <script:property name="testInterface" ref="test2" />
</script:jython>

test2 is the object created by the Javascript code, and you’ll note that it’s being injected into the object created (in this case) by Jython code. The opposite works as well, meaning you can call Jython code from Javascript and Javascript code from Jython (well, at least through Spring injection). Exactly why you’d want to do this, I don’t know, but it’s a fun feature.

In either case, my classes implement a simple Java interface, meaning the beans created by both scripts are useable from Java as well — as you can see in the Test code:

public static final void main(String[] args) throws Exception {
    ApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "beans.xml" });
    BeanFactory factory = (BeanFactory) context;

    TestInterface ti1 = (TestInterface) factory.getBean("test1");
    System.out.println("jython test: " + ti1.getTest());

    TestInterface ti2 = (TestInterface) factory.getBean("test2");
    System.out.println("rhino test: " + ti2.getTest());
}

Anyone interested can find the whole thing (very much a work in progress) in a Mercurial repository here.

Version 0.4

The link on the Snake Wrangling for Kids home page, now points to version 0.4. In this update, I’ve re-ordered the chapters somewhat (as previously discussed on the Python Edu-sig mailing list), fixed a few references to code that wouldn’t work in Python2.4, included a brief discussion on while-loops, and added a long lamented (at least, by me) Table of Contents.

I have to say, OpenOffice.org is starting to become rather unwieldy. Partly my fault, because of the way I wanted to layout the book, but also because it’s not obvious how to accomplish certain layout & style tasks that are necessary to make a PDF look less like a unprofessional pamphlet and more like a professional piece of work.

Anyway, the latest version is downloadable from this link.

Gusty

My upgrade to Gusty Gibbon (Kubuntu) was a staggering failure to start with. First had some repository fetch failures (my fault for not tidying up Apt’s sources list). Then had a couple of errors extracting (or dl’ing… I forget now) some packages, followed by an error “Modifying software channels” which seemed unrecoverable (i.e. it would interminably hang at that point). Reboot, try again, same problem.

In the end I gave up and downloaded the upgrade CD, burnt it and tried with that, only to experience at least one of the problems again. All seemed lost until I specified -not- to download updates during the upgrade and everything seemed to work swimmingly after that.

Still. Hardly a stunning endorsement for the user-friendliness of Linux… but at least it worked in the end.

Some time ago I decided I needed a text editor with minimal distractions. I can’t stand the sheer volume of buttons on the average word processor. Even AbiWord, which is skeletal in comparison with OpenOffice or Word, is still too busy at times (I miss Q&A Write actually — the Word Processor I used to use back in the days of MS-DOS).

A google search at the time turned up WriteRoom, which is Mac-only. But not much else.

So, of course, I developed my own alternative.

It didn’t quite fulfill the vision, so I dumped it in the “deprecated projects” list after it languished, unused. But I’ve been coming back to the idea lately, and finally did a bit more research on the various buttons you can push in PyGTK.

So, the Vanilla text editor is now -slightly- more supported than it was before (i.e. I’m probably going to use it myself), and is a bit closer to the vision. It’s completely configurable (background and foreground colours, font, key map, etc are all set from an ini file), and now runs full screen (as it should’ve from the beginning).

Only the source is available at the moment (Python2.5 and PyGTK2.0 required), but I’ll eventually make a commercially supported package available if there’s any interest.

Name dropping…

Since I’m already naming dropping… I thought I’d also mention I received a reply from David Brin (who was the reason I started working on SWFK) a few weeks back. I’m quoting part of it below (hopefully he doesn’t mind) because, let’s face it, it’s durn cool to get a reply from an author who’s one of my heroes.

Thanks for your thoughtful and interesting message in regards to my Salon Article “Why Johnny Can’t Code”.

Alas, this one swarmed me beyond all expectations. Who’d have thought that a little meditation on the inability of computers to compute would spark such fury! (Far more outright rage than when the topic is religion or politics!)

I appreciate your efforts to create a book on scripting languages to interest kids. At a brief glance, it looks cool. In fact, I have added it to my standard reply…

……snip……

With best wishes, for a confident and ambitious 21st Century,

David Brin
www.davidbrin.com

Coolness!

I know. I’m a geek. :-D

Updating chapter order

On a whim I decided to send the link for SWFK to Guido. Not that I’m on a first name basis or anything…

Anyway, turns out that was a darn good idea, because he suggested sending the link through to the Education Special Interest Group; which resulted in a ton of downloads (well, compared to the few I’ve already had, at least), and some really useful advice.

The most common theme so far seems to be “move the turtle chapter forward” — something I’d already thought briefly about, but hadn’t come to any particular conclusions. So, I’ve decided to split the chapter on using the turtle module into two shorter chapters, and cover the basics in Chapter 5 (inserting it before the chapter on functions, modules, etc).

After I’ve tidied things up, I’ll update the site with the new version.

The definition of Instant Gratification?

In Rainbows.

Register.

Decide what I want to pay.

Pay.

Download.

Instant gratification in less than 4 mins. First track sounds good as well.

YAK 1.0.1

YAK version 1.0.1 has now been released. Downloadable from either the WordPress plugins page, or from Sourceforge. This updates YAK to be compatible with WordPress 2.3, but unfortunately breaks backwards compatibility with prior versions of WP. If you’re using an older WordPress, I’m afraid you’ll have to stick with 1.0.

As well as WP2.3 compatibility, 1.0.1 adds paging to the “products” page, adds a facility to select the countries you support (see the options page), and adds a new quantity tag () to display product availability to your customers.

Interesting story on Close Up tonight, about the lack of interest in local body elections. “Boring” was the general consensus.

I couldn’t agree more. I have no idea about any of the candidates for the Auckland mayoralty, other than the current encumbent and the previous. Neither of whom I have any interest in voting for. Oh yeah, and the guy who started that horrible excuse for gratuitous nudity on Auckland’s Queen street. Skanks-on-bikes, or whatever it’s called.

The other half dozen or more candidates are unknowns. The paragraph on each person in the voting documents, is hardly enough to make a decision on who should be running the city for the next few years.

It seems to me, there’s an easy, web-based answer to fix a lack of interest in local-body elections. How about a simple form which asks a bunch of questions about relevant topics and, based on the answers given, presents the list of candidates who match the recipient’s answers. Questions like:

Would you increase rates to build more parks: Yes/No/Undecided
Do you believe rates are being used properly in [some area]: Yes/No
Which are do you think the council should focus on for the next term: [topic 1], [topic 2], [topic 3], [topic 4]…
Rank these issues in order of importance: [topic 1], [topic 2], [topic 3], [topic 4], [topic 5]…

etc

There could be a 2 minute form (short list of questions), 5 minute and 10 minute form (long list of questions), depending upon how much effort you wanted to put into your selection. The list of candidates at the end would be sorted by the percentage match to the recipient’s answers, and contain links to more information about their candidacy. It’s just a quick jump from there to adding online voting. Tick boxes next to the candidates in your list who you want to vote for.

Doesn’t seem like rocket science, and wouldn’t necessarily have to cost as much money as the Government throws into other projects. And at least there’d be more chance I’ll be choosing the right set of candidates, based on what I think is important. At the moment, I’ve got no idea.

Disappointingly, but perhaps unsurprisingly, there are no plugins for WordPress which provide bug-tracking capabilities. Well, at least none that I’ve been able to find. I did consider the possibility of developing one myself, but I have enough to do in my spare time as it is. The family would probably kick me out of the house, if I started another project…

However, I did want a basic bug tracking system for Do My Invoice, and it makes sense to also use it for YAK (and perhaps some of my other low volume projects).

After a bit of searching, I came across Mantis, a PHP bug tracking system which looks simple enough for my needs, and perhaps approachable enough for other users to easily post their issues and feature requests. It was certainly easy to install, which makes it one of the more attractive candidates… (that said, I wouldn’t have minded using FogBugz, but don’t have the budget for the moment).

So if you have features or bugs for Do My Invoice, or for the YAK shopping cart plugin, please sign up for a new account at:

http://www.briggs.net.nz/bugtrack/

In the case of YAK, the comments on the project page is still the place for support issues and, in the case of DMI, the email for support requests can be found on the dashboard after you’ve logged in.

Assumption is the mother of all screw-ups.

Like assuming that IE cache settings haven’t been touched since the last time you tested. Assuming that a final check on a test server is good enough and forgetting the final check in production, is another good example.

Unfortunately the D.E.Y. attitude (Do Everything Yourself) means that I’ve got no one to blame but myself.

So if you’ve tried Do My Invoice lately in IE and had nothing but errors, try again with a CTRL+Refresh (to ensure that IE reloads all files from the server instead of using its annoyingly aggressive cache). You should have a bit more success…

Incoming Links in 2.3

Seen a few complaints about the replacement of Technorati incoming links by Google’s blogsearch. I can sympathize, since my list of external incoming links has been replaced by a bunch of links from my own site. Useless.

Anyway, as seen here, you can set it back… although I’m not sure his her instructions were clear enough. Either that or there’s a slight difference between the release candidate and the final release.

So for those who don’t have php coding skills, but still want the return of their Technorati links, download this zip file, unzip index-extra.php inside and copy to the wp-admin directory of your WP install. Probably best to take a copy of the current one, just in case. I’ve only tested with the just-released WP2.3, so use at your own risk, etc, etc, etc.

Dodgy ISPs

Is it just me, or do ISPs in New Zealand tend to operate on the south-side of the “moral tracks”? At the moment, I’m trying to decide whether it’s worth having an argument with Orcon over the advertising for their “Zero Shock” plan (see “The Yogurt Container Broadband Plan“) — supposedly, this plan is “traffic managed” to keep email and web access fast, and the speed of P2P applications are reduced as a consequence (by accepting this, you get the piece of mind that if you go over your datacap, you won’t get charged extra… as long as you don’t keep going over every month). For me, traffic management actually meant I had the average speed of a 28K modem most evenings for any site out of the country. Of course, if you look at their Terms & Conditions, there’s just enough caveats there to make them liable for nothing. Legally they’re fine. I quibble, however, on the dubious morals that allow a company to sell a “broadband” plan that they know barely meets the definition at the best of times.

To be honest, I really have no argument with Orcon otherwise. It just seems like false advertising to call something “Zero Shock”, when I find myself damn shocked at how slow it is.

The other ISP I have experience with is IHUG, who, if they reduce their prices for some reason, will keep quiet about it… “it’s your responsibility to check our website”. I’ve experienced this and so, more recently, has my father. Seems you should focus on keeping your current customers happy, rather than just attracting new ones.

That’s two of NZ’s larger ISPs, and I know the largest (Xtra) has had problems in the past.

I wonder if the issue is industry wide?

YAK, for Wordpress 2.3, is on its way.

There are structural database changes required for WP2.3, and while I don’t necessarily need to change the YAK tables as a consequence, I do need to change a few (relatively complicated) SQL statements. So if anyone has a test environment and would like to help, it would be great if someone (other than me) can check whether or not the changes have been completely successful.
I can package up the current tip of the repository and email out to those interested.

Please note that I’ve made the decision not to support older versions of WP (i.e. versions less than 2.3) from this point on, as supporting different versions of a database makes development inordinately complicated. That said, if you won’t (or can’t) upgrade to the latest version of Wordpress, and have some essential feature that you want in YAK, feel free to cross my palms with (quantities of) silver and I’d be happy to help. ;-)

The only other change that goes into this release is the support for paging in the YAK products page. This is the product list page (using the tag <!–yak_product_page–> tag) where your users can see all your current products (in order of newest to oldest). I’m only aware of one person actually using this feature, so for most, the only thing of interest in this coming release is the 2.3 support. More to come when I have the time.

I’ve just updated Do My Invoice with a few minor bug fixes, and some new functionality in the form of a download facility for project tasks (download for expenses is coming soon). Download in XML format took no time at all, since the functionality was basically already there, but a few changes were needed for supporting CSV output. Also included in this release were “presets” for the invoice date input fields (because, yes, I am that lazy), and a bug fix for the daily email service (which wasn’t working quite as well as expected). Behind the scenes, I’ve also finally -completed- the automated test scripts (thanks to Selenium), that will hopefully notify me when I’ve broken something. Nothing like a bit of a safety net to make you feel a little more comfortable.

Next task on the list is to fully document the (REST) API, which will actually also require some minor code updates, because of the way I want to do it. Not to be unnecessarily cryptic, but more on that later…

It’s an impressive feat.

When my daughter was about 2 and a half years old, we got a long piece of string, poked it through holes in a pair of yogurt containers, pulled the string tight and used it as a telephone. It was difficult to get the concept across to a 2 year old; of talking into the container, then listening for the response. It was also difficult keep the string taut enough, so that sound waves were transmitted properly.

Somehow, Orcon have managed not only to keep a piece of string tight over thousands of kilometres, they have also managed to connect the yogurt container to the local internet loop. An extremely impressive piece of engineering. Even if it does mean my international traffic is slower than a 28K modem. Just think of the science!

* * *

So it’s now almost a month since I first noticed the problem, and over 3 weeks since I reported it — and there is still no resolution in sight. At least a couple of emails have gone unanswered in the last few weeks, although the initial response from their support department (instructions on how to provide all the data their technicians would need) was positive. Last night I finally gave up waiting and decided to sit on hold for 10 minutes or so. Their helpdesk, while nice enough (and local), were unable to shed any light and would need to pass on the details to technicians. But…

“…we have had reports from other customers of similar problems… it may have something to do with the traffic shaping…”

Yes. I’m blimmin’ well aware that it’s traffic shaping. I could’ve told you that a month ago.

“…a quick fix might be to upgrade your plan…”

Where’s the sound of screeching tyres when you want it?

Upgrade my plan?

I must remember that if I ever get a complaint about software I’ve developed…

“I’m sorry you’re having problems sir. Other people have also experienced problems with that version of our software. I invite you to upgrade to a more expensive version, in which we have fixed that issue.”

PS. Unsurprisingly, still no response from technical support.

UPDATE: it helps if you check the menu options properly… blushsmiley

I don’t tend to waste my time investigating all the nooks and crannies of an IDE (Integrated Development Environment, for the non-developer-types). I typically just use the basics. Some might say I’m wasting time by not using those features, but it works for me.

So when the Eclipse & IntelliJ users on the team opened a dialog box and jumped straight to a source file by typing the first few letters of the filename, I just shrugged and went back to navigating through the project tree…. that is, until someone pointed out that Netbeans had the exact same feature — “Go To File” (so obviously a little investigation of menu options wouldn’t have gone astray).

Then, lo and behold, I discovered shortly after, that Netbeans’ “Go To File” function actually did more than Eclipse (and was at least equivalent to Intelli). You could type the capital letters of the class and it would list the matching classes. For two glorious months (or so), I had a feature that was at least as good as my colleagues. The months of enduring taunts, because of my obscure choice in IDEs, faded from memory as I jumped from file to file with a flick of a few (less) fingers… at least, until the latest version of Eclipse arrived with that feature.

Now Netbeans 6 beta 1 has been released. I’ve been burnt in the past by NB early releases — but this is a brand-spanking-new beta. Spit-polished with the glean of months of development effort, since then. Gosling is talking about it. The general consensus elsewhere appears to be that it’s good.

And, after upgrading, it does look good. Not a huge amount of visible difference from NB5. A few burrs here and there have been filed off the sharp edges. There are some things I don’t find attractive, but it’s bearable. Integration with source control doesn’t seem to thrash the CPU, which is a major improvement.

But then… Alt+Shift+O

My most-used feature.

The only thing I could (until recently) hold above the Eclipse users on the team, and say confidently (and maturely), “Nyah nyah nyah nyah nyah”.

One thousand curses on the perpetrator, for violating the perfection of the Alt+Shift+O! Yes, they’ve indeed extended it to search all filenames instead of just classes, but at the same time they’ve rendered it unuseable. Not only is it slower, it is s…l……o………w……………e……………………r.

It is grindingly slow.

If the phrase that immediately pops to mind to describe the fastest thing you’ve ever seen is “blazingly fast”, then a snail would be described as “blazingly fast” by this feature. A tortoise would have the opportunity to perform a full circuit around my desk, and execute a perfect pirouette, before this abysmal piece of code decided that it should return some results.

Slowness I could’ve forgiven if they hadn’t removed the only thing that (until recently — and yes, I know I keep saying that) made me better than the Eclipsers. The feature-in-the-feature that made me as good as the Intellis. Searching, via the capital letters of a class.

MCGF would find MyCrazyGeneratorFactory.java and MyCrazyGeneratorFactoryImpl.java. WDMCHSLN would find WhyDoMyClassesHaveSuchLongNames.java. As it is, I now have to type My (then wait an inordinately long amount of time) to find all files starting with “My”. Carry on typing if I want to narrow the results. With a bit more waiting…

Netbeans 6.

The upgrade that is actually a downgrade.

Now I have to endure the snickers of both the IntelliJ AND the Eclipse users.

Sigh.

Footnote: Welcome back NB5.5.1!

…this is patently -not- striking while the iron is hot.

Back in September last year (2006), David Brin wrote an article in Salon.com lamenting an inability to get the BASIC programming language running on a current generation Mac or PC.

That article made a lot of sense, though I disagree(d) with his essential argument against scripting languages…

BASIC was close enough to the algorithm that you could actually follow the reasoning of the machine as it made choices and followed logical pathways.

Well, to be more precise, I disagree with ruling out scripting languages based on this premise, rather than disagreeing with the fundamentals of that specific argument.

However, Brin’s article resonated more because I’d already been thinking (a few weeks earlier) that there didn’t seem to be anything out there similar to the BASIC programming book I’d read as an 8 or 9 year old. An Amazon search revealed a precious lack of any recent publications that seemed relevant. A few beginner’s guides, programming for dummies, and some seriously out of date books about… Basic programming (and by seriously out of date, I mean circa 1980s).

At the time, I wondered if perhaps I could have a go at writing a Python programming book for kids, so David Brin’s implicit call-to-action was just the added incentive.

It’d probably only take a couple of months…

This year, in January, O’Reilly Perl guru Nat Torkington continued the meme, and judging by the 50 comments (mine included), there’s plenty of interest in kids programming. More fuel for the proverbial fire. And then there’s Scratch, MIT’s (newish) programming language for kids — which seems like a fine idea, and is probably more approachable than the typical programming languages.

So, finally — almost a year after I originally decided it might be a good idea — I’ve completed the first draft of “Snake Wrangling for Kids - Learning to Program with Python”. But striking while the iron is hot — this, rather obviously, isn’t.

Anyway, the manuscript is pretty unpolished. It hasn’t had the advantage of a professional edit (nor has it been proofed by anyone knowledgeable enough to say, “What on earth were you thinking!?!?”). But hopefully posting it here will result in a few comments to help me tidy it up… and perhaps someone will find it useful — at least hopefully any kids that want to try something a bit different to Scratch.

The main page for SWFK is here, where you’ll find the download for the zipped pdf.

We’ve thrown a few ideas around at the office, for development projects we could do after hours. The idea was to come up with something interesting (i.e. techie) that’s different enough from the contract we’re working on that we’d be able to keep motivated.

Most of the ideas were far too ambitious (i.e. would require the resources of a Google, or significantly more development effort than we could commit), until someone came up with the idea of designing something we ourselves would find useful. Which is one of those simple, rather obvious ideas which we probably should’ve started with from the beginning.

That opened up a whole different “can of discussion worms”, with the end result being that a few of the guys went in one direction, and I went in another. Which is a roundabout way of bringing me to: “Do My Invoice“.

What I decided I really needed was a simple way to record timesheet information (outside of the client’s timesheet system), which could then be converted into an invoice at the end of the month. To me “record timesheet information” means a simple email interface, because if I leave this stuff until the end of the week, it’s invariably a time-wasting struggle to remember everything I’ve been doing (of course, that’s not all there is to it… but it is the fundamentals of the idea).

Now, you might argue that any number of packages can be used to accomplish the invoicing side of things: MYOB, Quickbooks, and so on. But since the number of invoices I’m generating in a year numbers in the teens, my accountant has me working from a spreadsheet-based cashbook. His argument is why waste the money and effort on an expensive package I’ll hardly be using — I couldn’t agree more.

I’m equally sure there are other web-based, invoicing systems out there (I already came across one three-quarters of the way through the development), but I have yet to see something cheap and simple enough to satisfy my purposes.

Hence Do My Invoice is a cheap and simple (I hope, user-friendly) web-based invoicing system, with hopefully enough features to make it attractive to spend the US$50 subscription per year. In true eat-your-own-dog-food fashion, I’m using my own application, so new features will be added as, and where, I discover the lack — and so feature requests are welcome. At some point, over the next few weeks, I’ll get some sort of bug tracking software installed so requests can go there (in the meantime info ‘at’ domyinvoice.com will go to the right place).

Feedback and critique welcome — except if it’s regarding the web design (which will be fixed as soon as I have more than just myself as a paying subscriber…)

Well, I haven’t had much time to work on YAK lately, but still have a list of things I want to add when I get a chance.

However, in the meantime, I have decided I like Mercurial enough to shift YAK off subversion at SourceForge, and into its own mercurial repository hosted on my website. The subversion repository won’t go away, since I haven’t bothered to replay the tags into the Hg repos (just the individual revisions).

So if you want access to YAK from source control, the new checkout command is:

hg clone http://www.briggs.net.nz/hg/yak yak

…and then…

hg update

to keep it up to date.

You will, of course, need to install both Python and Mercurial to do so — but the repository itself is also directly accessible from the URL: http://www.briggs.net.nz/hg/yak.

While I have pretty much all my code in source control of some kind (originally subversion, now mainly mercurial), the only repos that’s externally accessible is YAK for WordPress (currently a subversion repos hosted at Sourceforge). For something like my quick (read hack-job) attempt at the Stomp protocol, that’s somewhat less than optimal, since I do occasionally (i.e. like today) get updates — so either I have to upload multiple versions, or just overwrite the current version. Which isn’t much use if someone wants to track back to previous revisions.

So, after coming across Bill de HÓra’s “Mercurial First Impressions” and subsequent “Setting up Mercurial on TextDrive” a few weeks ago, it seemed a good time to do something about the situation.

Installation went reasonably well, apart from the obligatory, and rather obscure, Apache error: “Premature end of script headers” — where it took me an embarrassingly long amount of time to figure out that the hg directory needed to be chmodded to 755 as well as the hgwebdir.cgi file (despite the fact I’d checked the file and directory permissions a couple of times during the process… sigh).

The URL for the stomp.py Mercurial repository is now:

http://www.briggs.net.nz/hg/stomp.py/

To checkout the latest copy you can use the following command:

hg clone http://www.briggs.net.nz/hg/stomp.py stomppy

After which hg update will keep you in sync with the (all too infrequent) changes.

Now have to decide whether I want to move YAK off sourceforge and into its own Mercurial repository. The control-freak, tech-geek part of me, gleefully says yes. The lazy, I’ve-got-too-much-other-stuff-to-do part says “pass”.
Time will tell… hopefully before I start arguing with myself.

…making my family wonder what on earth I’m doing:

Steve Yegge’s Tech News — humour you’ll only ‘get’ if you’re a techie, and Neil Gaiman’s “at-a-glance guide“. Which I still keep laughing at (the last 2 photos) every time I go back to look at them.

So, apart from the mild amusement value of a radioactive stream of pee on our nearest neighbour, I can’t say I’m particularly amused by the 51kbps, for international traffic, which I’ve been getting for the last 3 days (possibly longer).

radioactive relief

It’s nothing to do with my connection, as far as I can tell, since a speedtest within the country reports an acceptable (relatively speaking) 3300kbps.

Word from the responsive (<– sarcasm alert) technical support department of my ISP? Nothing, nada, zip, zilch. Official word on the system status page is “no known issues”.

So is the fact that I appear to be attached to the rest of the world via a small yogurt container and a piece of string, an “unknown issue”?

It’s one thing to play around with a source control tool on smaller-scale, personal projects — it’s another to decide to use it on a large-scale project with confidence (something I understand Sun have been doing with OpenSolaris). There’s evidence out there (if you go hunting for it), but personal experience counts for more, particularly if you hope to convince those with plenty of experience with other tools.

The obvious answer, is to take a large-scale project project and load it into Mercurial. The java project I’m leading at work has evolved over the last 18 months into a rather excessive 2.2GB (for trunk alone). I hate to think how much disk space would be required if I actually checked out every tag and branch.

There are tools (such as Tailor) to migrate from one SCM to another, but tailor, at least, appears to have some issues. So, after a bit of fruitless googling, I decided to roll my own script (of course). Luckily, I’m not particularly bothered by a less than accurate migration — all I want is to reproduce the volume of commits to see that 1) a mercurial repository *really* is smaller than the equivalent in subversion, and 2) performance is better than the abysmal response times I’m getting from subversion (which isn’t going to be hard when a majority of hg commits are local, with the occasional remote push).

The results…?

Well, after about 5 days of intermittent running, I’m about 80% of the way through the migration (mainly because of the aforementioned snail-paced subversion response), but Mercurial appears to be holding up well. At the very least, hg operations are responsive. I’ve excluded files like library jars, since Mercurial warns you about adding files to the repository that are over 10MB in size, so this is a bit of an apples-and-oranges comparison (I can’t really compare the overall repository sizes if I’m excluding files from one, but not the other, so I’m going to fail testing point 1), but that’s not really my fundamental goal anyway. I can say, with more than a reasonable level of confidence, that Mercurial looks viable for larger scale projects.

I’ve been playing with Mercurial lately, after having previously tried Git out for a few weeks.

I must say, I prefer Mercurial, though I would be hard-pressed to quantify that into some kind of this-feature-is-better-than-that-feature list (apart from the most obvious advantage that it’s cross platform, of course). For some reason, it just feels right. Which is weird, I know.

This is not to say Mercurial is perfect. Because there are a few niggles. The one that jumps immediately to mind is the fact that no matter where you are in a repository tree, hg status presents the list of changed files from the repository root — not the current context directory. So if you then copy and paste a file name (with path) from that status list, to commit a single change, you get an error. Because subdir/filename does not exist when you’re already in subdir. Small niggle, but there it is.

Second problem I’ve had recently: hg rm file, where file is the last in the directory. Mercurial appears to remove the directory. If you then try to commit, it throws its hands up in horror. Again, only a minor annoyance.

Apart from that, I like Mercurial enough to migrate all my other personal projects off subversion. I’d also be really interested to see how it handled a really large enterprise project, since subversion (at work) is groaning under the strain of handling that project. Chances of that happening are minimal, and would require replicating almost 2 years worth of commits, to really test it, but it would be interesting to see the results…..

Good lord, but Cullen is an idiot. Caught a brief glimpse of him on the news tonight commenting about the suggestion to drop GST on “healthy foods” to make them cheaper, and help improve the overall health of the population. His comment? “It would be too hard to enforce” (disclaimer: as far as I recall).

Erm… sorry?

How about fresh fruit and vegetables? Anything preprocessed misses out, but I would’ve thought fresh fruit and vege was a no brainer. Doesn’t seem too hard to “enforce” to me.

Idiocy.

Never before have I felt quite so intense a need to pick holes in an article, but Computerworld’s recently published opinion piece, written by the managing director of Intergen Wellington, has provided just such an incentive.

The article has been written with just the right amount of skew to the facts, that it comes across as the worst kind of turf protectionism. And since it is somewhat broadly aimed in my direction, I feel qualified to make a few comments.

To provide a bit of background, for the click-lazy, the basic premise is that contractors are -not- the answer to an IT skills shortage. On the hypothesis, I make no immediate comment. But I disagree with the evidence Stewart uses to arrive at his conclusion:

Why can’t I employ someone for less than $X an hour? The answer to that one is that demand has created contractors and contractors have created soaring rates that then elevate hourly rates in the IT sector across the board.

Demand may have created contractors, but it’s a bit rich to blame the freelance industry for soaring rates. Particularly without a good deal of statistical evidence to back it up.

In the past, I’ve worked as a permanent employee of an IT services/development company. I now work as a contractor for an IT services/development company. My external rate as a permie was about 50% higher than my current external rate as a contractor (the former company had vastly inflated ideas about the value of its services). This is one, albeit anecdotal, example that contracting has not unnecessarily driven up rates — in fact, from the client’s perspective, my being a contractor has arguably had little impact on the overall dollar figure for the project, if you compare the cost of doing business with the other company.

When an IT worker steps out on their own and becomes a contractor, they are stepping out of the mainstream and out of the fold where, more often than not, their learning curve diminishes to a horizontal path since they are generally no longer in a realm where they experience ongoing training, mentoring and the opportunity to learn.

This is trite to the point of being insulting. The idea that the mainstream, permanently employed “fold” holds some mystical ability to aid in the career path and ongoing education of the worker is nothing short of hyperbole. My personal experience as both a permie and a contractor (in both NZ and the UK) holds that there is -no- difference between permanent employment and freelance positions offering the opportunity to learn. In fact, I think I may have learned more in contract positions than I have elsewhere.

As a contractor, you are expected to be a self-starter, able to jump straight in and be immediately productive. In-depth knowledge of every aspect of software development is impossible (I defy anyone to cover the entire Java API set, all the external/3rd party libraries and packages that are available, without burning out a good percentage of brain cells in the process) so the dilligent contractor learns what he/she needs to know on the spot, or after hours. Chances are, you’ve done something similar before, so you draw on that knowledge in a new area. Or you burn the midnight oil and figure it out at home.

This is not to mention the long-term ‘tenured’ employees, so rooted in their knowledge that they’ll spend years without learning something new, and the legacy support tasks given to junior employees, whom are left with little opportunity for personal growth.
There are plenty of other examples on both the contract and permanent sides of the fence.

It’s these very people that we have invested time and resources into in the hope that they will be around to mentor the next generation of IT workers moving through the ranks. It’s for this reason that we invest so heavily and believe so strongly in a graduate programme. But without a pool of experienced mentors to take the graduates under their wings, the value of such programmes is devalued and the quality of training is diluted.

This, of course, assumes that a contractor, jealous of his/her skills, and resentful of those in permanent employ, will thus hoard said knowledge, perform only the task at hand, and reject communication with the ‘unworthy’. Quite the opposite is true in reality. Contractors are just as suitable a mentor from a technical perspective. I can think of a number of cases in my career where mentoring has come from both permanent and contract sources. But perhaps Stewart is justifiably worried that one of the lessons the naive employee may learn from an evil contractor, is that freelancing is a good career choice.

Some vendors have endeavoured to combat the skill shortage by jumping on the contractor bandwagon themselves and employing contractors, or even outsourcing overseas. While this is a financially practical solution in the here and now, it does nothing to invest in the ICT sector in New Zealand or help pave the way for a robust and leading edge pool of IT talent in the future.

I agree that outsourcing overseas does little to invest in the ICT sector in NZ. But to use that flimsy argument to cover his contractor angst is a bit of a stretch. The assumption, once again, is that the nasty contractor clasps their hard-won knowledge to their bosom like Gollum with the One Ring, and thus contributes nothing to the overall pool of IT talent.

Finally, Stewart lists a number of pros and cons comparing vendor delivery with, I assume, a project staffed entirely by contractors (which is, in itself, contrary to every project I’ve worked on where there has been a modicum of freelance involvement). He chooses this point to descend into almost complete fantasy.

The first benefit of a vendor sourced solution over contractors, is that with one you get a team “with one unified purpose and clearly delineated roles working towards agreed objectives and timeframes“, and the other, “a collection of individuals with no common purpose“.

We’re all milling around like a headless chickens, I suppose?

I couldn’t disagree more. Commonality of purpose for a contractor team who, by his own admission, are more senior in experience (and thus, less likely to be milling around in purposeless confusion) is that of product delivery. Purpose is driven by strong leadership and stronger vision, which can be found both in permanent and freelance staff.

I also disagree that somehow a vendor “ensures you are getting the best, most suitable and up-to-date technology for your solution“. This may be true of some vendors — but not all. In the past, I’ve had the misfortune to see technology solutions promoted because of the most base financial reasons, and out of political (in the business sense) expediency. Stewart provides no evidence that there is any difference between vendors and a team of contractors, in this regard. Oh yes, we can read between the lines here, but his intent is so blatant, it seems churlish to point it out.

I also find myself disagreeing with a number of the “cons” he lists for the use of a contract team. That they somehow “strip the ICT sector of mentors for graduates and juniors” — which I’ve mentioned earlier has never been the case in my experience — and that the “hourly rate often means that there is no urgency for deadline“. As to deadlines, I personally have never felt any less pressure to meet a deadline as a contractor. Agile methodologies may have helped, but much as I’d prefer a contract to continue longer, I certainly don’t drag my feet to ensure that longevity.

His poorly thought out missive aside, I agree with the fundamental premise. Contractors are not the answer to a skills shortage. They are but one of the answers. A healthy market requires a variety of different sources: vendors, contract, internal IT departments with graduates moving through the ranks, etc.

The problem is that Stewart draws a picture villifying the freelance IT worker as both cause and effect. Some kind of vicious circle that must be broken free of for the greater good of the industry. He paints for us a stereotypical contractor that is more caricature than portait… and tars companies that use contract staff (be they IT service vendors, or otherwise) with the same brush, as he does so.

Conveniently forgetting the fact that some contractors use the freedom this career choice offers, to start their own businesses, some band together into partnerships, and many put just as much effort into a project as might the permanent employee of an IT vendor.

In many different ways, contract staff can contribute just as much to the ICT sector as a whole.

All kudos to Michael Rakuskin of Tower Books in Australia for the most exceptional response to a blackmail letter.

You should take the time to read his response to Angus & Robertson’s blatant extortion attempt. It truly is the literary equivalent of flaying them alive.

(Source: Boing Boing and Making Light’s excellent detailed breakdown)

I thought I’d already noted this somewhere, but a quick search failed to find the answer.

A new Postgres database installation always catches me out, when it comes to creating a user. I usually do the following:

1. update permissions in pg_hba.conf (to allow text password access, for example)

2. createuser -W &lt;username&gt;
(prompted for a password)

Then scratch my head when I try to create a database and get the following error:

createdb: could not connect to database postgres: FATAL: password authentication failed for user "&lt;username&gt;"

The answer is:

~$ sudo su - postgres
~$ psql
postgres=# alter user &lt;username&gt; with password '&lt;password&gt;';
ALTER ROLE

One of those annoying little details that is extremely easy to forget.