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 numpy as np | |
import scipy.stats as ss | |
import time | |
def BinomialTree(type,S0, K, r, sigma, T, N=2000): | |
#calculate delta T | |
deltaT = np.divide(float(T), N) | |
# up and down factor will be constant for the tree so we calculate outside the loop | |
u = np.exp(sigma * np.sqrt(deltaT)) | |
d = np.divide(1.0, u) | |
# Initialise our f_{i,j} tree with zeros |
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
const http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = http.createServer((req, res) => { | |
if (req.method == 'POST') { | |
console.log("POST"); | |
var body = ''; | |
req.on('data', function (data) { |
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
labels <- read.table("batches.meta.txt") | |
images.rgb <- list() | |
images.lab <- list() | |
num.images = 10000 # Set to 10000 to retrieve all images per file to memory | |
# Cycle through all 5 binary files | |
for (f in 1:5) { | |
to.read <- file(paste("data_batch_", f, ".bin", sep=""), "rb") | |
for(i in 1:num.images) { | |
l <- readBin(to.read, integer(), size=1, n=1, endian="big") |
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
require(e1071) | |
pima_data <- read.csv(file = "pima.data", header=TRUE) | |
#load data into data frame | |
names(pima_data) <- c(1:9) | |
# 1. Number of times pregnant | |
# 2. Plasma glucose concentration a 2 hours in an oral glucose tolerance test | |
# 3. Diastolic blood pressure (mm Hg) |
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
/* | |
Example 1 | |
*/ | |
func OkName(param1, param2, newStr, callback) { | |
callback(newStr) | |
} | |
OkName(1,2,"newStr", collectNewStr(param) { | |
store(param) |
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
<div class="container" id="to-close" style="display:block"> | |
<div class="container" id = "chat-out-box" style="height:300px;width:95%;background-color:#ffffff;overflow: scroll"> | |
<ul class="list-group" id="all-messages" > | |
</ul> | |
</div> | |
<form class="form row" id = "chat-form" style="margin-top:30px;margin-left:15px;margin-bottom:10px;" id = "chat_message" method="POST" action="http://tripubproject.web.engr.illinois.edu/411SP17/frontend/trip/createTrip.php?<?php echo "planid=$the_plan_id"?>"> | |
<input type="text" class="form-control col-10" id="messege_box" placeholder="Instant messeges?" name = "place"> | |
<button type="submit" id="searchBtn" class="btn btn-primary">Send</button> | |
</form> |
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 pprint import pprint | |
import numpy as np | |
grade = np.array([3, 2, 1, 1, 2, 3, 2, 3, 2, 2, 1, 2, 3, 1, 2, 2, 1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 3, 1, 3, 3]) | |
# S=3 J=2 F=1 | |
BMI = np.array([1,2,2,1,1,2,1,1,1,1,1,1,2,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,2]) | |
#N=1 O = 2 | |
y = np.array([0,1,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0]) | |
#+=1 -=0 | |
trim = 20 |