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
| [Desktop Entry] | |
| # put this file into ~/.local/share/applications/edit-with-spectacle.desktop | |
| Type=Application | |
| Name=Edit with Spectacle | |
| Comment=Annotate and edit an image with Spectacle | |
| Exec=spectacle -E %f | |
| Icon=spectacle | |
| MimeType=image/jpeg;image/png; | |
| Categories=Graphics;2DGraphics;RasterGraphics; | |
| NoDisplay=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
| def pagerank_csr(A, alpha=0.85, tol=1e-6, max_iter=100): | |
| """ | |
| PageRank on a CSR adjacency matrix. | |
| Parameters | |
| ---------- | |
| A : scipy.sparse.csr_matrix | |
| Weighted adjacency matrix where A[i, j] is the weight of edge i -> j. | |
| alpha : float | |
| Damping factor. |
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 aiohttp import web | |
| from fastapi import FastAPI | |
| from fastapi.staticfiles import StaticFiles | |
| from starlette.requests import Request as ASGIRequest | |
| from aiohttp_asgi import ASGIResource | |
| aiohttp_app = web.Application() | |
| app = FastAPI() |
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 random | |
| import itertools | |
| ord_a = ord('a') | |
| ord_z = ord('z') | |
| ord_A = ord('A') | |
| ord_Z = ord('Z') | |
| alpha = [chr(i) for i in range(ord_a, ord_z)] | |
| ALPHA = [chr(i) for i in range(ord_A, ord_Z)] | |
| alphanum = alpha+ALPHA+list('0123456789') |
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
| syntax = "proto3"; | |
| package helloworld; | |
| service Greeter { | |
| rpc SayHello (HelloRequest) returns (HelloResponse); | |
| rpc SearchResults (Empty) returns (SearchResponse); | |
| } | |
| message HelloRequest { |
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 asyncio | |
| # also consider asyncio.Semaphore(10) see https://docs.python.org/3/library/asyncio-sync.html#semaphore | |
| async def unordered_bulks(size, aiterable): | |
| tasks = set() | |
| async for task in aiterable: | |
| tasks.add(task) | |
| if len(tasks)>=size: | |
| for coro in asyncio.as_completed(tasks): | |
| yield coro |
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
| #! /usr/bin/env python | |
| from __future__ import print_function | |
| import argparse | |
| import os | |
| import tensorflow as tf | |
| # from tensorflow.python.framework import graph_util | |
| # from tensorflow.python.framework import graph_io |
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
| # add the below to your ~/.bash_profile | |
| parse_git_branch() { | |
| [ -d .git ] && { | |
| echo -n '@' | |
| git rev-parse --abbrev-ref HEAD | |
| } | |
| } | |
| export PS1='[\u@\h \W$(parse_git_branch)]\$ ' |
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 tensorflow as tf | |
| import numpy as np | |
| import math | |
| PADDING_VALID, PADDING_SAME = 'VALID', 'SAME' | |
| FORMAT_NHWC, FORMAT_NCHW = 'NHWC', 'NCHW' | |
| # TODO: support N=? | |
| def rnd_pooling2d(inputs, ksize=2, strides=2, padding=PADDING_VALID, data_format=FORMAT_NHWC, name=None): |
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
| version: '3' | |
| services: | |
| postgres: | |
| image: "postgres:9.6" | |
| environment: | |
| POSTGRES_USER: awx | |
| POSTGRES_PASSWORD: awxpass | |
| POSTGRES_DB: awx | |
| rabbitmq: |
NewerOlder