Fail Early, Fail Often 1

Posted by ch0wda on May 13 2008 at 12:15 PM

I was recently having a discussion with someone, and the topic was standing up while you’re working. I’ve recently been hearing a lot about it here and here. This person was mentioning that he had found a standing desk with a treadmill underneath. The proposed benefits are improved posture and increased attention span. I’m intrigued by the idea, but it’s something that I’d have to try out to find out if I like it. Unfortunately, my height (6’4”) purchasing something cheap or rigging up an existing table didn’t seem to be an option. I needed something ~48” high.

I remembered that I had a couple of nicely cut Medium Density Fiberboard pieces laying round that would be a great start. I also had 5 12’ 2×4s, a hand jigsaw, and a screw gun. Long story short, 2.5 hours and $0 later, I had something I could use. Is it great? No. Is it permanent? No. Is it something that I can use to evaluate whether I like to work this way or not without making a large investment? Absolutely. Fail early, fail often. Open Source carpentry.

Utili-Tool, A Camping Application

Posted by ch0wda on April 10 2008 at 11:24 AM

Something that I use everyday that I’ve just released for public use is the Braintree Tools Site, which is just a Camping application frontend to the Braintree APIs. It’s also a simple collection of tools that will help you figure out if your ‘hashing’ is correct and what response look like. It’s kinda like a sandbox, but you don’t need to go so far as to write your own script. You can just do it from the web.

There is certainly truth in the statement that the best tools are created by the people who actually use them. A major part of my job at Braintree is to ease the task of integration for our customers. I come into contact with people who are using everything from Ruby on Rails to customized PHP to Oracle Forms. The nice thing about our API is that it doesn’t matter. You’re simply making HTTP GETS/POSTS to interact with the Gateway. For me, customer support at it’s most basic is just typing a query string into a browser address bar and looking at the response.

Is This Customer Support? 2

Posted by ch0wda on March 04 2008 at 04:20 PM

I hate to be a dick about it, but I needed help installing an EV SSL certificate, so I went to the certifying authorities website and tried to find some articles or tutorials. No dice, poorly documented, inaccurate. They had a feature that let me “chat” realtime with one of their customer support folks. Perhaps I’m really missing something major, but I think this is absolutely terrible.

Malcolm: Hi!!

Malcolm: How can I assist you?

you: i'm trying to install an EV certificate on Apache

you: running Ubuntu

Malcolm: Ok.

you: i'm getting an error in IE7 only

Malcolm: can I have your order#

you: sure: #1234567

Malcolm: Please wait.

you: sure

Malcolm: I did installation check from our end, it seems that the root and intermediate certificates are not installed properly.

Malcolm: please install the root and intermediate certificates.

you: ok, there aren't _any_ instructions anywhere on how to do that

Malcolm: Please wait.

Malcolm: Please go through the below link.

Malcolm: https://support.nameprotected.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=264&nav=0,1,88

you: i've done all that

you: the site works with ssl in every browser BUT IE7

you: it has to do with EV portion

you: your documentation is woefully inadequate

Malcolm: Ok. Please send mail to support@nameprotected.com. We will solve your query.

you: I HAVE

Malcolm: Can I have your ticket number.

you: #987654321

Malcolm: Please wait.

you: what i'm saying is that your documents that i keep getting referred to are not clear

you: on how to install a EV certificate whether it be root or intermediate

Malcolm: Please wait.

Malcolm: could you please tell, at which place you are getting error

Malcolm: while installing the certificate.

you: I'm getting an error in IE7 when attempting to go to the page... it says that the certificate is not validly signed

you: no error in firefox or safari

you: to install the EV certificate, i downloaded the EV-Auto Enhancer for your website and used it as the SSLCertChainFile instead of the one you sent to, as directed by your site

you: for/from

Malcolm: Please go throgh the below link for evssl auto enhancer

Malcolm: https://support.nameprotected.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=1076&nav=0,1,82

you: perhaps you're not listening to me

you: I'VE ALREADY DONE THAT

you: please do not send another link to your documentation as it is completely incomplete

you: do you have a phone support center?

Malcolm: Phone Support will be available on Monday - Friday around 9am - 5pm GMT

Malcolm:

Malcolm: US + 1.555.1212

