This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
This file contains 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
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
var Zoo = { | |
init : function(animals){ | |
var animals = animals; | |
}, | |
bipeds: function(){ | |
var bips = []; |
This file contains 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
// shorthand for $(document).ready(); | |
$(function(){ | |
//Your code... | |
$('button').click(function(event) { | |
var email = $('#email').val(); | |
var pass = $('#password').val(); | |
var errors = new Array; | |
var em_re = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i; | |
//email valid |
This file contains 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
// Shorthand for $(document).ready(); | |
$(function(){ | |
// Your code goes here... | |
$( "#next_frame" ).on('click',function() { | |
if ($('li').first().css('left')[0,1] === '6') | |
{ | |
console.log($('li').first().css('left')[0,1]) | |
$('li').animate({ | |
left: "=0%" |
This file contains 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 Machine | |
attr_accessor :facts | |
def initialize | |
@facts = {} | |
fill_facts | |
end | |
def find_sum | |
upper = @facts['9']*3 |
This file contains 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
==> devstack: Box 'monasca/devstack' could not be found. Attempting to find and install... | |
devstack: Box Provider: virtualbox | |
devstack: Box Version: >= 0 | |
==> devstack: Loading metadata for box 'monasca/devstack' | |
devstack: URL: https://vagrantcloud.com/monasca/devstack | |
==> devstack: Adding box 'monasca/devstack' (v0.1.3) for provider: virtualbox | |
devstack: Downloading: https://vagrantcloud.com/monasca/boxes/devstack/versions/5/providers/virtualbox.box | |
==> devstack: Box download is resuming from prior download progress | |
==> devstack: Successfully added box 'monasca/devstack' (v0.1.3) for 'virtualbox'! | |
#<Proc:0x00000103209dc0@/Users/nicholaslee/.vagrant.d/gems/gems/ridley-4.1.0/lib/ridley/chef/config.rb:50 (lambda)> |
This file contains 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
filename = '7.csv' | |
with open(filename, 'r') as f: | |
for line in f: | |
positions = map(int, line.split(',')) | |
def build_costs(max_num): | |
costs = {} | |
for i in range(max_num): | |
if i == 0: |
This file contains 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
from functools import reduce | |
filename = '9.txt' | |
hmap = [] | |
RIGHT_END = None | |
with open(filename, 'r') as f: | |
for line in f: | |
numline = [int(n) for n in list(line.strip())] | |
numline = [[n, True] for n in numline] | |
RIGHT_END = len(numline) - 1 |
This file contains 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
filename = '13.txt' | |
class Grid(): | |
def __init__(self, max_x, max_y, coords, folds): | |
self.max_x = max_x | |
self.max_y = max_y | |
self.coords = coords | |
self.folds = folds | |
self.map = None | |
self.build_map() |
This file contains 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 Node(): | |
def __init__(self, val, pos): | |
self.pos = pos | |
self.td = None | |
self.visited = False | |
self.val = val | |
self.nodes = [] | |
def unvisited_nodes(self): | |
return [n for n in self.nodes if not n.visited] |
OlderNewer