Skip to main content

Posts

Cryptic Facebook Message

Facebook OAuth2 is a feature I frequently integrate, but sometimes its error messages can be downright opaque. In particular I keep on forgetting to associate my Facebook account on applications where Sandbox Mode is enabled. The error message in this case is the following: Sorry, this feature isn't available right now: An error occurred while processing this request. Please try again later. This message is super cryptic, since what I usually need to do is to register my account as a tester or admin on the Facebook application page. If you get this error message here are the steps to fix it: As an application administrator, go to the OAuth2 configuration page for the application in Facebook. Add the Facebook account as an admin or tester on the "edit roles" screen. This will send an application request to that account. As the added account, accept the application request to become an admin or tester. At this point the Facebook login should work for the accou...

Integrating LESS and Maven

When working on your local workstation, running a local instance of your website is very helpful. I often create two scripts to move code from my development workspace into the local website instance. One takes the war file outputted by Maven and publishes it. The second takes all of my static content and publishes it bypassing Maven, which is much faster than building and deploying the war file. When integrating CSS preprocessors into the workflow, I need to make sure they run in both deployment scripts. Here are the requirements for running CSS preprpceasors in my build process: The preprocessors need to run as part of the Maven build so my compiled files make it into the war file. The preproceasors should be run when I deploy just the static resources to my local instance. I am going to walk through installing and integrating LESS, but the concept is similar for other tools like compression or inspections. First I need to install LESS. I am running Ubuntu, so I can simply use...

The Joy of Debugging

For a long while now, my demo transit application hasn't been picking up new articles from the web - leaving the home page looking quite stale between deployments. Earlier this week I added extra logging to capture counts of different kinds of articles, and noticed this morning that new articles were only found the first time the parsers run. After reviewing the simple logic for determining which articles are new, I noticed the cache implementation problem. I had implemented a crude cache using a hash map, but apparently forgot to write the cache expiration logic. When the parsers went to look at news listing pages, the cache was returning a stale block of content rather than fetching the new content from the internet. I was so sure I wrote that expiration logic! So things are all fixed up and I'm going to be verifying the fix over the next few days. Nothing quite beats the feeling of finding a simple explanation for a pesky bug.

Defensive System Integration

A big part of my current job is getting different systems to work together and sometimes to work in a way not entirely intended by the original authors. For example, getting a SSO server to share account data with a CRM platform, or getting any "enterprise" system to have a reasonable user interface (enterprise software is always ugly by default). One important consideration is how much I trust the system I am working to integrate: it's more work to be paranoid, but sometimes the software is  out to get you. I tend to trust popular open source libraries, such as those included in the Apache family like Lucene, Hadoop or Cassandra. Level of activity is an important indicator of a high quality open source project. I also tend to trust self-contained libraries more than external services, since many network and availability failure modes just don't apply when code runs in the same runtime as my own application logic. Conversely, I distrust closed vendor systems and ...

AWS S3 versus CloudFront Performance

Yesterday I took Amazon CloudFront for a spin. Creating the CloudFront distribution was pretty simple - the wizard process flowed nicely. I found myself relying on the help text in places, but the most surprising thing was how long it took for the distribution to become enabled. I didn't time it exactly, but I probably spent 45 minutes waiting for my new CloudFront distribution to change from "In Progress" to "Enabled" status. The performance is a bit confusing. Compared to the S3 bucket, I didn't see any improvement in performance in a few tries - in fact, the CloudFront CDN performance was worse than the S3 bucket on its own for my 217 KB image file. I decided to take a larger sample, loading the same image 30 times in Chrome and noting the timing data from the "network" tab in the developer tools. I'm located in Brooklyn, have CloudFront configured for the US/Europe with download mode configured. My S3 bucket is in the US Standard zone, w...

Second System Effect

Software engineers often stick close to successful designs used in our past. We have favorite tools and techniques that we reach for without deliberation, and the more specialized our knowledge, the more this tendency dominates approaches to software design. How do we know the difference between the best solution and the one that we're most comfortable with? In a word, the answer is experience . The second system effect postulates that the second system a designer creates will tend to be over-complex for the problem it solves, but eventually experience will help the designer to distinguish between core technique and chance detail. Many online commentaries focus on the way features accumulate as systems mature. There is merit in this view, but I think the key observation is rather that acquired experience is what allows software designers to create more elegant solutions. Different software design projects build experience in differing amounts. Imagine solving very similar probl...

AWS Summit 2013

I am officially registered for AWS Summit 2013 | NYC on April 18th. I've been using Amazon AWS in various ways for the past 3 years. Kanban Solutions, my current employer, hosts its own virtual infrastructure on VMware and serves clients who pay for "high touch" support from RackSpace and others. I didn't expect they would have much interest in letting me attend an all-day conference on Amazon AWS. Surprisingly, not only are they sending me but our director of engineering and another engineer were already planning to attend. I need to decide which breakout session to attend. They have a few options that are pretty interesting to me. The use cases session is interesting because it will cover Amazon's new operations tool OpsWorks , which allows administrators to manage the configuration of servers and resources deployed in the AWS cloud using "Chef" recipes. I think I'm going to attend their architecture session, which address how to scale applica...