October 2009 - Posts
I spent last Wednesday at Benaroya Hall,
attending the Seattle edition of StackOverflow's traveling DevDays conference.
It was well worth $99.
Joel Spolsky, owner of FogCreek Software and co-founder of StackOverflow,
opened the conference with a keynote about the
dichotomy of power and simplicity.
People are happier when not overwhelmed with choices.
Many of the choices that software forces users to make
are essentially meaningless to the users.
However, even though people want simplicity, they also want features
and different people use different features.
Powerful software sells more copies.
He argues that developers and designers should put in the extra work to make good choices
on behalf of the users: don't make users feel bad about themselves.
Undo is better than a confirmation dialog.
You are not in charge of what your users do.
Scott Hanselman spoke about ASP.NET MVC.
We're moving away from ASP.NET to Python,
but if we were to use ASP.NET again, MVC would be a compelling feature.
His presentation was entertaining, if gimmicky.
Rory Blyth introduced iPhone development, in a tone of snarky ambivalence.
He mentioned the Stockholm Syndrome.
He stressed that Apple's Design "Guidelines" are effectively laws:
violate them and you won't make it into the App Store.
Looks like there's a lot of tedious messing around to hook things up in Objective-C.
At the very end, he briefly demoed MonoTouch, which seemeed a little less tedious.
Cody Lindley introduced jQuery.
I've done a lot of work with jQuery, but I still learned a few things.
He worked through five facets of jQuery: Find something, do something;
Create something, do something; Chaining; Implicit iteration; and jQuery parameters.
He has an ebook at jqueryenlightenment.com, which I just picked up.
Daniel Rocha of Nokia talked about the cross-platform Qt (/cute/) toolkit,
which runs on Windows, Mac, and Linux.
More importantly from Nokia's point of view, it runs on their smartphones.
Nokia has changed the licensing of Qt—once very expensive for closed-source apps,
it's now free for apps that don't modify the Qt source.
Qt is for C++, but there are bindings for other languages, such as Python.
Joel Spolsky came back and treated us to a half-hour demonstration
of Fogbugz 7, Evidence-Based Scheduling, and Kiln,
their new hosted Mercurial repository.
Not terribly interesting to me, but the conference was only $99.
Ted Leung gave us a rather dry Hacker's Introduction to Python
from slides rendered unreadable by a poor choice of colors.
I've done a lot of Python, so I didn't learn much new.
pip is an easy_install replacement that uninstalls;
zc.buildout assembles apps from multiple parts;
bpython is a fancy REPL.
Dan Sanderson talked about Google App Engine
and demoed building apps with Java and with Python.
Looked pretty cool and straightforward.
We probably won't go that route, since we're pushing data to
Amazon's S3, so EC2 makes more sense for us.
Finally, Steve Seitz from the University of Washington
gave a cool talk on Modeling the World from Internet Photos.
Some of this technology ended up in Photosynth.
See Building Rome in a Day for some demos.
Title: Pragmatic Version Control Using Git
Author: Travis Swicegood
Publisher: Pragmatic Bookshelf
Reading period: 10–18 October, 2009
As part of my personal conversion to Git, I read Swicegood's Git book.
It's a decent introduction to Git and you learn how to
do all the basic tasks as well as some more advanced topics.
The examples are clear and well-paced.
I would have liked to see more about collaboration and workflow in a DVCS world,
perhaps a few case studies:
how is Git used in the Linux kernel development process;
how a small, distributed team uses Git and GitHub;
how a collocated team migrates from more traditional tools.
The book avoids discussing the lower levels of the Git object model,
which is a reasonable choice for a pragmatic guide.
Over the last few weeks,
I built a PHP application that overlays Approve 71 banners on profile pictures.
The actual application is hosted in an iframe
and lives on a server in a different domain, eq.dm,
than the main server at approvereferendum71.org.
This works fine in most browsers.
Then we started getting reports that it wasn't working in IE8 on Win7 RC1.
The iframe content was blank.
Poking around, I found the problem with the Fiddler proxy.
The landing page on eq.dm was supposed to stick some information into the PHP session,
then redirect to a second page at the same site.
The second page was in an endless loop, redirecting to itself.
In Fiddler, I saw a different PHPSESSID cookie on each response,
and no cookie in the requests.
After reading IE 8 only has access to session cookies,
I told IE8 to Accept All Cookies and the iframe content appeared.
That fixed it for me, but we could hardly ask people to lower their security sessions.
I created a P3P file for the second domain, using the IBM P3P Policy Editor.
(KB 323752 has more background on P3P and third-party cookies.)
IE now worked at its default security level.
Or so I thought.
A day later, we got reports of similar problems with Safari 4 on Mac OS X.
I sniffed the traffic with Wireshark.
Same problem: the “third-party“ cookie wasn't being accepted by Safari.
Unfortunately, Setting cross-domain cookies in Safari
indicated that there was no reasonable workaround.
We overcame the issue up playing some DNS games,
which was only possible because we control both servers.
The second server is now also acting as a subdomain of the first,
We used ini_set("session.cookie_domain",".approvereferendum71.org")
to scope the iframe cookies.
I've tried it in a variety of Windows, Mac, and Linux browsers,
and it works in all of them.
In the last few weeks, I've switched over to Git for most of my version-control needs,
at home and at work, after putting it on the long finger for months.
We continue to use Subversion at work,
but I've recently followed Pavel and Eric's lead in using git-svn.
I work locally on my own private branches and
git svn dcommit and git svn rebase occasionally.
I'm primarily on Windows at work, but I have a Linux box and a Mac Mini too,
while at home, I have a MacBook, a Linux netbook, and a Vista desktop.
I'm using msysGit, occasionally supplemented by TortoiseGit and QGit.
Pavel's on a Mac and Eric's mostly on Ubuntu, so git adoption was easy for them.
When I first tried git-svn under msysGit about a year ago,
it didn't work worth a damn.
Git-svn works fine now, but it's slow compared to the *nix implementation.
The developers say that's due to the fork() emulation
of the MSys/Cygwin layer.
The rest of msysGit is much faster.
For my home needs, I've had private Subversion repositories at
DevjaVu.com and OpenSvn.csie.org.
DevjaVu has gone out of business and OpenSvn has been unavailable too often for my liking.
It was time to find some new hosting.
I've experimented with private Git repositories at
GitHub and ProjectLocker.
GitHub is very nice, but charges for private repositories.
ProjectLocker provides free private repositories,
but is comparatively clunky.
ProjectLocker lets you set up a fresh repository on their server.
They tell you how to clone from that, which is great for a new repository.
But they don't tell you how to hook it up to an existing local repository.
Since I had some difficulty in figuring it out, here's the recipe:
git remote add origin git-foobar@freeN.projectlocker.com:foobar.git
git pull origin master
... merge, local edits and commits ...
git push origin master
I found Git, Xcode and ProjectLocker and Cygwin, SSH and ProjectLocker
useful in figuring this out.