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
{ | |
"cache-control": "public, s-maxage=86400, max-age=300", | |
"content-encoding": "gzip", | |
"content-language": "en", | |
"content-length": "26452", | |
"content-type": "text/html; charset=utf-8", | |
"date": "Sun, 06 Jul 2014 12:52:17 GMT", | |
"etag": "\"1404615811-0+gzip\"", | |
"expires": "Sun, 19 Nov 1978 05:00:00 GMT", | |
"last-modified": "Sun, 06 Jul 2014 03:03:31 +0000", |
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
Running 20 trials | |
----------------------------------------------------------------- | |
Starting trial 0 | |
20 right-handed people | |
19 left-handed people | |
Result: 0.745341614907 | |
Expected: 0.736842105263 | |
Percent error: 1.15350488021 | |
----------------------------------------------------------------- | |
Starting trial 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
import itertools, random | |
class Person: | |
def __init__(self, righthanded): | |
self.righthanded = righthanded | |
self.shakes = [] | |
def shake(self, partner): | |
if self.righthanded and partner.righthanded: |
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 ng-app="friendsApp" ng-controller="friendsController"> | |
<head> | |
<title>Friends</title> | |
<script src="angular.js"></script> | |
<style> | |
body { | |
color: #444; | |
font-size: 14px; | |
font-family: "Roboto", sans-serif; |
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
// Simple Flappy Bird Clone | |
// Allen Guo <allenguo@berkeley.edu> | |
var SPAWN_INTERVAL = 15; | |
var GRAVITY = 1; // Accelerate toward bottom | |
var RECT_WIDTH = 50; | |
var RECT_VELOCITY = 10; | |
var PLAYER_X = 360; |
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
import os | |
[os.system('javac ' + n[2:] + '; java ' + n[2:].strip('.java')) for n in os.popen('find -name "Test*.java"').read().split('\n') if n] |
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
def evaluateNext(tokens): | |
first = tokens.pop(0) | |
if first == '(': | |
inner = [] | |
depth = 0 | |
while not (tokens[0] == ')' and depth == 0): | |
if tokens[0] == '(': | |
depth += 1 | |
if tokens[0] == ')': | |
depth -= 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
#lang racket | |
; pythagoras-tree.rkt: | |
; Draws a Pythagoras tree using Racket's turtle graphics library. | |
; Run this program from the terminal with `racket pythagoras-tree.rkt`. | |
(require graphics/turtles) ; raco pkg install htdp-lib | |
(turtles #t) | |
(define (pythagoras-tree side) ; starting position: center of square, facing east |
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
diff --git a/scripts/commonscat.py b/scripts/commonscat.py | |
new file mode 100755 | |
index 0000000..064ba72 | |
--- /dev/null | |
+++ b/scripts/commonscat.py | |
@@ -0,0 +1,631 @@ | |
+#!/usr/bin/python | |
+# -*- coding: utf-8 -*- | |
+""" | |
+With this tool you can add the template {{commonscat}} to categories. |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Simple, crude tests for Claim's removeSources() method. | |
Tests are run on Wikidata's sandbox. | |
Allen Guo <Guoguo12@gmail.com> | |
November 2013 | |
""" |
OlderNewer