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
{"paths":{"/api/questions/create":{"post":{"description":null,"tags":["questions"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOk->app.admin.views.questions.QuestionSchema"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app.admin.views.questions.QuestionNoIdSchema"}}}},"security":[]}},"/api/questions/delete":{"post":{"description":null,"tags":["questions"],"responses":{},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app.admin.views.questions.DeleteQuestionSchema"}}}},"security":[]}},"/api/questions/list":{"get":{"description":null,"tags":["questions"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOk->app.admin.views.questions.ListResponseSchema"}}}}},"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":0}},{"in":"query","name":"offset","required":false,"schema":{"type":"integer |
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 asyncio | |
import collections | |
import time | |
import uvloop; asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) | |
def chunkify(lst, n): | |
s = len(lst) // n | |
o = 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
import multiprocessing | |
def map_parallel(func, iterable, chunksize=1, *, | |
pool=None, | |
n_processes=None, | |
progress_bar_func=None, | |
pool_kwargs=None, | |
progress_bar_func_kwargs=None, | |
total=None | |
): |
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
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -c -s`-pgdg main 9.6" > /etc/apt/sources.list.d/pgdg.list |
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
local function alter_package_path(paths, base)local isroot=function(s)return string.sub(s,1,1)=='/'end;local slashends=function(s)return string.sub(s,-1,-1)=='/'end;local fio=require('fio');local bf=debug.getinfo(2,"S").source:sub(2);local lb=fio.readlink(bf);if lb~=nil then bf=lb end;local b=bf:match("(.*/)");if not isroot(b) then b=fio.abspath(b);if not slashends(b)then b=b..'/'end;end;if base~=nil and base~="" then if isroot(base) then b=base;else b=b..base..'/';end;end;local pkg='';for _,p in ipairs(paths)do if isroot(p) then pkg=pkg..";"..p;else pkg = pkg..";"..b..p;end;end;package.path=package.path..pkg;return b;end | |
local base = alter_package_path({ | |
'?.lua', | |
'?/init.lua', | |
'libs/tnt-luas16/?.lua', | |
}) | |
-- Full function here: | |
local function alter_package_path(paths, base) | |
local isroot=function(s)return string.sub(s,1,1)=='/'end; |
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
class CustomJsonEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, JsonSerializable): | |
return obj.__to_json__() | |
if isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date): | |
return int(time.mktime(obj.timetuple())) | |
return super(CustomJsonEncoder, self).default(obj) | |
class JsonSerializable: |
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
class ObjectId(JsonSerializable, str): | |
def __init__(self, object_id): | |
super().__init__() | |
self.object_id = int(object_id) | |
def __str__(self): | |
return str(self.object_id) | |
def __int__(self): | |
return self.object_id |
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 tensorflow as tf | |
import tensorflow.examples.tutorials.mnist.input_data | |
import numpy as np | |
mnist = tensorflow.examples.tutorials.mnist.input_data.read_data_sets("MNIST_data/", one_hot=True) | |
image_size = 28 | |
n_labels = 10 | |
def create_w_b(n_prev_layer, n_next_layer): |
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 tensorflow as tf | |
import tensorflow.examples.tutorials.mnist.input_data | |
import numpy as np | |
mnist = tensorflow.examples.tutorials.mnist.input_data.read_data_sets("MNIST_data/", one_hot=True) | |
image_size = 28 | |
n_labels = 10 | |
def create_w_b(n_prev_layer, n_next_layer): |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> | |
</handlers> | |
<httpPlatform processPath="d:\home\site\wwwroot\go\bin\go.exe" | |
arguments="run d:\home\site\repository\app.go" | |
startupTimeLimit="60"> | |
<environmentVariables> |
NewerOlder