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 os import scandir | |
from sys import argv | |
from math import radians, cos, sin, asin, sqrt | |
def iterate_users(dataset_path): | |
l = [] | |
for user in scandir(dataset_path): | |
for f in scandir(user.path): | |
if f.name == "user.txt": | |
l.append(parse_file(f.path)) |
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
COMP1927 15s2 Exam Question 4 (Fury of Dracula) | |
A. | |
Dracula's Castle | |
B. | |
City move (Unknown City) | |
C. | |
They lose all their lifepoints |
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
NUMBERS = { | |
0: "zero", | |
1: "one", | |
2: "two", | |
3: "three", | |
4: "four", | |
5: "five", | |
6: "six", | |
7: "seven", | |
8: "eight", |
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
word={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"}[int(input()[-1])];print(any(True if ord(i)==101 else False for i in word if i==word[-2]or i in word[-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 | |
if test $# -ne 2 | |
then | |
echo "Usage: ./burn.sh image_name disk_name" | |
exit 1 | |
fi | |
img=$1 | |
sd=$2 | |
echo "Are you sure you want to run: (Y)" | |
echo "'sudo dd bs=4M if=$img of=/dev/$sd status=progress conv=fsync'" |
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/python3 | |
# Author: ekohilas | |
# Creates a list of lists containing the all the numbers of a certain base to | |
# the given length. | |
# i.e. | |
# base, length = 32, 4 | |
# [1,1,1,1] ... [32,32,32,32] | |
def dec2base(n, b): | |
""" |
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
// https://developers.google.com/apps-script/reference/document | |
function insertTimeStampAtCursor() { | |
const doc = DocumentApp.getActiveDocument(); | |
const selection = doc.getSelection(); | |
const cursor = doc.getCursor(); | |
const dateTimeString = rfc2822Datetime(); | |
if (selection) { | |
const selectedElements = selection.getRangeElements(); |
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 python | |
import sys | |
import os | |
import subprocess | |
import re | |
from StringIO import StringIO | |
# usage: | |
# |