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
x = var('x') | |
f(x) = sin((x*pi)/180) | |
g(x) = cos((x*pi)/180) | |
p1 = plot([f,g], | |
(x,0,360), | |
ticks=[[30,45,60,90,120,135,150,180,270,360], | |
[-1, | |
-sqrt(3)/2, | |
-sqrt(2)/2, |
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
def unit(v): | |
mag = sqrt(v[0]*v[0]+v[1]*v[1]) | |
return (v[0]/mag, v[1]/mag) | |
VF = plot_vector_field(unit([-y,-x]),[x,-2,2],[y,-2,2]) |
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
% | |
% advanced_calc.sty | |
% | |
% This is the LaTex style file for Calculus Exams and Handouts. | |
% | |
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace} | |
\RequirePackage{tikz} | |
\usetikzlibrary{plotmarks} | |
\RequirePackage{pgfplots} |
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
qtext() { | |
cp $1 $1.bak | |
sed -i -e 's/^/q_text.append(r"/' $1 | |
sed -i -e 's/$/")/' $1 | |
} |
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
''' | |
620031587 | |
Net-Centric Computing Assignment | |
Part A - RSA Encryption | |
''' | |
import random | |
''' |
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
import textwrap | |
f = open('sample_input_text.asc','r') | |
contents = f.read() | |
split_contents = contents.splitlines() | |
for line in split_contents: | |
dedent_line = textwrap.dedent( line ) |
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
import pandas | |
import requests | |
from bs4 import BeautifulSoup | |
page = requests.get('http://www.politico.com/2012-election/results/president/wisconsin/') | |
soup = BeautifulSoup(page.text, "html.parser") | |
for body in soup("tbody"): | |
body.unwrap() |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
const readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
prompt: 'Enter numbers sep by newlines. Ctrl-d when done> \n' | |
}); | |
let inputStack = []; |
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
let myBigArray = [] | |
for(let i=0; i<2000000; i++) { | |
myBigArray.push(i); | |
} | |
console.log('Done filling the array.'); | |
let myNewBigArray = myBigArray.map( (e) => { | |
return e+2; |
OlderNewer