Skip to content

Instantly share code, notes, and snippets.

Avatar

Francois Vanderseypen Orbifold

View GitHub Profile
@Orbifold
Orbifold / PenroseDrawingStyle
Created Oct 2, 2014
Penrose drawing style
View PenroseDrawingStyle
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 Oct 6, 2014
yFiles module nesting
View yFilesModuleNesting
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 Aug 29, 2015
Basic reation of a yFile diagram.
View Basic.html
<!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 Aug 29, 2015
Kendo diagram, PDF and drawing
View Diagram-pdf
<!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 Oct 23, 2014
Move an item in place in an array.
View MoveArrayItem.js
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 Jan 31, 2016
Question-answer from StackOveflow via the StacMan package
View main.cs
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 Apr 15, 2016
Chaining promising so they execute sequentially.
View PromisesSequence.html
<!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 Nov 6, 2016
Image recognition with MxNet.
View MxNet.R
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 Nov 11, 2016
Noise reduction using chi2. A synthetic proof by example.
View Chi2NoiseReduction.R
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 Nov 12, 2016
Highlighting the usage of synthetic data (SMOTE) to imbalanced data.
View SMOTE.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.