Skip to content

Instantly share code, notes, and snippets.

View marciok's full-sized avatar
🎯
Focusing

Marcio Klepacz marciok

🎯
Focusing
View GitHub Profile
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(
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:
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
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
# 3.Set our hyper paremeters: epoch, learning rate, m and b.
learning_rate = 0.0001
epochs = 1000
start_m = 0
start_b = 0
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:
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" ||
xcrun simctl openurl booted "https://medium.com/@MarcioK/"
@marciok
marciok / dijkstra.swift
Created June 22, 2016 21:15
Dijkstra's algorithm in Swift 3
/**
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
3EvKms7mK7Ca29AwYHJovGuHb2TPD35jmy