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
use std::iter::Iterator; | |
use rand; // requires the rand crate | |
use rand::Rng; | |
use std::f64; | |
// I came up with this little algorithm because it seems | |
// (as far as I could google) there are no simple methods | |
// for selecting a single value randomly _and_ fairly | |
// from a variable-size stream/iterator in a single pass. |
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
import sys, os, base64, datetime, hashlib, hmac | |
import requests | |
import json | |
from typing import * | |
# based on the example python code found here: | |
# https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html | |
# call this method to query all items for a given primary hash key in a table | |
# endpoint: the DynamoDB endpoint to query (for AWS servers, this is "https://dynamodb.{region}.amazonaws.com/") |
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
mod linked_list { | |
use std::fmt::Display; | |
use std::default::Default; | |
type Next<V> = Option<Box<Node<V>>>; | |
struct Node<V> { | |
val: V, | |
next: Next<V>, | |
} |
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
mod sort { | |
fn insert_from_right<S>(vals: &mut [S], left: usize, right: usize) where S: Clone { | |
let mut i = right; | |
let mut temp; | |
while i > left { | |
temp = vals[i].clone(); | |
vals[i] = vals[i - 1].clone(); | |
vals[i - 1] = temp; | |
i -= 1; | |
} |
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
γγ£#γγ£#Ah!, Oh!#int | |
γγ#γγ#like that, that way#int | |
ζ#γγ#love#n,n-suf,vs | |
γγγγγγ#γγγγγγ#as ever, as usual, the same#adv,n | |
ζ¨ζΆ#γγγγ€#greeting, salutation#n,vs | |
ζζ #γγγγγ#love, affection#n | |
εε³#γγγ#sign, signal#n,vs | |
γ’γ€γΉγ―γͺγΌγ #γ’γ€γΉγ―γͺγΌγ #ice cream#n | |
ζγγ#γγγγ#to love#vs-s | |
ι#γγγ #space, room, time#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
#!/bin/bash | |
# this script will run input/output tests for java programs | |
USAGE="Usage: | |
javatest.sh <progpath> <inputs_folder_path> <expected_outputs_folder_path> | |
The names of the input files is expected to be the same as the name of the corresponding expected output files." | |
if [[ $# != 3 ]]; then |