Coder Social home page Coder Social logo

quest-for-life's Introduction

Crowdsourcing the Drake Equation


Interview exercise notes
========================

Files changed:
  app/helpers/surveys_helper.rb
  app/views/surveys/_parameter_results.html.erb


To install old versions of things to get this app running:

rvm install ruby 1.8.7
rvm rubygems 1.3.5
gem install rake -v 0.8.7
gem install rails -v 2.3.5
gem install RedCloth -v 4.2.2

I replaced the HTML tables with plain JSON hashes to hold the chart
data.  The tables were hidden anyway, so it didn't seem like they were
intended to be there for, say, browsers with Javascript turned off.

I wasn't sure what column values to use for N.  I somewhat arbitrarily
chose 0, 1, 2, 3, 4, and then buckets for 5-9, 10-99, 100-999,
1000-9999, 10000+.

Some of the longer column labels overlap each other, e.g. "1 in
1,000,000".  Perhaps these could be combined into buckets also, or
else just stagger the labels vertically so they don't overlap.
Probably should consult a graphic designer and/or a data visualization
expert.  :)

I didn't do the extra credit: I'm not sure how to make tests for
Javascript behavior (capybara? haven't looked into it).  (Although it
just occurred to me that I could write unit tests for the surveys
helper.)  I didn't have time to do highlighting of the user's
parameter values.

Overall (not counting time spent figuring out what old versions of
things to install), this exercise took me about 6-7 hours, spread
across 3 hacking sessions.


Potential cleanup tasks:

Write a migration to clean up the data, e.g. change the age group
description '26-35' to '26 - 35' to match the others, and change the
null genders to 'Unknown'.

Add :order clauses to the queries (currently they rely on the fact
that the age groups and rational options are in the correct order in
the db).

Refactor chart_data to be a little cleaner/more efficient.

Put Javascript code into public/javascript.

Convert to Rails 3...

quest-for-life's People

Contributors

cnecochea avatar semanticart avatar shammond42 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.