Saturday, May 31, 2008

Fun with visualizations

Looking through MacResearch, I saw NodeBox, "...a Mac OS X application that lets you create 2D visuals (static, animated or interactive) using Python programming code and export them as a PDF or a QuickTime movie." A bit of a hobbyist math geek, I checked it out a bit and realized that a lot of the Python source code used with NodeBox looks rather similar to JavaScript interacting with the canvas HTML5 element.

So I took a few and wrote a quick library to behave similarly to NodeBox, albeit for JavaScript to run in a browser. I just looked at the parametric equation examples for something easy to start off with, and wrote a few examples. The first, extremely simple example more or less just draws a circle within certain bounds:

function CircleEquation(dt, steps, r) {
 Frozen.Chart.Equation.call(this, steps, dt);
 this.r = r;
}
CircleEquation.prototype = new Frozen.Chart.Equation;
CircleEquation.prototype.next = function() {
 this.x = Math.cos(this.t) * this.r;
 this.y = Math.sin(this.t) * this.r;
 return Frozen.Chart.Equation.prototype.next.apply(this);
};

function circleTest1() {
 chart.clear();
 chart.map.lineWidth = 0.5;
 chart.renderEquation(new CircleEquation(4.5, 75, 95));
}

This results in the following visualization:

A spiral design made up of thin lines making up a 100 pixel circle

You can see it in action, along with a couple of slightly more interesting examples. NodeBox can do a lot more than simple charting, this part of its functionality just inspired a fun exercise in web+math geekery.

Labels: , ,

Tuesday, May 06, 2008

Opera Dragonfly (alpha) Released

Over a year ago, I wrote about the Opera Developer Console. This morning (for me, at any rate), Opera posted Dragonfly, which (two years in the making) offers a completely fresh look at browser-based debugging.

An Opera Dragonfly window showing a JavaScript console, stack trace, and active debugger, stepping through a call to add an event listener

It offers most of the familiar tools for DOM inspection (along with a nice DOM editing capability), error logging (with the same granularity as before wrapped in a more polished UI), a JavaScript debugger that rivals WebKit's Drosera, a JavaScript thread logger, and a lot more that I haven't explored yet.

Time will tell whether Dragonfly can get enough developers to use Opera and keep them there, and how much the developers behind the new developer tools listen to the community in the coming iterations, but so far this looks extremely promising.

Edit: Chris Mills from Opera gave me some additional info:

Part of the reason I haven't found the XMLHttpRequest logger/debugger apparently stems from it not getting exposed yet, though it will appear in an upcoming iteration, along with HTTP header inspection (not just for XMLHttpRequests, of course) and a new "single window mode" which sounds like it will make things much more usable! When using Safari's inspector, I almost always find myself attaching it to the window, and I always had the urge to do the same with Opera's developer console.

Chris also mentioned something which makes me very happy to hear: even though the Developer Tools (loaded via the Tools → Advanced → Developer Tools) download from Opera's server, it only does so the first time, and for each following update of the tools. This ensures that it not only saves Opera's servers when usage takes off, but it also ensures that developers can work offline, and the slow loading of the tools will only happen initially, loading from the local drive after installation.

Written in XML/CSS/JavaScript, Dragonfly will run in all browsers including Opera's Core-2.1 rendering engine (except Opera Mini for some reason), and even supports debugging on mobile devices by way of a proxy setup between the device and the desktop Dragonfly installation! This will prove invaluable for developers of web applications supporting devices, as they will have the ability to use their normal desktop tools to debug on the mobile browser without having to use emulation.

You can find more information in an Introduction to Opera Dragonfly and on the Opera Dragonfly product page (which has a very good start of fleshed-out documentation already, feedback and bugtracking, and of course a blog).

Edited to fix the Introduction to Opera Dragonfly link...

Labels: , , , ,

Monday, May 05, 2008

Heading to Google I/O at the end of the month

As an added benefit of living in the Bay Area again, I get much easier access to many of the conferences and events that go on around Ajax/RIAs/etc. May 28-29, I'll take BART into the city in order to attend Google I/O, which looks extremely interesting. Somehow, in the short two days, I need to find my way to the sessions on design patterns, performance, HTML5, open source, and chase down some of the speakers and fellow developers to pick their brains for a bit. Fun!

Labels: , , ,

Tuesday, April 15, 2008

History meme

Indirectly tagged by Arve Bersvendsen's entry.

wollstonecraft:~ shawn$ history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
85 screen
52 ssh
50 ls
44 vi
39 cd
36 svn
25 ping
20 telnet
16 cp
14 mv

I guess I reattach my screen session a lot. The telnet calls probably stem from checking the server once I got it up and running again, since the router had some issues letting everyone through for a while.

Labels:

Saturday, April 05, 2008

Part 2 of the Advanced Ajax review went up!

In the midst of things, the second half of the review from Agile Ajax went up! It seems that despite the rather heavy use of PHP for the server-side example code, Brian (apparently more into ASP, JSP, and Ruby) still liked it, which makes me very happy.

Back in February, I reviewed the first half of Shawn M. Lauriat's "Advanced Ajax: Architecture and Best Practices" (Prentice Hall, 2008, 360p). The first four chapters of Lauriat's book, which focused almost exclusively on client-side technologies, impressed me considerably. But it's taken me several weeks to get through the remainder of the book, and there's one reason why: PHP.

