Skip to content

Instantly share code, notes, and snippets.


Greg Borenstein atduskgreg

View GitHub Profile
View morphological_skeletonization.pde
// porting from here:
import gab.opencv.*;
import org.opencv.imgproc.Imgproc;
import org.opencv.core.Size;
import org.opencv.core.Core;
import org.opencv.core.Core.MinMaxLocResult;
import org.opencv.core.Mat;
PImage src;
View gist:8757795
This is how the communication when the engine boots can look like:
GUI engine
// tell the engine to switch to UCI mode
// engine identify
id name Shredder
id author Stefan MK
atduskgreg /
Last active Aug 29, 2015
Millionaire Chess Open Call Agenda 2/5/14

Notes for Call (2/5/14)

  • Boomerange detection progress: how good is that bishop move?
  • => get "free" material on first move which leads to catastrophe later
  • => 180: Alekhine-Levenfish (ideal)
  • => maybe Rasmusson-Niemi
  • => 184: Lasker-Ragozin
  • => 176: Nielsen-Amateur (black's POV)
  • => 174: Richter-Amateur @ 3-pli
  • => important to search odd plies
View bounce_ball.js
var w = 470;
var h = 235;
var startForce = 0.5;
var gravity = 0.1;
var squash = 0.2;
var p = {x:0, y:0};
var g = {x:0, y:gravity};
var f = {x:startForce, y:0};
View suqash_bounce.pde
// world parameters
float startForce = 2.5;
float gravity = 1;
float squash = 0.2;
float r = 50; // ball radius
PVector p;
PVector g;
PVector ball;
PVector f;
atduskgreg / gist:8905776
Last active Aug 29, 2015
bounce ball shader
View gist:8905776
// fragment shader
#version 150
uniform float time;
uniform vec2 mouse;
uniform vec2 startingPosition;
uniform float gravity;
uniform vec2 initialVelocity;
uniform float ballRadius;
uniform float rebound;
View async_uci_interaction.rb
require 'open3'
require 'io/wait'
require 'thread'
class Uci
attr_accessor :to
attr_accessor :from
def initialize path_to_engine
@to, @from = Open3.popen2e "/usr/local/bin/stockfish"
View gist:9002546
## Detecting Boomerang combinations
* For each Maurice boomerang example:
* Translate board positions into fen
* Tell Stockfish to set the board position (over UCI)
* Request a white move with limits on search depth (parameter)
* Play out move sequences at full search depth
* Track centipawn score (for black move) and loss of material/checkmate
* Automate this.
View gist:9003625
* Understand info line (especially what move centipawn (cp) score applies to)
* Get centipawn score for each "bestmove"
* "Graph" centipawn score for best move for white and black for series of moves after bad move
* Suggest values for boomerang outcome "threshold" (to detect a big change, i.e. loss of queen, checkmate, etc) "losing the exchange"
* Do this for more of Maurice-suggested games
View opencv_processing_camera_select.pde
import gab.opencv.*;
import java.awt.*;
Capture video;
OpenCV opencv;
void setup() {
String[] cameras = Capture.list();
You can’t perform that action at this time.