A neat javascript hack

Javascript library publishers often go out of their way to prevent other sites from linking to their libraries directly, preferring anyone who wants to use their library to download and host the file(s) themselves. The most common way to do this is to check the referrer of any requests for javascript files and reject any requests which come from other domains. However, this requires the (minor) extra complexity of requiring server side support.

I just discovered a neat hack in Douglas Crockford‘s popular json2 parser/serializer which obviates the need for any server side support. So simple, yet so effective. Check out the first line of  http://www.json.org/json2.js:

  alert('IMPORTANT: Remove this line from json2.js before deployment.');

Neat, eh?

Alon at Web 2.0 in SF May 5 on “Blurring the Lines”

I’m excited about our panel next Wed at Web 2.0 Expo in San Francisco Blurring the Lines: From Human Centered Design to Customer Driven Development. We’re planning to share real world practices that help multi-disciplinary teams collaborate on creating great products.

We’ve got a good range of perspective and experience to draw from. Maria Giudice from Hot Studio is our user-centered designer, Rob Spiro from Aardvark is our user-centered product entrepreneur, Darren David from Stimulant is our multi-touch and NUI innovator, and I am our Agile software developer.

This event seems to have really caught on to the growing energy in the entrepreneurial community around strategies and techniques for creating products that people really want. Eric Ries is giving the keynote on Tuesday just one year after his first big conference presentation at Web 2.0 2009 and Steve Blank is giving the keynote Thursday. Both of these guys and the growing community around them have been inspiration to me and our work at Carbon Five over the last year for the answers they provide about how software development serves the goal of creating successful businesses and products.

Intro to Spring MVC Talk at SD Forum

I’ll be speaking next Tuesday evening for SD Forum in Palo Atlo about Spring MVC. It’s mostly an introductory talk, but I’ll weave in some opinions and lessons learned from real projects. I’ll cover many of the MVC features, including those introduced in 3.0, by walking through code for a running application.

Event Page

Networking (and pizza) starts at 6:30 and we’ll get down to business at 7:00. The night starts with a short talk about Agile Java by Bjorn Freeman-Benson, of New Relic fame.

If you’re still doing Java and you’re curious about Spring MVC, come join in the fun.

Play at Work for Museums and the Web in Denver, April 17

Dana Mitroff from SFMOMA and I are running a session April 17 at Museums and the Web in Denver, CO called Play at Work: Applying Agile Methods to Museum Web Site Development.

Our goal is to give attendees a taste of some of the novel activities we use to encourage collaboration, communication and fun while engaged in the messy business of creating web software. The session is intended to be interactive – we want attendees to try some of this out with us – which should be interesting given that the conference organizers chose to put us in the Grand Ballroom, the same room used for the conference keynotes. “Gather around, everyone!”

Resources

Here are some follow up resources for attendees who are intrigued and want to learn more.

Effective User Stories for Agile Requirements
http://www.mountaingoatsoftware.com/presentations/52-effective-user-stories-for-agile-requirements
This series of slides by Mike Cohn is a good introduction to user stories as a means of capturing project requirements. We often use this presentation to introduce folks new to agile to the ins and outs of user stories.

Agile Estimating and Planning
http://www.mountaingoatsoftware.com/books/1-agile-estimating-and-planning
This book by Mike Cohn is an excellent guide to the planning side of agile software development and what you do with those user stories.

Art of Agile
http://www.amazon.com/Art-Agile-Development-James-Shore/dp/0596527675
This book by James Shore covers the breadth of agile practices, both in planning and development, and includes many activities like those we cover in this session for helping your team collaborate and communicate effectively and efficiency.

Tasty Cupcakes
http://blog.tastycupcakes.com
Tasty Cupcakes is collection of games and activities designed to help illustrate the value and effectiveness of different agile practices. Rather than being specific techniques used in running an agile project, they are more targeted at teaching agile practices and values with short illustrative games.

The Manifesto for Agile Software Development
http://agilemanifesto.org
This is a historic document (2001) in the Agile software movement where a group of folks advocating new values and practices in software development came together to recognize their shared goals and values.

We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on
the right, we value the items on the left more.

Controlling embedded Vimeo video using javascript

We are embedding video from Vimeo on a site we are working on and wanted to change the behavior of playing a video so that it would go back to the first frame after the video was done playing, rather than staying on the last frame. Since it ended up being harder than expected and finding good documentation online was difficult, I thought I’d share my solution here. Continue reading ‘Controlling embedded Vimeo video using javascript’

