Skip to content

Instantly share code, notes, and snippets.

@icezee
icezee / a_remote_scene.glsl
Last active June 23, 2021 05:37
A Remote Scene (Texture and Displacement Exercise)
/*
* A Remote Scene
* a simple technical exercise for texture and displacement
* icezee 06.19.2021
*
* see it live at https://www.shadertoy.com/view/flBGzK
*/
// Most utility functions are from http://iquilezles.org/
/*
* GLSL Ray Marching in Shadertyoy
* notes based on ig's live demo
*/
float map( in vec3 pos )
{
float d = length(pos) - 0.25;
float d2 = pos.y + 0.25;
/*
* GLSL Ray Marching in Shadertyoy
* notes based on ig's live demo
*/
float map( in vec3 pos )
{
float d = length(pos) - 0.25;
float d2 = pos.y + 0.25;
const
next = op.outTrigger("next"),
inTrig = op.inTrigger("reset"),
outArr = op.outArray("Points"),
inIndex = op.inInt("Index", 0),
inNumber = op.inInt("Number", 0),
inX1 = op.inValue("x1", 0),
inY1 = op.inValue("y1", 0),
inZ1 = op.inValue("z1", 0),
inX2 = op.inValue("x2", 1),
chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("fill", color)
.selectAll("rect")
.data(data)
.join("rect")
.attr("x", (d, i) => x(i))
.attr("y", d => y(d.value))
import spacy
from collections import Counter
import csv
from sklearn.manifold import TSNE
nlp = spacy.load('en_core_web_lg')
nlp.max_length = 1100000
def word_vec(w):
return nlp(w).vector
import spacy
from collections import Counter
import csv
nlp = spacy.load("en_core_web_sm")
doc = nlp(open("data/pride_and_prejudice_clean.txt").read())
sents = list(doc.sents)
print("total sentences:",len(sents),"average words per sentence",len(doc)/len(sents))
import json
import syllapy
def lambda_handler(event, context):
if event["text"] is None:
return {'statusCode':400 }
txt = event["text"]
tt = txt.split('\n')
let p = []
let c = 0
let submit_button
let url="https://7kkkls40gc.execute-api.us-west-1.amazonaws.com/s0/z3syl_count"
function setup() {
createCanvas(windowWidth, windowHeight);
let font_size = int(max(width * 0.05,36))
let s = 'font-size:'+font_size+'px;text-align:center;border:none'
@icezee
icezee / pointCluster.java
Last active October 29, 2020 13:22
Point Cluster
void pointCluster(PVector v, int n, float alt) {
float r = alt * zmap.range; //0.000122; //0.00025;
for(int i=0; i<n; i++) {
float theta = random(TWO_PI);
float rr = random(r-random(r)); //random(r+random(r));
float x = v.x + rr*cos(theta);
float y = v.y + rr*sin(theta);
float d = min(random(15), 120/v.dist(new PVector(x,y)));