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
level=warn ts=2021-01-31T23:52:39.276157883Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=2 firstKey=P:01EX6WSYJWHRKSQKBFC9QAVVZT:0U6Adltjl3JF0DL5BdJjKuGoFR-3enALMYjXypyynE8 err="failed to wait for turn: context canceled" | |
level=warn ts=2021-01-31T23:52:39.276323918Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=2 firstKey=P:01EX6NXS9NWZ3BX9029Z3N2SVG:0U6Adltjl3JF0DL5BdJjKuGoFR-3enALMYjXypyynE8 err="failed to wait for turn: context canceled" | |
level=warn ts=2021-01-31T23:52:39.276342535Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=2 firstKey=P:01EX6NXWQXM8AZQ7K8KTG6B63D:0U6Adltjl3JF0DL5BdJjKuGoFR-3enALMYjXypyynE8 err="failed to wait for turn: context canceled" | |
level=warn ts=2021-01-31T23:52:39.276160506Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=2 firstKey=P:01EX6NY6TP74K6RGH9RKH1FVEM:0U6Adltjl3JF0DL5BdJjKuGoFR-3enALMYjXypyynE8 err="failed to wait for turn: contex |
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
level=warn ts=2021-01-31T23:53:11.343049641Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=5 firstKey=P:01EXAHJGKSGFTQ75X5FNNPP3SK:2gmaL7FyTFFkWrLxlPTZxJwOoDLrkkYyETqcp0l1FL4 err="memcache: connect timeout to 10.11.105.37:11211" | |
level=warn ts=2021-01-31T23:53:11.343138289Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=1 firstKey=S:01EX9P3FDZ055JCKZ7ZS22ECMN:41603280 err="memcache: connect timeout to 10.11.105.37:11211" | |
level=warn ts=2021-01-31T23:53:11.343198509Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=5 firstKey=P:01EX9P34379RNTDWJMJT3KC8H4:2gmaL7FyTFFkWrLxlPTZxJwOoDLrkkYyETqcp0l1FL4 err="memcache: connect timeout to 10.11.105.37:11211" | |
level=warn ts=2021-01-31T23:53:11.343225582Z caller=memcached_client.go:382 msg="failed to fetch items from memcached" numKeys=5 firstKey=P:01EXARD9S52S833EDTV1N4PNM6:2gmaL7FyTFFkWrLxlPTZxJwOoDLrkkYyETqcp0l1FL4 err="memcache: connect timeout to 10.11.224.48:11211" |
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
class Tree(object): | |
def __init__(self, root): | |
self.root = root | |
class Node(object): | |
def __init__(self, value, left=None, right=None): | |
self.value = value | |
self.left = left | |
self.right = right |
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 itertools | |
import string | |
def main(): | |
alphabet = string.ascii_lowercase | |
for r in range(2, 6): | |
perms = len(list(itertools.permutations(alphabet, r))) | |
perms_with_reps = len(list(itertools.product(alphabet, repeat=r))) |
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
{ | |
"all_boards": { | |
"board_0": [ | |
"7s", | |
"3c", | |
"7c", | |
"5s", | |
"9s" | |
], | |
"board_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
"details": [ | |
{ | |
"board_id": 0, | |
"game_type": "high_card", | |
"p1": "e3d8069530064d14ab45de8a6f1a38ec", | |
"p1_score": 1, | |
"p2": "bot-1", | |
"p2_score": -1, | |
"winner": "e3d8069530064d14ab45de8a6f1a38ec" | |
}, |
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
//server.js | |
var app = require('express')(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
io.on('connection', function (socket){ | |
console.log('connection made'); | |
socket.on('CH01', function (from, msg) { | |
console.log('MSG', from, ' saying ', msg); |
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 socketio | |
import eventlet | |
from flask import Flask, render_template | |
sio = socketio.Server() | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): |
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 | |
from flask_socketio import SocketIO | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'secret!' | |
socketio = SocketIO(app) | |
@socketio.on('test') | |
def handle_message(message): |
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
//client.js | |
var io = require('socket.io-client'); | |
var socket = io.connect('http://localhost:3000', {reconnect: true}); | |
// Add a connect listener | |
socket.on('connect', function () { | |
console.log('Connected!'); | |
socket.emit("test", {"data":"blob"}); | |
}); | |
socket.emit('CH01', 'me', 'test msg'); |
NewerOlder