Autoriser les applications moins sécurisées
Dans Google, paramètres du compte, sécurité
use cl-smpt library
(ql:quickload :cl-smtp)
#include <WiFi.h> | |
#include <HTTPClient.h> | |
void setup() { | |
Serial.begin(115200); | |
while (!Serial) continue; | |
WiFi.begin("your SSID", "p4sswOrd"); |
import requests | |
url = 'https://api.blockchain.com/v3/exchange/' | |
# Public requests | |
requests.get(url + 'tickers/BTC-EUR').json() | |
# Private requests | |
api_key = 'YOUR API KEY' | |
order = {'clOrdId':1,'ordType': 'LIMIT', 'symbol': 'BTC-EUR', 'side': 'BUY', 'orderQty': 10, 'price': 100} | |
requests.post(url + 'orders', json = order, headers = {'X-API-Token': api}).json() |
import urllib.parse | |
import hashlib | |
import hmac | |
import base64 | |
import time | |
import requests | |
def sign(method, data={}): | |
key = '' # your API key | |
secret = '' # your API secret |
import time | |
import hmac, hashlib | |
import requests | |
def sign(): | |
user = '' # username @ Bitstamp | |
key = '' # API key | |
secret = '' # API secret | |
now = time.strftime("%s") |
<script type="text/javascript" async | |
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> | |
</script> |
(define-condition my-error (condition) | |
((message :initarg :message :reader message))) | |
(handler-case (signal 'my-error :message "Damned! an error!") | |
(my-error (e) (warn "~s" (message e)))) |
Autoriser les applications moins sécurisées
Dans Google, paramètres du compte, sécurité
use cl-smpt library
(ql:quickload :cl-smtp)
How to write a message in another terminal (with Common Lisp) ?
(following the Reddit thread https://www.reddit.com/r/emacs/comments/hap72j/isnt_it_possible_to_ask_emacs_for_a_carriage/fv60gwq)
Install packages
apt install build-essential
apt install libfixposix3 libfixposix-dev
apt install netcat
;; use rolling-map and average (https://gist.github.com/brulint/c329d255746a7659cb01ba0305c1d2f0) | |
(defun rsi (n prices) | |
(let ((gain (let ((cumul 0)) | |
(mapcar #'(lambda (x) (setq cumul (/ (+ (* cumul (1- n)) x) n))) | |
(cdr (rolling-map 2 #'(lambda (&rest list) | |
(if (apply #'< list) (abs (apply #'- list)) 0)) | |
prices))))) | |
(loss (let ((cumul 0)) | |
(mapcar #'(lambda (x) (setq cumul (/ (+ (* cumul (1- n)) x) n))) |
(defun rolling-map (n func list &optional (sequence '()) (return '())) | |
(cond ((eq list '()) return) | |
(t (setq sequence (append sequence (list (car list)))) | |
(if (> (length sequence) n) (setq sequence (cdr sequence))) | |
(setq return (append return (list (apply func sequence)))) | |
(rolling-map n func (cdr list) sequence return)))) | |
(defun average (&rest list) (/ (apply '+ list) (length list))) | |
(rolling-map 3 'list '(1 1 2 3 5 8 13 21 34)) |