Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
| brew update | |
| brew versions FORMULA | |
| cd `brew --prefix` | |
| git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
| brew install FORMULA | |
| brew switch FORMULA VERSION | |
| git checkout -- Library/Formula/FORMULA.rb # reset formula | |
| ## Example: Using Subversion 1.6.17 | |
| # |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| #!/usr/bin/env ruby | |
| # this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) with the video library | |
| # use "rp5 unpack library" at a command line to install the video library, among others | |
| # tested with Ruby 1.9.2 | |
| # video file: http://bit.ly/H5yBjK | |
| class VideoTest < Processing::App |
| require 'faraday' | |
| module StatHat | |
| module API | |
| extend self | |
| CLASSIC_VALUE_URL = "http://api.stathat.com/v".freeze | |
| CLASSIC_COUNT_URL = "http://api.stathat.com/c".freeze | |
| EZ_URL = "http://api.stathat.com/ez".freeze | |
| def post_value(stat_key, user_key, value) |
| $('form').validate( | |
| { | |
| rules: { | |
| numero: { | |
| required: true | |
| }, | |
| descricao: { | |
| minlength: 3, | |
| email: true, | |
| required: true |
| class Person | |
| attr_accessor :pocket | |
| end | |
| class Artist < Person | |
| def draw_like_an_artist | |
| "Look, I painted a landscape." | |
| end | |
| end |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
| <title>Stripe Getting Started Form</title> | |
| <!-- The required Stripe lib --> | |
| <script type="text/javascript" src="https://js.stripe.com/v2/"></script> | |
| <!-- jQuery is used only for this example; it isn't required to use Stripe --> |
| // Disable the payment/submit button until everything has loaded | |
| // (if Stripe fails to load, we can't progress anyway) | |
| $(document).ready(function() { | |
| $("#payment-button").prop('disabled', false) | |
| }) | |
| var handler = StripeCheckout.configure("customButtonA", { | |
| key: '<yourpublishablekey', | |
| token: function(token, args){ | |
| var $input = $('<input type=hidden name=stripeToken />').val(token.id); |