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
| # calculate the WPM of a dit ".", dah "-", space (intra word) | |
| # and "/" (inter word) string as per the output of | |
| # https://morsecode.world/international/translator.html | |
| # | |
| # provide the number of seconds as an argument | |
| # | |
| # example run | |
| # python3 .\count_dits_est_wpm.py 57 | |
| # . ...- . .-. -.-- / -.. .. - / .- -. -.. / -.. .- .... / -.-. .- .-. .-. .. . ... / .- / ...- --- .. -.-. . / .- -.-. .-. --- ... ... / - .... . / .- .. .-. .-- .- ...- . ... .-.-.- | |
| # 7.768421052631578 |
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
| from sys import stdin | |
| from operator import sub | |
| input_data = [ (int(a),int(b)) for a,b in (line.split() for line in stdin)] | |
| print( sum( map(lambda a: abs(sub(*a)), | |
| zip(sorted(a for a,b in input_data), | |
| sorted(b for a,b in input_data)) ))) |
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
| swing states | |
| PA 19 | |
| GA 16 | |
| NC 16 | |
| MI 15 | |
| AZ 11 | |
| WI 10 | |
| NV 6 | |
| Democrats (226 baseline) |
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
| #!/usr/bin/env python3 | |
| # Take a AWS transcribe json file with speaker labels from stdin and | |
| # print out a plain text transcript with the speaker_label items at the | |
| # start of line with a colon | |
| # Copyright Mark Jenkins <mark@markjenkins.ca> | |
| # | |
| # Copying and distribution of this file, with or without modification, | |
| # are permitted in any medium without royalty provided the copyright |
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/sh | |
| opusenc $1 `basename -s .wav $1`.opus |
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
| rem VIC-20 basic program to act as a tone | |
| rem generator for morse code practice | |
| rem author Mark Jenkins <mark@parit.ca> | |
| rem checks portB pin 0 e.g. pin "C" | |
| rem hardware connected to user-port | |
| rem should short that pin to ground when a | |
| rem switch is closed. | |
| rem |
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
| UNIXPW_DISABLE_SSL=1 x11vnc -display :0 -forever -localhost -unixpw |
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/sh | |
| # for IQ511 | |
| # $1 is the last octet of the ipv4 address | |
| # created files are not cleaned up | |
| # regarding /now.jpg urls | |
| # snap=spush0.25 means camera push a frame every 0.25 seconds | |
| # ds=2 downsample by a factor of 2 (half size) | |
| # |
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
| #!/usr/bin/env python3 | |
| # https://adventofcode.com/2022/day/1 Parts 1 and 2 with constant memory | |
| # Mark Jenkins | |
| from heapq import nlargest | |
| def gen_elf_lines(): | |
| """a generator of consecutive elf lines, converted to int |
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
| #!/usr/bin/env python3 | |
| EOFDEPTH = -1 | |
| def read_depth_line(): | |
| try: | |
| line = input() | |
| return int(line) | |
| except EOFError: | |
| return EOFDEPTH |
NewerOlder