WordCamp Nashville 2016: The promise and peril of Agile and Lean practices

Presenting “the promise and peril of Agile and Lean practices” at WordCamp Nashville 2016
I’ve spoken at WordCamp Nashville every year since it started in 2012, and it was an honor to be invited back again this year. In preparing my talk, I wanted to share my experiences, both good and bad, in bringing Lean and Agile practices to different organizations over the years. Adopting these practices can lead to enormous benefits in quality, customer satisfaction, and developer happiness. But they can also involve very painful transitions, they can go very wrong if not done carefully, and some practices don’t translate well to the world of consulting and freelance work. The challenge was to present all these considerations, in 40 minutes, which doesn’t really allow time to explain a whole lot about actual Agile and Lean practices! My goal was to explain just enough about Agile and Lean – what they have in common and how they are different – and give some real life examples of what to expect if you try them in various kinds of work environments. The audience had great questions for me and I got really good feedback after the talk, so it went well. Here are my slides (they’re also embedded below).
As always, the after-party was great. It was at The Family Wash this year, and I saw a lot of familiar faces. Nashville is starting to feel like a 2nd home.
Something to think about @mtoppa #wcnash pic.twitter.com/fs0fFyFZg0
— WordCamp Nashville (@WordCampNash) September 17, 2016
What makes a job enjoyable? Getting rewards for efforts, which doesn't mean just getting paid it means getting respect @mtoppa #wcnash
— WordCamp Nashville (@WordCampNash) September 17, 2016
"The beginning of a project is a dangerous time to make promises." –@mtoppa #wcnash #coneofuncertainty
— Christina Blust (@christinablust) September 17, 2016
Multiple projects and multitasking can end up making you spend 20% longer on the different projects you are working on @mtoppa #wcnash
— WordCamp Nashville (@WordCampNash) September 17, 2016
Key to success in both lean and agile practices: inspect and adapt! @mtoppa #wcnash
— WordCamp Nashville (@WordCampNash) September 17, 2016
Getting set up for the promise and peril of Agile and Lean practices session @mtoppa #wcnash pic.twitter.com/370jtISio3
— WordCamp Nashville (@WordCampNash) September 17, 2016
I'm up next at #wcnash! Come learn how to decide if Agile and Lean practices can help your WordPress business pic.twitter.com/roQUZLPpK3
— Michael Toppa (@mtoppa) September 17, 2016
Can't miss this one. If you are at #wcnash this is a talk you'll want to attend. https://t.co/9NeIZUeAQC
— UpThemes (@upthemes) September 17, 2016
Here are my slides:
There were a bunch of excellent talks this year. I especially enjoyed these two:
Great #wcnash keynote by @Zengy with tips on being a successful WP entrepreneur pic.twitter.com/G88EDvKj9b
— Michael Toppa (@mtoppa) September 17, 2016
Great idea from @Zengy: at a group dinner, everyone gives up their phones. First to reach for theirs pays the bill. pic.twitter.com/dwNUhobT7p
— Michael Toppa (@mtoppa) September 17, 2016
Great tips on WordPress freelancing from @nathaningram at #wcnash pic.twitter.com/3iMUlaIrKo
— Michael Toppa (@mtoppa) September 17, 2016
I also had time to do some exploring around Nashville. Since it wasn’t my first time there, I skipped most of the touristy stuff. I spent most of my time in the Germantown neighborhood, where the WordCamp was held this year. Here are some pictures:
- The Bicentennial Capitol Mall
- The Bicentennial Capitol Mall
- The Johnny Cash Museum
- Broadway
- The Family Wash
Mike’s Talk on Dependency Injection for PHP

Mike Toppa speaking at Boston PHP
Yesterday at the Boston PHP meetup I gave a talk on Dependency Injection for PHP. It went really well and I got a bunch of great questions at the end.
Our speaker Mike Toppa will first review some key concepts for object oriented programming in PHP. He’ll then discuss the benefits of writing small classes, how to do class auto-loading, and explain how to get your objects working together through the use of an injection container. He’ll also cover more advanced techniques for managing multiple object dependencies, dynamic dependencies, and dependencies within dependencies.
For a preview of the talk, here’s a short interview I did with Matt Murphy, who is one of the Boston PHP organizers, and my slides are below the video.
“This program has performed an illegal operation” – Why are error messages so bad?
Last week Thomas Fuchs wrote an excellent post on how to write a great error message. He shows plenty of examples of all-to-common terrible error messages, and has solid advice on how to do it better.
For me this sparked the question, why has the software industry been so bad at this, and for so long? When I was in grad school, I made money on the side teaching people (mostly middle-aged) how to use their home computers. When I went to visit one of my clients, she was visibly shaken as I walked in the door. She told me she just got a message saying she had performed an “illegal operation.” She was genuinely concerned that it might have been automatically reported to the police. I had to explain to her that “illegal” had a different meaning to programmers, and it had nothing to do with criminality.

