upgrading pie from rails 3.0 to 3.1

Whenever I upgrade Rails, I always start with “rails new” so that I get all the new config file goodness — I want to start fresh with whatever the new defaults are and then only make the modifications that I really want in my app. Here’s the process I went through upgrading the pie “bakery” (a relative simple Rails 3.0 app) to Rails 3.1.

First I moved my old app to a new name (since I want my new Rails app to have the same name internally as the old Rails app):

mv bakery bakery30

Now I set up a new gemset, so I’m starting fresh. (My first attempt was to use my old gemset, but that showed me an old warning that I’d like to not bring forward, or at least isolate in the process of upgrading):

rvm use 1.9.2-p290
rvm gemset create rails31
rvm use 1.9.2-p290@rails31

Create the new app (specifying -T to create the app without test-unit, since I’m an RSpec fan)

rails new bakery -T
mv bakery bakery 31

Now I edit my Gemfile to include the gems I want to bring over from my old app…

cd bakery
vi Gemfile
bundle install

Then I want to re-generate rspec and cucumber config files and boilerplate

rails g rspec:install
rails g cucumber:install

ok, now I have vanilla Rails 3.1 app
I fetch my old app from github:

git clone git@github.com:blazingcloud/pie-bakery.git bakery
cd bakery

and using the power of git, I’m going to remove all the old 3.0 code, add in my 3.1 app

