This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee < ActiveRecord::Base | |
BILLABLE_HOURS = 1950 | |
belongs_to :store | |
validates :first_name, :last_name, | |
presence: true | |
after_create :increment_employees_count | |
after_destroy :decrement_employees_count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './bartender.rb' | |
require './restaurant.rb' | |
require './review.rb' | |
describe Bartender do | |
before :each do | |
@bartender = Bartender.new('John', 6) | |
end | |
describe '.new' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working with multiple stocks | |
""" | |
SPY is used for reference - it's the market | |
Normalize by the first day's price to plot on "equal footing" | |
""" | |
import os | |
import pandas as pd | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************** | |
Example 1: we can store a function like we store any other value. | |
In the example below, the function we are storing in `sumArray` is actually unnamed | |
which is to say it's an "annonymous" function. | |
**********************************************************************/ | |
var sumArray = function(arr){ | |
return arr.reduce(function(sum, elm){ | |
return sum += elm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x69b8Fb504E2eb0B2A8B6e5C1caF4ce6070c76BDB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.19; | |
contract ERC721 { | |
string constant private tokenName = "My ERC721 Token"; | |
string constant private tokenSymbol = "MET"; | |
uint256 constant private totalTokens = 1000000; | |
mapping(address => uint) private balances; | |
mapping(uint256 => address) private tokenOwners; | |
mapping(uint256 => bool) private tokenExists; | |
mapping(address => mapping (address => uint256)) private allowed; | |
mapping(address => mapping(uint256 => uint256)) private ownerTokens; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Neighbourhood | Average Listing Price ($) | Average Price per Bed ($) | |
---|---|---|---|
Waterfront Communities-The Island | 191.83 | 124.92 | |
Rosedale-Moore Park | 174.61 | 117.98 | |
Lawrence Park South | 168.72 | 79.51 | |
Bridle Path-Sunnybrook-York Mills | 166.33 | 114.02 | |
Lawrence Park North | 164.93 | 68.55 |