I’ve just released a minor update to Yak, fixing a problem found with the products page.
Download it here.

by Jason R Briggs
You are currently browsing jrbriggs’s articles.
I’ve just released a minor update to Yak, fixing a problem found with the products page.
Download it here.
I’ve finally released the first version of the Installation Handbook for YAK (see here for more information). While this is just the first release, if you decide to purchase the handbook, you needn’t worry that it’ll soon become out-of-date — whenever I release a new version, I’ll be sending out copies to everyone who previously bought a copy.
The Handbook covers basic installation, setup for gateways such as PayPal and Google Checkout, downloadable products, multiple types of products, etc. If you’re having difficulty with the basic instructions on the YAK page, this is hopefully the best place to start.
I’ve just released YAK version 1.1.1 (although it won’t show up on the WordPress site for a while).
This release includes the following changes:
I’ve also removed support for the old tags (the html comment form such as <!−−yak_buy−−>), so you’ll need to change your posts to use square brackets if you upgrade (e.g.
).As usual, this release has only been fully tested by… well, me… so there may be some bugs I’ve missed — if you find something, please post on the Bugs page or email me directly.
I’m experiencing a rather annoying technical problem, which is holding up the YAK release — and consequently the release of the YAK Handbook.
Google Checkout integration requires https, but when testing I’m currently getting the dreaded error:
Protocol https not supported or disabled in libcurl
This despite the fact that curl -V gives:
curl 7.18.2 (i386-apple-darwin9.4.0) libcurl/7.18.2 OpenSSL/0.9.8h zlib/1.2.3
Protocols: tftp ftp telnet dict http file https ftps
Features: Largefile NTLM SSL libz
And port installed gives the following output (excerpted):
curl @7.18.2_0+ssl (active)
curl-ca-bundle @7.18.2_0 (active)
lighttpd @1.4.19_0 (active)
mysql5 @5.0.51a_0+server (active)
php5 @5.2.6_1+fastcgi+macosx+mysql5 (active)
I’m obviously missing something, but no idea what. Hoping that any Mac gurus who happen to come across this might have a suggestion or two…?
I’ve just released a bug fix (version 1.0.3e) for the stable version of YAK. This fixes the bug where prices are cleared if a customer submits a review (by commenting on a product).
If you’re using 1.0.3d, I recommend you upgrade immediately.
The experimental release (1.1.0-exp) is still unpatched, and will be replaced by version 1.1.1 in a few days.
There’s a nasty bug in the latest version(s) of YAK. It’s definitely present in 1.1.0-experimental and probably in 1.0.3d as well. Basically if you have comments enabled on products, and someone adds a comment, it can wipe the prices.
It’s fixed in trunk (in source control), and I’ll be releasing an updated 1.1.1 version shortly which includes the fix. I’ll also be releasing a patched version of 1.0.3d just in case people don’t want to upgrade to the latest and greatest.
In the meantime, if you’re running either of those versions, I recommend you disable comments on those products for the moment.
Why do Apple laptop upgrades cost 200% more than Dell’s?
Erm… economies of scale might have something to do with it, perhaps?
CNet only manages to touch on that in their conclusion…
So why so pricey, Apple? Less buying power? Greed? Good business sense?
…whereas it perhaps should’ve been the focus.
A quick googleage would’ve uncovered that in the 3rd quarter of 2007, Apple sold 1.1 million Mac units in the US. Dell sold 5 million PC units in that period. I’m going on the assumption the difference is similar on the worldwide scale, but perhaps it’s not. Dell’s worldwide figures might be much larger in comparison.
In any case, if I’m buying 1 million items from you, it seems likely I’m going to get a much larger discount than someone who’s only purchasing around a fifth of that amount. Which might account for at least a percentage of the difference. It might not as well, but surely the possibility invites more than 3 words in a conclusion…?
I’ve decided to release 1.1.0 of YAK for Wordpress as an “experimental” version. It hasn’t been fully tested yet, but enough people are hanging out for some of the features that I hope a few early adopters might kindly help out with the process.
1.1.0-exp includes features from the not (publically) released 1.0.4:
Along with a few additional features:
Google support is minimal so far. It’s one-way integration at the moment (allowing customers to submit an order through Google Checkout) — with no automated return path for handling purchase. That will come with a later release.
These updates hopefully make configuration a lot more user-friendly — particularly the changes to the Payment Types. Note that if you decide to upgrade, please make sure you backup your installation, and you double-check all your configuration options after upgrading.
YAK version 1.1.0-experimental can be downloaded from the WordPress Extend site.
I’m now charging for support of YAK for WordPress. Basically for anything that can’t be handled via a few messages on the General Discussion page or on the Bugs page.
The main reason for this change is that I can’t justify (particularly to the family) the amount of time I spend both on development and bug fixing, AND on the volume of support requests I get (at times).
See the new Support page for more information.
It appears the only one who’s lost contact with reality is the NZ finance minister…
On one hand:
In particular, households are being squeezed by higher fuel prices since the budget, he said. Gasoline prices have surged 14 percent the past three months
and then on the other:
…workers needed to be aware of the outlook for the economy when they made wage claims… …Wage expectations in the public sector haven’t caught up with the changing economic environment. Some have lost a bit of contact with reality.
The word that jumps to mind starts with T and ends with WIT.
A recent file rearrangement on my server resulted in all the links for “Snake Wrangling for Kids” breaking.
The problem is fixed now, and the zip files should be accessible again.
As a matter of interest, just searched on Google for “wordpress shopping cart” to see how far down the list YAK turned up. Surprisingly, it’s on the first page. Well, the bottom of the first page, but it is the first page.
Cool geek-out moment!
YAK 1.0.3d has been released (the WordPress plugin page hasn’t updated yet, but the files are currently available from Sourceforge).
Please backup your existing installation before upgrading. Deactivate, remove the current yak-for-wordpress directory, then copy the new version into the plugins dir and re-activate. You’ll need to double-check the configuration settings, because many input boxes have changed to drop-down selects (for category and page selection for example… see below). This upgrade will also require you to go through your products and set the price in the “YAK Product Details” tab (see point 5 in the changes below) — the custom fields are no longer required.
This release includes the following bug fixes:
And the following changes:
The latest YAK release is slightly delayed because I’ve, thus far, been completely unable to test PayPal integration.
First problem: The return URL doesn’t appear to work (cancel return URL works fine). PayPal keeps sending me back to the index page of my test site.
Second problem: When trying to save the Website Payment Preferences (in PayPal Profile) I get a “Page Not Found” error. So there’s no way to change between IPN and PDT. This has been broken now for at least 5 days.
If anyone is using YAK and PayPal and is willing (and able) to test both IPN and PDT integration, please let me know. Worst case scenario, I’ll release this version as unstable, and wait for PayPal to fix their problems…
UPDATE: Problem solved. PayPal have updated their site, but this has somehow corrupted old test accounts. Deleting the old account and creating a new one fixes the problem.
Interestingly, there doesn’t seem to be a WordPress Community group on LinkedIn.
Or, possibly, there are dozens. There’s no way to tell since LinkedIn’s Group directory isn’t open and also isn’t searchable. Unless you’re lucky enough to find the relevant group on someone’s profile, you’re stuck with creating your own.
So that’s what I’ve done. If anyone is interested in joining, the invitation link is in the groups section of my profile.
And let’s hope LinkedIn develops a really good ratification process for merging millions of one-member groups…
It’s been over 2 years since I released YAK for WordPress (6th of March, 2006 according to Sourceforge), and the forthcoming release finally starts to tidy up a few loose ends. It was always a bit hacky — from a user interface perspective, that is — and 1.0.3 sorts out a few of the most obvious problems (this is not to say it’ll be perfect, of course).
YAK has always represented a reasonably significant investment in time. I don’t put a huge amount of effort into development now that it’s hit the 1.0 release, but popularity brings an inevitable increase in the number of calls for support.
Family commitments mean that I have less time available — or at the very least, it’s harder to justify spending the time. The obvious answer, suggested by a couple of people, is to commercialise (at least in part) the plugin.
There are plenty of open source projects which have at least a small commercial component. And plenty more which are mainly commercial, but release unsupported open source versions. An example of the former are projects which have paid-for documentation. An example of the latter would be something like JBoss or MySQL, which release community and enterprise versions of their apps — the enterprise version, rather obviously, providing commercial support.
So this brings me to a question: where to, with a semi-commercial version of YAK?
There are a few options on the table:
What do you think? Any better ideas?
I only found out the Wii was (might be) region-locked after carting all my Wii stuff from NZ to the UK. A rather depressing thought — I’d have to export any new games I wanted from back home.
I contacted Nintendo UK to find out for sure, and they confirmed, yes it was region locked… but then went on to describe the region locking as though it was tied to the TV colour encoding system. They continued, “For example, the UK uses PAL-a, and New Zealand uses PAL-b which should be compatible”.
I’m guessing the question was completely misunderstood.
Anyway, rather then destroying any chance of becoming carbon-neutral this century, I thought it was worth buying a local game and trying it out. Zack & Wiki duly arrived from Amazon, and was inserted, with some trepidation, into the console… and worked perfectly.
Conclusion: if the Wii region encoding is controllable by the publisher, as some have reported (see the comments of that page), then Capcom, at least, have not exercised that control. Well done Capcom, and… awesome game, by the way.
Well… not so sudden.. but yesterday I realised that this year will be the 30th anniversary of the first time I sat down in front of a blinking white cursor.
Said cursor was a small rectangular block, about 4 millimetres by 5 millimetres, and the machine was the Radio Shack TRS-80 — bought by my father for what is, now, quite a lot of money for a computer, comparatively speaking. That was also the year I started to learn programming (BASIC) — using a book which was the inspiration for my own programming book for kids. I was 8 years old at the time (in case you were wondering).
Thirty years is quite a long time to be using computers — although that’s elapsed time, rather than actual. There was a good period in my late teens when motorbikes were far cooler than computers…
Two wrongs making a right? Only time will tell.
If anyone is interested in previewing YAK 1.0.3, please get in contact. This release adds a new (admin) UI design (provided by Frank Malina), and fixes a couple of nasty bugs that emerged with the latest version of WP (tables not being created, globals not working as they used to, etc).
Apart from the new UI, there are no major feature improvements in this release, however there are a couple of “big ticket items” I’m thinking about adding in version 1.0.4.
In a moment of either inspiration or madness (I’m pinning my hopes on the fact that there’s a thin line between madness and genius), I decided to start work on a version of SWFK for the OLPC.
There are a couple of reasons why this is more of a challenge than the other versions of the book:
The first point is easy to solve. I’ve been running OLPC on VirtualBox (occasionally) for a few months now, so at least I have a vague idea of how to interact with the Sugar interface.
The second point is slightly more problematic. As far as I’m aware, the OLPC runs GTK, and so the pygtk module is available — but I have yet to come across a turtle implementation for gtk (ignoring, for the moment, the TurtleArt activity already installed on the OLPC, which I don’t think is particularly useful for my purposes).
It seems like quite a fun project — implementing the turtle module using pygtk — until you consider the arcane pygtk API, the (IMHO) lack of reasonable documentation (I’m not particularly impressed by the pygtk reference manual… particularly the lack of index), and simple examples to expand from.
Technical issues aside, a week later, I’m considering the semantics of an OLPC edition of the book. SWFK for Windows, Mac and Linux, all target the same fundamental audience. An OLPC edition has a completely different potential audience. The Western+English market is, no doubt, vanishingly small — so while, to date, I’ve had over 6500 downloads, I’m guessing an OLPC edition might garner less than 1-3% more. The real market would be translated versions (assuming the interest in translating actually results in translations) — but that begs another question: will kids in non-Western countries actually understand some of the references? Is talk of DVD players, in-car computers, Nintendos, etc (i.e. some of the references in chapter one, for example), at all meaningful in the developing world? I’m doubtful.
Which leads me to posit the question, is it worth the not-so-insignificant effort?
What do you think?
Genius or madness?
Through cruel (pronounced in melodramatic fashion with emphasis on all the verbs) twist of fate, I wound up clicking on a spam link the other day.
I never click on spam links. To mix a few metaphors, one has to be rather too many brain cells short of a four-cylinder engine to click on anything in a spam message.
I do have an excuse for my actions, although rather a feeble one: I was skimming rather quickly through my new mail and went from one email, from my father, to another. The second email was about replica watches.
Why is he sending me emails about replica watches?
The email was in a similar format to some of his others (a paragraph of text followed by a link), but the words “replica watches” and that link somehow caught my attention. An ominous orchestral theme should have started up as I moved my mouse, in slow motion of course, towards that little blue underlined set of characters…
I realised yesterday, after receiving another message about replica watches that I’d been duped. By the bizarre combination of a spam message formatted exactly the same as another, and the fact that Thunderbird occasionally doesn’t update the header info (from address, subject, etc) at the top of the message when I flick through too fast.
And somewhere there’s a twit with Dr Evil ambitions who’s currently rubbing his hands together with glee, because the “sucker” light has just flicked on next to my email address. I can look forward to an inundation of messages about cheap gucci bags, replica watches, “enlargement” remedies, and so on.
Needless to say, I won’t be buying that Breitling at the fraction of the price of the original.
Long awaited by… well a couple of people at least… I’ve recently been working on splitting out Snake Wrangling for Kids into 3 separate editions: one for Windows, one for Mac and one for Linux.
This proved rather more challenging than expected (rather characteristic of LaTeX as a whole actually), and I haven’t fully proofed the final result yet. Those interested can check out the new editions here:
SWFK - Linux Edition
SWFK - Mac Edition
SWFK - Windows Edition
The Mercurial repository (here) containing the LaTeX source has also been updated with the latest changes.
So I’ve sort-of figured out how to do conditional blocks. The following LaTeX initially appears to work:
\newboolean{cond1}
\newboolean{cond2}
\setboolean{cond1}{false}
\setboolean{cond2}{true}
\ifthenelse{\boolean{cond1}}
{
A block of conditional text in here.
blah blah
}
\ifthenelse{\boolean{cond2}}
{
A separate block of conditional text in here.
blah blah
}
I say initially appears to work, because it works fine for the first 4 or 5 attempts, but then some combination of blocks (\begin{verbatim} for example), causes it to break on the 6 attempt. If I include a verbatim block in that 6 attempt, latex outputs an obscure error message… something along the lines of:
Runaway argument?
some code here \end {verbatim} \end {listing}
! Paragraph ended before \@xverbatim was complete.
<to be read again>
Which is rather infuriating, considering that I’ve got verbatim blocks in the previous conditional sections (it doesn’t complain about those), and because I’ve almost got the answer to my problem.
Response from someone who grew up in the somewhat tectonically active east coast of NZ (i.e. me):
…
Meh
…
Does anyone out there know of a way to have conditional blocks in LaTeX that are controllable by external parameters?
The sort of thing I want to do is something like:
\configurablesection{someparameter_1}
some stuff here (this is block1)
\configurablesection{someparameter_2}
some different stuff here (this is block2)
Then, from the command line, set a parameter to include the text in block 1 AND/OR in block2, and produce different output as a consequence.
Any pointers welcomed!
I’ve had a few requests to release the “source” to Snake Wrangling for Kids, by people interested in translating the text into another language.
SWFK is still a work in progress — although that progress has been rather slow since we moved to the UK — but I can’t see any reason why I should put off releasing the LaTex source until some sort of mythical completion date, particularly not when there are willing participants out there.
So for those who are interested in translating SWFK to another language, the latex “source” can be found in the following Mercurial repository:
http://www.briggs.net.nz/hg/swfk
Note that it isn’t “buildable” in its current state. I haven’t added the image files yet because some of them are rather large (the cover alone is over 2MB) — the wonders of the EPS format. Mercurial doesn’t seem to handle excessively large image files that well (at least not on my web host it doesn’t), so if anyone has ideas on that front, let me know.
A somewhat surreal conversation with my daughter last night:
“Papa, what’s yod?”
“What’s WHAT??”
“Yod!”
“I don’t know.”
Kid wanders off, and comes back 2 minutes later.
“What’s yod?”
“I don’t know. What do you mean by yod? I don’t know any such word.”
Kid sighs in exasperation (conveying depths of feeling only possible in the average 5 year old), and stalks off down the hallway…. singing the NZ National Anthem to herself:
“Yod of Nations, at thy feet, in the bonds of yove we meet”.
Ah… that Yod…
I’ve just fixed (rather hurriedly) an annoying bug in domyinvoice.com. Invoices generated for a project with a daily rate (rather than hourly) were calculating the days incorrectly — basing the calculation on the number of tasks rather than the distinct list of days. Easy to fix, but since I haven’t been doing any Python for the last couple of months, it took a few hours longer than it should have.
Haven’t been posting lately because we’ve made a move back to the UK.
Again.
My carbon footprint must be of obscene proportions, given this is now the 5th time I’ve made a move from NZ to the UK.
A couple of immediate impressions after arriving back in the Mother Country:
1. I’d forgotten how dang cold this part of the northern hemisphere is. Even after leaving a rather average start of summer (well it was pretty average in Dec).
2. Getting longer-term accommodation is a nightmare — particularly the referencing process. We’re (hopefully) moving out to Rickmansworth next week (that’s Hertfordshire for the uninitiated), but it hasn’t been straightforward. Touch wood, cross fingers, etc, etc, etc.
3. Mobile phones are so much cheaper than back home. Even prepay. 15p for the first minute and 5p after. That’s about $NZ0.41c per minute followed by 0.14c per min. Plus free mobile phones with an 18 months plan, and in some cases free gifts like Sony PS3s, Nintendo Wiis, iPods, etc. Of course, those are for the crappier models.
4. Dang it’s cold here.
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.
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¤cy_symbol=£¤cy_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.
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:
Any problems with this release, please let me know.
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…
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.
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.
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.
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.
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?
Register.
Decide what I want to pay.
Pay.
Download.
Instant gratification in less than 4 mins. First track sounds good as well.