This file contains hidden or 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
pico-8 cartridge // http://www.pico-8.com | |
version 42 | |
__lua__ | |
function _init() | |
pspeed=4 | |
gameover=0 | |
xpos=63 | |
ballposx=63 | |
ballposy=63 |
This file contains hidden or 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 sys | |
from random import randrange | |
if __name__ == "__main__": | |
while True: | |
print("Level: ", end="") | |
try: | |
level = int(input()) | |
except ValueError: | |
level = False |
This file contains hidden or 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 | |
def weighted_quantile_type_7(a, q, weights=None, axis=None): | |
def _func_1d(arr, q, weights): | |
n = len(arr) | |
if weights is None: | |
weights = np.repeat(1 / n, n) | |
else: |
This file contains hidden or 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
In [65]: import pandas as pd | |
In [66]: a = pd.DataFrame({'hru': [9, 10, 10], 'sub': [100, 100, 100], 'down': [-1, 200, -1]}) | |
In [67]: a | |
Out[67]: | |
hru sub down | |
0 9 100 -1 | |
1 10 100 200 | |
2 10 100 -1 |
This file contains hidden or 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 sqlalchemy as db | |
from sqlalchemy import Table, Column, Integer, String, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
Base = declarative_base() | |
engine = db.create_engine("sqlite:///toto.db", echo=True) |
This file contains hidden or 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
from flinks import Client | |
CUSTOMER_ID = 'secret!!' | |
BASE_URL = 'secret!!' | |
DEMO_USER = 'Greatday' | |
DEMO_PW = 'Everyday' | |
DEMO_INST = 'FlinksCapital' | |
QUESTIONS = { | |
'What city were you born in?': 'Montreal', | |
'What is the best country on earth?': 'Canada', |
This file contains hidden or 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
from flask import Flask, send_file | |
from io import BytesIO | |
app = Flask(__name__) | |
@app.route('/get_placements') | |
def get_placements(): | |
placements = '<Placemark>bla</Placemark>' # replace with your own placement creation logic | |
f = BytesIO() # memory buffer, acting as a file | |
# f-strings are new in py3.6+ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 tensorflow as tf | |
N = 5 | |
M = tf.constant(np.arange(N * N).reshape((N, N)), dtype=tf.int32) # N x N tensor, with values from 0 to N-1 | |
# This code implements a fully differentiable summation of all the elements of M where i != j | |
# inner loop, on columns | |
def body(i, r): |
NewerOlder