Skip to content

Instantly share code, notes, and snippets.

imp_logs.RecordUserAction(imp_logs.ROCK_PAPER_SCISSORS, "Save user actions", imp_logs.ActionRecordFormat{
RoundID: pGame.GetRoundId(),
GameCode: pGame.GameCode,
Oid: pGame.GetOid(),
PfID: pPlayer.GetPfAccount(),
Data: PlayerActionESFormat{
ActionType: request.Event,
Data: params.payload,
},
})
export VSCODE_PATH=/Applications/Visual\ Studio\ Code.app/Contents/Resources/app
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"
# command line 左邊想顯示的內容
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
def combinations(n):
dp = [ [0 for _ in range(n)] for _ in range(n) ]
dp[0][0] = 1
dp[1][1] = 1
for i in range(2, n):
dp[i][1] = i
dp[i][i] = 1
for j in range(2, n):
def combinations(n):
dp = [ [0 for _ in range(n)] for _ in range(n) ]
dp[0][0] = 1
dp[1][1] = 1
for i in range(2, n):
dp[i][1] = i
dp[i][i] = 1
for j in range(2, n):
@jhowliu
jhowliu / Inject.js
Last active November 28, 2017 03:39
include js
const path = require('path')
const fs = require('fs')
let cssFolder = path.resolve(__dirname, '../build/static/css')
let jsFolder = path.resolve(__dirname, '../build/static/js')
// var jsfiles = fs.readdirSync()
// read in css content
var cssContent = null
@jhowliu
jhowliu / test.js
Last active September 16, 2017 07:28
.then(data => {
data.map(function(label) {
comment_count = 0;
label.processes.map(function(process) {
process.group.sentence = process.group.sentence.trim().split(',');
comment_count += process.group.sentence.length;
});
label['comment_count'] = comment_count;
});
});
@jhowliu
jhowliu / app.py
Last active May 12, 2017 08:35
app
from flask import render_template, request, redirect
from app.model import get_result_with_text
from app import app
conversations = []
@app.route('/')
@app.route('/index')
def home():
@jhowliu
jhowliu / .profile
Created April 19, 2017 09:27
environment setup for syntaxnet with gpu
# cuda path
export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH"
export CUDA_HOME="/usr/local/cuda-8.0"
export PATH="$PATH:$CUDA_HOME/bin"
export CUDNN_HOME=${CUDA_HOME}
export TF_NEED_CUDA=1
export CUDA_TOOLKIT_PATH=$CUDA_HOME
export TF_CUDA_VERSION=8.0
export TF_CUDNN_VERSION=5
export CUDNN_INSTALL_PATH=$CUDA_HOME
@jhowliu
jhowliu / .sh
Created April 19, 2017 08:47
demo code
echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh
2017-04-19 16:47:21.770904: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-19 16:47:21.770922: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-19 16:47:21.770928: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-04-19 16:47:21.770930: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could spee
@jhowliu
jhowliu / client.c
Last active October 31, 2015 12:41
Computer Networking Homework 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define BUFFER_SIZE 512
#define SERVER_PORT 3000