I like ubuntu/gnome's gedit for simple jobs when I'm not in the mood to wrestle vim.
Here's my pet peeves from a usability point of view
gedit 2.24.2 annoys me with:
1. Find and Replace across multiple documents should exist. Editplus does this with an 'all open documents' tickbox
2. If I open a filename which doesn't exist; don't show me an error. Create a new document, and when I save, create the file.
3. Give me a 'always reload when changed on disk' preference. I'm sick of clicking the buttons.
Saturday, January 31, 2009
Sunday, January 25, 2009
Using Image_Graph neatly
Here are my two best tips around using Image_Graph for projects. They aren't necessarily right, but have worked fantastically for me.
Build a simple page which takes a number of arguments via GET variables, and serves up an image. You can then use simple commands to render whatever you like.
Its worth thinking about maintaining a pretty similar approach to google's API, so that you can swap one for the other almost trivially.
Say you have a set of reports you must run. The amount of data is huge, so you really don't want to try and do things on the fly. You have to update the data periodically - ie, once a week or month.
Steps here:
1. Denormalize in the database - precalculate answers and render them into tables. It will save you loads of time.
2. When you have the data you need, pre-render the graphs and save them to disk. Do it with an easy naming scheme.
Now when someone hits your pages to look at information, you've got everything already there - its a matter of wiring it together.
These two things are pretty obvious and self explanatory, but worth keeping in mind. The last thing you want to do is build a page which assembles data, then realize Image_Graph renders in a different stream (ie, not inline), and resort to copy and paste coding.
Use it like Google Chart API (on demand)
Build a simple page which takes a number of arguments via GET variables, and serves up an image. You can then use simple commands to render whatever you like.
# Rendering code:
require_once 'Net/URL.php';
function make_graph_url($data) {
$url = new Net_URL('graph.php');
$url->gt;querystring['data'] = $data;
$url->gt;querystring['type'] = 'pie';
return $url->gt;getURL(); // "graph.php?type=pie&data[Cats]=1&data[Fish]=2";
}
# HTML / Presentation bit
<img src="%3C?php%20print%20make_graph_url%28$data%29;%20?%3E" alt="Graph of Cats and Fish" />
#Graph.php
require_once 'Image/Graph.php';
$graph = new Image_Graph();
// read in $_GET and construct your graph
$graph->gt;done();
Its worth thinking about maintaining a pretty similar approach to google's API, so that you can swap one for the other almost trivially.
Pre-rendering
Say you have a set of reports you must run. The amount of data is huge, so you really don't want to try and do things on the fly. You have to update the data periodically - ie, once a week or month.
Steps here:
1. Denormalize in the database - precalculate answers and render them into tables. It will save you loads of time.
2. When you have the data you need, pre-render the graphs and save them to disk. Do it with an easy naming scheme.
Now when someone hits your pages to look at information, you've got everything already there - its a matter of wiring it together.
These two things are pretty obvious and self explanatory, but worth keeping in mind. The last thing you want to do is build a page which assembles data, then realize Image_Graph renders in a different stream (ie, not inline), and resort to copy and paste coding.
Tuesday, January 20, 2009
PEAR Bug Triage Day Results (December 17-18th)
Here's the results of Bug Triage, Dec 17-18th and a few days surrounding it.
If you missed it, the next one will be Feb 7-8th.
Accomplishments
- Triage the latest 50 bugs
- Crypt_GPG - gauthierm fixed broken unit tests
- Services_Amazon_SQS - gauthierm is making progress on mocking out all HTTP
- Validate_BE unit tests fail - doconnor fixed
- HTTP_Session - doconnor made it skip if it can't possibly pass due to the unit test environment
- XML_Feed_Parser - doconnor excluded from unit test results (too much noise for too little benefit)
- PEAR 1.8 - fixing up unit tests - dufuz
- Text_Wiki_Creole saw a release
- Services_ExchangeRates 0.6 - doconnor did a release; mocked out all unit tests, tweaked API
- MDB2 / MDB2_Driver_mysql - a new beta was put out! Lots of bugs fixed since the last release
- New pear server was tested, lots of little patches, not quite ready yet! - doconnor, dufuz, cweiske, farell
If you missed it, the next one will be Feb 7-8th.
Tags
bug triage,
open source,
pear,
php,
Programming,
Testing,
Unit Tests
Thursday, January 15, 2009
Bug Triage, 17th/18th Jan
Hey all, get your bug triage gloves on!
This weekend in #pear and #pear-bugs
Overall goals:
* Triage latest 50 bugs
* Break the new pearweb server as much as possible so we can have shiny new pearweb releases
* If you have a package which is package 1.0; upgrade it
* New releases which would be handy (look at, talk to maintainers, etc)
* Services_ExchangeRates 0.6 - doconnor
* Numbers_Words
* Image_Graph - doconnor emailed on 27th
* DB_DataObject - troehr emailed on 27th
* Validate - troehr emailed on 27th
* Image_Transform - troehr emailed on 27th, waiting for feedback from Philippe Jausions (appx Jan 1)
* Image_Canvas - doconnor emailed on 27th
* HTML_Page2 - troehr emailed on 27th
* HTTP_WebDAV_Client - doconnor emailed on 27th
* HTTP_WebDAV_Server - doconnor emailed on 27th
* Net_SmartIRC - doconnor emailed on 27th
* SQL_Parser - doconnor emailed on 27th
* Spreadsheet_Excel_Writer - troehr emailed on 27th, doconnor suitably scared
* Mail_Mime - avb and lifeforms (walter) are on it
+ http://pear.php.net/bugs/bug.php?id=11238 - reasonably high impact - needs much refactoring, probably a Mail release too.
* Math_Finance - get it into cvs - doconnor
+ Usage examples would be neat
* Contact_Vcard_Build
* Contact_Vcard_Parse
I'll be around most of Saturday and Sunday during Australian daylight hours (GMT+0930); so if anyone wants to jump in and hassle people during the US/European daylight hours, feel free!
This weekend in #pear and #pear-bugs
Overall goals:
* Triage latest 50 bugs
* Break the new pearweb server as much as possible so we can have shiny new pearweb releases
* If you have a package which is package 1.0; upgrade it
* New releases which would be handy (look at, talk to maintainers, etc)
* Services_ExchangeRates 0.6 - doconnor
* Numbers_Words
* Image_Graph - doconnor emailed on 27th
* DB_DataObject - troehr emailed on 27th
* Validate - troehr emailed on 27th
* Image_Transform - troehr emailed on 27th, waiting for feedback from Philippe Jausions (appx Jan 1)
* Image_Canvas - doconnor emailed on 27th
* HTML_Page2 - troehr emailed on 27th
* HTTP_WebDAV_Client - doconnor emailed on 27th
* HTTP_WebDAV_Server - doconnor emailed on 27th
* Net_SmartIRC - doconnor emailed on 27th
* SQL_Parser - doconnor emailed on 27th
* Spreadsheet_Excel_Writer - troehr emailed on 27th, doconnor suitably scared
* Mail_Mime - avb and lifeforms (walter) are on it
+ http://pear.php.net/bugs/bug.php?id=11238 - reasonably high impact - needs much refactoring, probably a Mail release too.
* Math_Finance - get it into cvs - doconnor
+ Usage examples would be neat
* Contact_Vcard_Build
* Contact_Vcard_Parse
I'll be around most of Saturday and Sunday during Australian daylight hours (GMT+0930); so if anyone wants to jump in and hassle people during the US/European daylight hours, feel free!
Tags
bug triage,
open source,
pear,
php
#nocleanfeed, strategy, and direction shifts
There's a growing buzz amongst the #nocleanfeed communities - the issue is being framed as a censorship and freedom of speech issue more and more.
This is being driven largely by the DLC.
I don't like that; it's not what motivates me; its not how I get people on side. We don't have freedom of speech here in Australia except around political issues. When has that ever stopped us from saying what we want, though? As a society, we're more than happy to say what we want. If someone says nasty things about us, we don't get our panties in a twist about it; we call them a wanker and ignore them.
What does motivate me is how dishonest the government has been through this process.
1) They call it a "clean feed"; but it won't actually work. A more descriptive name: thing that will annoy the shit out of you every 3 days on the internet.
2) It won't work like they want, but the government won't listen to their own trials, industry and the public. That makes them stupid.
3) Its a people issue. Not a technology issue. It is pretty obvious that is the case.
Think of it like gun control - guns don't kill people; people kill people. Answer: don't let stupid people have guns, or arrest stupid people who do stupid things with stupid guns.
4) Conroy is a wanker. He acts like a child and won't answer questions in Question Time. He makes a mockery of our political process
5) Conroy (his office at least) threatened Mark Newton's job. That's unaustralian, stupid, and the act of a first class fuckwit.
6) This childish fuckwit is spending our tax money on his 1984 reenactment wet dream. Why?
7) If it is a problem; how come I don't hear more about it happening to my friends, family and workmates - my child was preyed upon by an internet sicko? The truth is, it doesn't happen.
8) IF THIS IS SUCH A PROBLEM AFTER ALL; WHY NOT SPEND THE MONEY SOMEWHERE USEFUL, LIKE THE POLICE?
This is being driven largely by the DLC.
I don't like that; it's not what motivates me; its not how I get people on side. We don't have freedom of speech here in Australia except around political issues. When has that ever stopped us from saying what we want, though? As a society, we're more than happy to say what we want. If someone says nasty things about us, we don't get our panties in a twist about it; we call them a wanker and ignore them.
What does motivate me is how dishonest the government has been through this process.
1) They call it a "clean feed"; but it won't actually work. A more descriptive name: thing that will annoy the shit out of you every 3 days on the internet.
2) It won't work like they want, but the government won't listen to their own trials, industry and the public. That makes them stupid.
3) Its a people issue. Not a technology issue. It is pretty obvious that is the case.
Think of it like gun control - guns don't kill people; people kill people. Answer: don't let stupid people have guns, or arrest stupid people who do stupid things with stupid guns.
4) Conroy is a wanker. He acts like a child and won't answer questions in Question Time. He makes a mockery of our political process
5) Conroy (his office at least) threatened Mark Newton's job. That's unaustralian, stupid, and the act of a first class fuckwit.
6) This childish fuckwit is spending our tax money on his 1984 reenactment wet dream. Why?
7) If it is a problem; how come I don't hear more about it happening to my friends, family and workmates - my child was preyed upon by an internet sicko? The truth is, it doesn't happen.
8) IF THIS IS SUCH A PROBLEM AFTER ALL; WHY NOT SPEND THE MONEY SOMEWHERE USEFUL, LIKE THE POLICE?
Monday, January 12, 2009
OOXML, Wikipedia, and whitewashing

