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 NeuralNetwork: | |
def __init__(self, x, y): | |
self.input = x | |
self.weights1 = np.random.rand(self.input.shape[1],4) | |
self.weights2 = np.random.rand(4,1) | |
self.y = y | |
self.output = np.zeros(self.y.shape) | |
def feedforward(self): | |
self.layer1 = sigmoid(np.dot(self.input, self.weights1)) |
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
#!/bin/bash | |
if [ -s "$1" ] | |
then | |
MONGO_STATUS=$(docker inspect -f {{.State.Running}} mongo) | |
if [ "$MONGO_STATUS" != "true" ] | |
then | |
echo "Mongo is not running" | |
exit 1 | |
fi |
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
#!/bin/bash | |
if [ -s "$1" ] | |
then | |
if [ "$(docker inspect -f {{.State.Running}} database)" != "true" ] | |
then | |
echo "Container MySql is not running" | |
exit 1 | |
fi | |
else | |
echo "Syntax: $0 <filename>" |
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
make_data_corr = function(corr, n){ | |
x = rnorm(n,0,1) | |
y = rnorm(n,0,1) | |
a = corr/(1-corr^2)^0.5 | |
z=a*x+y | |
the_data = data.frame(x,z) | |
return(the_data) | |
} | |
data=make_data_corr(0.99,50) |
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
╔══════╦═════════════╗ | |
║ Dias ║ Altura (cm) ║ | |
╠══════╬═════════════╣ | |
║ 10 ║ 5 ║ | |
║ 12 ║ 6 ║ | |
║ 13 ║ 7 ║ | |
║ 15 ║ 8 ║ | |
║ 19 ║ 13 ║ | |
║ 25 ║ 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
# tks jerimi ann walker | |
make_data_correlated = function(corr, n){ | |
x = rnorm(n,0,1) | |
y = rnorm(n,0,1) | |
a = corr/(1-corr^2)^0.5 | |
z=a*x+y | |
the_data = data.frame(x,z) | |
return(the_data) | |
} |
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
# -*- coding:utf-8 -*- | |
import scrapy | |
from scrapy.exceptions import CloseSpider | |
class LoginSpider(scrapy.Spider): | |
name = 'login-spider' | |
start_urls = ['http://quotes.toscrape.com/login'] | |
def parse(self, response): |
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
// Requires: http://cloud.github.com/downloads/harthur/brain/brain-0.6.0.js | |
// Contrived example using string "0" as output. | |
var net = new brain.NeuralNetwork(); | |
net.train([{input: [0, 0], output: {"F":1}}, | |
{input: [0, 1], output: {"1":1}}, | |
{input: [1, 0], output: {"1":1}}, | |
{input: [1, 1], output: {"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
/* | |
DESCRIPTION | |
----------- | |
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum: | |
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699 | |
CODE REPOSITORY | |
--------------- | |
https://gist.github.com/806605 |
NewerOlder