I hereby claim:
- I am nicksil on github.
- I am nicksil (https://keybase.io/nicksil) on keybase.
- I have a public key ASAmnhHDPXQXYaStOfKWboPO3PZ7DV8Tx78kafafo1XyKAo
To claim this, I am signing this object:
###################################### | |
########## CALL THE BACKEND ########## | |
###################################### | |
function successHandler(payload, textStatus, jqXHR) { | |
// Create 'labels' and 'values' arrays here, prepping for handoff to chart renderer | |
} | |
function errorHandler(jqXHR, textStatus, errorThrown) { | |
// Appropriate error-handling measures go here | |
console.error(errorThrown); |
I hereby claim:
To claim this, I am signing this object:
import turtle | |
bob = turtle.Turtle() | |
bob.goto(-675, 350) | |
bob.goto(-675, 0) | |
bob.backward(10) | |
bob.pensize(1000) | |
bob.color("blue") | |
bob.forward(2000) | |
bob.goto(-680, 400) |
Never attribute to malice that which is adequately explained by stupidity. |
radio_val = radio_val.toLowerCase().replace(/\b[a-z]/g, function(letter) { | |
return letter.toUpperCase(); | |
}); |
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MathBook Pro" | |
scutil --set HostName "MathBook Pro" | |
scutil --set LocalHostName "MathBook-Pro" |
$(document).ready(function() { | |
// AJAX GET | |
$('.get-more').click(function() { | |
$.ajax({ | |
type: "GET", | |
url: "/ajax/more/", | |
success: function(data) { | |
for(i=0; i<data.length; i++) { | |
$('ul').append('<li>'+data[i]+'</li>'); | |
} |
# File: KnuthMorrisPratt.py | |
# Author: Keith Schwarz ([email protected]) | |
# | |
# An implementation of the Knuth-Morris-Pratt (KMP) string-matching algorithm. | |
# This algorithm takes as input a pattern string P and target string T, then | |
# finds the first occurrence of the string T in the pattern P, doing so in time | |
# O(|P| + |T|). The logic behind the algorithm is not particularly complex, | |
# though getting it to run in linear time requires a few non-obvious tricks. | |
# | |
# To motivate KMP, consider the naive algorithm for trying to match a pattern |
# File: MatrixFind.py | |
# Author: Keith Schwarz ([email protected]) | |
# | |
# An algorithm for finding a specific value in a specially-formatted matrix of | |
# values. | |
# | |
# The algorithm takes as input a matrix of values where each row and each | |
# column are in sorted order, along with a value to locate in that array, then | |
# returns whether that element exists in the matrix. For example, given the | |
# matrix |