Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View malleor's full-sized avatar

Janusz Lenar malleor

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@malleor
malleor / .block
Last active February 20, 2017 13:45 — forked from kerryrodden/.block
Przejścia w BBX
license: apache-2.0
@malleor
malleor / .block
Created February 17, 2017 12:50 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060

Crazy inventions

Show the photos:

1a 1b

2

3a

@malleor
malleor / iris.py
Last active August 29, 2015 14:03
Playing with Decision Trees from scikit
import numpy as np
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from matplotlib import pyplot as plt
# fetch data
iris = load_iris()
classes = {}
for cls in (0,1,2):
classes[cls] = np.array([v for k, v in zip(iris.target, iris.data) if k == cls])
function play(iteration) {
var ctrl = {
up: function() { window.gm.inputManager.emit('move', 0); return window.gm.moved; },
right: function() { window.gm.inputManager.emit('move', 1); return window.gm.moved; },
down: function() { window.gm.inputManager.emit('move', 2); return window.gm.moved; },
left: function() { window.gm.inputManager.emit('move', 3); return window.gm.moved; }
};
while(!window.gm.over && !window.gm.won) {
if(!iteration(ctrl)) {
@malleor
malleor / _framerate_to_float.md
Last active December 15, 2015 07:19
Regex to convert a FlyCapture2 framerate enum to floats using the available documentation in a comment.

Replace:

.@{:i}, \/\*\*\< {:n}.*$

With:

\t\2, // \1

@malleor
malleor / _videomode_to_resolution_regex.md
Last active December 15, 2015 07:09
Convert FlyCapture2::VideoMode definition code into { width, height } pair - regex under VS10.

Replace:

.@{:i}, \/\*\*\< {:d+}x{:d+}.*$

With:

\t{ \2, \3 }, // \1

struct UserDerivedType :
public IUserType
{
// ...
};
void CreateCustomGraph(IProject& proj)
{
// create a uniform graph; no customization at this point
IUserGraphNode* first_node = proj.CreateUserGraph();