The server-side portion of "Advanced Ajax" uses PHP code to illustrate its many and varied lessons about Ajax architecture. It's not that I have anything against the popular web-development framework and scripting language. It's just that, after spending my career in the ASP Classic and JSP trenches and slowly ramping up on Rails in the last year, I'm not the ideal target audience for these code samples. Adding "PHP" to the title of the book might have limited its potential audience, but it also would have been more accurate.

That said, there's a lot of value here for adherents of any server-side framework. Lauriat discusses each topic from a general perspective before diving into the code. The technical approach to a given problem would obviously differ by framework, but the high-level approach wouldn't. If you don't mind skimming past the content that doesn't apply to you, Lauriat's advice about developing stable, scalable, accessible and secure Ajax applications transcends framework allegiance.

Read the rest of the review.

Sidenote: On the Ajaxian post for the review (part 2), Joeri left a comment that really hit on what I tried for in writing the book, almost quoting what I told Prentice Hall when describing the type book I intended to write:

I’ve read this since the last review.
It does a pretty good job documenting the best practices when building ajax apps. This is a book to read when you want to move beyond knowing the basics of javascript and xmlhttp to building a real web app using ajax methods.

Thank you, Joeri! I feel glad knowing that people out there have read the book and gotten out of it something resembling what I had hoped they would.

Labels: ,

No place like 67.102.65.250

I haven't posted in a while, partly to figure out the details of, and then execute a move from Austin, TX to Oakland, CA. It made for a hell of a trip, but a successful one nonetheless. I still have my job with IBM, now working remotely and officially from my home office. From my desk chair, I can see the loading docks of the bay in the distance, and have already timed the trip from my favorite peanut sauce source to the house at a mere 15 minutes (with light traffic)!

The site(s) and email(s) went down during the move partly because of DNS issues that resulted in utter failure to move to the temporary hosting service, and partly because so much came up that needed handling in the last couple of weeks that I just had too many higher priority things to do. Speaking of which...back to unpacking!

Labels:

Saturday, February 16, 2008

Advanced Ajax (Kindle Edition)

For those interested: Advanced Ajax (Kindle Edition) apparently went up on Amazon. I haven't met anyone yet who has a Kindle, but I imagine someone out there does! Hopefully lots of Ajax developers...

Labels:

Tuesday, February 12, 2008

Vienna + PHP (source code) + iUI

Source posted! BSD License. From the README:

You'll need to do a few things to get this working:

1. Move the extracted vienna directory to /Library/WebServer/Documents
2. Download iUI (http://code.google.com/p/iui/) and put the main iui directory into the extracted vienna/ directory
3a. Setup a cron job to copy ~/Library/Application Support/Vienna/messages.db to the extracted vienna/ directory
3b. For the adventurous: mv ~/Library/Application Support/Vienna/messages.db to the extracted vienna/ directory and sym-link it back to ~/Library/Application Support/Vienna/
4. Make sure to enable web sharing
5. Go to (your computer's name).local/vienna

Labels: , , , , , , , ,

Book review up on Agile Ajax

Book review: Advanced Ajax by Lauriat (Part 1 of 2) went up earlier today (also linked to from Ajaxian), and so far Brian Dillard (RIA Evangelist @ pathfinder and project lead for Really Simple History) seems to like it:

Because Ajax moves so much application logic from the server to the client, it forces many developers to master a wider range of web technologies than ever before. To work effectively on Ajax projects, front-end developers have to concern themselves with database performance, business logic and other server-side concerns. Back-end and middleware developers, meanwhile, have to make friends with XHTML, CSS, JavaScript and a wide range of browsers. Sure, it's possible to develop Ajax apps in a siloed team environment. But it's not the easiest way, and it rarely provides the strongest results.

Shawn M. Lauriat's "Advanced Ajax: Architecture and Best Practices" (Prentice Hall, 2008, 360p) bridges the gap between developers with exclusive client- or server-side skills. By exploring tools, technologies and best practices for every layer of the Ajax programming model, this solid new programming manual promises to plug the holes in any developer's resume. Lauriat's tops-to-tails approach offers something for almost any developer, but it also guarantees most readers will find some sections remedial. As this two-part review will demonstrate, that's not necessarily a liability.

Read the full review

Labels: ,

Sunday, February 10, 2008

Vienna + PHP + iUI

So, sick of not having the ability to feed my XML addiction when away from my machine, I took an hour this morning and hacked together a quick'n'dirty iPhone/iPod Touch UI for my Vienna database using MacOS 10.5's standard PHP (with SQLite PDO), iui, and my Vienna database (stored in sqlite3). I gave it read-only access to the database, partly so I wouldn't have to worry about screwing it up, partly because I didn't feel like bothering just yet. I just need to add a "Mark Read" button to make an Ajax call.

I'll ask the Vienna devs if they'd like a copy of the source to toy with and generally improve, since I blatantly stole reused Joe Hewitt's design and markup for iui-enabled Digg.

Note: though my uploaded demo does pull from a copied Vienna database, it does not pull from a live one, since I wrote the code to run on a desktop MacOS 10.5 machine and not a Linux server. I then just made a bookmark on my iPod Touch to my iMac on the local network.

Labels: , , , , , , , ,