JSFiddle

  • Decision Tree

    No-Library (pure JS), HTML, CSS, Babel + JSX

    class Node{
    	constructor(attribute_values, entries){
        	this.attribute_values = attribute_values;
            this.labels = [...new Set(entries.map(entry => entry.label))];
        	this.entries = entries ...
  • Search Algorithms

    A*, DFS, Beam Search, Hill Climbing

    var nodes = {
    	A: {
        	h: 3,
            g: 0,
            children: [
            	{id: "B", v: 2},
                {id: "C", v: 1},
                {id: "D", v: 4 ...
  • Simple Image Blurring

    Image blur using simple average of neighboring pixels.

    var input = document.getElementById("imageInput"),
    	imageDataUrl = null;
        
    function Stage(canvas, status){
    	this.canvas = canvas;
        this.ctx = canvas.getContext("2d");
        this ...
  • Schedulability Exact Analysis

    No-Library (pure JS), HTML, CSS, JavaScript

    var tasks = [
    	{c: 0, p: 64, b: 0, d: 64},
    	{c: 12, p: 65, b: 7, d: 55},
        {c: 25 ...
  • Slanted folds

    No-Library (pure JS), HTML, CSS, JavaScript

    <div class="list">
        <div class="slanted">
            <div class="slanted-content">First</div>
        </div>
        <div class="slanted">
            <div class="slanted-content">Second</div>
        </div>
        <div class="slanted">
            <div class="slanted-content">Third</div>
        </div>
    </div>
  • Implementing Unify in JavaScript

    No-Library (pure JS), HTML, CSS, JavaScript

    function Var(name){
    	this.name = name;
    }
    Var.prototype.toString = function(){ return "'" + this.name; };
    Var.prototype.equal = function(b){
    	return (this ...
  • applyShadow demo

    No-Library (pure JS), HTML, CSS, JavaScript

    var rendered = document.querySelector("#canvas"),
    	renderedCtx = rendered.getContext("2d");
        
    var t, nt, lt, lnt;
    renderedCtx.fillStyle = "blue";
    renderedCtx.fillRect(50 ...
  • L System Interpreter #6 is the latest revision

    L System Interpreter

    var rules = [
    	//["F", "F[+F]F[-F]F"]
        
        //["F", "F+F--F+F"]
        
        //["1", "1F1F"],
        //["0", "1F[+0][-0]"]
        
        //["F", "F ...
  • 3D engine

    No-Library (pure JS), HTML, CSS, JavaScript

    var Matrix = Class.create({
    	init: function(row, col){
        	this.row = row;
            this.col = col;
            this.data = [];
            for(var r = 0 ...
  • Drag diagonally #9 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript, jQuery UI 1.9.2

    $.fn.dragDiagonal = function(eles){
        var mD = false, dragEle = this,
            offset, a, b, ab;
        eles[0] = $(eles[0])[0];
        eles[1 ...