As someone who’s been responsible for my own share of unhandled errors and poor error messages over the years, I’ll share my thoughts on why this happens, and what to do about it:
-
Errors lost by the wayside of the “happy path:” developers, project managers, and most everyone involved in developing an application are focused on how to deliver the features they want their customers to use. The desired series of actions we want users to take is the “happy path” through the application. In developing and testing, we get tunnel vision, tending to use the application the same way, over and over again. But actual users will do all kinds of things with an application that we developers never dreamed of, and unintentionally will come up with novel ways to break it.
Many years ago I had a formative experience as a junior developer: I was invited to a professional user testing lab, complete with one-way glass for watching participants. After months of working on the application being tested, and clicking through the same screen hundreds of times myself without incident, I was astonished to see a user completely crash our application in less than 60 seconds.
Also, we developers often make all kinds of implicit assumptions about the environment of the application: database connections, API dependencies, browser versions, etc. We often don’t provide good error handling for when dependencies in the environment fail or don’t behave as we expect.
-
Lack of cross-functional teams: many organizations have tried to solve these problems by having dedicated testing teams. These teams are often great at finding errors, but then their reports are “thrown over the wall” back to the developers. The developers themselves may be divided into a database team, a back-end coding team, UI team, etc. A UI developer may be asked to add an error message, but this developer may be dealing with results from code created by a back-end developer that returns only “true” or “false,” indicating only whether the function worked out not. This leaves them with little useful information to communicate back to the user. A situation like this may very well be the story behind this Windows 10 error:

