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
1.) | |
fun squareSum nil = 0 | |
| squareSum(h::t) = h*h + squareSum(t); | |
how do tail recursive halp | |
2.) |
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
open List; | |
(* 1. Functions takes a list l and an int n ; Outputs l where the indexes are offset by n places *) | |
fun rotN(nil, n) = [] | |
| rotN(l, 0) = l | |
| rotN(h::t, n:int) = if (n > 0) then | |
rotN([last(t)]@rev(tl(rev(h::t))),n-1) | |
else |
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
(* Alejandro Salvador Vega Nogales | |
801-13-7956 | |
Prof. Koutis | |
CCOM-4029 *) | |
open List; | |
(* 1. Functions takes a list l and an int n ; Outputs l where the indexes are offset by n places |
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
(* Alejandro Salvador Vega Nogales | |
801-13-7956 | |
Prof. Koutis | |
CCOM-4029 *) | |
open List; | |
(* 1. Functions takes a list l and an int n ; Outputs l where the indexes are offset by n places |
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/bash | |
#script for batch generating users for AECC's raspberry pi. All passwords are temporary and will need to be prompted for new passwords on first login | |
echo -ne "This script must be run as root!\nScript for creating users for AECC raspberry pi from a csv file.\nEnter path for csv file: " | |
read csv_file | |
#exit if not root | |
if [[ `id -u` != 0 ]]; then | |
echo "Must be root to run script" |
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/bash | |
#script for batch generating users for AECC's raspberry pi. All passwords are temporary and will need to be prompted for new passwords on first login | |
echo -ne "This script must be run as root!\nScript for creating users for AECC raspberry pi from a csv file.\nEnter path for csv file: " | |
read csv_file | |
#exit if not root | |
if [[ `id -u` != 0 ]]; then | |
echo "Must be root to run script" |
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
#! /usr/bin/env python3 | |
#from http://rosalind.info/problems/revc/ | |
s = open("Downloads/rosalind_revc.txt", "r").read() | |
#added new line to dic since it's present in downloaded datasets | |
comp = {'A':'T', 'T':'A', 'C':'G', 'G':'C', '\n':''} | |
for c in s[::-1]: | |
print(comp[c], end='') |
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
#! /usr/bin/env python3 | |
#from http://rosalind.info/problems/fib/ | |
def rabi(n,m): | |
a = [1,1,2] | |
if (n < 4): | |
return a[n-1] | |
else: | |
for i in range(2, n): | |
a.append(a[i-1] - a[i-(m-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
Error: Got Net::HTTPBadRequest from gist: {"message":"Problems parsing JSON","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"} |
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
#! /usr/bin/env bash | |
# ask user for what to back up | |
read -p "Please enter the directory or file you wish to backup: " src | |
# compress and package | |
tar -czvf "$src-backup.tar.gz" "$src" | |
bak="$src-backup.tar.gz" | |
# ask where we're storing our backup | |
read -p "Enter directory or server where you want to store your backup: " dst | |
# check for remote destination | |
if echo "$dst" | grep -qe "(.*@.*\..*)" | grep -qe "^:$"; then dst+=':'; fi |
OlderNewer