How to install rails on CentOS 5.4 x64

1. Download ruby source

wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
tar -zxvf ruby-1.8.7.tar.gz

2. Install dependencies

sudo yum install gcc
sudo yum install gcc-c++
sudo yum install zlib-devel
sudo yum install openssl-devel
sudo yum install readline-devel
sudo yum install sqlite3-devel

3. Build ruby from source

cd ruby-1.8.7
./configure --with-openssl-dir=/usr/lib64/openssl
make
sudo make install

4. Download rubygems source

wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar -zxvf rubygems-1.3.6.tgz
cd rubygems-1.3.6
sudo ruby setup.rb

5. Install gems

sudo gem install rake
sudo gem install rails
sudo gem install sqlite3-ruby (optional)

Story Mapper is Release Planning for Pivotal Tracker

We’re proud to announce the release of Story Mapper, a project we have been working on at Carbon Five to support an Agile project planning technique called story mapping.

We use Pivotal Tracker to manage our feature backlog and the day-to-day activities of tracking a feature from estimation through delivery and acceptance. However, we find it easy to lose the big picture in the detail-oriented view Tracker provides.

Story Mapper uses your project data from Tracker to provide a higher level view geared toward release and milestone planning. This view is based on Jeff Patton’s story mapping techniques and provides the ability to see how the different components of your project will evolve across successive milestone.

Story Mapper Screenshot

All you need in order to use Story Mapper is a Tracker project with a backlog of stories and a subset of labels that represent user activities or components of your system. If you have a large project and have not been using labels in this way, you may have some work to do in Story Mapper before you have a story map that makes sense.

Try it out, let us know what you think, and tell us how to make it better. Comment here so others can see your thoughts or by contacting us directly.

Ada Freezes Monsters with Snowballs (and Canvas)

Alex sent me an email Saturday morning with this really cute Canvas game he wrote with his daughter Ada. His timing was really great since I am on a panel at SXSW Tuesday called Is Canvas the End of Flash? He explains it all below…

I was telling Ada how video games are made one night, and she ask me if I could make a game. I said yes, we could make one together, and she bugged me all night to get started. I told her to start by designing a game on paper. She drew something that looks surprisingly like pacman (given that she’s never played the game), but she told me the dots were snowballs and that you could throw them at the monsters and use them to build walls. I started programming it as an SPA using canvas. She came up with all the rules, with some suggestions from me.

It may be that I’ve just been doing a lot of JS lately, but building a game like this in JavaScript felt really comfortable and extremely rapid. I had a basic version working with about 200 lines of code, but the details have tripled that. I went through a couple of major refactors, neither of which were troublesome in textmate.

The game is completely un-optimized, but it runs fast enough on my macbook. I know lots of ways to speed it up if I had to. It’s a little rough in a lot of areas, but it’s getting close enough to present.

Play Snowballs

Play Snowballs

Instructions

Load in Firefox or Safari. The arrow keys move your character, the spacebar launches snowballs (which you have to collect). Hit a monster 5 times to freeze it, then touch it to collect it.

Testing iPhone View Controllers

I have been writing tests around my iPhone apps’ view controllers in order to follow the same TDD practices we use in other environments. Writing tests first has changed the way I structure my code in a couple of ways which I think offer immediate and emergent benefits for my applications. Most of an iPhone application’s business logic is implemented in its view controllers. Testing those controllers is therefore a priority if I want to have a well tested application.
Below are some examples of the sort of tests I have written for my view controllers using GTM, Hamcrest, and OCMock (our iPhone Unit Testing Toolkit). Hopefully this can serve as a starting point for the tests you could be writing for your own projects.
Continue reading ‘Testing iPhone View Controllers’

Javascript Testing Talk in Oakland

Next week at EBig Jonah and I are wrapping up our world tour of talking about Javascript testing. March 17th in Oakland: ”Recent evolutions in Javascript testing frameworks now allow creating test suites, test-driving development, and running tests on a continuous integration server. This allows us to support more complex Javascript, have confidence in the implementation, and push more of the logic from the server into the browser, reducing the load on the server.” The focus of the talk is walking through a suite of tests we build for a real-world example.

For those of you who caught it last week at the SDForum, here are the links people requested:

To sign up for next Wednesday, go to the EBig site.