This file contains hidden or 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
/* | |
* 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/ |
This file contains hidden or 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
/* | |
* 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; | |
This file contains hidden or 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
/* | |
* 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; | |
This file contains hidden or 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
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), |
This file contains hidden or 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
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)) |
This file contains hidden or 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 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 |
This file contains hidden or 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 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)) |
This file contains hidden or 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 json | |
import syllapy | |
def lambda_handler(event, context): | |
if event["text"] is None: | |
return {'statusCode':400 } | |
txt = event["text"] | |
tt = txt.split('\n') | |
This file contains hidden or 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
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' | |
This file contains hidden or 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
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))); |
NewerOlder