Skip to content

Instantly share code, notes, and snippets.

# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: choices.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: choices.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
@PeterZhizhin
PeterZhizhin / jax_ctc.py
Last active September 17, 2021 12:21
Jax CTC loss implementation
import jax.numpy as jnp
import jax
import functools
@jax.jit
def logadd(x0, x1, x2):
# produces nan gradients in backward if -inf log-space zero element is used https://github.com/pytorch/pytorch/issues/31829
#return jax.nn.logsumexp(jnp.stack([x0, x1, x2]), axis=0)
# use if -inf log-space zero element is used
@PeterZhizhin
PeterZhizhin / outline-server-setup.md
Created May 8, 2018 20:34 — forked from okeehou/outline-server-setup.md
How to setup an Outline VPN Server on Ubuntu 16.04

How to setup an Outline VPN Server on Ubuntu 16.04 Server

This guide will show you how to install Outline Server on an Ubuntu 16.04 Server, use Outline Manager for Windows and connect to your Outline Server on Windows and Anroid.

Install Outline Manager

Outline Manager supports Windows, macOS and Linux.

Outline Manager for Windows

#ifdef NOJUDGE
#include <iostream>
#include "test.cpp"
int func(int a, int b)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
return a + b;
}
friend class iterator;
class iterator :
public std::iterator<std::forward_iterator_tag, pair_t> {
private:
std::list<size_t>::iterator lit;
typename std::vector<Element>::iterator it;
public:
iterator(HashMap& h, std::list<size_t>::iterator _lit) :
lit(_lit), it(h.elements.begin()) {}
iterator(HashMap& h, size_t position) :
from queue import PriorityQueue
import re
class HuffmanTree:
class HuffmanNode:
def __init__(self, node0=None, node1=None, symbol=None):
self.node0 = node0
self.node1 = node1
self.symbol = symbol