you: ok, so i've downloaded the file and have it set as the value for SSLCertificateChainFile

you: it's still not working

Malcolm: I have checked your domain in IE7

Malcolm: its working without  any error

you: with a green bar?

Malcolm: Yes.

you: to indicate EV SSL?

Malcolm: Yes.

you: try again because i'm getting certificate error:navigation blocked

Malcolm: Please wait.

you: do i need to rename the file to what my original ca-bundle was called?

Malcolm: No.

Malcolm: Now am getting error.

you: k

Malcolm: the error because root and intermediate certificates are not installed properly

you: you already said that

you: then you sent me a link

Malcolm: Yes.

you: which was followed

you: then i get the error

you: which is the root which is the intermediate?

Malcolm: Send your query to support@nameprotectedcom. We will escalate to our next level support

Malcolm: ca bundle file

you: you're killing me

Malcolm: I apologize for the inconvenience caused. send mail to us. We will escalate to next level support and solve your query.

you: great!!!!! thanks for all your help!

Malcolm: Welcome!!

Am I completely missing it?

Scotland on Rails Registration is Open 1

Posted by ch0wda on February 15 2008 at 08:29 AM

While I’m not going to be able to attend myself, I did want to mention on behalf of fellow Twitterer, Alan Francis that Scotland on Rails registration is open. It really looks like a dynamite group of speakers including a couple of Ohioans, Joe O’Brien and Jim Weirich. Of particular interest to me would be the talk by Paul Dix on creating some collective intelligence in Rails applications. The blurb:

Take advantage of user data to create intelligent Rails applications! This talk will focus on data mining to create complex application behavior and gain insight into the patterns and habits of your users. Examples of these techniques can be seen with recommendation systems like those created by Amazon, Netflix, last.fm, and others. Additional examples include spam filtering systems for email or comment filtering provided by Akismet.

I will focus on techniques for gathering data, specific gems and plugins for performing various data mining and machine learning tasks, and performance issues like how to distribute the work to separate servers. Theory in this talk will be light and the specific algorithms will only get a mention by name. We’ll be looking at real world Ruby and Rails code examples for building recommendation, ranking, and classification systems.

Sounds fascinating. I also found it interesting that one of my former employers, JPMorganChase is a sponsor. If you have the means to attend, I’d really recommend it. I’ll wager there will be scotch, but probably not any Highland Games.

I've Joined Braintree Payment Solutions

Posted by ch0wda on February 13 2008 at 11:35 AM

It’s been a while since I’ve posted, and it’s also been a while since I changed jobs. I’m very pleased to announce that I now work for Braintree Payment Solutions. I’ve been putting all my energy into helping our CEO, Bryan Johnson make Braintree the place for discerning developers, and I think the combination of our support, technology, and services offered place us at the top of the industry. In short, it’s a credit card payment gateway, but it’s way more than that. Here’s the description from Braintree:

Braintree Payment Solutions is a leading provider of end-to-end electronic payment products and services. Braintree processes all forms of electronic payment transactions – credit, debit, electronic check, and electronic funds transfer. The company offers simplified PCI Compliance and credit card storage solutions, risk and fraud management, ecommerce solutions, and rate management. We’re changing the industry one customer at a time and would invite you to experience the difference.

Officially, my role is “Community Developer”, which sounds a bit ambiguous, but it’s actually a perfect title for what I’m going to be doing. I’m in charge of all things developer at Braintree, so I’m focused on Developing the Community and also Developing for the Community. In short, you can check out my work on the Braintree Community Developer Site which will include a blog, support forums, api docs, code examples, and all the information that you’ll need to easily integrate payment processing into your own applications.

The site is currently a little sparse on content, but we’re adding more everyday and I’m completely focused on making it the definitive place for information on credit card processing, payment gateways, and integration issues for developers in all communities. Initially, we’re focusing on Ruby on Rails developers, but we welcome developers from all languages and frameworks. If you have any suggestions or feedback, please contact me at developer@getbraintree.com.

Needless to say, I’m very excited to be a part of such a great company and I’m looking forward to helping people navigate through a very complicated industry.

Emacs Shell Ansi Colors 2

Posted by ch0wda on December 13 2007 at 03:58 PM

