Skip to content

Instantly share code, notes, and snippets.

View Orbifold's full-sized avatar
🍀
Happy. Thinking. Understanding.

Francois Vanderseypen Orbifold

🍀
Happy. Thinking. Understanding.
View GitHub Profile
@Orbifold
Orbifold / PenroseDrawingStyle
Created October 2, 2014 06:34
Penrose drawing style
g3 = Graphics3D[{Gray, KnotData[{6, 2}, "ImageData"]},
Lighting -> "Neutral", Boxed -> False];
img = ColorConvert[Rasterize[g3, "Image", ImageResolution -> 72],
"GrayLevel"];
edge = ColorNegate@EdgeDetect[img];
Manipulate[
dots = Image@
@Orbifold
Orbifold / yFilesModuleNesting
Created October 6, 2014 12:19
yFiles module nesting
yfiles.module("Life", function (exports) {
var Person = Class('Person',
{
constructor: function (name) {
this.name = name;
},
toString: function () {
return this.name;
}
@Orbifold
Orbifold / Basic.html
Last active August 29, 2015 14:07
Basic reation of a yFile diagram.
<!DOCTYPE html>
<html>
<head>
<title>Hello, yFiles for HTML</title>
<link type="text/css" rel="stylesheet" href="/OrbyWorks/lib/yfiles.css">
<style>
html, body, #graphCanvas, .canvascontrol {
width: 100%;
height: 80%;
@Orbifold
Orbifold / Diagram-pdf
Last active August 29, 2015 14:07
Kendo diagram, PDF and drawing
<!DOCTYPE html>
<html>
<head>
<title>Kendo Diagramming</title>
<link rel="stylesheet/less" type="text/css" href="../../styles/web/kendo.common.less"/>
<link rel="stylesheet/less" type="text/css" href="../../styles/web/kendo.default.less"/>
<link rel="stylesheet/less" type="text/css" href="../../styles/dataviz/kendo.dataviz.less"/>
<link rel="stylesheet/less" type="text/css" href="../../styles/dataviz/kendo.dataviz.default.less"/>
<script type="text/javascript" src="../../demos/mvc/content/shared/js/less.js"></script>
@Orbifold
Orbifold / MoveArrayItem.js
Created October 23, 2014 07:04
Move an item in place in an array.
Array.prototype.move = function (pos1, pos2) {
var i, tmp;
pos1 = parseInt(pos1, 10);
pos2 = parseInt(pos2, 10);
if (pos1 !== pos2 &&
0 <= pos1 && pos1 <= this.length &&
0 <= pos2 && pos2 <= this.length) {
// save element from position 1
tmp = this[pos1];
@Orbifold
Orbifold / main.cs
Created January 31, 2016 13:24
Question-answer from StackOveflow via the StacMan package
static void Main(string[] args)
{
var client = new StacManClient(key: "Your-key", version: "2.1");
var response = client.Search.GetMatchesAdvanced("stackoverflow",
page: 1,
pagesize: 10,
sort:SearchSort.Relevance,
accepted:true,
title:"whatever you like to search for",
order: Order.Desc,
@Orbifold
Orbifold / PromisesSequence.html
Created April 15, 2016 11:58
Chaining promising so they execute sequentially.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script type="text/javascript">
var getters = [];
function getPromise(k) {
@Orbifold
Orbifold / MxNet.R
Created November 6, 2016 10:32
Image recognition with MxNet.
require(devtools)
install_version("imager", version = "0.20", repos = "http://cran.us.r-project.org")
library("mxnet")
library(imager)
# can download the model from http://www.orbifold.net/default/R/MxNet/MxNetInception.zip
model = mx.model.load("Inception_BN", iteration=39)
mean.img = as.array(mx.nd.load("mean_224.nd")[["mean_img"]])
@Orbifold
Orbifold / Chi2NoiseReduction.R
Created November 11, 2016 06:36
Noise reduction using chi2. A synthetic proof by example.
probabilityInsideCluster = 0.5
probabilityOutsideCluster = 0.2
probabilityNoise = 0.3
clusterBoundaries = c(10, 25, 56, 81, 151, 293)
clientTypeCount = c(0, 0, 0, 0)
library(dplyr)
library(rpart)
# this create a frame of clients
makeClientsFrame = function(attribCount = 1000,
clientCount = 1000,
@Orbifold
Orbifold / SMOTE.ipynb
Created November 12, 2016 15:44
Highlighting the usage of synthetic data (SMOTE) to imbalanced data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.