git rm -r *
cp -r ../bakery31/* .
git add .

Then I use gitx (a modern version like brotherbard) to look at the changes and revert any deletes that are actually app code that I want to keep, review every diff, and hope that I’m paying close enough attention to everything (really wish I could be pairing on this).

Now I set up my database and run my tests… I don’t know why “rake test” doesn’t automatically run cucumber and rspec tests like it used to. hmmm

rake db:schema:load
rake cucumber
rake spec

I realize that I missed a couple of diffs, rinse, repeat… when all is green I’m done. Whew.

I copy in my old .git/config so I pull in my remote heroku repo config (which I’ve updated to cedar stack)

cp ../bakery30/.git/config .git/config

and run rails

Posted in general | 1 Comment

mobile payments hidden costs

In the so-called 3rd world, mobile payments are stimulating economic growth and individual entrepreneurship. While in the United States, we struggle to overcome the legacy of an earlier trend in mobile payments facilitated by a plastic card. New players such as Square, Verifone, and Erply are bringing us, belatedly, into the modern world.

TechCrunch reported yesterday on Square-competitor, GoPayment, a mobile credit card reader from the well-established Intuit. Perhaps the Verizon partnership to offer them in retail stores and piles of marketing with the well-known Intuit name will spur adoption. However, to understand the real value to the small business owner, we need to look past the nifty device that plugs into your mobile phone or tablet. What matters most to the small business owner is the effect on the business — what is the setup time and expense, switching costs, transaction fees, and cash flow.

As a small business owner with some recent real-world experience in getting set up to accept AmEx, I applaud this disruptive change. This spring I spent a few weeks of my life disentangling tens of thousands of dollars from a maze of holding centers and risk management departments. All the trouble came from the intermediary MerchantOne with whom we set up a merchant account. In turn MerchantOne accepted payment through FirstData, which initially held the payment. (Despite having been assured of 24 hour approval and 5 day settlement.) MerchantOne offered several types of accounts and allowed us to switch to another one but require a reversal of payment which was WITHDRAWN from OUR bank account, instead of FirstData’s and then, subsequently, held the second payment. It’s a long and sorry tale that leads me to know more about credit card processing than one would expect for a software consulting company.

Many thanks to Bill Devine, biz dev guy extraordinaire, who researched much of the info below. I thought it important to share my perspective and shed light on some of the hidden corners in the payments world for those who are new to it.

Setting up

The biggest difference between Square and its competitors is that Square doesn’t require that you set up a Merchant account. If you already accept payments, you already have a merchant account and with GoPayment you’ll need another from Intuit. For the uninitiated, a Merchant account is offered by 3rd parties as a way to accept credit card payments from multiple card companies. In reality, even if you just want to process a single payment from a single credit card company, you pretty much have to deal with these intermediaries. Typically, setting up a merchant account takes weeks, involves credit checks and verifications that you are who you say you are. When I can get an online credit card by filling out a web form, it does seem a little incongruous that allowing someone to give me money should take more than 24 hours. In adding to the setup time, there are additional costs — Merchant accounts typically have multiyear terms with setup and/or early termination fee (from Intuit, it’ll be $60 signup and $19.95/month).

Note: Square doesn’t require merchant accounts because it acts as a Internet Payment Service Provider (possible through a partnership w/ Visa) which essentially means it manages a single merchant account, and assumes all risk for all merchants. This may give Square more collective bargaining power since they are moving a lot of money under a single account (via Quora)

Aside from the merchant account nonsense, GoPayment offers a “free” reader which is only free via rebate, whereas if you buy a Square reader in the Apple Store they credit your account. If you sign up using the iPhone app, they will physically mail you one for free.

Fees

Merchant accounts also typically have their own transaction fees, but aside from that GoPayment’s rate (2.7%) is seemingly less than Square’s (2.75%). Until you take a look at the asterisks:

  • Any business, rewards, or foreign card automatically bumps that up to 3.7% + $.07 per transaction
  • If you want to accept American Express the you’ll have to apply and be placed in some bracket that can go up to 3.5%

Note: Everyone has a higher fee for manual entry of credit card numbers, which is based on credit card company policies.

Cash Flow

Merchant accounts are evil. In this day of instantaneous wire transfers, companies like MerchantOne, FirstData and even alternate payment services like PayPal, routinely hold money for 5-10 business days. I assume they make piles of money off the interest, while still charging fees on every transaction, and sometimes sign-up and termination fees as well.

Square settles payments every evening. Money is in your bank account the next day.

Posted in general | 2 Comments

gratuitous animation vs. meaningful motion

In 1996, I was working at Macromedia, when Rob Burgess took over as CEO. Shortly after he came on board, an edict came down from the top: “no more gratuitous animation.” I saw people look at each other bewildered, most employees thought that the company was all about gratuitous animation. I agreed with Rob.

Don’t get me wrong. I love delightful motion graphics that make you feel immersed in an alternate space. We’re even teaching a class on it at Blazing Cloud, since we’re starting to see what used to be called “multimedia” arrive on the web sans plugin. If you’ve got a Chrome browser, you gotta check this out.

However, I believe we can do more with motion than purely entertain. We can use motion graphics to teach, to engage, and illustrate our conclusions. Zach Gemignani describes this well as Wow vs. Ah-ha (via FlowingData). We’re seeing many great examples of motion in human interface design that conveys meaning. The iPhone uses motion to convey a sense of greater space and to maintain visual persistence when screens change state — of course, this only works because the device is fast enough that the experience doesn’t slow down to teach us what it is doing. I’m excited to see increased use of thoughtful motion graphics in web, as well as mobile applications.

Posted in general | 2 Comments

pink and princesses

Lisa Bloom is right on target with her recent article How to Talk to Little Girls. Her story of a little girl in a pink ruffled dress being presented to the guests is so reminiscent of my own experience, but the following genuine conversation was not and I wish it had been.

I so wanted to be a princess or maybe a fairy with a magic wand or a witch like Glinda the good. I loved pink and flowing dresses and sparkles and rainbows. I did not understand why people didn’t seem to take me seriously.

Why can’t we be beautiful and smart? Why can’t we be fanciful and imaginative and serious? The boys could be rough and tumble and still have real grown-up conversation sometimes. Cooking, baking and cleaning were treated as serious stuff.

On a very rare occasion, I remember a conversation or two like Lisa Bloom relates. I hope we can make those more the norm for the next generation without dampening the fragile imagination of a child who still believes in magic.

Posted in general | Leave a comment

multicountry/multilingual seo

Following my recent post, a colleague (@mightyverse) found a great review of how to handle SEO for multiple languages.

SEO for international multilingual projects
View more presentations from Ani Lopez

Ani Lopez provides good reasoning that we should offer distinct pages for translations, since we want to target those pages to a specific audience. Search queries will be most commonly in someone’s native language, we want to segment our analytics by target market. English should not be treated just as English, but as American English (en-us), British English (en-gb), etc. An Australian searching for “bangers” would be looking for a tasty breakfast meat. As an American that sounds like it might be NSFW. We need to recognize that supporting multiple languages in our web sites and applications is not just a checkmark feature, but an opportunity to address a new market.

Posted in general | 1 Comment

on localization and translation

In thinking about presenting a web site in a different languages, there are a few very different concerns:

In addition, some sites might consider SEO Translation to entice people searching in their native language to find a site even if the site itself isn’t translated (but to me that seems like a cheap hack). If you really want to reach someone, you want to do so in their own language.

I’ve collected examples below of each different kind of translation and at the end I’ve listed ways to detect and retain language settings with implications for SEO and user experience.

A localized interface is when we translate the functional parts of an application, but it still may display text or play audio/video from a different language. You Tube is a good example of this. In the image below we can see that the navigational elements, YouTube tagline, and labels are in Japanese, but the videos and user-generated text are in their own language. It seems odd to me that I’ve selected Japanese as a language, but that I’m seeing mostly English language content. Perhaps YouTube is detecting my geo-location and showing me videos that are popular in my country, or perhaps YouTube just shows everyone what is globally popular which would slant the votes towards English-language (or perhaps more specifically American English language) content because of its US origins.

YouTube - Broadcast Yourself
Brand Localization Challenges

Brand Localization Challenges

A localized Brand is sometimes necessary when brands don’t translate well. If you need to re-brand for a specific market because of the meaning of some word used in your brand, it is likely that your website content will be so different as to not apply to the rest of this article.


Unique content may be the result a targeted marketing initiatives, where advertisements or introductory material in a language is written to be appropriate to the target culture. For some text-focused products, the product may actually differ in some meaningful way in the target language, such as with WordReference.com which has different dictionary features available for some languages, so the introductory text is quite different between Spanish and German pages:

Oxford German-English dictionary - WordReference.com
Diccionarios de Español, Ingles, Francés, Portugues - WordReference.com


 

User generated content like we saw in the YouTube example above is a bit different from uniquely targeted or language-specific product text. When people write comments or submit text or video contributions in their own language, that content may be appropriate to a global audience, even if it was submitted in a specific language. Most sites don’t even have a way of detecting or specifying the submission language, so they simply display all user generated content equally. It is technically possible to detect language (or at least make a good guess) based on unicode characters and dictionary lookup. For example, the language website tatoeba does this quite well. You just need to be careful to allow the user to change the language, because it is possible to guess wrong. For example, some Japanese words share Chinese characters and other languages also share sequences of characters that have different meaning. In the example below Tatoeba guessed the language correctly for my three words, but allows me to select a different language just in case:

Firefox

Providing translated content makes sense for a global brand with information that is generally useful to a global audience. For example, Adobe translates product information pages such as with http://www.adobe.com/aboutadobe/volumelicensing/ and http://www.adobe.com/la/aboutadobe/volumelicensing/ :

software discounts | Adobe Volume Licensing | home
descuentos de software | Programa multilicencia de Adobe | inicio


Technical Options

There are a few ways to detect and respond to the need to reach people who speak different languages.
We can display a specific language, based on:

1) Accepts header, cookie or query parameter. For example, Tatoeba.org respects the accepts header and redirects to http://tatoeba.org/spa/ when it is set to Spanish (es). Whereas, YouTube requires you to set your language (at the bottom of the page), then uses a query param (http://www.youtube.com/index?hl=es) which remains sticky, presumably with a cookie, to retain the language setting.

2) Country domain. (e.g. www.google.fr, de.wikipedia.org) This is most useful when content or functionality is targeted for the culture or adjusted based on geolocation. It makes it easy for users to see content for their country or culture even when they are away from home or for cultural tourists or language learners to easily experience a language and culture without leaving their home country. Google has a nice article about geotargeting (via @avdi).

3) Language encoded in the URL This can be combined with #1 above for language detection or be based solely on links.

Steve Klabnik wrote an insightful post (mostly focused on Web Services APIs) where he argued for using the accepts header for localized content. However, the implications for SEO are significant. It is appropriate to use an accepts header, query parameter or cookie when the displayed text is not significant to the content. Most localized UI text (such as “Log in” or “Submit”) is not going to be significant to a search engine or ultimately to the person choosing whether the page is the one they want.

However, if the content is translated, then it could be argued that the page is, in fact, a different resource — different content, different audience. The challenge is exacerbated by the fact that the Google indexing bot will always request our pages in English, so without a separate URL that always presents non-English content, people searching with Google based on non-English queries will be unlikely to find a page that is auto-translated based on the Accepts header or a query parameter.

I dove into this exploration while thinking about how to implement the user experience in multiple languages for Mightyverse. Currently, the site is very English-language-centric and translations of videos are always presented in English. Under the hood, we have a bunch of translations in other languages that I want to figure out how to display to people and to search engines. In some ways the site is like a dictionary site, but in other ways it’s a lot like any media site that would have multi-lingual content and localized UI. Oddly, YouTube was the only media site I could find with content in different languages — I’m sure I know of others, but its not something that is easy to search for!

My conclusion is that the technical solution should be based on the intent. Is the content for a page different enough to be considered a different resource? I personally believe that there is no such thing as a translation which is identical to the source material. Equivalent words in different languages have different connotations. Often the actual substance needs to differ based on a different audience, often in a different country, sometimes with different laws and certainly with a different culture.

Alternately, I suppose I could combine the approaches, and detect that a search bot is asking for the page and generate a document with all of the text for all languages, then display it based on the accepts header and allow the end user to change the language and remember that. I worry, though, that I would need to choose a language for the meta tag description and therefore the page summary presented by the search engine would not match the language of the search query… or maybe I shouldn’t worry and just expect the search results to be smart enough to display relevant text.

[Update: better to have different pages for different languages see multicountry/multilingual seo.]

Posted in general | 1 Comment

sf rails meetup talks about performance

I attended the SF Ruby on Rails meetup last week with two excellent talks on performance. The first talk, by Brian Doll (@briandoll) of New Relic, provided an overview of how to think about performance. In the second talk, Guillaume Luccisano (@luckwi) of justin.tv shared his experience of optimizing their Rails app.

Performance is a Feature

Brian Doll points out that performance is not just about speed, it is about cost. The cloud allows us to add thousands of servers at the click of a button, but as a web app scales to dozens of virtual instances the infrastructure costs increase significantly. We also need to think about operational efficiency. Even if it significantly improves performance to create an alternate subsystem on a different server, that system will take effort to maintain and may scale differently from the rest of the system. A homogeneous architecture that is horizontally scalable allows us scale with little or no development costs. Being able to move quickly is the biggest factor in real life scalability.

Martin Fowler’s technical debt quadrant from a 2009 article illustrates a different aspect of cost. In thinking about performance, we often make debt tradeoffs. We need to think about the scalability of the system, not just the system in its current state.

Planning for scale doesn’t imply that we should build a very scalable solution before we need it, but we also don’t want to just rewrite everything because it fell over last night.

Brian related thinking about performance to Kent Beck’s RailsConf talk about Agile, where he highlighted five attributes of agile development: Simplicity, Communication, Feedback, Respect and
Courage. “We can be courageous because of the tools we have.”

Performance Optimization in Rails

Guillaume Luccisano spent a couple of months optimizing justin.tv while also working on upgrading the site from Rails 2 to Rails 3. In case anyone wasn’t aware, Rails 3 is a little slower than Rails 2. Guillaume guesses about 20% slower.

Guillaume did an amazing job of collecting details about what made a difference in performance optimization. He has shared his slides which report his findings:

Posted in general | Leave a comment

truths about starting a company

I love Tara Hunt’s synopsis of being a startup entreprenuer (via Women 2.0)

Her whole presentation really resonates with my experience. Changing the world is tough. That’s what starting a company is all about. I got involved in a startup straight out of college. From the very early days of CoSA (The Company of Science & Art which created After Effects) where we met in living rooms through the grueling nights and weekends of building software in our office where we didn’t turn on the air conditioning in Providence’s sweltering summers and skimped on heat during New England winters. I can’t say that I loved every minute of it, but I’m proud of creating something that people still tell me changed their lives and shifted an industry. Knowing I have the potential for such things, how can I really do anything else when I have ides and see problems in the world that can be solved with software? Knowing how hard it is, understanding the sacrifices that it takes, I also know that I’m more than a little bit crazy.

Nice to feel like I’m in good company.

Complete slides below:

Posted in general | 1 Comment

trackerbot iphone experience

TrackerBot is a new iOS application that lets us access PivotalTracker — an issue/feature tracking system from Pivotal Labs. TrackerBot (just $4.95 in the App Store) works on iPad and iPhone, but I’ve just used it on my phone. A few weeks ago, I spent a week in Olympic National Park in Washington State. Knowing that I was traveling to a rain forest with a pack of middle-schoolers, I left iPad and laptop at home, bringing only my iPhone as a computing and communications device. I was prepared to just check in via voice, but it was pretty neat to be able to see progress via TrackerBot as well.

TrackerBot is one of a new generation of iOS applications that embraces gestures in the user experience. In PivotalTracker’s web applications, “stories” are organized into columns for categories of work: current, backlog, and icebox. In the TrackerBot iPhone application each of these is a screen. We can move a story to another category by dragging to the left or the right of the screen which scrolls to show another category and allows us to drop the story wherever it should go. We can, of course, re-arrange stories vertically to adjust priorities. The interface is delightfully translated into an appropriate mobile interface.

There’s always some cognitive overhead to interacting remotely on a mobile device and using a new app. We need to get used to a slightly different interaction model and gain confidence, not only that the app will work, but that it will fit with how we’ll use the app. Having a fun, fluid UI really helps that transition. I didn’t really expect that the UI would make that much of a difference, but for me it does. I rarely spend time away from my laptop and a wireless connection, but when I do, I’m glad to have TrackerBot on my phone.

Posted in general | Leave a comment

how to get paid

I just watched Mike Monteiro’s recent talk “F*ck you. Pay me.” which has a lot of great advice about how to get make sure you get paid for your work when doing service work for clients. It was targeted at designers, but it rings true for development as well. His talk focused around contracts. I thought I would add a few notes about what I’ve learned in running my own business for the past two years.

I started software development consulting with many years experience in contract negotiation. I have always had a policy of never starting work without a contract. When I first started consulting, I would work hard to get a contract signed as soon as possible. Now I take the time to make sure that this is a relationship I want to get into. I want to make sure we work with clients who need our services and want to work the way we work. We have always provided great value for our clients, but the best value for clients who are aligned with us in wanting agile development processes and where there is a high level of trust.

The legal agreements document a trust relationship, they don’t substitute for one. Never surprise a client in a contract. If they are surprised, just treat it as a communication gap. Your standard contract documents your standard business practices.

When I started, I identified two areas that I would have to learn more about and do well: collections and keeping track of finances. The third thing that I didn’t know I needed to understand was cash flow. For this post, I’ll focus on collections, which is the other side of the legal concerns that Mike talked about. Sometimes, all is good, but there’s a process to getting paid and every company is just different enough to get you into trouble.

As soon as the contract is signed, ask “who can I talk to so that I understand how you process payments?” You want to know:

  • Are electronic invoices ok? or do they need paper?
  • Who should the invoices be sent to?
  • What is the approval process?
  • Who is the person who writes the checks or authorizes electronic bill pay?
  • Where are they sent from?

You want to know every step of what happens from when you send your invoice to when the check is in your bank. If cash is tight, you want to have a phone call with the person who writes the check. I would just be open with them and let them know that I run a small company and that I had to be sure my folks got paid in a timely manner.

When I establish that rapport up front, the conversations are much easier if the check didn’t arrive. Better yet, I would have a conversation like this: “Hey Betty. I sent an invoice to Bob yesterday and he told me he approved it. Did it get to you yet? Great. So, will payment go out today?” Once I caught my own mistake that way. I was using new invoicing software which had its default payment terms as Net 45, which was significantly longer than what the contract said. This company had a policy of using the longer of contract or invoice terms. With one friendly conversation, I was able to ensure the check got sent out weeks earlier than it otherwise would have.

And lastly, the most important thing to getting paid: always invoice on time.

Posted in general | Leave a comment