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
=== Start of delete_post.py === | |
from atproto import Client | |
def main() -> None: | |
client = Client() | |
client.login('my-handle', 'my-password') | |
# same with the like_post.py example we need to keep a reference to the post |
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
[0m [0m[1m[38;5;9mfn main() { | |
[0m [0m[1m[38;5;12mpush [0m rbp | |
[0m [0m[1m[38;5;12mmov [0m rbp, rsp | |
[0m [0m[1m[38;5;12mpush [0m r15 | |
[0m [0m[1m[38;5;12mpush [0m r14 | |
[0m [0m[1m[38;5;12mpush [0m r12 | |
[0m [0m[1m[38;5;12mpush [0m rbx | |
[0m [0m[1m[38;5;12msub [0m rsp, 3344 | |
[0m [0m[1m[38;5;9mlet mut rng = rand::thread_rng(); | |
[0m [0m[1m[38;5;12mcall [0m[1m[38;5;9m rand::rngs::thread::thread_rng |
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 | |
AUTH_TOKEN = 'xoxb-...' | |
channel = '#locked-out' | |
USER_ID = 'UDAS0J04S' # A user ID obtained by `list_members.py` | |
text = f'<@{USER_ID}>, Smerity locked himself out' | |
params = { | |
'token': AUTH_TOKEN, |
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 pprint | |
import requests | |
AUTH_TOKEN = 'xoxb-...' | |
params = {'token': AUTH_TOKEN} | |
r = requests.post('https://slack.com/api/users.list', params=params) | |
for member in r.json()['members']: |
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
# encoding=utf8 | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
import re | |
number_match_re = re.compile(r'^([0-9]+[,.]?)+$') | |
number_split_re = re.compile(r'([,.])') |
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
1 .+? | |
1 [^ | |
2 0000 | |
2 010101 | |
2 1111 | |
2 1234 | |
2 12345 | |
2 666666 | |
2 adm | |
2 anna |
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 torch | |
from cupy.cuda import function | |
from pynvrtc.compiler import Program | |
from collections import namedtuple | |
a = torch.randn(1,4,4).cuda() | |
b = torch.zeros(a.size()).cuda() | |
kernel = ''' | |
extern "C" |
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
vocab = set() | |
for i, line in enumerate(open('wiki.train.tokens')): | |
words = [x for x in line.split(' ') if x] | |
[vocab.add(word) for word in words] | |
if i < 10: print(words) | |
print('Vocab size:', len(vocab)) |
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
''' Script for Cartpole using policy gradient via Chainer, two layer MLP, dropout, and rejection sampling of historical memories ''' | |
import gym | |
import numpy as np | |
import chainer | |
from chainer import optimizers | |
from chainer import ChainList, Variable | |
import chainer.functions as F |
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
""" Quick script for Cartpole using policy gradient via Chainer, two layer MLP, dropout, and vaguely rejection sampling of historical memories """ | |
import gym | |
import numpy as np | |
import chainer | |
from chainer import optimizers | |
from chainer import ChainList, Variable | |
import chainer.functions as F |
NewerOlder