Friday, July 28, 2006

OSCON 06 Day 4 - Afternoon Sessions

Session 3
Outer Joins for Fun and Profit
Bill Karwin

I've never fully understood Outer Joins. Although I can use them, I'm far more comfortable falling back to the (+) from Oracle and += from MSSQL to get what I want. Bill started explaining outer joins with set theory and Venn diagrams, which open source databases support which kind of outer joins. Then Bill launched into several examples, each explaining concepts of increasing complexity. Beyond the obvious stuff, you can do things like mimic a NOT IN subquery on platforms (MySql4.0) that doesn't support subqueries. You can also do a 'Greatest row per group' subquery without having to use the max() function. This lets you return more rows than just the max'd one. In english, its "show the row for which no other row exists with a greater date for the same product".

One of the more interesting demo/solution bits he showed was sudoku solving with SQL (using outer joins, of course...).


Session 4
Using the Google Web Toolkit
Bruce Johnson and Bret Taylor

Ajax, the same old arguments: nothing to download, every app is only a URL
away, desktop-like functionality. In reality, it auto-reinstalls every
full-page load, so it'd better be small. It's sorta secure; it's so dang hard
to get it working at all that security is almost an afterthought. There's a
plethora of technologies, on it's own platforms with it's own quirks - it's no
wonder developers hate Ajax.

Looking at Ajax from a Java viewpoint, Google set out to leverage their Java
knowledge, and make Ajax front-ends that are still very webby. They came up
with the idea of translating Java into Javascript. They actually pulled this
off, and it really works. GWT can run in two mode: hosted mode (the whole app
runs in the jvm as java - this gives you java-based debugging - which is
beautiful and useful!) and native mode (that runs in a os-native web browser).

GWT moves all the stateful session logic to the client. This enables stateless
load balancing and (thus) server clustering. It also leaves as much UI-only
stuff on the client, requiring no server round-trip. GWT provides leverage for
the solutions - you can take any solution and wrap it in a class and have it
to reuse later.

GWT, as Java, brings static type checking (static types... lalalalala....) and
all the benefits and drawbacks that typically come with it. There are code reuse advantages: create your ajax libraries as jars, reuse your code.

They provide a fantastic palette of UI widgets that make cross-platform rich
UI creation pretty simple, and one less thing to worry about.

The Web Toolkit comes along with a RPC library as well. It's dead simple, and
lets you create objects remotely, and serialize them back to the browser.

History and linking are ususally a casualty of Ajax. AWT lets you (with a pretty simple set
of calls) provide a full history support and linking. It really is dead
simple!

But wait! There's more!! There's JUnit support for testing of both the Java
and Javascript sides!

Downloadable at http://code.google.com/webtoolkit/
and the GWT Widget Library at http://gwt-widget.sourceforge.net/ and more.

Wow. GWT is cool. I can't wait to get it and play with it.




Session 5
Taming an Audience with Laser and Snake
Robert Stephenson

The basic idea is that you have a webcam, an iSight in Robert's case, and a
laserpointer. You point at the screen with the laserpointer, and the iSight
and your software work like a mouse to control the computer running the
presentation. In Robert's case, he leveraged the AppKit (a python interface to
Apple system calls) to call the CocoaSequenceGrabber to capture frames. Robert
chose a set of RGB factors to pick an appropriate range of laser colors to
have the app look for.

-1.1r + 2.0g -1.1b > 0.9

But this didn't work so well. The problem is that that there's not enough
resolution in the sRGB color space for the camera to be able to resolve the
dot of the laser pointer. And/or there's not enough range in the sRGB gamma
when ends up clipping the intensity of the laser dot. Owing to the way that
the camera's automatic gain control tries to normalize the camera exposure,
Robert tweaked the camera's sensitivity settings to compensate and was
able to reliably track the laser about the screen.

He then, with some ObjectiveC, C, Python and AppleScript, he was able to
control PowerPoint (or was it Keynote). Robert also added capabilties to
ajust keystoning and skewing of the image for the camera.



Session 7
Web Heresies
Avi Bryany

Seaside is a web development framework written in Smalltalk. Chances are
you're not going to go out and use Seaside. That's okay with Avi. He just
wants to talk about the heresies of web development. Avi's first idea is that
the HTML files belong to the developer, and that designers work with the CSS
files. He did a brief apples to apples comparison of language semantics so we
non Smalltalk people could read his examples. Naming things, while a good idea
when absolutely necessary, should be avoided if it can. You can use the object
that the field is rendering for to source it's own information. If you don't
name your objects, they get numbers, and a behind-the-scenes hash maps the
numbers back to their objects and their accessors for each numbered field.
Kinda confusing, but I can see the reasons why this would be a good idea.

An aside from Avi's talk: Seaside is based on Squeak Smalltalk, which I've been meaning to check out.
From my Smalltalk days, grumble11grumble years ago, I remember the Virtual
machine being HUGE and somewhat slow, and hard to crack for outside use. I'm
really curious to give Seaside a shot, even if just to see how it does what it
does. I'm intreagued as heck about how a Smalltalk web app server would fit
together and work.

Avi went on to cover a few demos, showing source code, and running a few hello
world-type things. A question that came up (as part of his talk) is how would
you serialize a session? The short answer is that you don't. Just use session
affinity instead. The cost of a server failing and taking a session with it
tends to be very low, so (essentially) screw it. Use sessions like crazy. Put
anything in a session you want. Really. Anytime. (I'm guessing this is another
herasy.) Try on the idea that you can also save the current execution point
and put it in the session. This would mean that you can throw the current
execution stack in the session (and in this case putting it in the URL) as the
form is displayed. When the form gets posted, you pull the execution stack out
of the session and continue execution from where it was, thus processing the
form. Think about that one and let that one sink in. Does your brain hurt yet?
It should. (This overhead isn't that much, but amounts to about 1M / current
user.)

Another Seaside goodie is that you can change your page load order by changing
the method order in your Smalltalk code. Relying on Smalltalk gives you some
really interesting powers that I've never seen in web applications before.
Your server image is still a fairly full-featured image, including the ability
to vnc into the sever image and interactively debug it. That's another "Think
about it." moment. That's cool.

Q: What's the lineage of Seaside?
A: WebObjects + Paul Graham = Seaside. It's also similar to Tapestry.

Q: What have been the changes to Seaside over time?
A: Seaside used to have a templating system. That was ditched 3 years
or so ago in favor of the programamtic html creation. There were also a few
minor architectural changes over time as well.

Q: Ajax?
A: Yes! http://scriptaculous.seaside.st/

-Bill

Tags: , , , ,,,

No comments: