x - allocation number
y - diff allocated at iteration between old and new memory
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 get_text(is_test = False): | |
if is_test: | |
return [ | |
'Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53', | |
'Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19', | |
'Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1', | |
'Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83', | |
'Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36', | |
'Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11', | |
] |
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 get_text(is_test = False): | |
if is_test: | |
return [ | |
'Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green', | |
'Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue', | |
'Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red', | |
'Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red', | |
'Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green', | |
] |
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 get_text(is_test = False): | |
if is_test: | |
return [ | |
'467..114..', | |
'...*......', | |
'..35..633.', | |
'......#...', | |
'617*......', | |
'.....+.58.', | |
'..592.....', |
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 countCalibrationValue(text): | |
count = 0 | |
for row in text: | |
i, j = 0, len(row)-1 | |
while i <= j: | |
if row[i].isdigit() and row[j].isdigit(): | |
count += int(row[i] + row[j]) | |
break | |
if not row[i].isdigit(): | |
i += 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
trait Figure { | |
fn area(&self) -> f64; | |
} | |
struct Circle { | |
radius: f64, | |
} | |
struct Rectangle { | |
a: f64, |
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 | |
NEW_USER=$NEW_USER_NAME | |
LAST_IP=$LAST_LOCAL_IP_SERVER_CONFIGURE | |
cd /etc/wireguard && mkdir "${NEW_USER}" | |
wg genkey | tee /etc/wireguard/"${NEW_USER}"/privatekey | wg pubkey | tee /etc/wireguard/"${NEW_USER}"/publickey | |
echo "configured keys for new user:" "${NEW_USER}" |
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
git filter-branch --env-filter ' | |
WRONG_EMAIL="[email protected]" | |
NEW_NAME="New Name Value" | |
NEW_EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$NEW_NAME" | |
export GIT_COMMITTER_EMAIL="$NEW_EMAIL" | |
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 mp4 to wav format `ffmpeg -i <infile> -ac 2 -f wav <outfile>` | |
join wav files `ffmpeg -i 1.wav -i 1.wav -i 1.wav -i 1.wav \ | |
-filter_complex '[0:0][1:0][2:0][3:0]concat=n=4:v=0:a=1[out]' \ | |
-map '[out]' output.wav` |
Example by docs
- Install gcc, avr-gcc, avr-objcopy, avrdude
- Use updaload.sh
NewerOlder