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
# Based on https://stats.stackexchange.com/a/57254 | |
# Before running, look at all comments starting with XXX below | |
library('car') | |
library('compute.es') | |
library('effects') | |
library('emmeans') | |
library('ggplot2') | |
library('multcomp') | |
library('pastecs') |
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 java.util.Arrays; | |
public class QuikMaths { | |
public static void multiplyBy3(int[] A) { | |
for (int x: A) { | |
x = x * 3; | |
} | |
} | |
public static void multiplyBy2(int[] A) { | |
int[] B = A; |
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/env python | |
""" | |
Created by Allen Guo <allenguo@berkeley.edu> for CS 61A Fall 2017. | |
Dependencies: Selenium configured for Chrome (see https://goo.gl/WBXMhf). | |
Before running: | |
- Fill out the constants below. Double check all of them! | |
- Open Piazza and switch to the CS 61A Piazza. Make sure you're not on a |
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/env python | |
from __future__ import print_function | |
import os | |
import signal | |
from time import sleep | |
# TODO: Install Selenium and PhantomJS | |
from selenium import webdriver |
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
\documentclass{article} | |
% imports and settings | |
\usepackage{fullpage} % wider margins | |
\usepackage{amsmath} % symbols | |
\usepackage{amsfonts} % more symbols | |
\usepackage{verbatim} % comment environment | |
\usepackage{float} % stop tables from moving | |
\usepackage{hyperref} % URLs, e.g., \href{url}{text} | |
\usepackage{graphicx} % graphics (see \img below) |
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/env python | |
def change(cents, remaining): | |
if cents == 0: | |
return 1 | |
if not remaining: | |
return 0 | |
s = 0 | |
amt = cents | |
while amt >= 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
# in exp/nnet3/tdnn_sp_smbr/cmvn_opts | |
--norm-means=false --norm-vars=false |
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 Animal { | |
void bark(Animal a) { | |
System.out.println("bark(Animal a) in Animal"); | |
}; | |
void bark(Dog d) { | |
System.out.println("bark(Dog a) in Animal"); | |
}; | |
} |
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
#!/usr/bin/env python | |
"""calc.py: A concise prefix notation calculator.""" | |
import regex # pip install regex | |
def calc_eval(exp): | |
"""Evaluates the given prefix notation expression. | |
Raises a SyntaxError if the input is not valid. |
NewerOlder