Skip to content

Instantly share code, notes, and snippets.

@genekogan
genekogan / ofApp.cpp
Created May 14, 2015 00:19
code examples from SFPC 5.13
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
kinect.setup();
kinect.addDepthGenerator();
kinect.setDepthColoring(COLORING_GREY);
kinect.start();
grayImage.allocate(kinect.getWidth(), kinect.getHeight());
@genekogan
genekogan / genesis
Last active August 29, 2015 14:25
auto-summarization of the book of genesis
automatically summarized the Book of Genesis using Sumy.
code: https://github.com/genekogan/text-learning
sumy: https://github.com/miso-belica/sumy
text: http://monolith.sourceforge.net/genesis.txt
-----------------------------------
4:25 And Adam knew his wife again; and she bare a son, and called his name Seth: For God, said she, hath appointed me another seed instead of Abel, whom Cain slew.
5:28 And Lamech lived an hundred eighty and two years, and begat a son: 5:29 And he called his name Noah, saying, This same shall comfort us concerning our work and toil of our hands, because of the ground which the LORD hath cursed.
10:15 And Canaan begat Sidon his first born, and Heth, 10:16 And the Jebusite, and the Amorite, and the Girgasite, 10:17 And the Hivite, and the Arkite, and the Sinite, 10:18 And the Arvadite, and the Zemarite, and the Hamathite: and afterward were the families of the Canaanites spread abroad.
14:5 And in the fourteenth year came Chedorlaomer, and the kings that were with him, and smote t
@genekogan
genekogan / president-biographies.md
Last active September 15, 2015 04:38
automatic 1-sentence summary of each u.s. president's wikipedia

1-sentence biography of every U.S. president, auto-summarized from Wikipedia using Sumy.

Barack Obama

In February and March 2009, Vice President Joe Biden and Secretary of State Hillary Rodham Clinton made separate overseas trips to announce a "new era" in U.S. foreign relations with Russia and Europe, using the terms "break" and " reset " to signal major changes from the policies of the preceding administration.

George W. Bush

@genekogan
genekogan / CvUtils.h
Last active October 11, 2015 00:23
OCR on browser screengrab in openframeworks, ofxTesseract + ofxScreebGrab
#pragma once
// small excerpt from forthcoming of-cv utility/addon
#include "ofConstants.h"
#include "ofImage.h"
#include "cv.h"
namespace cv {
@genekogan
genekogan / SuperDuper.pde
Created April 18, 2016 15:19
hemesh superduper
import wblut.math.*;
import wblut.processing.*;
import wblut.core.*;
import wblut.hemesh.*;
import wblut.geom.*;
HE_Mesh mesh;
WB_Render render;
float m1, n11, n12, n13, m2, n21, n22, n23, t1, t2, d1, d2, c1, c2, c3;
import processing.video.*;
Movie movie1, movie2;
int blendAlpha;
int typeBlend;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
// you need to put the glsl files into the sketch's data folder
String[] shaders = new String[] {
"vert1.glsl", "vert2.glsl", "wrap.glsl" };
PGraphics pg;
PImage img;
PShader myShader;
int idx, nextIdx;
boolean isImage = true;
@genekogan
genekogan / main.cpp
Last active February 13, 2017 23:35
comparing kd-Tree and cover tree performance
#include "ofMain.h"
#include "ofxCoverTree.h"
#include "ofxKDTree.h"
float squaredDistance(vector<double> & v1, vector<double> & v2) {
float dist=0;
for (int i=0; i<v1.size(); i++) {
float d = v2[i]-v1[i];
dist += (d*d);
}
@genekogan
genekogan / wekinator_basic.pde
Created February 18, 2017 16:23
wekinator + processing + sound
import netP5.*;
import oscP5.*;
import processing.sound.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
SoundFile s1, s2, s3, s4;
boolean sending;
float prediction;
@genekogan
genekogan / download_haeckel.sh
Created July 29, 2018 13:45
script to scrape scanned illustrations from Ernst Haeckel's book Kunstformen der Natur (Artforms of Nature)
for i in {1..100}; do
filepath=$(printf "http://caliban.mpipz.mpg.de/haeckel/kunstformen/Tafel_%03d_300.jpg" $i)
wget $filepath;
done