Image via CrunchBase
I'm still pissed about OOXML, and the standardisation process.
Have a read of the wikipedia article.
That certainly doesn't sound like my understanding of it - there's about 3 lines of content throughout the entire thing talking about the criticism of it, and the standards process.
What the?
You would thinks that at least the technical arguments against OOXML would fit somewhere on the main page, wouldn't you.
So, delving deeper; we discover this is mainly due to one editor with a hard on for OOXML.
His about page doesn't tell you much, except:
"From that work I have various interest in interapplication communication, real time and batch textual data interfaces, electronic archiving, datawarehousing and flexible data in documents (of which we produce millions every year)."
If you look at his edits, it's all very pro-microsoft, ever since he joined the site.
Now that's not a bad thing by itself - after all, it might just be his area of expertise; but to have a minuscule amount of criticism over a file format which created street protests during the standardisation process; primarily due to his efforts - that's just not on.
Wednesday, January 07, 2009
Generating Nutritional Data RDF from USDA, Part 2
I has a bit of a whinge yesterday about copyright, nutrition data, and so forth.
Today, my inbox has a nice copy of the NUTTAB data I want, I've located SR21, I've had someone else point me at canadian nutritional data too.
To get the NUTTAB data, you have to email Food Standards Australia, but thats not a huge deal.
So; progress:
I've made a script to import the USDA SR21 data into a database (ie, mysql), and render it out as RDF.
Pretty easy stuff! Its in PHP, and makes use of PEAR.
The basic plan: import everything, render out individual items, publish them statically on the web. Maybe later, get someone to stuff them all into a SPARQL endpoint.
Rinse, repeat with Canadian, Australian data. Grow a common ontology for Food, Nutrients, etc.
You can view some of the output RDF, I've not generated the whole set yet as my poor computer is far too old and creaky to do so.
Additionally, there are lots of linked data connections I want to make.
I want to link the sources with pubmed, the units with... something (side note: there's not much in the way of unit and measurement ontologies I could find!), the USDA style names with wikipedia/dbpedia/freebase; the compound names (PROCNT - protein content) with... something.
How silly is this: there's no semantic web url for milligrams. The best I could do was a few related concepts, because someone at wikipedia decided to merge all of the sub-articles for measurements into the single unit (ie, mg to g).
Today, my inbox has a nice copy of the NUTTAB data I want, I've located SR21, I've had someone else point me at canadian nutritional data too.
To get the NUTTAB data, you have to email Food Standards Australia, but thats not a huge deal.
So; progress:
I've made a script to import the USDA SR21 data into a database (ie, mysql), and render it out as RDF.
Installing it
Pretty easy stuff! Its in PHP, and makes use of PEAR.
# Get the code:
$ svn co svn checkout http://freebase-owl.googlecode.com/svn/trunk/nutrition/
# 0. Install dependencies
$ sudo apt-get install php-pear mysql wget unzip
$ sudo pear install -fa MDB2 XML_Beautifier
# 1. Get the SR21 data, extract it
$ wget http://www.nal.usda.gov/fnic/foodcomp/Data/SR21/dnload/sr21.zip
$ unzip sr21.zip
# 2. Make configuration
$ cp config.php.dist config.php
$ vim config.php
# 3. Create a database of your choosing, with the same settings as configuration
mysql -u root -p
CREATE DATABASE usda;
# 4. Run the install script. This will take a while as it imports all data. If it fails, just DROP the database and start again
$ php install.php
# 5. Give it a shot from the command line. "1002" is the USDA food id.
$ php rdfizer.php 1002
$ php rdfizer.php 1002 > 1002.rdf
# 6. Generate the whole set:
php generate-all.php
The basic plan: import everything, render out individual items, publish them statically on the web. Maybe later, get someone to stuff them all into a SPARQL endpoint.
Rinse, repeat with Canadian, Australian data. Grow a common ontology for Food, Nutrients, etc.
You can view some of the output RDF, I've not generated the whole set yet as my poor computer is far too old and creaky to do so.
Additionally, there are lots of linked data connections I want to make.
I want to link the sources with pubmed, the units with... something (side note: there's not much in the way of unit and measurement ontologies I could find!), the USDA style names with wikipedia/dbpedia/freebase; the compound names (PROCNT - protein content) with... something.
How silly is this: there's no semantic web url for milligrams. The best I could do was a few related concepts, because someone at wikipedia decided to merge all of the sub-articles for measurements into the single unit (ie, mg to g).
Tuesday, January 06, 2009
Nutrition, Food Standards and Copyright
I have a simple wish: build a really simple calorie counter backed with some common products; so that I don't have to manually count calories.
I should be able to type "Rosella Condensed Tomato Soup", and it finds the right product for me and tells me that it has:
Energy 78.87189kcal
Protein 1.5g
Carbohydrate 16.8g
Sugars 12.3g
Fat 1.0g
Saturates 1.0g
Sodium 1,125.0g
Serving size 245.0g
Servings per package 4
... and I ate a whole can, meaning I ate 4 servings.
So, I set off looking around for things which already did this.
Nothing.
Update: Bigfoodlist is almost exactly what I want.
Apparently, you can get information from a bunch of sources, like Foodstandards.gov.au or the USDA; but after just a little bit of clicking my eyes bled from the web 1.0 of it all.
Finally, I find where I can get information in CSV form - by emailed request.
I feel so very backwards that there isn't a simple, universal product database which stores this information.
This is the kind of thing I want from the semantic web - government data I can query so that I can control my calorie intake. Why is this idea so foreign to government? Why are all licenses by default set to "no".
We'll see how far I get with my can-I-have-information email, but past experience has led me to disappointment.
Update 2: Success! USDA SR21 is a bunch of data you can download and stick into a database. It would not be hard to RDFize this.
I should be able to type "Rosella Condensed Tomato Soup", and it finds the right product for me and tells me that it has:
Energy 78.87189kcal
Protein 1.5g
Carbohydrate 16.8g
Sugars 12.3g
Fat 1.0g
Saturates 1.0g
Sodium 1,125.0g
Serving size 245.0g
Servings per package 4
... and I ate a whole can, meaning I ate 4 servings.
So, I set off looking around for things which already did this.
Nothing.
Update: Bigfoodlist is almost exactly what I want.
Apparently, you can get information from a bunch of sources, like Foodstandards.gov.au or the USDA; but after just a little bit of clicking my eyes bled from the web 1.0 of it all.
Finally, I find where I can get information in CSV form - by emailed request.
This work is copyright. You may download, display, print and reproduce this material in unaltered form only (retaining this notice) for your personal, non-commercial use or use within your organisation.
Apart from any use as permitted under the Copyright Act 1968, no part may be reproduced by any process without prior written permission from Food Standards Australia New Zealand (FSANZ).
Requests and inquiries concerning reproduction and rights should be addressed to the Information Officer, FSANZ, PO Box 7186, Canberra BC, ACT 2610 or email info@foodstandards.gov.au
I feel so very backwards that there isn't a simple, universal product database which stores this information.
This is the kind of thing I want from the semantic web - government data I can query so that I can control my calorie intake. Why is this idea so foreign to government? Why are all licenses by default set to "no".
We'll see how far I get with my can-I-have-information email, but past experience has led me to disappointment.
Update 2: Success! USDA SR21 is a bunch of data you can download and stick into a database. It would not be hard to RDFize this.
Friday, January 02, 2009
Becoming a Were-Cyclist
Today, the infection took over. I've finally transformed into a full blown were-cyclist.
I'm pretty happy now, as I've ridden further and further and slowly become more and more obsessed, most of my car driving friends have ridiculed me in increasing amounts.
Now when I get to work, the ball is in my court.
How do I figure this?
I have my final piece of cycling kit.

Tight bike shorts.
This is going to lead to endless mornings, where I get off my bike, haul my tired ass into the elevator, step out, and treat everyone to a far too revealing eyeful of between my waist and knees.
Now, being a were cyclist is no ordinary thing. Basically, whenever a traffic light goes green, you turn into a snarling evil creature which intimidates other vehicles. Usually, the larger the vehicle, the more intimidating a cyclist is.
So, the were cyclist - this is the guy you are afraid of in your giant 4WD, as you sit there, perched far too high off of the ground living in what can only be described as mid-suburban soccer mum fear.
Roll up the windows, press the central locking button and try not to make eye contact! Think to yourself oh those cyclists think they own the road! and try not to make physical contact as you accelerate off.
If a were-cyclist should make contact with your car, you'll turn into one at the next green traffic light. Soon, you would turn on your friends and families, loved ones and pets - you'll sell the petrol guzzler and buy a prius.
Before you know it, the infection has spread further, in a horrendous mix of the Tour de France meets 28 Days Later.
Simply unthinkable.
How do you know if you are infected?
You might wake up one day with strange textures on your hands, hooves, and a hard carapace on your head.
You'll have an urge to climb up hills for no particular reason, insatiable appetite, and you'll get very aggressive about personal space on the road.
Scary stuff, isn't it?
There is one huge benefit though, which simply can't be understated, and which I have gained: you end up with energylegs.
I'm pretty happy now, as I've ridden further and further and slowly become more and more obsessed, most of my car driving friends have ridiculed me in increasing amounts.
Now when I get to work, the ball is in my court.
How do I figure this?
I have my final piece of cycling kit.

Tight bike shorts.
This is going to lead to endless mornings, where I get off my bike, haul my tired ass into the elevator, step out, and treat everyone to a far too revealing eyeful of between my waist and knees.
Now, being a were cyclist is no ordinary thing. Basically, whenever a traffic light goes green, you turn into a snarling evil creature which intimidates other vehicles. Usually, the larger the vehicle, the more intimidating a cyclist is.
So, the were cyclist - this is the guy you are afraid of in your giant 4WD, as you sit there, perched far too high off of the ground living in what can only be described as mid-suburban soccer mum fear.
Roll up the windows, press the central locking button and try not to make eye contact! Think to yourself oh those cyclists think they own the road! and try not to make physical contact as you accelerate off.
If a were-cyclist should make contact with your car, you'll turn into one at the next green traffic light. Soon, you would turn on your friends and families, loved ones and pets - you'll sell the petrol guzzler and buy a prius.
Before you know it, the infection has spread further, in a horrendous mix of the Tour de France meets 28 Days Later.
Simply unthinkable.
How do you know if you are infected?
You might wake up one day with strange textures on your hands, hooves, and a hard carapace on your head.
You'll have an urge to climb up hills for no particular reason, insatiable appetite, and you'll get very aggressive about personal space on the road.
Scary stuff, isn't it?
There is one huge benefit though, which simply can't be understated, and which I have gained: you end up with energylegs.
The quickest way to create a PEAR package
Is called PEAR_PackageFileManager_Cli, or pfm.
More documentation lives here.
More documentation lives here.
(02:56:15) stunami: hi is there an easy way to generate the contents tag for a package.xml?
(02:58:41) CloCkWeRX: stunami: you might be interested in pfm (pear_packagefilemanager_cli)
(02:59:38) CloCkWeRX: pear install it, hop into your directory, and type 'pfm' -> follow prompts
(03:01:13) stunami: oh excellent that sounds very helpful thanks, i was sure there must been something but google wasn't being very helpful today :)
(03:10:10) CloCkWeRX: what did you google for?
(03:13:34) stunami: stuff like generate package.xml pear
(03:15:01) stunami: I reckon a blog entry on pfm would be very handy indeed. Creating a package.xml while not hard is a bit tedious especially when updating all the files
Tags
howto,
open source,
pear,
pfm,
Tools
Thursday, January 01, 2009
Songbird, Hype Machine, Music Blogs

I am still in utter awe of Songbird + Last.fm + Hype Machine.
Right now I'm browsing around trying to find new sounds with hype machine. Hype machine points me to Superpose. Songbird makes it trivial for me to add it to my collection.
If I favorite it on hype machine, it'll twitter it for me; I can preview it right in songbird, add it to my library, and I can purchase tracks / albums from Amazon. As soon as I listen to it, it's right there in last.fm.
This isn't a music player, this is a distributed networked music experience.
Also, if someone could please buy me a whitefolksgetcrunk tshirt, or make superpose appear in Adelaide; I would be pretty happy
Related articles by Zemanta
Tags
Amazon,
Amazon.com,
Hype Machine,
last.fm,
music,
open source,
Radio,
songbird,
twitter
Subscribe to:
Posts (Atom)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=837ba105-3395-433e-9778-452e6d821032)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=ad3ea4c7-2fb7-4b40-86a7-84d43d3d7623)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=47391883-6357-462d-9779-8d1d8600e6f8)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=57b6db4c-4759-49a3-8e4e-133d9b1f586d)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=6a3fd375-b5ae-42eb-946f-34eafe51bd0f)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=963c2088-bd20-4d0c-8b46-53ead595c2dc)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=1980a108-1b10-4c25-8449-2f66f443c881)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=2988b000-eb2f-425c-8bea-dc33d9572ce2)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=8cf2259b-45c9-4450-98c4-f5ae827c72ff)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=d788832f-d882-490d-a096-2c60c505f628)