Skip to content

Instantly share code, notes, and snippets.

View kousun12's full-sized avatar
💭
👾

Rob Cheung kousun12

💭
👾
View GitHub Profile

systems thinking (iterated prisoner's dilemma / network models / positive social contagions) [rc]

A: If so much of the emergent mechanics are totally dependent on what individuals do, how can we even start to think about it?

B: Yeah, it seems intractable, but a good place to start might be to try and make a model.

A: In principle, I'd agree. But what we're talking about is a randomness built on randomness

B: What do you mean?

dan blizerian social study

Majority Illusion - local observations misrepresent global prevalence. (this happens naturally and is related to friendship paradox). Meaning: that sampling your local network for global sense-making is naturally biased. img

  • on avg, most of your friends drink more than you (adverse / unhealthy behavior)
  • most people on avg have fewer friends than their friends
  • explanation for how extremeism propagates

“The effect is largest in the political blogs network, where as many as 60%–70% of nodes will have a majority active neighbours, even when only 20% of the nodes are active,”

  • unsurprisingly modern marketing gets very good ROI on "influencer" marketing
  • Dan blizerian is an influencer; I know about dan blizerian because that's dan blizerian's role: to be a highly connected node in the network. on avg any given people are 6 degrees of acquaintance a
@kousun12
kousun12 / postgres-info.sql
Last active August 25, 2020 19:05
useful postgres stuff
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- 9.2+
SELECT now() - query_start as "runtime", usename, datname, waiting, state, query
FROM pg_stat_activity
WHERE now() - query_start > '2 minutes'::interval
@kousun12
kousun12 / playground.js
Last active October 10, 2019 20:41
tf-wolfram-ca
// @flow
import React from 'react';
import ReactDOM from 'react-dom';
import { reverse } from 'lodash';
import * as tf from '@tensorflow/tfjs-core';
import { webgl } from '@tensorflow/tfjs-core';
const rule = 30;
function toBin8(rule: number): (0 | 1)[] {
const bin = [...rule.toString(2)].map(s => parseInt(s, 10));
@kousun12
kousun12 / CellAutomata.js
Created January 19, 2019 17:03
three js render cellautomata
// @flow
import {
BufferGeometry,
BufferAttribute,
Geometry,
Line,
LineBasicMaterial,
Mesh,
Points,
PointsMaterial,
@kousun12
kousun12 / index.js
Last active August 22, 2023 19:37
a more convenient / abstract js wrapper around performance rnn using tfjs
// @flow
import * as tf from '@tensorflow/tfjs-core';
import Tone from 'tone';
import 'regenerator-runtime/runtime';
const STEPS_PER_GENERATE_CALL = 10;
const GENERATION_BUFFER_SECONDS = 0.5;
const MAX_GENERATION_LAG_SECONDS = 1;
const MAX_NOTE_DURATION_SECONDS = 3;