Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Ryan Richard

Posts By

PIVOTAL LABS
Standup 9/8/11

Ask for Help

"What's the best gem for Google Calendar integration? There are a few out there."

It was suggested to look for a gem which is implemented using CalDAV, instead of the old Google APIs. Anyone have any specific suggestions?

Interesting Things

LABS
Embedding VideoViews in your UI: Caution!

Using a VideoView to play streaming videos is quite easy on Android, and the class provides handy callbacks to manage your UI too. For example:

    // set the Uri of the video
    videoView.setVideoURI(Uri.parse(videoUriString));
    // start streaming/playing the video
    videoView.start();

    videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mp) {
            // about to start playing
        }
    });

    videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mp) {
            // reached the end of the video
        }
    });

VideoViews can be embedded into your layouts and sized any way that you'd like. However, there is one serious limitation.

According to Romain Guy, SurfaceViews (such as VideoView, etc.) inside ScrollViews (or ListView, etc.) are not supported by Android.

For example, playing a video using a VideoView inside of a row of a ListView seems to work at first, until the user tries to scroll the list. As soon as the list starts to scroll, the video turns black. It keeps playing in the background but you can't see it anymore because it renders the rest of the video as a black box.

As another example, when the VideoView is scrolled so that it is partially off-screen at the time that the video starts playing, the VideoView does not render the video in the correct location on screen, causing the video to appear mostly black.

So be careful where you decide to put your VideoViews. At first it seems that they can go anywhere, but they cannot.

PIVOTAL LABS
Standup 5/11/2011

Ask for Help

"How can you resize the browser window from a Capybara test before visiting the page under test?"

Interesting Things

Tommy had a suggestion for testing scopes in Rails controller tests.

Here is an example of the type of test that he does not enjoy writing:

<code>
it "scopes products to active and available" do
    not_active = Factory(:product, :active => false)
    not_available = Factory(:product, :available => false)
    active_available = Factory(:product, :active => true, :available => true)
    get :index
    assigns(:products).should_not include(not_active)
    assigns(:products).should_not include(not_available)
    assigns(:products).should include(active_available)
end
</code>

Here is a nice way that he found to write the same test:

<code>
it "scopes products to active and available" do
    get :index
    assigns(:products).should == assigns(:products).active
    assigns(:products).should == assigns(:products).available
end
</code>

The only question is what to do with pagination? A work-around is for the controller to do:

<code>
def index
  @products_scope = Product.active.available
  @products = @products_scope.paginate(:per_page => blah blah blah)
end
</code>

PIVOTAL LABS
Standup 5/9/2011

Ask for Help

"Any general advice for writing Rails generators?"

One person suggested this Rails guide. Another suggested looking in the Rails source code at the existing generators. Any other ideas?

Interesting Things

  • Hack night this Wednesday, 6:30pm, at the new office of TRUECar.

PIVOTAL LABS
Standup 9/10/10

Interesting Things

PIVOTAL LABS
Standup 9/9/10

Helps

"Has anyone experienced fuzzy PDF rendering at some zoom levels on iOS?"

One project was having trouble with their iOS app which shows a PDF file. When you zoom the view, the text becomes fuzzy looking. The text in the PDF is only fuzzy at certain, seemingly nondeterministic, zoom levels. They are drawing the PDFs with CGContextDrawPDFPage and scaling with CGContextScaleCTM. Does anyone know what could cause this?

Interesting Things

  • There doesn't seem to be any reliable way to know if an HTML checkbox got checked by simply looking in the DOM. There's an attribute on the INPUT called "checked", but this is only read during page load to set the initial value of the checkbox.

  • Interesting Amazon EC2 announcement:

    "Micro instances provide 613 MB of memory and support 32-bit and 64-bit platforms on both Linux and Windows. Micro instance pricing for On-Demand instances starts at $0.02 per hour for Linux and $0.03 per hour for Windows."

PIVOTAL LABS
Standup 9/8/10

Helps

"Is anyone using Devise (authentication solution for Rails) with SSL for an app's login page (on Heroku)?"

One project was having trouble with the redirects caused by this and is looking for help. Has anyone experienced trouble with this?

Interesting Things

  • There is a Ruby meetup tonight at 6:30 pm in San Francisco on the subject of unicode and internationalization in Ruby.

PIVOTAL LABS
Standup 9/7/10

Helps

"Using bundler vs. gemsets?"

These can be used separately or together depending on the needs of your project. Bundler checks dependencies to make sure you have the gems that your application needs, while RVM gemsets keep your gems separate to prevent conflicts (between Rails 2 and 3, or example).

"Anyone ever see IE fall over when parsing 500 KB of JSON?"

Try explicitly using eval()

Interesting Things

  • If you have any strange, unexplained errors with RVM, try upgrading to see if it solves them.