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
lst1 = list(str1) | |
lst2 = list(str2) | |
for char in lst1: | |
if char in lst2: | |
count += 1 | |
lst2.remove(char) | |
return count |
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
trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 6 --transparent true --alpha 0 --tint 0x000000 --height 16 & |
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
, ((mod4Mask .|. controlMask, xK_j), spawn "amixer set Master 5%-") | |
, ((mod4Mask .|. controlMask, xK_k), spawn "amixer set Master 5%+") |
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
int array[]; | |
int prev2 = array[0]; | |
int prev1 = array[1]; | |
int sum_prev = prev1 + prev2; | |
bool seg_good = true; | |
for (int i = 2; i < n; ++i) | |
{ | |
int cur = array[i]; | |
if (cur == sum_prev) |
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
int f(const vector<int> &x) | |
{ | |
int longest = 2; | |
int p = 0; | |
int q = 0; | |
while (q < x.size()) | |
{ | |
int len = q - p + 1; | |
if (admissible(x, p, q)) | |
{ |
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
ans3 = Import["Anscombe3", "Table", "HeaderLines" -> 1]; | |
ansModel = LinearModelFit[ans3, x, x]; | |
residuals = ansModel["FitResiduals"] | |
KolmogorovSmirnovTest[residuals] | |
KolmogorovSmirnovTest[residuals, NormalDistribution[]] |
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
a=read.table("Anscombe3", header=TRUE) | |
model=lm(formula=y~x, data=a) | |
e=residuals(model) | |
ks.test(e, pnorm) |
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
ages = {40, 34, 23, 40, 31, 33, 49, 33, 34, 43, 26, 39}; | |
dates = {1543, 1600, 1665, 1746, 1774, 1839, 1858, 1864, 1896, 1901, | |
1905, 1926}; | |
data = Transpose[{dates, ages}]; | |
model = LinearModelFit[data, t, t] | |
residuals = model["FitResiduals"] | |
KolmogorovSmirnovTest[residuals] | |
KolmogorovSmirnovTest[residuals, NormalDistribution[], | |
"HypothesisTestData"]["TestDataTable"] |
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 queue import PriorityQueue | |
import config | |
class EventQueue: | |
def __init__(self): | |
self.q = PriorityQueue() | |
def get(self): | |
if self.q.empty(): | |
return -1 |
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
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
OlderNewer