Skip to content

Instantly share code, notes, and snippets.

View mutoo's full-sized avatar

Lingjia Liu mutoo

View GitHub Profile
int total = 100;
int range = 10;
int player = 50;
void setup() {
size(640, 480);
frameRate(5);
}
void draw() {
background(200);
var game = window.open('http://jenniferdewalt.com/window_sizer/game');
game.onload = function() {
game.$('#start').click();
setInterval(function() {
game.resizeTo(game.$('#target_area').width(), game.$('#target_area').height() + 50) // 50px for title bar + address bar
}, 50);
}
import gifAnimation.*;
PFont font;
GifMaker gifExport;
PImage[] frames;
PImage img;
void setup() {
gifExport = new GifMaker(this, "export.gif");
gifExport.setRepeat(0);
#include<stdio.h>
int main(int argc, char *argv[]) {
int _ = -1, b = -1;
return -_-b;
}
PGraphics pg;
Net net;
ArrayList<TrainingPair> trainingSet;
void setup(){
size(512, 512);
pg = createGraphics(width, height);
net = new Net(2, 3, 1, 0.5, 0.9);
@mutoo
mutoo / ann_gesture_recognition.pde
Created November 8, 2013 10:09
ann_gesture_recognition
PGraphics pg;
Net net;
ArrayList<TrainingPair> trainingSet;
void setup(){
size(512, 512);
pg = createGraphics(width, 512);
net = new Net(24, 12, 5, 0.5, 0.9);
class Point
{
int x,y;
Point(int x, int y)
{
this.x = x;
this.y = y;
}
};
/**//**//**//**//**//**//*
** ==================================================================================================
** 类名:J.gbk
** 版本:1.0
** 功能:URLEncode,URLDecode
** 示例:
---------------------------------------------------------------------------------------------------
用法:参见组件地址
@mutoo
mutoo / split_more.php
Last active December 31, 2015 03:49
split post at more tag;
if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {
list($main, $extended) = explode($matches[0], $post, 2);
$more_text = $matches[1];
} else {
$main = $post;
$extended = '';
$more_text = '';
}
int count = 10;
int minVel = 3;
int maxVel = 4;
class Point {
PVector pos, vel;
Point(float x, float y) {
pos = new PVector(x, y);
updateVel();
}