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
<?php | |
require '/var/www/scripts/directoryToArray.php'; | |
function getRandomCatPicture() { | |
$expFileArray = shuffle(loadExpressions()); | |
$index = 0; | |
$file = ""; | |
while (strpos(pathinfo($expFileArray[$index], PATHINFO_FILENAME), 'cat') === false) { | |
$index += 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
module Pipeline12Register_Test(); | |
parameter CLOCK_PERIOD = 20; // ns | |
parameter BIT_WIDTH = 32; | |
parameter REGSEL_BITS = 4; | |
reg clk, reset; | |
reg [REGSEL_BITS - 1:0] r1, r2, r_dest; | |
reg [BIT_WIDTH - 1:0] r1_out, r2_out, alu_out; | |
reg isBranch, isJump, toReg, toMem; | |
wire [BIT_WIDTH - 1:0] p12_r1_out, p12_r2_out, p12_alu_out; |
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
; BREAK | |
Debug_Break: | |
; Display the value of t0 on HEX | |
; Display the value of t1 on LEDR | |
sw t0,OFSHEX(gp) | |
sw t1,OFSLEDR(gp) | |
bt t0,t0,Debug_Break |
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
assign pcIn = (opcode == 11) ? (reg_read_data1 + (4 * imm)) | |
: (branch && alu_result) ? pcOut + INST_SIZE + (4 * imm) | |
: pcOut + INST_SIZE; |
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
.NAME IOBASE= 0xF0000000 | |
.NAME OFSHEX= 0x00000000 | |
.NAME OFSLEDR=0x00000004 | |
.NAME OFSLEDG=0x00000008 | |
.ORIG 0x40 | |
AtZero: | |
; Display 0xFF on LEDG | |
mvhi gp,IOBASE | |
andi s0,s0,0 |
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
# coding=utf-8 | |
# Arr Encryption Standard (ArES) | |
# A R R | |
from sys import argv | |
key2_array = ['a', 'r', 'r'] | |
def arr_encrypt(plaintext, key): | |
output = [] | |
for index in range(0, len(plaintext)): |
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
// daysuntil.js | |
// (C) 2012+ by Steakscorp Labs and Jinhai Steakhouse | |
// Calculates the number of days between two dates, or | |
// the number of days between today and some date in | |
// the future | |
// Number of milliseconds per day | |
const ONE_DAY = 86400000; | |
const MONTHS = ["January", "February", "March", "April", "May", |
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 | |
mount | grep '/var/motion-captures type fuse.sshfs' | |
if [ $? -ne 0 ]; then | |
echo "No SSHFS connection to Steakscorp Core - attempting mount" | |
sshfs pir2-camera@steakscorp.org:/home/pir2-camera/camera-output /var/motion-captures -o nonempty | |
if [ $? -ne 0 ]; then | |
echo "FAILURE - Can't connect to Steakscorp Core - not starting motion" | |
exit 1 | |
fi |
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 subprocess import call | |
from urllib import request | |
REF_URL = 'https://google.com' | |
def main(): | |
if not check_connectivity(REF_URL): | |
print("NO INTERNET - Attempting to refresh wlan0") | |
call(["ifdown", "wlan0"]) | |
call(["ifup", "wlan0"]) |
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
/** | |
* Converts an input string to a fixed-width string. | |
*/ | |
function stringToFixedLength(input) { | |
var output = ""; | |
for (var i = 0; i < input.length; i++) { | |
/* Ignore newline characters */ | |
if (input.charAt(i) == "\n") { | |
output = output + "<br />"; |