| Instance | Branch |
|---|
This file contains hidden or 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
| cycler==0.10.0 | |
| kiwisolver==1.3.1 | |
| matplotlib==3.3.4 | |
| numpy==1.19.5 | |
| Pillow==8.2.0 | |
| pyparsing==2.4.7 | |
| python-dateutil==2.8.1 | |
| six==1.16.0 |
This file contains hidden or 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 LinkedListNode(v) { | |
| this.val = v; | |
| this.next = null | |
| } | |
| LinkedListNode.prototype.print = function() { | |
| let node = this; | |
| while (node) { | |
| process.stdout.write(`${node.val} -> `) | |
| node = node.next |
This file contains hidden or 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
| /** | |
| * @param {number} x | |
| * @return {number} | |
| */ | |
| var reverse = function(x) { | |
| let y = 0; | |
| let num = Math.abs(x); | |
| const intMax = Math.pow(2, 31) + 1; | |
| while(num != 0) { |
This file contains hidden or 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
| // Not the fastest thing in the world | |
| export default class Middleware { | |
| constructor (methods) { | |
| this.methods = methods; | |
| this.methodsStack = {}; | |
| this.originalMethod = {}; | |
| methods.forEach (method => { | |
| this.methodsStack[method] = []; | |
| this.originalMethod[method] = this[method]; |
This file contains hidden or 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
| const splitTotal = (total, n) => { | |
| let arr = []; | |
| let i = 0; | |
| while (i < n) { | |
| arr.push(Math.floor(Math.random() * total) + 1) | |
| i++; | |
| } | |
| const sorted = [0].concat(arr, [total]).sort((a, b) => a - b); | |
| let out = []; |
This file contains hidden or 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
| const fs = require('fs'); | |
| const solc = require('solc'); | |
| const Web3 = require('web3'); | |
| // Connect to local Ethereum node | |
| const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); | |
| // Compile the source code | |
| const input = fs.readFileSync('Token.sol'); | |
| const output = solc.compile(input.toString(), 1); |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| from keras.models import Sequential | |
| from keras.layers import Dense | |
| from keras.optimizers import Adam | |
| model = Sequential() | |
| model.add(Dense(10, input_dim=X_train.shape[1], activation='sigmoid')) | |
| model.add(Dense(1, activation='sigmoid')) | |
| model.compile(optimizer=Adam(lr=0.01), | |
| loss='binary_crossentropy', |
This file contains hidden or 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
| def nn(X, y, hiddenLayerSize=10, learningRate=0.01, epochs=100, debug=False): | |
| m = X.shape[1] | |
| outputSize = y.shape[1] | |
| # Make our model | |
| model = dict( | |
| w0 = np.random.randn(m, hiddenLayerSize), | |
| w1 = np.random.randn(hiddenLayerSize, outputSize) | |
| ) | |
This file contains hidden or 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 | |
| import pandas as pd | |
| np.random.seed(1) | |
| # train comes from the titantic dataset provided by | |
| # kaggle (https://www.kaggle.com/c/titanic/data) | |
| df = pd.read_csv('./data/titanic-train.csv') | |
| def preprocess(raw_data): | |
| # Preprocess data |