Skip to content

Instantly share code, notes, and snippets.

View w8r's full-sized avatar
💭
learning

Alexander Milevski w8r

💭
learning
View GitHub Profile
@w8r
w8r / Readme.md
Last active April 29, 2024 11:53
Huygens' arc length approximation
@w8r
w8r / link.txt
Created March 27, 2024 16:13
Marketing dataset
@w8r
w8r / graphToSVG.ts
Last active March 10, 2024 15:08
Graph to SVG
type Id = string | number;
interface Node {
id: Id;
color: string;
radius: number;
x: number;
y: number;
strokeWidth?: number;
strokeColor?: string;
@w8r
w8r / bresenham.c
Created January 10, 2018 10:02 — forked from lyjia/bresenham.c
bresenham.c
/********************************************************************
* *
* Curve Rasterizing Algorithm *
* *
********************************************************************/
/**
* @author Zingl Alois
* @date 22.08.2016
* @version 1.2
@w8r
w8r / readPixelsAsync.ts
Created January 25, 2024 12:35
readPixelsAsync.ts
const clientWaitAsync = function (gl, sync, flags = 0, interval_ms = 10) {
return new Promise<void>(function (resolve, reject) {
const check = () => {
const res = gl.clientWaitSync(sync, flags, 0);
if (res === gl.WAIT_FAILED) {
reject();
return;
}
if (res === gl.TIMEOUT_EXPIRED) {
setTimeout(check, interval_ms);

Whose life do I admire that is secretly miserable?

What do I believe is true only because believing it puts me in good standing with my tribe?

Which of my current values would be different if I were raised by different parents?

What do I believe the most with the least amount of evidence of it being true?

Who has the right answer but I ignore because they’re a bad communicator?

@w8r
w8r / AI-en.md
Last active September 7, 2022 23:17
AI screenplays hackathon

Problem

We wanted to find out if we can generate movie screenplays or short story synopsises using artificial intelligence. The idea was to see if we can train it not only to follow the certain text style, but make it produce new ideas and deliver them in a structured way.

State of the art

We have explored the artificial intelligence models for text generation. We have focused on the latest most recent and advanced models capable of producing and imitating natural language. The latest models are GPT-3 by OpenAI and GPT-J by EleutherAI. They are very heavy and complex models trained to predict and continue text based on their language model and the provided context. Both have billions of internal parameters and are able to produce about 500-1000 words based on the context that is passed in as a prompt or question, few parameters and the adjustments made by feeding them different datasets before using them. Both are based on the same scientific research but trained by different companies on different gig

@w8r
w8r / liang-barsky.js
Created August 2, 2017 13:19
Liang-Barsky line clipping
/**
* Liang-Barsky function by Daniel White
*
* @link http://www.skytopia.com/project/articles/compsci/clipping.html
*
* @param {number} x0
* @param {number} y0
* @param {number} x1
* @param {number} y1
* @param {array<number>} bbox
@w8r
w8r / laplacian.js
Created January 6, 2017 12:36
Graph Laplacian
function laplacian(G, N) {
var L = new Array(N);
for (var i = 0; i < N; i++) {
var row = new Array(N);
var node = G.nodes[i];
for (var j = 0; j < N; j++) {
if (i === j) {
row[j] = node.edges.length;
} else {
row[j] = (node.edges.indexOf(j) === -1) ? -1 : 0;
@w8r
w8r / linked_list.ts
Created January 19, 2022 12:29
Simple doubly-linked list
export class Node<T>{
data: T;
prev: Node<T> = null;
next: Node<T> = null;
constructor(data: T) {
this.data = data;
}
}