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
function shortnumberstring(number) | |
local steps = { | |
{1,""}, | |
{1e3,"k"}, | |
{1e6,"m"}, | |
{1e9,"g"}, | |
{1e12,"t"}, | |
} | |
for _,b in ipairs(steps) do | |
if b[1] <= number+1 then |
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 removeNILTop | |
(defun removeNILTop (lst) | |
(remove-if #'null lst)) | |
(removeNILTop '(NIL X NIL NIL Y NIL Z)) | |
(removeNILTop '(X NIL Y NIL Z NIL)) | |
(removeNILTop '(NIL (X NIL Y) (NIL NIL))) | |
;;; #2 removeNILMost | |
(defun removeNILMost (lst) |
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
# Get a temporary file for storing encrypted outputs | |
$encryptedFile = New-TemporaryFile | |
# Milestone testing function | |
function TestMilestone($milestone, $inputFile, $outputFile, $keyFile, $expectedOutputFile) { | |
Write-Host "Running Milestone $milestone... " -NoNewline | |
echo "" # Use echo to skip the system pause | |
| ./Debug/cs3843-cryptography.exe -e $inputFile -p SECRET -o $outputFile -k $keyFile -m $milestone | |
| Out-Null # Suppress output |
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
const colors = require('tailwindcss/colors'); | |
const Color = require('color'); | |
// Range generation function | |
const range = (lower, upper, step) => { | |
return Array.from( | |
new Array(Math.floor(upper / step - lower / step) + 1), | |
(_, i) => lower / step + i | |
).map((x) => x * step); | |
}; |
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
{ | |
"Response": { | |
"status": 200, | |
"flightInfo": { | |
"logo": null, | |
"airlineName": null, | |
"airlineCode": "ASA", | |
"airlineCodeIata": null, | |
"tailNumber": "N976AK", | |
"flightNumberInfo": "ASA541", |
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 detected while processing WinEnter Autocommands for "*": | |
E5108: Error executing lua Vim:E495: no autocommand file name to substitute for "<afile>" | |
stack traceback: | |
[C]: in function 'expand' | |
[string ":lua"]:1: in main chunk |
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
def score(distribution): | |
count = len(distribution) | |
deviation = [abs(1 / count - d) for d in distribution] | |
avg_deviation = sum(deviation) / count | |
return 1 - sum(deviation) / count | |
print(score([1 / 5 for _ in range(5)])) | |
print(score([0.12, 0.33, 0.55])) |
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
❯ type -a pkg-config | |
pkg-config is /home/linuxbrew/.linuxbrew/bin/pkg-config | |
pkg-config is /usr/bin/pkg-config | |
pkg-config is /bin/pkg-config | |
❯ pkg-config --variable pc_path pkg-config | |
/home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/pkgconfig |
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
warning: variable does not need to be mutable | |
--> src/item.rs:412:15 | |
| | |
412 | if let Ok(mut asleep) = (&mut asleeps).try_get(who) { | |
| ----^^^^^^ | |
| | | |
| help: remove this `mut` | |
| | |
= note: `#[warn(unused_mut)]` on by default |
NewerOlder