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 etherroll(fromBlock,toBlock): | |
address = '0xa52e014b3f5cc48287c2d483a3e026c32cc76e6d' | |
topic0 = '0x8dd0b145385d04711e29558ceab40b456976a2b9a7d648cc1bcd416161bf97b9' | |
apikey = 'yourapikey' | |
url = f'https://api.etherscan.io/api?module=logs&action=getLogs&fromBlock={fromBlock}&toBlock={toBlock}&address={address}&topic0={topic0}&apikey={apikey}' | |
request = requests.get(url) | |
results = request.json() | |
new = [] | |
i = 0 | |
while i < len(results['result']): |
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
-- Output a count of jobs by the organization name and id | |
SELECT | |
jobs.organization_id | |
,organizations.name | |
,COUNT(jobs.id) as jobs | |
FROM jobs | |
LEFT JOIN organizations ON jobs.organization_id = organizations.id | |
GROUP BY 1,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
-- Query all columns from the jobs table, and limit to 10 rows | |
SELECT * | |
FROM jobs | |
LIMIT 10; | |
-- Query all columns with costs above 50 | |
SELECT * | |
FROM jobs |
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
SELECT * | |
FROM jobs | |
LIMIT 10; | |
SELECT * | |
FROM jobs | |
WHERE costs > 50; | |
SELECT | |
state_abb |
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
CREATE TABLE Accounts ( | |
Id INT, | |
Name varchar(50), | |
Account_type varchar(50), | |
Created_at timestamp | |
); | |
INSERT INTO Accounts | |
(Id, Name, Account_type, Created_at) | |
VALUES |
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 os | |
import tempfile | |
import time | |
import numpy as np | |
import pandas as pd | |
import talib | |
from logbook import Logger | |
from catalyst import run_algorithm |
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
payment <- function(loan, apr, months) { | |
rate <- 1 + apr / 100 / 12 | |
loan * rate^months * (rate - 1) / (rate^months - 1) | |
} | |
amortize <- function(loan, payment, apr, months) { | |
rate <- 1 + apr / 100 / 12 | |
month <- 0:months | |
balance <- loan * rate^month - payment * (rate^month - 1) / (rate - 1) | |
complete <- match(TRUE, balance <= 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
<?php | |
/** | |
* The template for displaying image attachments | |
* | |
* | |
* @package i_spirit | |
* @since i-spirit 1.0 | |
*/ | |
get_header(); ?> |
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
for i in range(1,101): | |
s = str(i) | |
if i % 3 == 0 or i % 5 == 0: | |
s = " " | |
if i % 3 == 0: | |
s = s + "Fizz" | |
if i % 5 == 0: | |
s = s + "Buzz" | |
print (s) |
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
x = int(input("enter an integer: ")) | |
ans = 0 | |
while ans*ans*ans < abs(x): | |
ans = ans +1 | |
print ("current Guess =", ans) | |
print ("last guess = ", ans) | |
print ("ans*ans*ans = ", ans*ans*ans) | |
if ans*ans*ans == abs(x): |
NewerOlder