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
#include <stdlib.h> | |
#include <iostream> | |
#include <pthread.h> | |
#ifndef SINGLETON_H | |
#define SINGLETON_H | |
namespace util { | |
template <class T> | |
class Singleton { |
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
#include <iostream> | |
#include <stack> | |
#include <stdlib.h> | |
struct BTree { | |
int value; | |
int depth; | |
BTree *left; | |
BTree *right; | |
}; |
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 numpy as np | |
class Any(): | |
def __init__(self): | |
pass | |
class Vec(Any): | |
def __init__(self, vec): | |
self._vec = vec | |
def __getitem__(self, idx): |
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
def parse_list(values, message): | |
if isinstance(values[0], dict): | |
for v in values: | |
cmd = message.add() | |
parse_dict(v, cmd) | |
else: | |
message.extend(values) | |
def parse_dict(values, message): | |
for k, v in values.iteritems(): |
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
#include <iostream> | |
#include <vector> | |
#include <set> | |
#include <initializer_list> | |
template<typename E> | |
struct ExpressionFunctor { | |
double operator[](size_t i) const { return static_cast<E const&>(*this)[i]; } | |
size_t size() const { return static_cast<E const&>(*this).size(); } |
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 ray | |
import paddle.v2 as paddle | |
import paddle.v2.fluid as fluid | |
import numpy | |
ray.init() | |
NUM_WORKERS = 2 | |
BATCH_SIZE = 128 |
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
#!/bin/bash | |
PSERVERS="" | |
for i in {6170..6171} | |
do | |
if [ "${PSERVERS}" == "" ]; then | |
PSERVERS="127.0.0.1:${i}" | |
else | |
PSERVERS="${PSERVERS},127.0.0.1:${i}" | |
fi |
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
#include <string> | |
#include <condition> | |
#include <atomic> | |
class RPCServer; | |
/* | |
* Handler Class for the server to use | |
*/ | |
class RequestHandler { | |
public: |
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 sys | |
import re | |
def escape(input): | |
o = input.replace("\n", "") | |
o = o.replace("\r", "") | |
return o | |
def main(): | |
logfile = sys.argv[1] |
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
#!/bin/bash | |
image="paddlepaddle/paddle" | |
tags=`wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'` | |
if [ -n "$2" ] | |
then | |
tags=` echo "${tags}" | grep "$2" ` | |
fi |
OlderNewer