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
(** logging.ml - Custom logging and error messages *) | |
(* | |
The two key functions here are _log and fatal, which do what they sound like | |
*) | |
(** Represents the severity of a log statement *) | |
type log_type = | |
| Log_None | |
| Log_Debug |
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
Require Import ZArith. | |
Require Import List. | |
Require Import Coq.Strings.Byte. | |
Import ListNotations. | |
Import ByteNotations. | |
Open Scope list_scope. | |
Open Scope nat_scope. | |
Open Scope bool_scope. | |
(* |
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
import pandas as pd | |
import requests | |
import os | |
import progressbar | |
def download_image(tweet_id, url): | |
dot_index = url.rindex(".") | |
q_index = url[dot_index:].index("?") if "?" in url else len(url) | |
fn = f"tweet_{tweet_id}" + (url[dot_index:q_index]) | |
if os.path.exists(fn): |
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
cont = input("This is a tough one to get out of. Use ctrl-c as a backup. Continue? (y/n) ") | |
if not "y" in cont: | |
quit() | |
print("CHALLENGE: EXIT INTERPRETER USING A VALID PYTHON 3.10 PAYLOAD") | |
import builtins | |
import readline | |
input = builtins.input |
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
/* | |
* Author: Charles Averill | |
* WARNING: Don't run this on anything important | |
*/ | |
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> |
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
/* | |
Author: Charles Averill | |
Usage: Open BuildPlayer window from Tools > BuildPlayer | |
Note: This script assumes that your scenes are in Assets/Scenes, and that you have a Builds folder in your project root. | |
Ex: | |
Project/ | |
├── Assets | |
│ └── Scenes | |
│ ├── Scene1.unity | |
│ └── Scene2.unity |
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
matrix_shape = matrix.shape | |
flat_matrix = matrix.flatten() | |
ls_matrix = flat_matrix.tolist() | |
num_items = len(ls_matrix) | |
for stricken in range(int(num_items * self.v_ratio)): | |
if self.value: | |
ls_matrix[random.randint(0, len(ls_matrix) - 1)] = self.value | |
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
weights[tuple(map(lambda x: np.random.randint(0, x), weights.shape))] = random.uniform( | |
self.low_bound, self.high_bound) |