Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Andrea Pollini ProfAndreaPollini

View GitHub Profile
@ProfAndreaPollini
ProfAndreaPollini / Activation.js
Last active Mar 25, 2019
NeuralNetworks Backpropagation
View Activation.js
class ActivationFunction {
get f() {}
get df() {}
}
export class SigmoidActivationFunction extends ActivationFunction {
static get f() {
return x => 1 / (1 + Math.exp(-x));
}
@ProfAndreaPollini
ProfAndreaPollini / Matrix.js
Created Feb 23, 2019
Matrix class in Javascript ES6
View Matrix.js
export default class Matrix {
constructor(rows, cols) {
this.rows = rows;
this.cols = cols;
this.data = new Array(rows * cols).fill(0);
}
set(v, x, y) {
this.data[y * this.cols + x] = v;
}
@ProfAndreaPollini
ProfAndreaPollini / heapq.js
Last active Feb 24, 2019
Binary heap in Javascript
View heapq.js
export default class HeapQ {
constructor(priorityFunction = x => x) {
this.data = [];
this.priorityFunction = priorityFunction;
}
get length() {
return this.data.length;
}
@ProfAndreaPollini
ProfAndreaPollini / docker-compose.yaml
Created Feb 13, 2019
node red - influxdb - grafana Docker compose file
View docker-compose.yaml
version: "3"
services:
nodered:
image: nodered/node-red-docker
ports:
- "1880:1880"
influxdb:
image: influxdb
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
View conway.js
let screen = document.getElementById("screen");
screen.width = 600;
screen.height = 400;
let ctx = screen.getContext("2d");
let zoomLevelUI = document.getElementById("zoomLevelUI");
let zoomLevel = 1;
function setZoomLevel() {
View prova.txt
dfgdfg
df
gdf
gdf
dgdf
@ProfAndreaPollini
ProfAndreaPollini / complex.js
Created Jan 11, 2019
MANDELBROT SET + JULIA SET IN PLAIN JAVASCRIPT - from live: https://youtu.be/mXMnW-ET7Tg
View complex.js
export default class Complex {
constructor(x, y) {
this.x = x;
this.y = y;
}
add(other) {
return new Complex(
this.x + other.x,
this.y + other.y
@ProfAndreaPollini
ProfAndreaPollini / JSONTestWrite.java
Created Jan 1, 2019
JSON WRITE DEMO IN JAVA: Using json-simple
View JSONTestWrite.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ap.demo.jsontestwrite;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
View DemoJson.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ap.demo.demojson;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
You can’t perform that action at this time.