Skip to content

Instantly share code, notes, and snippets.

View oraoto's full-sized avatar

Oraoto oraoto

  • Guangzhou, China
View GitHub Profile
@oraoto
oraoto / phpfunctions.sql
Last active April 30, 2024 14:33
Big Query统计最常用php函数
#standardSQL
CREATE TEMPORARY FUNCTION parseFunction(src STRING)
RETURNS ARRAY<STRING>
LANGUAGE js AS """
var result = [];
var regex = /([:\\w]+?)(?:\\()/g;
var match;
while (match = regex.exec(src)) {
result.push(match[1]);
}
@oraoto
oraoto / How to Docker Swarm.md
Created August 31, 2017 13:08 — forked from alancnet/How to Docker Swarm.md
How to Docker Swarm

Temporary environment variables

# IP Address of master machine
masterip=192.168.0.101

# IP Address of node machine
nodeip=192.168.0.14

On the master

Run ETCD

@oraoto
oraoto / php2php.php
Created October 27, 2017 07:10
Parse PHP file and pretty print
<?php
include __DIR__ . "./vendor/autoload.php";
use PhpParser\Error;
use PhpParser\ParserFactory;
use PhpParser\PrettyPrinter;
$code = file_get_contents("php2php.php");
@oraoto
oraoto / Makefile
Created November 7, 2017 08:15 — forked from jeremyroman/Makefile
llvm/brainfuck: Complete
PROGRAM := llvm-brainfuck
OBJECTS := main.o
SHIM := shim.a
SHIM_OBJECTS := shim.o
CC := clang
CXX := clang++
CXXFLAGS := $(shell llvm-config --cppflags) -Wall -Werror -pedantic
LDFLAGS := $(shell llvm-config --ldflags --libs core)
@oraoto
oraoto / copy_file_range.c
Created December 28, 2017 05:22
Romove BOM wih copy_file_range
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <unistd.h>
static loff_t
copy_file_range(int fd_in, loff_t *off_in, int fd_out,
@oraoto
oraoto / backtrace
Created January 8, 2018 07:04
backtrace of nnabla
*** Error in `/usr/bin/python3': free(): invalid next size (fast): 0x00000000016bc360 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f158a8767e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f158a87f37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f158a88353c]
/usr/local/lib/python3.5/dist-packages/nnabla/libnnabla.so(_ZNSt23_Sp_counted_ptr_inplaceIN4nbla9CpuMemoryESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv+0x39)[0x7f1589575be9]
/usr/local/lib/python3.5/dist-packages/nnabla/libnnabla.so(_ZN4nbla8CpuArray10deallocateEv+0x7a)[0x7f15895f9d8a]
/usr/local/lib/python3.5/dist-packages/nnabla/libnnabla.so(_ZN4nbla8CpuArrayD1Ev+0x23)[0x7f15895f9dd3]
/usr/local/lib/python3.5/dist-packages/nnabla/libnnabla.so(_ZN4nbla8CpuArrayD0Ev+0x9)[0x7f15895f9e59]
/usr/local/lib/python3.5/dist-packages/nnabla/libnnabla.so(_ZNSt8_Rb_treeISsSt4pairIKSsS0_ISt10shared_ptrIN4nbla5ArrayEEbEESt10_Select1stIS7_ESt4lessISsESaIS7_EE8_M_eraseEPSt13_Rb_tree_nodeIS7_E+0x11a)[0x7f15895f680a]
@oraoto
oraoto / TensorFlowParser.py
Created March 6, 2018 01:44
modified TensorFlowParser.py
# Copyright 2017 Intel Corporation.
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors.
# The Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions.
# No part of the Material may be used, copied, reproduced, modified, published,
# uploaded, posted, transmitted, distributed or disclosed in any way without
# Intel's prior express written permission. No license under any patent,
@oraoto
oraoto / graph.py
Last active September 28, 2018 07:07
nnabla graph visualization
import nnabla as nn
import nnabla.functions as F
import numpy as np
import matplotlib.pyplot as plt
import graphviz as gv
def draw_graph(v, hide_params=True, op_as_edge=False):
graph = gv.Digraph()
params = nn.get_parameters(grad_only=False)
layer_count = {}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oraoto
oraoto / output.svg
Last active April 16, 2018 04:14
NNabla to NCS, maxpooling + tanh example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.