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 curryAdd = (x) => (y) => return x + y; |
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 numpy as np | |
inputs = np.array([[1],[100],[3],[30],[40]]) | |
testSet = np.array([[10],[13],[19],[33],[1]]) | |
outputs = np.array([[5],[203],[9],[63],[83]]) | |
bias = 1 | |
biasWeight = 1 | |
#initWeights | |
weights = np.random.random() |
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
function convertToIntArray(hex){ | |
var bytes = [], | |
str; | |
for(var i=0; i<hex.length-1;i+=2){ | |
bytes.push(parseInt(hex.substr(i, 2), 16)) | |
} |
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 tensorflow as tf | |
import numpy as np | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
x_learn = np.array([[1.000,2.000], | |
[10.000,2.0000], | |
[9.000,3.0000], | |
[5.000,8.000], |
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
'use strict'; | |
class example_component extends HTMLElement { | |
/* THIS RETURNS THE NAME OF OUR WEB COMPONENT */ | |
static get is() { | |
return 'v-graph' | |
} | |
/* WE CAN SET UP GETS TO RETRIEVE THE ELEMENT NAMES BAM, EASY ! */ |
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
class node { | |
value: any | |
left: any | |
right: any | |
height: number | |
balanceFactor(){ | |
var bf = (this.right.height) - (this.left.height); | |
} | |
constructor(v,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
function sortTable(table,col){ | |
if(table.nodeName != "TABLE"){ | |
throw new Error("Node is not of type TABLE"); | |
return; | |
} | |
/* DEEP CLONE WILL BREAK THE REF */ | |
//table = table.cloneNode(true); | |
var rows = [].slice.call(table.tBodies[0].rows,1); | |
var tBody = table.tBodies[0]; | |
/* SORT MAP AND REPLACE */ |
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
function observer() { | |
const data = {}; | |
const callbacksObj = {}; | |
const set = (property, value) => { | |
data[property] = value; | |
notify(property); | |
}; | |
const notify = (property) => { | |
if(!property) { | |
throw new TypeError('Property "property" is not type string') |
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 R from 'ramda'; | |
import { task, of } from 'folktale/concurrency/task'; | |
import hash from 'object-hash'; | |
function processService(p) { | |
return p.data; | |
} | |
const getDataFailure = data => ({ | |
type: 'FAILURE_TYPE', |
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
/* Build an adjacency matrix for a super simple tree a -> b,c */ | |
const m = [ | |
[0, 1, 0, 0, 0], | |
[0, 0, 1, 1, 0], | |
[0, 0, 0, 0, 1], | |
[0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0] | |
]; | |
/* Data at each node */ |
OlderNewer