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
#!/bin/bash | |
echo Enter MacBook Air IP: | |
read IP | |
echo Enter username for MacBook Air: | |
read USR | |
export MBA=$USR@$IP | |
echo Transferring... | |
scp -r $MBA:/usr/local/pintos-utils /usr/local/ | |
scp -r $MBA:/usr/local/i386-elf-gcc /usr/local/ |
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
# Makefile for Divide and Conquer | |
## LIST - all categories of source | |
## TEST - all test related source | |
## ANAL - all analyse related source | |
LDFLAGS = -lm -lstdc++ | |
CXXFLAGS = -Wall -g | |
CXX=g++ | |
VPATH= c++ |
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
#include "userprog/exception.h" | |
#include "userprog/gdt.h" | |
#include "userprog/pagedir.h" | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include "threads/interrupt.h" | |
#include "threads/thread.h" | |
#include "threads/pte.h" | |
#include "vm/page.h" |
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
In kernel.o: | |
0xc0020c92: thread_foreach (..../../threads/thread.c:532) | |
0xc0028ada: debug_backtrace_all (...../lib/kernel/debug.c:122) | |
0xc002bf7c: page_fault (.../userprog/exception.c:178) | |
0xc002207d: intr_handler (..../threads/interrupt.c:367) | |
0xc0022280: intr_entry (threads/intr-stubs.S:38) | |
In kernel.o: | |
0xc0020c92: thread_foreach (..../../threads/thread.c:532) |
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
#!/bin/sh | |
echo "Enter college login:" | |
read user | |
echo "Enter password:" | |
read -s pass; echo | |
creds="{\"user\":\"$user\",\"pass\":\"$pass\"}" | |
# Pull JSON { token: <token> } |
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
expect = (a,b) -> | |
[a,b] = [a.join(), b.join()] | |
if a != b | |
console.log """ | |
Expect failed! | |
[#{a}] != [#{b}] """ | |
else console.log "PASS! [#{a}]" | |
# Preprocesses P to generate list of occurances of suffixs within | |
# the pattern. |
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
PASSED = 0 | |
check_sorted = (was, now) -> | |
if !now.reduce ((a,c,i) -> a && (!now[i+1]? || now[i] < now[i+1])), true | |
throw new Error """\n | |
Was: [#{was}] | |
Now: [#{now}]\n""" | |
else | |
++PASSED |
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
# Calculates time interval between start and end, formatted as | |
# 17928 -> 17s 928ms | |
timeElapsed = (start, end) -> | |
diff = end - start | |
"#{Math.floor(diff/1000)}s #{Math.floor(diff%1000)}m" | |
# Helpers for the permute function | |
arrayExcept = (A, idx) -> | |
(A = A[0..]).splice idx, 1; A |
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
# Simply rounds to four digits | |
dp = (num) -> | |
Math.round(10000*num)/10000 | |
# Calculates empirical probability of | |
lazyCheck = (P, k) -> | |
RUNS = 500000 | |
avg = 0 | |
for i in [1..RUNS] | |
heads = P.reduce(((a,c) -> |
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
# Making comparisons between two DNA sequences can become a hard computational | |
# problem, due to the inexact definition of organic similarity. | |
# | |
# When making comparisons between two sequences, a useful definition of | |
# similarity is the largest subsequence present within both sequences, where a | |
# subsequence is defined as such... | |
# | |
# Given X = { X1, X2, ..., Xm } | |
# and Z = { Z1, Z2, ..., Xk }... | |
# |