| title | How to cover any parking lot with EV charging stations |
|---|---|
| subtitle | protip: easier than gasoline pumps at every parking lot |
| author | Felina Rivera Calzadillas 🇲🇽 |
- Leader in EV charging and distributed energy resources.
- Adaptive Load Management
| <?xml version="1.0" encoding="utf-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <meta http-equiv="Content-Style-Type" content="text/css" /> | |
| <meta name="generator" content="pandoc" /> | |
| <meta name="author" content="Felina Rivera Calzadillas 🇲🇽" /> | |
| <title>How to cover any parking lot with EV charging stations</title> |
| (* Some prime stuff in Mathics, an open source mathematica clone with pythonic influence *) | |
| In[1]:= 2^255-19 | |
| Out[1]= 57896044618658097711785492504343953926634992332820282019728792003956564819949 | |
| In[2]:= 2^255+95 | |
| Out[2]= 57896044618658097711785492504343953926634992332820282019728792003956564820063 | |
| In[3]:= PrimeQ[2^255-19] | |
| Out[3]= True |
| #!/bin/sh | |
| # pgsql - connect to PostgreSQL using credentials from pass(1) | |
| set -eu | |
| if [ $# -lt 1 ]; then | |
| echo "Usage: pgsql <pass-prefix> [extra psql args...]" >&2 | |
| echo "Reads from these secrets: <pass-prefix>/{host,port,user,dbname,password}" >&2 | |
| echo "https://www.passwordstore.org/" >&2 | |
| exit 1 | |
| fi |
| #!/usr/bin/env node | |
| const addr = process.env.MTPLVCAP_ADDRESS || "ws://localhost:42839/control" | |
| // TODO: add the other mtplvcap commands | |
| const payload = {af_focus_now: true} | |
| let ws = new WebSocket(addr) | |
| ws.onopen = () => { | |
| ws.send(JSON.stringify(payload)) | |
| ws.close(1000, "Normal Closure") | |
| } |
| """This program is for working with Polynomials. | |
| With this code, you can define a Polynomial and: | |
| - convert it to LaTeX math notation | |
| something like 5x^2 + 2x - 3 | |
| - find the derivative of a polynomial | |
| - find a root of a one dimensional polynomial (floating point or complex/imaginary) | |
| """ | |
| from math import isclose | |
| from typing import Sequence, Generic, TypeVar |
| {"0": [-459.66999999999996, -60], "1": [-60, -50], "2": [-50, -40], "3": [-40, -30], "4": [-30, -20], "5": [-20, -10], "6": [-10, 0], "7": [0, 10], "8": [10, 20], "9": [20, 30], "10": [30, 40], "11": [40, 50], "12": [50, 60], "13": [60, 70]} | |
| [[0, "A", -459.66999999999996, -65], [0, "B", -65, -60], [1, "A", -60, -55], [1, "B", -55, -50], [2, "A", -50, -45], [2, "B", -45, -40], [3, "A", -40, -35], [3, "B", -35, -30], [4, "A", -30, -25], [4, "B", -25, -20], [5, "A", -20, -15], [5, "B", -15, -10], [6, "A", -10, -5], [6, "B", -5, 0], [7, "A", 0, 5], [7, "B", 5, 10], [8, "A", 10, 15], [8, "B", 15, 20], [9, "A", 20, 25], [9, "B", 25, 30], [10, "A", 30, 35], [10, "B", 35, 40], [11, "A", 40, 45], [11, "B", 45, 50], [12, "A", 50, 55], [12, "B", 55, 60], [13, "A", 60, 65], [13, "B", 65, Infinity]] | |
| [["0A", -459.66999999999996, -65], ["0B", -65, -60], ["1A", -60, -55], ["1B", -55, -50], ["2A", -50, -45], ["2B", -45, -40], ["3A", -40, -35], ["3B", -35, -30], ["4A", -30, -25], ["4B", -25, -20], ["5A", -20, -15], ["5B", -15, |
| {"type":{"Spectral":"div","RdYlGn":"div","RdBu":"div","PiYG":"div","PRGn":"div","RdYlBu":"div","BrBG":"div","RdGy":"div","PuOr":"div","Set2":"qual","Accent":"qual","Set1":"qual","Set3":"qual","Dark2":"qual","Paired":"qual","Pastel2":"qual","Pastel1":"qual","OrRd":"seq","PuBu":"seq","BuPu":"seq","Oranges":"seq","BuGn":"seq","YlOrBr":"seq","YlGn":"seq","Reds":"seq","RdPu":"seq","Greens":"seq","YlGnBu":"seq","Purples":"seq","GnBu":"seq","Greys":"seq","YlOrRd":"seq","PuRd":"seq","Blues":"seq","PuBuGn":"seq"},"Spectral":{"3":[[153,213,148],[255,255,191],[252,141,89]],"4":[[43,131,186],[171,221,164],[253,174,97],[215,25,28]],"5":[[43,131,186],[171,221,164],[255,255,191],[253,174,97],[215,25,28]],"6":[[50,136,189],[153,213,148],[230,245,152],[254,224,139],[252,141,89],[213,62,79]],"7":[[50,136,189],[153,213,148],[230,245,152],[255,255,191],[254,224,139],[252,141,89],[213,62,79]],"8":[[50,136,189],[102,194,165],[171,221,164],[230,245,152],[254,224,139],[253,174,97],[244,109,67],[213,62,79]],"9":[[50,136,189],[102,194 |
| # This demonstrates using tox to test different Python versions and different library versions on select Python versions. | |
| # TODO: use asdf, pyenv, Dockerfile to install many py versions | |
| # Dependencies: aiohttp | |
| # Dev dependencies: pytest pytest-asyncio pytest-cov tox tox-pyenv | |
| [tox] | |
| envlist = | |
| # The oldest Python version we support | |
| # 3.7 is EOL and 3.8 only has 1 more year of security updates |
| function resolve_hostname(hostname) | |
| local dns_resolver_lib = require("resty.dns.resolver") | |
| local dns_resolver, dns_resolver_err = dns_resolver_lib:new({ | |
| -- Kubernetes default nameserver IP | |
| -- If your hostnames are public, try Google's DNS nameserver 8.8.8.8 | |
| nameservers = {"kube-dns.kube-system.svc.cluster.local"}, | |
| -- 250 milliseconds | |
| timeout = 250, | |
| retrans = 2 |