This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
A Lua module that defines a little DSL for generating CSS | |
-- csstest.lua | |
require 'css' | |
width = 500 | |
lmargin = 50 | |
leftm = 150 | |
gap = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <Windows.h> | |
#include "glfw/glfw.h" | |
#include "skia/include/gpu/GrContext.h" | |
#include "skia/include/gpu/GrRenderTarget.h" | |
#include "skia/include/gpu/GrGLInterface.h" | |
#include "skia/include/gpu/SkGpuDevice.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* BMW IBus Daemon reads BMW IBus data through serial port. It detects | |
* BMW board monitor(at least BM53) unit and steering wheel button presses | |
* from IBus data, maps them to key events and injects them to system event | |
* queue via uinput. | |
* | |
* It also can be configured to inject key events only in certain state like | |
* TAPE or AUX which can be useful if you want to hijack for example TAPE | |
* mode for other use. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* depth: 1 - monochrome | |
* 4 - 4-bit grayscale | |
* 8 - 8-bit grayscale | |
* 16 - 16-bit colour | |
* 32 - 32-bit colour | |
**/ | |
function drawArray(arr, depth) { | |
var offset, height, data, image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<canvas id="c" width="128" height="128"></canvas> | |
<script src="glutil.js"></script> | |
<script id="vshader" type="text/plain"> | |
attribute vec2 vtxpos; | |
varying vec2 texpos; | |
void main() { | |
texpos = (vtxpos / 2.) + vec2(0.5, 0.5); | |
gl_Position = vec4(vtxpos, 0, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = function (msg, url, lineno) { | |
alert(url + '(' + lineno + '): ' + msg); | |
} | |
function createShader (str, type) { | |
var shader = gl.createShader(type); | |
gl.shaderSource(shader, str); | |
gl.compileShader(shader); | |
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) | |
throw gl.getShaderInfoLog(shader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<pre id="page" style="font-family: monospace; white-space: pre-wrap;"> | |
<h3>A Sinus Activated Multi-Stochastic-Descending/Ascending (MSD/A) Feed Forward Artificial Neural Network (ANN) Computed by GPU via JavaScript and WebGL GLSL (GATO 2014)</h3>This web page attempts to outline an implementation for solving non-linearly-separable (NLS) classification and function approximation problems using a sinus activated feed forward neural network, trained via multi-stochastic-descension/ascension (MSD/A), and evaluated using the GPU via JavaScript and WebGL GLSL source code. | |
In order to overcome NLS using MSD/A, a sinus activation function: <b>sin(x)</b>, has been used in place of sigmoid: <b>1 / (1 + exp(-x))</b>, hyper-tangent: <b>htan(x)</b>, and/or averaging: <b>sum / count</b>, activation functions. | |
Although ANNs capable of overcoming NLS problems are said to be capable of entering any computationally complete state, actually finding and entering a specific state required to solve a real |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas_in = document.getElementById("canvas_in"); | |
var canvas_out = document.getElementById("canvas_out"); | |
var img = new Image(); | |
img.onload = function() { | |
var w = this.width; | |
var h = this.height; | |
canvas_in.width = canvas_out.width = w; | |
canvas_in.height = canvas_out.height = h; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LICENSE : MIT | |
"use strict"; | |
// call from node | |
exports.start = function () { | |
global.profile_startTime = Date.now(); | |
}; | |
// call from renderer | |
exports.stop = function () { | |
var ms = Date.now() - require('remote').getGlobal('profile_startTime'); | |
console.log("profile", ms + "ms"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import random | |
vowels = "aoeuiy" | |
def m(): | |
c1 = vowels[random.randint(0,len(vowels)-1)] | |
c2 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)] | |
c3 = string.ascii_lowercase[random.randint(0,len(string.ascii_lowercase)-1)] | |
print('z' + c1 + c2 + c3) | |
m() |
OlderNewer