input | output |
---|---|
16 | 1 |
17 | 1 |
18 | 1 |
19 | 1 |
20 | 1 |
21 | 0 |
22 | 0 |
23 | 0 |
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
try: | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
except: | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import socket | |
class NumberServer(BaseHTTPRequestHandler): | |
def _set_headers(self): | |
self.send_response(200) | |
self.send_header('Content-type', 'text/plain') |
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
// npm i ripple-lib | |
// node valstream.js | |
const RippleAPI = require("ripple-lib").RippleAPI; | |
var api = new RippleAPI({ server: "wss://s1.ripple.com" }); | |
api.connect().then(() => { | |
api.connection.on('validationReceived', (event) => { | |
console.log(JSON.stringify(event, null, 2)) |
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
### I have just deposited some more XRP to what was a balanced portfolio, not is it is unbalanced | |
(crypto_balancer) Matts-iMac:crypto_balancer matt$ crypto_balancer binance | |
Connected to exchange: Binance | |
Balances: | |
XRP 4468.878282 | |
BTC 0.01609 | |
ETH 0.42 | |
BNB 3.04830514 | |
USDT 33.602051 |
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 fft(inp): | |
inp = tuple(inp) | |
total = "" | |
for i, c in enumerate(inp, 1): | |
pat = [ [item] * i for item in base_pat ] | |
pat = [item for sublist in pat for item in sublist] | |
l1 = len(pat) | |
l2 = len(inp) | |
pat = pat * math.ceil((l2+1)/l1) | |
pat = pat[1:l2+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
def heater_control(temperature): | |
if temperature > 20: | |
return 0 | |
else: | |
return 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
# USAGE | |
# python align_faces.py --shape-predictor shape_predictor_68_face_landmarks.dat input/example_*.jpg | |
# import the necessary packages | |
from imutils.face_utils import FaceAligner | |
from imutils.face_utils import rect_to_bb | |
import argparse | |
import imutils | |
import dlib | |
import cv2 |
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
(pytorch2) (base) Matts-iMac:facial_alignment matt$ ls input/ | |
IMG_0720.JPG IMG_1784.JPG IMG_2697_2.JPG IMG_3251.JPG IMG_5523_2.JPG IMG_7489.JPG IMG_7836.JPG | |
IMG_1148.JPG IMG_1908.JPG IMG_2918.JPG IMG_3651.JPG IMG_7480.JPG IMG_7490.JPG IMG_9029.JPG | |
IMG_1215.JPG IMG_1910.JPG IMG_3028.JPG IMG_3833.JPG IMG_7482.JPG IMG_7630.JPG IMG_9622.JPG | |
IMG_1574.JPG IMG_2041.JPG IMG_3250.JPG IMG_5520_2.JPG IMG_7485.JPG IMG_7633.JPG IMG_9919.JPG | |
(pytorch2) (base) Matts-iMac:facial_alignment matt$ python align_faces.py --shape-predictor shape_predictor_68_face_landmarks.dat --images input/*.JPG | |
processing: input/IMG_0720.JPG | |
processing: input/IMG_1148.JPG | |
processing: input/IMG_1215.JPG | |
processing: input/IMG_1574.JPG |
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 argparse | |
import requests | |
import json | |
from urllib.parse import urlparse | |
parser = argparse.ArgumentParser(description="Fetch content from a coil post") | |
parser.add_argument("url", help="URL to fetch from Coil") | |
args = parser.parse_args() | |
url_parts = urlparse(args.url) |
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
# A simple hello world function | |
% cat hello.py | |
def main(args): | |
name = args.get("name", "unknown") | |
return {"message": f"Hello {name}!"} | |
# create an action | |
% ic fn action create hello hello.py | |
ok: created action hello |
OlderNewer