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
pragma solidity ^0.4.11 | |
contract Friendship { | |
mapping (address => uint256) public balanceOf;// This creates an array with all balances | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
/* Initializes contract with initial supply tokens to the creator of the contract */ | |
function Friendship( |
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 | |
import csv | |
import matplotlib.pyplot as plt | |
# 1. Extract Bitcoin prices and number of Google searches. | |
bitcoin_interest = {} | |
with open('bitcoin-interest.csv') as f: | |
reader = csv.reader(f) | |
for row in reader: |
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
def gradient_descent(points, b, m, learning_rate): | |
m_gradient = 0 | |
b_gradient = 0 | |
N = float(len(points)) | |
for i in range(0, len(points)): | |
x = points[i, 0] | |
y = points[i, 1] | |
# Caluclating the partial derivative |
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
def calculate_error(points, m, b): | |
# Error is calculated by the average distance from the points to the line | |
error = 0 | |
for i in range(0, len(points)): | |
x = points[i, 0] | |
y = points[i, 1] | |
# Moving y to the other side of the equation | |
# y = mx + b -> = mx + b - y | |
error += (y - (m*x + b))**2 |
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
# 3.Set our hyper paremeters: epoch, learning rate, m and b. | |
learning_rate = 0.0001 | |
epochs = 1000 | |
start_m = 0 | |
start_b = 0 |
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 | |
import csv | |
import matplotlib.pyplot as plt | |
# 1. Extract Bitcoin prices and number of Google searches. | |
bitcoin_interest = {} | |
with open('bitcoin-interest.csv') as f: | |
reader = csv.reader(f) | |
for row in reader: |
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 validarCPF(cpf) { | |
cpf = cpf.replace(/[^\d]+/g,''); | |
if(cpf == '') return false; | |
// Elimina CPFs invalidos conhecidos | |
if (cpf.length != 11 || | |
cpf == "00000000000" || | |
cpf == "11111111111" || | |
cpf == "22222222222" || | |
cpf == "33333333333" || | |
cpf == "44444444444" || |
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
xcrun simctl openurl booted "https://medium.com/@MarcioK/" |
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
/** | |
Dijkstra's algorithm in Swift 3 | |
The idea is to create a more protocol oriented implementation. | |
Note: It could use some optimizations, if you wish to use in production. | |
*/ | |
import Foundation |
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
3EvKms7mK7Ca29AwYHJovGuHb2TPD35jmy |