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 requests | |
import datetime as dt | |
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library | |
from time import sleep # Import the sleep function from the time module | |
GPIO.setwarnings(False) # Ignore warning for now | |
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering | |
pins = [23,21,19] | |
for pin in pins: | |
GPIO.setup(pin, GPIO.OUT, initial=GPIO.LOW) | |
while True: |
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
--- | |
title: Irydium ❤️ Synesthesia | |
scripts: | |
- https://cdn.plot.ly/plotly-latest.min.js | |
- https://d3js.org/d3-dsv.v1.min.js | |
components: | |
- https://github.com/irydium/irdium/files/blah/document.md#PlotlyGraph | |
variables: | |
- midi_url: https://raw.githubusercontent.com/janeadams/synesthesia/master/audio/midi/dancingqueen.mid | |
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
def printBoard(board, game): | |
print(f"Game #{game}. Board configuration:\n {' '.join([str(c) for c in board[:3]])}\n {' '.join([str(c) for c in board[3:6]])}\n {' '.join([str(c) for c in board[6:]])}\n") | |
def checkWin(board, game): | |
printBoard(board, game) | |
routes = [board[:3], board[3:6], board[6:]] # Rows of board | |
columns = [board[::3],board[1::3],board[2::3]] # Columns of board | |
routes.extend(columns) | |
diagonals = [[board[0],board[4],board[8]],[board[2],board[4],board[6]]] # Diagonals of board | |
routes.extend(diagonals) # Routes = all possible routes to a win-state |
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 json | |
import pandas as pd | |
import csv | |
dfs={} | |
with open('storywrangler_data.json') as json_file: | |
data = json.load(json_file) | |
for ngram in data['metadata']['ngrams']: |
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 requests | |
import json | |
import pandas as pd | |
import csv | |
query = "one two three four" | |
language = "es" | |
metric = "rank" | |
rt = "false" |