In a previous post I mentioned a funky character encoding issue with my Emacs Autotest output. I finally looked into the cause and came across the solution. I just needed to enable ansi-colors in my Emacs shell.

In your .emacs file, add the following:

   ;; Add color to a shell running in emacs 'M-x shell'
   (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
   (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

Cheap and easy. Now, you’ll get all the cool ansi colors, like the kids.

Rails 2.0 & CRB

Posted by ch0wda on November 19 2007 at 12:33 PM

For those of you in the Columbus area, I’ll be speaking at the Columbus Ruby Brigade meeting this evening regarding Rails 2.0. This will be a high-level talk around some of the new things and some of the deprecated behaviours in everyone’s favorite web framework.

validates_acceptance_of howto 1

Posted by ch0wda on November 16 2007 at 09:24 AM

We’re really getting things rolling on Gonowdo and as part of that, we’re starting to accept users on a somewhat limited basis. When signing up, I need to make sure that users accept our terms of service. With Rails, this is extremely simple, but after spending a few minutes on mailing list archives and forums I didn’t find a good resource or howto. Hopefully, this post will serve as that for anyone in the future.

The key to accomplishing this is to use an active record validation called “validates_acceptance_of”. Adding this to the User model with a method will create a virtual attribute for that named method, in my case, I used “terms_of_service”. There is no corresponding column in the database needed. This will not allow a model to be saved without it. By default, this method will allow the record to be saved if it is nil. Setting it to true will mean that you must pass this value to the record everytime you want to save it. One other thing, in order be able to access this method from the view, you need to make it accessible by creating an accessor. Here is the example from our application.

1
2
3
4
5
6
7
8

  class User < ActiveRecord::Base
    # ...
    validates_acceptance_of :terms_of_service
    # ...

    attr_accessible :terms_of_service
  end

In the view, you just need to add a control to the form for selecting this checkbox. Without checking this box, the form will throw a validation error and the model will not be saved.

1
2
3
4
5
6

  <% form_for :user, @user, :url => users_path do |f| %>
    <p>... other controls ...</p>
    <p><%= f.check_box :terms_of_service %> I accept the terms of service.</p>
    <p><%= submit_tag "Save" %></p>
  <% end %>

There are several other configurations that you can pass to validates_acceptance_of, similar to other validations. Check the documentation for this method for more information. If you have more stringent auditing requirements, then you may need to think about just using a boolean field in the database and using a regular validation. Extending this further might even allow you to track acceptance of versions of your terms of service as they get updated. Since we’re allowing nil by default, you will need to make sure that create a test/spec to specifically pass a :terms_of_service method. I would keep this in a special test case and not worry about including it throughout your test suite.

Hopefully, this will get you going, best of luck!

RSpec NO NAME error

Posted by ch0wda on October 06 2007 at 08:51 AM

On Gonwodo, Aaron and I decided to use RSpec for our tests. We were getting a really strange error when attempting to print out the spec docs through the rake tasks. We had actually never written any specifications, just it “foo foo foo” methods in order to get pending tests. The error we were getting was:
A New User
  -- NO NAME (Because of --dry-run)
  -- NO NAME (Because of --dry-run)
  -- NO NAME (Because of --dry-run)
I was able to determine that the rake task does indeed call dry run. Here’s the task,
1
2
3
4
5
6

desc "Print Specdoc for all specs (excluding plugin specs)"
  Spec::Rake::SpecTask.new(:doc) do |t|
    t.spec_opts = ["--format", "specdoc", "--dry-run"]
    t.spec_files = FileList['spec/**/*_spec.rb']
  end
This is actually the expected behavior, as RSpec is attempting to generate the names of the specs using the code internally. The problem with the dry-run is that it never executes the code so the names cannot be determined. In order to have the empty tests generate the necessary spec doc you would do:
./script/spec spec -fs
I’m not sure that I understand why this is the expected behavior because I give the test a name, so I’m not expecting it to be run. If anyone has an explanation, I would greatly appreciate it.

Joining GoNowDo 1

Posted by ch0wda on September 26 2007 at 08:59 AM

Today marks the last day that I’ll be working at Cardinal. I’m extremely excited to be working for a new company, GoNowDo. We’re going to be working on solving some interesting problems in the online travel industry. Stay tuned for more information.

Thanks to everyone at Cardinal!