- No recognition of business value: this is the key issue. The quality of error handling will only be as robust as the weight its given in the cost/benefit analysis that goes into the prioritization of work. For many projects I’ve seen, error handling often doesn’t come up as a point of discussion in the planning process, as an area where time and money needs to be dedicated. Which browser versions need to be supported? How often and what kinds of user testing should we do? How should we handle an API outage? Questions like these often go unraised (now that I’m old and wise, I always make sure to raise them 😉 ).
Error handling is an especially important issue for a consulting company like ours. Nothing will shake a client’s confidence in your ability more than seeing the application you’re developing for them crash with a cryptic and unhelpful error message. How do we address this, and how do we do it without driving the budget for a project through the roof?
- Have Agile, cross-functional development teams: this removes the organizational barriers that prevent testers, developers and UI designers from working closely together. It allows their focus to go where it should: to the needs of the user, instead of being driven by the implicit incentives of organizational divisions. This approach doesn’t add cost, and may even decrease it.
- Have a standard design pattern for handling errors: dealing with ugly error conditions only when your boss notices or a customer complains is a recipe for inconsistent results and messy, hard to maintain code. A better approach is for the team to develop a standard for how error conditions will be reported up the stack (e.g. from the database, to the business code, to the UI). This facilitates making error handling a routine and consistent aspect of the development process. Fuchs also provides excellent advice on the front-end aspect of this: having good and consistent UI elements for displaying error messages, and using clear, human-readable language.
- Have standards for testing: you should have an automated test suite that confirms your error handling continues to function as expected as the application code evolves and changes (as it would be prohibitively expensive to manually and repeatedly test all the edge cases in the application). Usability testing with real customers is also important, but when and how to do this depends on several factors, such as whether the application is intended for use by the public.
Rails and WordPress, BostonRB and WordCamp Boston
I recently moved from Philadelphia to Boston, and my house is currently overflowing with half-unpacked boxes. Despite all the craziness of moving (or perhaps because of it…), I was a speaker at WordCamp Boston this past weekend, and also gave a lightning talk at the BostonRB Ruby meetup last week.
If you’ve followed our blog so far, you may have noticed we talk about both WordPress and Ruby on Rails. While it’s unusual to see a consultancy that develops in these two very different platforms, supporting both gives us the flexibility to choose the platform that best suits our clients’ needs. For applications that primarily need CMS (content management system) functionality, WordPress is a natural fit, while Rails is best suited for highly customized application development. Well known sites with a focus on content, such as The New York Times, CNN, Mashable and many others use WordPress. Twitter was originally developed on Rails, and sites such as Groupon, Bloomberg, Airbnb, and many others also use Rails.
Many consultancies will shoehorn the development of your web application into the one platform they happen to know, even if it’s not a good fit for your needs (this may not be a conscious decision on their part – if they only know one platform well, they may not have the perspective to know whether another platform might be a better choice). For example, WordPress’ Custom Post Types are great for situations where your data can be well represented in the relational database table structure on which WordPress is built, and using them can speed along the development process. But if they aren’t a good fit, then you will likely encounter poor performance when your traffic increases, or have to do custom database development work, which is a breeze in Rails but is awkward and inefficient to do in WordPress.
We also do extensive work in javascript. The ROI calculators we’ve created for Hobson & Co are written entirely in object-oriented javascript, using jQuery and HighCharts (javascript frameworks such as AngularJS or ember.js would have been overkill for this kind of project). Our latest calculator for Greenway Health is a good example.
Regardless of the platform, we take an Agile approach to our work. On the technical side, this means a relentless focus on quality, using object oriented design and test driven development (TDD). My lightning talk at the BostonRB meetup focused on an aspect of this: following the Law of Demeter in Rails application development. Check out my slides.
My WordCamp Boston talk was about the business side of the Agile development process, with a focus on how to build professional, long term partnerships with your clients. I’ve given this talk a few times now, and it’s been a lot of fun to have the opportunity to refine it and keep improving it (I also gave it at the Philadelphia Emerging Technologies for the Enterprise conference and WordCamp Nashville). The video is above, and you can check out my slides.
Here are some tweets from people at each of my talks:
@mtoppa @bostonrb Great talk! I've made egregious violations of the Law of Demeter before that I'm now eager to try and fix (sans #try 🙂
— Rahul Horé (@TheAllBox) July 15, 2015
@mtoppa on Law of Demeter pic.twitter.com/lyS7RrgWEK
— Boston Ruby Group (@bostonrb) July 14, 2015
Eager to explore the Agile Contracts Primer and revolutionize the way we run our projects. Thanks, @mtoppa! @WordCampBoston…
— WP SuperService (@WPSuperService) July 18, 2015
Good talk by @mtoppa making the argument for agile development with time & materials contracts @wordcampboston #wcbos
— Andy Gagnon (@andygagnon) July 18, 2015
Great takeaway from @mtoppa's session on Agile contracts at @WordCampBoston #wcbos pic.twitter.com/UG3VywnnP7
— Amanda Giles (@AmandaGilesNH) July 18, 2015
agree: Having to give an estimate when you know least about the client places all the risk on you – by @mtoppa #wpbos pic.twitter.com/OtQCvJ9jOu
— Daria Mark (@dariamark) July 18, 2015
Agile consulting @mtoppa agile focuses on agreement about collaboration rather than deliverables and deadlines constant feedback = less risk
— Pat Carroll (@PatC508) July 18, 2015
Loving the agile contracting idea presented by @mtoppa at#wcbos. Turns out I've been doing this all along without knowing it's a framework.
— Daria Mark (@dariamark) July 18, 2015
Armchair WordCampers: Plethora of WP knowledge in @wordcampboston w/ @bobbiec @williampd @mtoppa @scottwyden @professor @michaeldcain #wcbos
— David Bisset (@dimensionmedia) July 18, 2015
Taming Cybersource: the Cybersourcery Testing gem for Rails
Cybersource is a subsidiary of Visa, and is one of the largest providers of online credit card payment services. As any developer who has worked with Cybersource’s Silent Order POST service can tell you, it’s not the easiest service to work with. It provides a great deal of flexibility, but that comes at the cost of you having to write a good deal of your own code in order to use it. Setting up automated testing is also extremely difficult.
Last year I completed a Cybersource project for the University of Pennsylvania, and that project provided the inspiration for 2 Ruby gems, to simplify working with Cybersource: Cybersourcery, and Cybersourcery Testing. There’s also a demo project, so you can see an example of how to use them in a Rails project.
The readme files provide detailed documentation of their features and how to use them. So rather than repeat that information here, let’s take a look at why these gems are necessary in the first place. There’s a lot to cover, so I’ll discuss the testing gem in this post, and Cybersourcery in the next one.
Writing tests that can be repeated and automated provides benefits such as improving the design of your code (if you’re doing test-driven development) and catching regressions early (when changes to your code inadvertently introduce bugs). This can be challenging with 3rd party services, as we don’t want to call those services every time we run our test suite. VCR is a gem that helps with this problem: by recording requests and responses, it allows you to play back those responses in your tests, rather than making real-life calls in every test run.
Unfortunately, Cybersource makes this kind of testing especially difficult. There are 3 different servers involved in processing a transaction through Cybersource, and the key difficulty is that one of them is at a fixed URL that is not easy to swap out in the test environment. Cybersource calls this URL the “Customer Response Page.” It is saved on the Cybersource server as part of the merchant profile, so it cannot be updated dynamically. If you are a developer attempting to test Cybersource transactions, this diagram illustrates the scenario:
+ + +
| Developer's | Cybersource | "Customer Response"
User's browser | test server | test server | server
+------------------+--------------------+-------------------+---------------------+
Request credit
card form
+
|
+-----------> Respond with
credit card form
+
|
Submit form <-------------+
+
|
+------------------------------> Process and log
transaction;
generate "Customer
Response" form
+
|
Hidden "Customer <------------------------------+
Response" form is
automatically
submitted by JS
+
|
+---------------------------------------------------> Process submission;
generate response page
+
|
Display <-------------------------------------------------------+
response page
So, what the heck is going on here? The first few steps makes sense, but then when you submit the credit card payment form to Cybersource, things start to seem strange. What happens is that Cybersource sends a seemingly blank page to your browser. But it only appears for a second, as it contains a hidden form, which is immediately and automatically submitted to the “Customer Response Page.” This is the page where users are sent when transactions are complete. You provide the URL for this page when setting up your merchant profile in the Cybersource Business Center. This is a page you create and host yourself – you can use it to show users a “thank you” message, log information about the transaction, etc.
So why doesn’t Cybersource simply redirect to your response page after processing the transaction? Why this peculiar reliance on a hidden form? The reason is that conventional redirects use the GET method, which is meant for idempotent requests. An idempotent request is one that can be safely repeated, which definitely does not apply to a credit card transaction, or logging it. So Cybersource’s forms appropriately use the POST method, which is meant for non-idempotent requests. This is why, if you submit a POST form, and then click “back” in your browser, and try to submit the form again, your browser will warn you, and ask if you really want to submit the form again.
In the case of Cybersource, this is a thorny problem. Trying to do a POST redirect has issues, for these reasons. A redirect isn’t really appropriate anyway: the Cybersource server does some work when it receives the user’s credit card submission (charging the user’s card), and then your response page may also do some work when it receives the hidden form submission (such as logging details of the transaction). These are distinct activities, so – while having two forms may seem odd – it’s a viable solution. Cybersource came up with this before asynchronous requests were a common practice (which is a big part of the reason it’s harder to work with than newer services like Stripe).
The Cybersourcery Testing gem makes it possible to set up automated, repeatable tests in this complex environment. It provides a “translating proxy” server, running on Sinatra, which has middleware to manage the requests and responses between the 3 servers involved in Cybersource transactions. Middleware is especially useful in this situation, as it allows us to modify requests and responses before they reach the application’s code.
In order to explain how the gem works, let’s first take a look at its dependencies:
- The Rack Proxy gem is a Rack app which allows you to rewrite requests and responses. It’s very open-ended and is designed to be subclassed, so you can implement rewrite rules appropriate to your project.
- The Rack::Translating Proxy gem inherits from the Rack Proxy gem, and provides an implementation that’s suitable for the Cybersource use case. We need to provide it with a
target_hostURL, which indicates where the proxy server should redirect requests. We also need to provide it with arequest_mapping, which indicates what strings to find in the requests and responses, and what to change them to. It uses a hash format, so that on requests, the keys are translated to the values, and on responses, the values are translated to the keys.
The Cybersourcery Testing gem inherits from the Rack::Translating Proxy gem, and implements the methods described above. Specifically:
For the target_host, we provide the URL of the Cybersource testing site. So if the proxy server is running at http://localhost:5556, and the target_host is https://testsecureacceptance.cybersource.com, requests to http://localhost:5556/some/path will be redirected to https://testsecureacceptance.cybersource.com/some/path. The gem also hooks into VCR, allowing us to record transactions that pass through the proxy server, for use in subsequent automated tests.
This is a simplified version of the request_mapping implementation, using hard-coded values for clarity:
def request_mapping
{
# local test server Cybersource's "Customer Response Page" URL
'http://localhost:1234/confirm' => 'http://your-site.com/confirm'
}
end
A Cybersource transaction in this environment looks like this:
- The credit card form is submitted and the proxy server receives it.
- Based on the
target_host, the proxy server passes the request through to the actual Cybersource test server. If the transaction was previously recorded with VCR, VCR will instead play back the recording of the transaction. - Cybersource (or VCR) sends a hidden form back to the browser, which is automatically submitted via JavaScript to the “Customer Response Page” URL. The middleware’s
request_mappingwill rewrite the URL of the form’s action, causing the form to instead submit to the local test server.
The upshot is, the gem handles all this complexity so you don’t have to. By following the setup steps in the readme, you can get a robust test environment setup for Cybersource without breaking a sweat. The Cybersourcery Testing gem offers other features as well, such as reporting of undocumented Cybersource errors. Check out the README to learn more!
Discontinuing WordPress plugin support
I posted a message in the WordPress.org support forums a couple months ago saying that I was temporarily discontinuing support for my Shashin plugin. I was single-parenting for over a month, and getting ready to move to Japan.
Unfortunately, I now need to say that I’m discontinuing development and support of my plugins for the foreseeable future. I’m living in Japan until the end of the year, working full time, studying Japanese, and enjoying the unique experience of being here with my family.
My work over the last couple years has involved an increasing amount of time with Ruby on Rails, and currently involves little WordPress work. Also, I never developed a business model for my plugins, which means I’ve spent many hundreds of hours over the years developing and supporting them for free. That’s not something I can continue doing.
I’ll keep the current versions available at wordpress.org and they are also available on github, if anyone wants to fork them and continue their development.
The WordPress community has been a fantastic place for me. Because of WordPress I’ve improved my technical skills, made friends, advanced my career, and had the privilege of giving 7 WordCamp presentations over the last few years. So this was not an easy decision. I hope that in the future I’ll have opportunities to contribute to the WordPress community again.
My new job at PromptWorks, and thoughts on developer interviews
I’m excited to officially start my new job at PromptWorks next week. The slogan on their website says it all: “we are craftsmen.” If you’ve seen my Clean Code talk, you know what software craftsmanship means to me. An important aspect of it is to keep improving your skills. I’ve been working at PromptWorks on a contract basis for the past several weeks, and I can tell already that I will learn a lot from my new co-workers. They place a strong emphasis on Agile practices, quality, and working at a sustainable pace. I’ve seen enough so far to know that this isn’t just talk, and that their focus is on building long-term relationships with their clients and their staff. They’re also very involved in the local tech community. Among other things, one of them oversees the philly.rb Ruby meetup group.
They’re also supportive of me working remotely while my family and I are in Japan from July – December this year[/p2p], which is very generous of them (especially for a new hire).
I interviewed with several different companies recently, and for me, the most dreadful part of interviewing is being asked to do live coding. This is sometimes done in the form of a pop-quiz, where I’m presented with some out of the ordinary coding problem, and I’m expected to write code on a whiteboard, or hack together a quick script to solve it. Other times it’s a surprise mini-project I’m expected to do on the spot. Even though I’ve been coding for close to 20 years, and I’ve had plenty of experience doing quality work faster than expected, I’m terrible at these coding exercises.
The issue for me is that they are nothing like doing real work. The only times in my life I’ve had to think up code on the spot for a surprise problem and write it on a whiteboard is in interviews. And in a real job I don’t think I’ve ever had a project dropped on me out of the blue and been asked to code up a solution in an hour or two, with severe consequences if I make a mistake or try to talk to anyone about it.
My thinking process is largely driven by understanding context (the context of the code, and the context of the business problem), and these coding exercises are usually devoid of context. I’ve also trained myself over the years to not just hack things together. I was told in one interview that, sorry, you won’t have time to write tests. Telling me to take my best practices and throw them out the window in an interview strikes me as completely backwards.
How to best interview programmers is a hotly debated topic. Some very respected people, like Joel Spolsky, swear by the whiteboard-coding approach. Others say you’re doing it wrong:
A candidate would come in, usually all dressed up in their best suit and tie, we’d sit down and have a talk. That talk was essentially like an oral exam in college. I would ask them to code algorithms for all the usual cute little CS problems and I’d get answers with wildly varying qualities. Some were shooting their pre-canned answers at me with unreasonable speed. They were prepared for exactly this kind of interview. Others would break under the “pressure”, barely able to continue the interview…
But how did the candidates we selected measure up? The truth is, we got very mixed results. Many of them were average, very few were excellent, and some were absolutely awful fits for their positions. So at best, the interview had no actual effect on the quality of people we were selecting, and I’m afraid that at worst, we may have skewed the scale in favor of the bad ones…
So what should a developer job interview look like then? Simple: eliminate the exam part of the interview altogether. Instead, ask a few open-ended questions that invite your candidates to elaborate about their programming work.
– What’s the last project you worked on at your former employer?
– Tell me about some of your favorite projects.
– What projects are you working on in your spare time?
– What online hacker communities do you participate in?
– Tell me about some (programming/technical) issues that you feel passionately about.
When I became Director of the web team at the Penn School of Medicine, I led an overhaul of how we conducted our interviews, and we adopted questions similar to these. We focused on behavior-description questions, which are actually much more revealing than you might think, if you haven’t tried them before. We also asked for interviewees to bring in a sample of their code, and we’d have them talk us through it in the interview, and answer any questions we had about it. This was an excellent and reliable way to get an understanding of their experience level and getting past shyness and nervousness. For anyone who’s done half-way decent work, they always become animated when showing off work they’re proud of.
For my interview with PromptWorks, they gave me a small project to do on my own time, to turn in a few days later, which is also a good approach. Apart from that, they also had me do a pair programming exercise, which I was worried about at first, but the focus was on getting an understanding of my thought process and overall problem-solving approach, as opposed to how fast I could tear through it, or trying to hit me with “gotcha” questions.
And they hired me, so I must have gotten something right 😉
WordCamp Lancaster

Giving my talk at WordCamp Lancaster
I’ve lived in the Philly area more than 10 years, and yesterday was my first time visiting Lancaster, because I finally had a good reason to go! I gave a presentation at WordCamp Lancaster. It was the first WordCamp in Lancaster, and had a single track, with web accessibility as the theme:
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.
— Tim Berners-Lee, W3C Director and inventor of the World Wide Web
There were a bunch of great talks. I especially enjoyed Aaron Jorbin’s and David Kennedy’s:
Wow, really impressive set of 5 lightning talks in a row by @aaronjorbin, with topics selected by the audience #WCLanc
— Michael Toppa (@mtoppa) March 1, 2014
Great web accessibility talk by @DavidAKennedy at #WCLanc. I’m glad he spoke before me – my talk will make a good sequel to his
— Michael Toppa (@mtoppa) March 1, 2014
My talk focused on the language aspects of accessibility, which entailed a discussion of internationalization, localization, and character sets. The title alone was a mouthful: “A11Y? I18N? L10N? UTF8? WTF? Understanding the connections between accessibility, internationalization, localization, and character sets” (slides are below). I managed to make people laugh while discussing character encoding, so I must have done something right.
I learned something about language attributes today at #WPLanc! Very cool. Thanks, @mtoppa!
— Bryan Daniel Peach (@bryanpeach) March 1, 2014
Hey, there's @mtoppa with a mic on his shirt and a podium in front of him. #WPLanc
— Liam Dempsey (@liamdempsey) March 1, 2014
Accessibility on the web with @mtoppa here at #WCLanc pic.twitter.com/jUNrhTtnUf
— Azrael Group (@AzraelGroup) March 1, 2014
I also enjoyed having the opportunity to meet and talk with George Stephanis
(@daljo628S), who organized the WordCamp, Scott González (@scott_gonzalez) the jQuery UI project lead, and catch up with Jason Coleman (@jason_coleman), Liam Dempsey (@liamdempsey), and Eric (@ericandrewlewis).
WordCamp Lancaster also had one of the nicest designs for a WordCamp t-shirt that I’ve seen.
Here are my slides (if you view them on slidehsare.net you can see my notes as well), and hopefully the video will be up on WordPress.tv soon.
Get some more coal, it’s time to fire up the old blog engine
I haven’t been blogging for ages – it’s time to fix that. Let’s start with a recap of last night.
The monthly philly.rb meetup at the Comcast Center: how good were the presentations? They were just as good as the view from our room on the 45th floor:

View from the 45th floor of the Comcast Center, where we had the philly.rb monthly meetup
I got a lot out of Nate Olds’ talk, “Refactoring with a View.” A large part of my career has been spent wrestling with big, old, sprawling, messy codebases, so Nate’s real-life walk-through of his strategies for dealing with such challenges was very informative. Check out the February meetup page for more information.
Afterwards, a group of us went to Ladder 15 for beer, where we met up with Maria. She stoically suffered through several minutes of extremely nerdy conversion, before she and I headed to the Boot & Saddle, for a rare evening out without the boys, to see one of Maria’s favorite bands, Cibo Matto. It was a sold out show, and we ended up stuck near the back, but it was still a good time. I tried to take a couple videos, but they didn’t come out. A good introduction to their utterly goofy side is the song Sci Fi Wasabi (I’m Miho Hatori, straight out of purgatory), and their split-screen video for Sugar Water, with one side portraying the visual story in reverse, is quite clever (the ending is in the middle).
I’m presenting at the WordPress ‘Burbs meetup next Monday on Kanban. And on March 1 I’m presenting at WordCamp Lancaster: A11Y? I18N? L10N? UTF8? WTF? Understanding the connections between accessibility, internationalization, localization, and character sets.
Data IO 2013 conference – my notes
These are my notes from today’s Data IO conference
Next Generation Search with Lucene and Solr 4
Lucene 4
- near real time indexes (used by Twitter for 500 million new tweets/day)
- can plug in your own scoring model
- flexible index formats
- much improved memory use, regexs are faster, etc
- new autocomplete suggester
Solr (Lucene server – managed by the same team as Lucene)
- if someone chooses the red shirt, do we have large in stock (pivot faceting – anticipating the next question)
- improved geo-spatial (all mexican restaurants within 5 blocks, plus function queries to rank them)
- dstributed/sharded indexing and search
- solr as nosql data store
Uses
- recommendation engine (LinkedIn uses Lucene for people recommendations). Recommend content to people who exhibit certain behaviors
- avoid flight delays – one facet – flights out of airports, pivot to destination airports (Ohare to Newark) – origin, destination, carrier, flight, delay times – look at trends over time. Solr has a stats package – you can get averages, max, min, etc
- for local search, how to show only shops that are open? (Yelp also uses Lucene).
You added Zookeeper to your stack, now what?
Old way of system management: active and backup servers, frantically switch to backup when active fails
Common challenges with big distributed system
- Outages
- Coordination
- Operational complexity
A common deficiency: sequential consistency (handling everything in the “right” order, when data is coming from multiple places)
- Zookeeper is a distributed, consistent data store – strictly ordered access
- Can keep running as long as only a minority of member nodes are lost (usually want to run 3 or 5 nodes)
- all data stored in memory (50,000 ops/sec)
- optimized for read performance (not write); also not optimized for giant pieces of data
- it’s a coordination service
- A leader node is elected by all the members. Leader manages writes (proposes it to followers, they acknowledge it, then it is assigned and written)
- nodes can have data, and can have child nodes
- has “ephemeral nodes” – created when a client connects, destroyed when client disconnects (these do not ever have child nodes)
- watches: clients can be kept informed about data state changes (just lets you know it has changed, but not what it’s changed to – you need to request it again if you want to know the current value)
Zookeeper open-source equivalent of Chubby
- good for discovery services (like DNS)
- Use cases: Storm and HBase, Redis – http://www.slideshare.net/ryanlecompte/handling-redis-failover-with-zookeeper
- Distributed locking
Beware – Zookeeper can be your single point of failure if you don’t have appropriate monitoring and fallbacks in place
Graph Database Use Cases
- nodes connected by relationships
- no tables or rows
- nodes are property containers
- cypher is neo4j’s query language
- http://github.com/maxdemarzi/neo_graph_search
- http://maxdemarzi.com/2012/10/18/matches-are-the-new-hotness
- also used for content management, access control, insurance risk analysis, geo routing, asset management, bioinformatics
- “what drug will bind to protein X and not interact with drug Y?”
- http://neovisualsearch.maxdemarzi.com
- performance factors: graph size (doesn’t matter), query degree (this is what matters – how many hops), graph density. RDBMS doesn’t scale well with data size, neo4j does
- the more connected the data, the better it fits a graph db,
- NoSQL – 4 categories – key value, column family, document db, graph db
- popular combo is, e.g. mongo for data, neo4j for searching it (then hydrate the search results from mongo)
- optimized for graph traversal, not, e.g., aggregate analysis of all the nodes
- top reasons to use it: problems with RDBMS join performance, evolving data set, domain shape is naturally a graph, open-ended business requirements
- Gartner’s 5 graphs: interest, intent. mobile, payment
Parquet
I didn’t take notes during those one (a drop of water from the bottom of my glass got under my Mac trackpad, and my mouse was going crazy for a while)
All the data and still not enough?
- No matter how much data you have, it’s never enough or never seems like the right type
- Predictive modeling – will someone default on a loan? Look at data for people who’ve had loans, and who defaulted and didn’t. Use data to make a predictive risk model
- IID = independent and identically distributed
Example IBM sales force optimization
- Can we predict where the opportunities are – which companies have growing IT budgets?
- Couldn’t know what was most important – where were these target companies spending their IT budget (not disclosed)
- Companies who are spending with us are probably representative of similar sized companies in the same market – use the “nearest neighbor” technique
- Compared model prediction to expert salesmen’s opinions, except for 15% of them, where the expert’s put the chances at zero. Why the difference? The model mis-identified some of the companies (no good way to cross-reference millions of internal customer records with independent sources)
Siemens – compter aided detection of breast cancer
- patient IDs ended up predicting odds for cancer. It turns out the ID was a proxy for location (whether they were at a treatment facility or a screening facility)
Display ad auctions – how do we decide who to target?
- multi-armed bandit – exploration vs exploitation
- what do we know? urls you’ve visited
- for something like advertising luxury cars, very few positive examples (people don’t buy them online)
- There is no correlation between ad clicks and purchases
- Better to look at – did the person eventually end up at the company’s home page at some point after seeing the ad?
- target people who the ad can actually influence (i.e. not people who already bought the product, or never will)
- but there’s no way to get data for that
- Counterfactuals – you can’t both show and not show someone and ad, and observe subsequent behavior. You have to either show it or not show it
- Ideally, build a predictive model for those who see the ad, and another model for those who don’t
- But the industry doesn’t do that – it’s all about conversion rate
Advertising fraud
- Malware on sites generating http requests
- Very difficult for ad auctions systems to detect
- Detect by looking at traffic between sites. Foe example, malware site womenshealthbase generates massive traffic to lots of other sites, not about womens health
- they make money by visiting a site with a real ad auction system. Then bid prices go up because of your traffic, which drives up ad revenue traffic on womenshealthbase
- Auction systems now put visitors from these sites in a penalty box, until they start displaying normal behavior again
What’s new with Apache Mahout?
- Amazon: customers who bought this item also bought this item – best known Mahout example
- Mahout implemented most of the algorithms in the Netflix recommendation contest
- In general, finds similarities between different groupings of things (clustering)
- Key features: classification, clustering, collaborative filtering
- Automatically tags questions on stack overflow
Uses
- recommend friends, products, etc
- classify content into groups
- find similar content
- find patterns in behavior
- etc – general solution to machine learning problems
[I’m leaving it most of the details about performance improvements and the roadmap for upcoming refinements – below are other interesting points]
- Often used with Hadoop, but it’s not necessary. Typically included in Hadoop distributions
- Streaming K-means – given centroids (points at the center of a cluster) determine which clusters other points belong in
- References: Mahout in Action (but a bit out of date), Taming Text http://mahout.apache.org
- Topic Modeling He wasn’t sure what the full feature set is – he’s pretty sure it doesn’t generate topic labels for you




