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
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
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
### 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
// 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
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') |
NewerOlder