tag:blogger.com,1999:blog-8754579225841693202008-05-08T10:12:34.664+12:00Rob Coup - the rest is missingRobert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-875457922584169320.post-7441394815221112992008-04-21T20:08:00.006+12:002008-04-21T20:27:21.974+12:00Dojo from the AirWhile I'm sitting here 35,000 feet above the Tasman I thought it'd be a good time to update you all on the goings on in the world of Dojo from my point of view.<br /><span style="font-size:180%;"><br /></span><span style="font-size:130%;"><span style="font-size:180%;">1.1!</span><br /></span><br />Dojo released 1.1 after a lot of hard work. The team worked really hard to get this release out, and it adds a lot of polish to 1.0 and a number of cool new features. Some quick snippets from me:<br /><br /><span style="font-size:130%;">dojo.attr()<br /></span><br />We now have a smooth &amp; nice way to access attributes on DOM elements, normalising access much in the way dojo.style() does. And, just like dojo.style() can now, if you pass in an object as the name, it'll set a bunch of attributes for you in one go:<br /><code></code><pre><blockquote><br />// get the current value of the "foo" attribute on a node<br />dojo.attr(dojo.byId("nodeId"), "foo");<br /><br />// we can just pass the id:<br />dojo.attr("nodeId", "foo");<br /><br />// use attr() to set the tab index<br />dojo.attr("nodeId", "tabindex", 3);<br /><br />// set multiple values at once, including event handlers:<br />dojo.attr("buttonId", {<br /> "name": "myButton",<br /> "value": "123",<br /> "onclick": function(e){<br /> // an onclick handler connected via dojo.connect()<br /> }<br />});</blockquote></pre><a href="http://api.dojotoolkit.org/"><span style="font-size:130%;">api.dojotoolkit.org</span></a><br /><br />Our API browser is back, newer and better. You can search and browse all the code in Dojo, see method arguments and examples, and dig into the code if necessary. And when you figure out a tip you can comment in the appropriate place to help others out. We think this is a fantastic addition, and I've been using it on a daily basis for a while now.<br /><span style="font-size:130%;"><br />dojox.help</span><br /><br />Not really part of 1.1, but happened about the same time. The talented Neil Roberts whipped up an awesome demo based on some <a href="http://dojocampus.org/content/?p=62">suggestions from a dojo cookie</a>. Basically it accesses the API site live and allows you to get method arguments and descriptions directly in Firebug. I often get some code semi-working and test and experiment using the Firebug console while I finalise it, so this is a real boon.<br /><br />Let's have a go:<br /><ol><li>load <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/help/demos/demo_Console.html">this page</a> in Firefox with Firebug enabled</li><li>in the Firebug console, type the following:<ul style="font-family: courier new;"><li><span style="font-size:85%;">dojo.require("dojox.help.console") // loads the help infrastructure</span></li><li><span style="font-size:85%;">dojo.attr // prints the method arguments for dojo.attr()<br /></span></li><li><span style="font-size:85%;">dojo.attr.help() // prints the method description, examples, etc</span></li></ul></li><li>revel in its coolness, dig in if you're using trunk, or wait patiently for it to appear in 1.2</li></ol><span style="font-size:180%;">Summer of Code</span><br /><br />On Monday the Summer of Code students for 2008 will be announced. Dojo received a huge pile of great applications, and we had a really hard time evaluating and ranking them. Unfortunately the funding isn't infinite and neither is our mentoring capacity, so we've chosen what we think is a pretty exciting mix of projects. More to follow next week after the announcements!<br /><br />The coding exercise we set went down pretty well. I suspect many of the students spent a lot more time on it than we asked, but there are some damn cool demos in there, which I'll try to show off over the next few weeks. Next year we'll try something a little more focussed, but its actually fairly tricky to think up the right balance.<br /><br />Anyway, time to land now. Better be off. :)Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comtag:blogger.com,1999:blog-875457922584169320.post-40031822022725887692008-03-18T18:58:00.004+13:002008-03-18T20:55:06.149+13:00Prepping for the Summer of CodeSo, it was announced today that <a href="http://dojotoolkit.org/">Dojo</a> will be part of the <a href="http://code.google.com/soc/2008/">Google Summer of Code</a> in 2008. w00t! For students, you get a modest amount of fortune (US$4500) and some degree of fame (TBA), and Dojo gets your nice shiny code. This is our third year and the second time I've been involved. Looking at the quality of some of the applications that <span style="font-style: italic;">didn't</span> make it this year, I'm a little scared that we only just scraped in.<br /><br />Since the <a href="http://code.google.com/opensource/gsoc/2008/faqs.html#0.1_timeline">programme</a> was announced on 25 February, we've achieved quite a bit, so I thought I'd jot it down:<br /><ul><li>Figured out who's organising it: me, since I volunteered again ;)<br /><br /></li><li>Thought about what was good and bad from 2007 and 2006 and what we'd change<br /><br /></li><li>Write up a pile of documentation:<br /></li><ul><li>An <a href="http://www.dojotoolkit.org/book/summer-code-2008">overview of SoC and Dojo</a> for mentors and students<br /></li><li>A <a href="http://www.dojotoolkit.org/book/summer-code-2008/student-faqs">FAQ for students</a> about what we and they should expect<br /><br /></li></ul><li>Created our <a href="http://www.dojotoolkit.org/book/summer-code-2008/summer-code-project-ideas">project ideas list</a> - basically we need to list some projects we think are both interesting and achievable by a new student in a couple of months. This involved a huge brain dump from me, followed by trying to herd our contributors into reviewing it and adding their own ideas, notes, and corrections. We've got some pretty good stuff down, but I know there's more great ideas out there still.<br /><br /></li><li>Posted to the blog and our mailing lists <a href="http://dojotoolkit.org/2008/03/06/summer-code-here">looking for mentors and more ideas</a>. We're trying to get 2 mentors per student this year, with one from the "core" Dojo team and someone else from the Dojo community who wants to get more involved - we have a lot of smart &amp; talented people and we want to pull them closer.<br /><br /></li><li>Answered a pile of emails, forum posts, IRC, and IM conversations with students and potential mentors.<br /><br /></li><li>Wrote our application to Google. Only 175 out of 505 organisations have been accepted, so it needed to be good.<br /><br /></li><li>Wrote a <a href="http://www.dojotoolkit.org/book/summer-code-2008/dojo-coding-test">coding test </a>- shamelessly ripping off the idea from my good friends at <a href="http://silverstripe.com/">SilverStripe</a> we decided that our students should do something practical as part of their application too. Still some more tweaking to do there too.<br /></li></ul>That took until this morning. Phew. What's next?<br /><ul><li>Start matching enquiries to mentors</li><li>Hassle some more of the core committers to get involved<br /></li><li>Figure out how we're going to deal with version control &amp; ticketing for the SoC projects<br /></li><li>Sketch out our mentor 'teams' and fill in any gaps<br /></li><li>Decide how many projects we can handle</li><li>Keep on top of the emails and other enquiries</li></ul>Student applications start flowing in on the 24th, then they need to be reviewed and voted on by the 11th. Then I can relax for a bit (unless I end up mentoring a project as well) and just make sure everyone is communicating and making progress. Until evaluation-time.Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comtag:blogger.com,1999:blog-875457922584169320.post-66196316990961059182008-02-22T01:16:00.005+13:002008-02-25T20:24:50.655+13:00February in NZ Tech - KiwiFoo, Webstock, Amazon...So I'm both late and lazy getting around to my writeups!<br /><br /><a href="http://baacamp.org/">KiwiFoo</a> was awesome! So many interesting people, and everyone was open for sharing and discussing - the corporate walls were down for a couple of days. I was involved in some great sessions - both issues I'm passionate about - open government data, student internships, IE8, developing OSS communities; and stuff that was just plain interesting - Meraki, getting Internet to Puhoi library, blog ads. There was a bit of linux-ness (Toby trying to use my Macbook for his 3D augmented reality demo didn't go as smoothly as we'd hoped), and hundreds of chats with like-minded and interesting folk. The weather was great (even a bit of cricket on Saturday night), and the venue and food was top notch. Nat may have gotten us there, but Jenine made everything work, and we appreciate it!<br /><br />Last week was <a href="http://webstock.org.nz/">Webstock</a>, and 3 of us took the trip to Wellington. <a href="http://simonwillison.net/">Simon Willison's</a> session on <a href="http://openid.net/">OpenID</a> was great - particularly how Sun has OpenID identities for each of its 34K employees. For SaaS applications, especially cross-company collaborative ones, this is fantastic. The authentication stays inside each person's 'home' company, but any service anywhere can easily utilise it, and thats just the first benefit. Microsoft: add an OpenID provider to Windows Server!<br /><br />Lots of other memorable stuff, but <a href="http://blogs.msdn.com/nigel/">Nigel Parker's</a> 5 minutes on online privacy in social networks had lots of peoples eyebrows climbing up their foreheads. And as he said, for his daughter he's making decisions about whether and where she'll be online before she knows what online is. It's standard for me to drop names of people into Google to see what comes up and what I can find out about their backgrounds and involvements - and not just job applicants, but any business or personal contact.<br /><br />Heading down to the Brewery Bar on the waterfront on Thursday evening for a few beers outside was great, especially with the background sounds of Phoenix Foundation's gig up the road. Thanks again to Mike, Tash, Siggy and the others for your hard work! And to the <a href="http://blog.projectxtech.com/">ProjectX</a> and <a href="http://www.makeithappenhq.com/">PlanHQ</a> folks for hanging with us visitors :)<br /><br />This morning I was at Mike Culver's presentation on <a href="http://aws.amazon.com/">Amazon Web Services</a> put on by the <a href="http://www.csi.ac.nz/">UoA Centre for Software Innovation</a>. A good mix of people who quickly grasped the issues. AWS makes it <span style="font-weight: bold;">so</span> easy for US businesses to get off the ground without investing huge amounts in infrastructure and the ops to make it work. The problem from this (and other) ends of the world is international bandwidth costs. As far as I'm concerned, the NZ government should be bending over backwards to get the likes of Amazon to set up here to help our software startups get up and running and growing (as should every other government, but they're not mine). Mike's talk in Wellington went well too, so at least he knows we're all enthusiastic.<br /><br />Only downside: another mention from an international guest of how NZs broadband is sucky and expensive. <a href="http://www.drury.net.nz/2008/02/20/internet-quality-is-part-of-our-brand/">As Rod said, this is our national reputation to global influencers.</a> Not good.Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comtag:blogger.com,1999:blog-875457922584169320.post-28685554258519393732008-02-22T00:25:00.006+13:002008-02-22T01:09:53.502+13:00Children, Lego, OLPC, and IPSo, I stumbled across an <span style="font-style: italic;">absolutely fascinating</span> article care of Nat's <a href="http://feeds.feedburner.com/%7Er/oreilly/radar/atom/%7E3/238718145/radar-roundup-2.html">Radar</a> roundup: <a href="http://www.rethinkingschools.org/archive/21_02/lego212.shtml">Why We Banned Legos</a><br /><br />Now, I grew up in a Lego-mad house. It's probably one reason why both my brother Mikey and I are working in engineering-related fields. For years and years we had Lego structures and contraptions erected around the house, and one of my very first memories is playing with Lego with my cousin Hamish. Mikey and I had wars about lots of stuff as we grew up, but and I'm sure more than one was about Lego - I'll have to ask Mum.<br /><br />I read this article just after reading <a href="http://www.plasticbag.org/archives/2008/02/on_the_olpc_movement/">Tom Coates' review of OLPC</a>, and that sparked some thoughts. The Legotown issues are about access to physical property - Lego bricks. I'd say western society in general feels that physical property is commonly understood with similar attitudes. Intellectual property (patents, trademarks, copyright, ownership of ideas &amp; discoveries, the whole shebang...) is a whole different kettle of fish, and I'd say society as a whole barely grasps the concepts, is only starting to get to grips with it, let alone has common understanding and agreement.<br /><br />OLPC is all about giving knowledge and the capability to learn to kids around the world. Great. But this is physical property (a cool green high-tech laptop) combined with intellectual property (information and access). If I was a kid I'd be pretty disenfranchised if the kid down the road knew everything about everything because she had an OLPC and I didn't. Much more so than if she had a cool toy and I didn't (hey, everyone grows up like that right?).<br /><blockquote style="font-style: italic;">we were struck by the ways the children had come face-to-face with the frustration, anger, and hopelessness that come with being on the outside of power and privilege.<br /></blockquote>Francis Bacon once said "Knowledge is power", and he was right. Magnitudes more powerful than controlling physical property. Normally kids don't need to deal with IP issues, but they learn about physical property early. I think the OLPC will change that, especially if only a handful of kids in a community have one. And I suspect the frustration and anger will be bigger.<br /><br />Now, don't get me wrong, I think OLPC is a fantastic scheme, I'm a supporter, and I've had plenty of lively discussions around it over the past couple of years. And was lucky enough to have a play with one in San Francisco in October!<br /><br />But just something to ponder :)Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comtag:blogger.com,1999:blog-875457922584169320.post-10867910998262366442008-01-03T13:02:00.000+13:002008-01-05T17:52:51.161+13:00Automated Dojo testing - DOH & Selenium-RCBefore the 0.9 release, <a href="http://dojotoolkit.org/">Dojo</a> replaced its old unit-testing framework with a new one named <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing">D.O.H.</a> that is miles nicer and cleaner. It'll run in both the browser &amp; under <a href="http://www.mozilla.org/rhino/">Rhino</a>, supports defferrables and is relatively easy to customise.<br /><br />At <a href="http://www.onetrackmind.co.nz/">One Track Mind</a> we've been using <a href="http://www.openqa.org/selenium-rc/">Selenium-RC</a> to drive unit-testing of JS code since Dojo 0.4 (of our stuff mostly, not Dojo itself) and it wasn't ever particularly clean. The basic idea is to run a suite of unit tests across a series of browser/version/OS combinations and collate the results. So you can find that some irrelevant little change b0rked Opera but only on Windows.<br /><br />Selenium's API for writing tests (for JS stuff anyway) is pretty awful compared with DOH and we'd done ours in Python, which was then launched from Ant after the Dojo build was done. But what Selenium-RC does do well is fire up browsers on multiple operating systems, do magic proxying, and allow you to interrogate the pages.<br /><br />A <a href="http://www.nabble.com/-1.02--ReferenceError%3A-%22navigator%22-running-tests-in-Rhino-td14400798.html">thread on dojo-interest</a> this week sparked me back into looking at it again. I noticed that Selenium-RC now supports <a href="http://www.openqa.org/selenium-rc/js.html">running from Javascript</a>. (to be honest, the java bindings would have always worked but someone's actually spelt it out in small words now). Since the Dojo build system is now Javascript-based, why not make the Selenium test runner as well?<br /><br />Plan:<br /><ul><li>Have a config file defining which browsers to launch, which machines they're on, and what tests to run.</li><li>Launch each browser via Selenium-RC<br /></li><li>Run the tests via the normal DOH browser runner.</li><li>Use Selenium to extract the results from DOH.<br /></li><li>Collate the results from the various browsers and produce something useful.</li></ul>So, after a bit of toying I came up with this:<br /><ul><li>Drop <a href="http://rob.coup.net.nz/seleniumRunner.js">seleniumRunner.js</a>, <a href="http://rob.coup.net.nz/seleniumRunner.config.js">seleniumRunner.config.js</a>, <a href="http://rob.coup.net.nz/seleniumRunner.sh">seleniumRunner.sh</a> (or the <a href="http://rob.coup.net.nz/seleniumRunner.bat">.bat</a> if you're on Windows), and <a href="http://rob.coup.net.nz/selenium-java-client-driver.jar">selenium-java-client-driver.jar</a> into <span style="font-style: italic;">util/doh/</span> in your Dojo install.<br /></li><li>Put <a href="http://rob.coup.net.nz/selenium-server.jar">selenium-server.jar</a> on each test machine, then run <span style="font-family:courier new;">java -jar selenium-server.jar -multiWindow</span> so it listens for the browser-control messages.</li><li>Edit <span style="font-style: italic;">seleniumRunner.config.js</span> and change <span style="font-style: italic;">browsers</span> and <span style="font-style: italic;">rootUrl</span> to match your setup. The <span style="font-style: italic;">rootUrl</span> needs to be reachable from each test machine.</li><li>run <span style="font-family:courier new;">./seleniumRunner.sh seleniumRunner.config.js</span> from <span style="font-style: italic;">util/doh/</span> on your workstation</li><li>It'll load the config, fire up the browsers on each machine, run the unit tests from Dojo core, and print the pass/fail/error stats for each.<br /></li><li>Each browser is kicked off and monitored in a separate thread (not strictly necessary but too cool to resist doing).</li></ul>Some issues I ran into:<br /><ul><li>unless I ran the selenium server in multiWindow mode Safari and Firefox would pop up Print dialogs (!?!) whenever the test page was loaded. But Safari never initialised the test page if it was in multiWindow mode. On OSX and Windows. gah.<br /></li><li>Opera on OSX didn't set up the Selenium proxy properly (<span style="font-family: courier new;">localhost:4444</span> for reference).</li><li>IE didn't like doing a dojo.connect() via the selenium javascript commands for some reason.<br /></li></ul>The next step is to improve the reporting. This will probably necessitate writing another browser runner that produces a JSON report (or changing the existing one). Modifying DOH to have an isComplete flag would make life simpler as well. I'd want to know which tests were run on each browser (since not all tests run everywhere), which ones passed and failed and had errors. A hunk of JSON which could be loaded into a Dojo Grid for exploration might make an interesting way of viewing the results.Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.comtag:blogger.com,1999:blog-875457922584169320.post-23432979127890955532007-12-16T22:28:00.001+13:002007-12-17T10:15:48.093+13:00Cool data in the browser with DojoThis is basically what I talked about on Saturday at <a href="http://bca.ludwignz.com/">Barcamp</a> (which was heaps of fun and big props to Ludwig for organising it all!).<br /><br /><span style="font-weight: bold;">Cool data in the browser with Dojo</span><br /><br />We're now at a place with Javascript development where we can handle structured data really well in the browser. And then we can start doing some cool stuff - grids, charts, maps, and so on. The <a href="http://bca.ludwignz.com/">Dojo toolkit</a> calls it <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/data-retrieval-dojo-data-0">dojo.data</a>.<br /><br />Basically dojo.data is an abstraction - sitting between where the data comes from (tables, lists, xml, csv, json, Flickr...) and what you want to do with it (querying, widgets, graphs, grids, maps, ...).<br /><br /><span style="font-weight: bold;">Stores</span><br /><br />A data store describes <span style="font-style: italic;">where</span> the data comes from. This could be from in the HTML page (from inline lists or tables), from static sources (XML, CSV, JSON), dynamic sources (database-backed querying) or external APIs (like Flickr). Different stores can implement different sections of the dojo.data API depending on what the source supports - reading, writing, identities, and so on. Its pretty easy to create your own store implementation if none of the <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/what-dojo-data/available-stores">existing ones</a> suit.<br /><br /><span style="font-weight: bold;">Data Widgets</span><br /><br />Data widgets present data from a store. The idea is that we can create kick-ass widgets <span style="font-style: italic;">once</span> that work with data from any source. The widgets interface to the data via the dojo.data APIs and then do cool things to present it. Data-driven widgets include form components like ComboBox, the tree, the grid, charting, image galleries, and so on. We'll just talk about a couple of them.<br /><br />The Dojo Grid was released in September by SitePen, Mozilla, and others. It is the Javascript table to end all tables, with a <a href="http://www.sitepen.com/blog/2007/09/16/the-dojo-grid/trackback/">truly impressive feature list</a> - paging, sorting, filtering, subgrids, events, formatting, internationalisation, and the list goes on. Of course, the grid can consume data from a store, so we can have all these impressive features for CSV data, XML data, or anything else. SitePen has a <a href="http://www.sitepen.com/blog/2007/11/06/simple-dojo-grids/trackback/">two</a> <a href="http://www.sitepen.com/blog/2007/11/13/dojo-grids-diving-deeper/trackback/">part</a> tutorial on a few of the grid features, or you can check out the <a href="http://www.dojotoolkit.org/book/dojo-book-0-9/docx-documentation-under-development/grid">documentation</a> (still in-progress) and the <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/">tests</a>.<br /><br />Dojo Charting provides vector-based charting in 2D, and now 3D thanks to the work of Kun Xi and Neil Joshi during this years Google Summer of Code. Underneath it uses <a href="http://www.dojotoolkit.org/book/dojo-book-0-9/part-5-dojox/dojox-gfx">dojox.gfx</a> which leverages SVG, VML, Silverlight, or Canvas depending on the browser to draw the vector graphics. Charting is pretty new but already has an impressive set of features: lines, columns, areas, bars, pies, grids, axes, themes, ... see the <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/charting/tests/">tests</a> for some examples. The dojo.data implementation in charting isn't fully complete yet but its still easy enough to get it working.<br /><br /><span style="font-weight: bold;">Demo Time</span><br /><br />Enough talk - lets see all this in action. I've grabbed some 10-minute weather readings in CSV format from 18 Auckland stations for a 24 hour period in November from <a href="http://www.niwa.cri.nz/">NIWA</a>'s <a href="http://cliflo.niwa.co.nz/">climate database</a>. Then built a simple data explorer where you can select a station in the table and see a line chart of the temperature and wind speed over the 24 hour period for that station. And there's a map, because that's what I do.<br /><br /><a href="http://rob.coup.net.nz/cool_data_in_the_browser.html">Play with the demo</a><br /><br /><a href="http://www.blogger.com/cool_data_in_the_browser.html"></a>You'll notice that there is no page-loading involved (AJAX goodness), you can sort the grid by clicking on the column headings, and that it's all very smooth and responsive. View the source and read the comments to see what is happening underneath.<br /><br />Enjoy!Robert Couphttp://www.blogger.com/profile/05096198530493752948noreply@blogger.com