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
public static ArrayList<Integer> cumSum(ArrayList<Integer> s, int acc){ | |
ArrayList<Integer>l = new ArrayList<Integer>(); | |
try{ | |
(l = new ArrayList<Integer>(Arrays.asList(new Integer[]{s.remove(0)+acc}))).addAll(cumSum(s,l.get(0))); | |
} | |
finally{ | |
return l; | |
} | |
} |
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
#; Yang Zhou 260366321 | |
.data | |
ZERO: .float 0.0 | |
ONE: .float 1.0 | |
TWO: .float 2.0 | |
a: .float 0.7 | |
b: .float 1.375 | |
EPSILON: .float 0.0001 #; Value e in algorithm above. | |
INTERVAL: .float -5,5 #; Root is between these values. |
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
fun occurs (a , Arrow(t,s) ) = (occurs (a,t) orelse occurs (a,s)) | | |
occurs (a, Product(t,s) ) = (occurs (a,t) orelse occurs (a,s)) | | |
occurs (t as ref(NONE), TVar(s as ref(NONE))) = (t = s)| | |
occurs (t, s) = false |
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
.data | |
ZERO: .float 0.0 | |
ONE: .float 1.0 | |
TWO: .float 2.0 | |
a: .float 0.7 | |
b: .float 1.375 | |
EPSILON: .float 0.0001 | |
INTERVAL: .float 0,2 | |
POLYORDER: .word 0 | |
COEFFICIENTS: |
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(dec1::decs, e2) => (case dec1 of | |
Val(expr,name) => if name = x then | |
Let(Val(subst s expr,name)::decs,e2) | |
else | |
let | |
val (varName,Let(rnDecs, rnExpr)) = if member name (freeVars e') | |
then rename (name,Let(decs, e2)) else (name,Let(decs, e2)) | |
val Let(subDecs,subExpr) = subst s (Let(rnDecs, rnExpr)) | |
in | |
Let(Val(subst s expr,varName)::subDecs,subExpr) |
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
<html> | |
<body> | |
<script> | |
var xml_type; | |
// branch for native XMLHttpRequest object | |
if(window.XMLHttpRequest && !(window.ActiveXObject)) { |
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
.data | |
list1: .word 4,6,3,7,9,34,9,1,2,2,3,4,4,4,6 | |
buf1: .space 60 | |
list2: .word 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 | |
buf2: .space 60 | |
list3: .word -1,43,5,6,-7,2,3,4,-3,4,5,3,3,2,3 | |
buf3: .space 60 | |
test1: .asciiz "\nTesting for list1 - random list\n------------------------------\n" | |
test2: .asciiz "\nTesting for list2 - sorted list\n------------------------------\n" | |
test3: .asciiz "\nTesting for list3 - negative numbers\n------------------------------\n" |
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
# $a0 = address of string | |
# $v0 = length of it | |
strlen: | |
addi $t1, $a0, 0 | |
loop: | |
lb $t0, 0($a0) | |
addi $a0, $a0, 1 | |
bne $t0, $zero, loop | |
sub $v0, $a0, $t1 | |
addi $v0, $v0, -1 # -1 because \0 is counted |
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
// ==UserScript== | |
// @name WebCT Multiple sessions and Never expiring mymcgill sessions | |
// @namespace fuck webct | |
// @description ^ | |
// @include https://mycourses.mcgill.ca/webct/cobaltMainFrame.dowebct?* | |
// @include http://mycourses.mcgill.ca/webct/cobaltMainFrame.dowebct?* | |
// @include https://mymcgill.mcgill.ca/portal/page/portal* | |
// @include http://mymcgill.mcgill.ca/portal/page/portal* | |
// ==/UserScript== |
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
#!/usr/bin/env python | |
_ =["#@" | |
,'$%&#@#%%#' | |
,'=+@#%#$####' | |
,'@@@@@' | |
'.++ ,`###`` `:+#@@@' | |
,];import string, os;M=[string | |
.count,lambda zz: zz|1<<6,lambda QQQ ,X, |