Glenn Jahnke's blog



Glenn JahnkeGlenn Jahnke
Is your XML foo savvy?
edit Posted by Glenn Jahnke on Tuesday November 15, 2011 at 09:25AM

Helps

  • "How do you change the address and port that Solr is running on?"

Somewhere in the server.xml file was suggested, however that didn't seem to work. The workaround was using IP Tables.

Interestings

  • as_json (with options) seems to always be called with an explicit nil argument from to_json under Rails 3. Some people just use as_json explicitly, or pass an explicit empty hash as the arg to get around this oddity.

  • Jenkins now supports Ruby plugins.

  • Support Movember! Pivotal has raised quite a bit of money and you can too.

Glenn JahnkeGlenn Jahnke
Is your XML foo savvy?
edit Posted by Glenn Jahnke on Tuesday November 15, 2011 at 09:25AM

Helps

  • "How do you change the address and port that Solr is running on?"

Somewhere in the server.xml file was suggested, however that didn't seem to work. The workaround was using IP Tables.

Interestings

  • as_json (with options) seems to always be called with an explicit nil argument from to_json under Rails 3. Some people just use as_json explicitly, or pass an explicit empty hash as the arg to get around this oddity.

  • Jenkins now supports Ruby plugins.

  • Support Movember! Pivotal has raised quite a bit of money and you can too.

Glenn JahnkeGlenn Jahnke
Standup 2011.04.14 - Bustin' Caches, Pow, and Trajectory
edit Posted by Glenn Jahnke on Thursday April 14, 2011 at 09:23AM

Helps

Busting JS Caches Better

How do I bust Javascript caches better? Changing the url params doesn't always work?

The most consistent way to bust Javascript caches is to change the path to it. Sometimes transparent proxies and some browsers won't be busted otherwise.

Busting Chrome JS Cache when running Jasmine Fixtures

Chrome is cache Jasmine fixtures and Firefox is just too slow.

No great solution. Chrome typically runs tests so fast that just mashing the refresh until your test output changes seems to work for some.

Interestings

Trajectory

Trajectory is a new product out by Thoughtbot which has been described as a cross between Tracker and Basecamp.

Pow

37Signals has come out with a native Mac app called POW. Here's a snippet from the Readme:

Pow is a zero-configuration Rack server for Mac OS X. It makes developing Rails and Rack applications as frictionless as possible. You can install it in ten seconds and have your first app up and running in under a minute. No mucking around with /etc/hosts, no compiling Apache modules, no editing configuration files or installing preference panes. And running multiple apps with multiple versions of Ruby is trivial.

A fellow Pivot also mentioned that it makes running multiple apps on the same port, and having sub-domains easier.

Firefox cacheing

There is an option in Firefox to remember the last opened tabs so when you return to your browser, it will restore your last viewed websites.

This has the unfortunate side-effect of not deleting cookies despite the opposing setting for deleting all cookies upon session exit.

Glenn JahnkeGlenn Jahnke
Standup 9/3/2010
edit Posted by Glenn Jahnke on Friday September 03, 2010 at 09:21AM

Help

Server-Side Image Editing

"What's the latest and greatest server-side image processing library people are using?"

Most people quickly agreed that ImageMagick was the way to go.

Data Analysis

"Are there good libraries for data analysis similar to NumPy in Python but for Ruby?"

While there may not be many Ruby libraries that directly comparable to NumPy, there are a fair number of packages to do related work. For instance, you can utilize RSRuby which is a bridge between the R statistical language and Ruby. GnuPlot is another Ruby library that allows both data processing and plotting of graph data.

RSRuby - R / Ruby binding

GnuPlot - Data processing and Plotting

Glenn JahnkeGlenn Jahnke
Standup 2/17/2010: A New Jasmine Release
edit Posted by Glenn Jahnke on Wednesday February 17, 2010 at 09:14AM

Interesting Things

There is a new release of Jasmine, the Javascript testing framework written by several people here at Pivotal Labs, due to a bug found in CI related to implementing Rack.

