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
# Most of this was adapted from | |
# http://matt.might.net/articles/compiling-up-to-lambda-calculus/ | |
# Python's lambda expressions are turing-complete. To show this, we will | |
# implement the "Lambda calculus" which is another way of saying "We're so manly | |
# we don't even NEED if statements!" The lambda calculus was invented in the | |
# 1930s, and it can solve any computable problem just by using anonymous | |
# functions that each take one argument and return one value, function | |
# application, and variable references. No jumps or GO TO's needed. |
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 numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Voronoi | |
def voronoi_finite_polygons_2d(vor, radius=None): | |
""" | |
Reconstruct infinite voronoi regions in a 2D diagram to finite | |
regions. | |
Parameters |
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
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"os/signal" | |
"syscall" | |
"time" |
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
package main | |
import ( | |
"fmt" | |
"golang.org/x/net/context" | |
cc "golang.org/x/oauth2/clientcredentials" | |
"io/ioutil" | |
"net/http" | |
"os" | |
) |
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
There are two options - implicit storages in MV (MV without TO) and explicit (table created in advance) (MV with TO). | |
And I have not been using MV without TO for a long time. Because it’s much more obvious and convenient to stupidly drop MV and create a new one. | |
# alter MV with implicit storage .inner (without TO) | |
1. stop ingestion | |
2. detach table MVX | |
3. alter table `.inner.MVX` add column ..... | |
4. attach MATERIALIZED VIEW MVX as select new_SELECT_..... |
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
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"sync/atomic" | |
"time" |