For those uninitiated to Javascript BDD testing, here is a quick example.

it('should be a test', function () {
  var foo = 0
  foo++;

  expect(foo).toBeTruthy();
  expect(foo).toEqual(1);
});

Be sure to check out Jasmine at Github.

Glenn JahnkeGlenn Jahnke
Standup 8/13/2009: BART Strike, etc
edit Posted by Glenn Jahnke on Friday August 14, 2009 at 09:19AM

Ask for Help

"BART will be striking for an indefinite period of time starting Monday"

Somewhat scary for those of us trying to get into the city... good luck to everyone else in the same predicament.

"Has anyone used geminstaller to install Passenger?"

It appears not.

Interesting

"EngineYard's Solo offering now has a feature called quickstart"

The Solo Linux OS image which is built to run on Amazon's EC2 apparently has a new quickstart feature that lets people drop a git repository link into their web interface and self configures things appropriately. Pretty interesting.

"RabbitMQ is a viable option for projects"

RabbitMQ has been vetted and so far has proven to be stable, fast, and reliable, despite a few things we had to iron out first. Pretty cool new technology with some good Ruby integration in the form of the amqp gem. This website had a similar experience with RabbitMQ, AMQP, and Rails.

"Rails code committers inside Pivotal now get t-shirts denoting that fact for their efforts"

Sweet ;).

Glenn JahnkeGlenn Jahnke
Standup 8/13/2009: Java, Java, Java
edit Posted by Glenn Jahnke on Thursday August 13, 2009 at 02:57PM

Despite being a Ruby shop, we do have our hands in some Java issues...

Ask for Help

"Anyone know of a good Rhino Javascript book?" (He was looking for more information on the Javascript implementation using Java and related information)

Nope :(.

"What is the status of finding out how to sandbox Java"

Still in progress.

Interesting

Changing the Java version from 1.5 to 1.6 in Mac OSX is painful.

  • It may be tempting to manually install Java and then just change the link (in some file called "a"), but this is wrong and spits out warnings.

  • Most options can be set using:

    /Applications/Utilities/Java\ Preferences.app/Contents/MacOS/Java\ Preferences

and then setting $JAVA_HOME is up to you.

Glenn JahnkeGlenn Jahnke
Standup 8/12/2009: Using stub with before(:all)
edit Posted by Glenn Jahnke on Wednesday August 12, 2009 at 05:43PM

Ask for Help

"My method stub only works on the first RSpec example and clearing in subsequent examples, what's wrong?"

Using RSpec, it is common to mock out certain aspects of your code to change functionality for testing. This is accomplished using the "stub" method and passing the method name as a symbol.

SomeObject.stub(:some_method_to_modify).and_return do something_else() end

As we like to keep our code nice and DRY, we often pull things into "before" blocks. Unfortunately, this can cause some confusion as

describe "ObjectA" do
    before :all do
        ObjectB.stub!(:some_method_ObjectA_depends_on).and_return(15)
    end

    it "can test something" do
        ...
    end

    it "can test something else" do
        Objectb.some_method_ObjectA_depends_on
    end

end

will have ObjectB.some_method_ObjectA_depends_on actually executing ObjectB's method instead of stubbing. This is because after each example ("it" block), all stubs are cleared from all objects, leaving the stubs only effective in the first example.

Glenn JahnkeGlenn Jahnke
Standup 8/10/2009: Javascript Date-Time Picker
edit Posted by Glenn Jahnke on Monday August 10, 2009 at 05:23PM

Ask for Help

"Does anyone know of the best current Date-Time picker for Javascript?"

*Tim Harper's Calendar Date Select was recommended for its simplicity and rails integration.

Simply install the gem and add it as a project dependency:

sudo gem install calendar_date_select
config.gem "calendar_date_select"

And insert into your Rails code:

<%= calendar_date_select_includes "red" %>

And voila, you have an intuitive time and date selector:

Date and Time Selector GUIJ

Check out the live Demo.

*Yahoo's Javascript toolkit was determined to work well for people in need of a date and time selection GUI.