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 os | |
import platform | |
import re | |
from functools import lru_cache, wraps | |
GLOBBING_SPECIAL_CHARS = '{}[],?*' | |
def yield_once(iterator): | |
""" | |
Decorator to make an iterator returned by a method yield each result only |
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 numpy as np | |
ITEMS_COUNT = 100 | |
MAX_SIMILARITY = 100 | |
CLUSTER_THRESHOLD = 80 | |
SPLIT_THRESHOLD = 50 | |
# 随机生成一个相似度矩阵 | |
# 相似度(0-100),数值越大越相似 |
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
sudo apt update | |
# setup zsh | |
sudo apt install -y zsh curl git tmux realpath | |
curl -L https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | bash | |
chsh `whoami` -s /bin/zsh | |
# customize zsh | |
mkdir -p $ZSH_CUSTOM/themes | |
curl -L https://raw.githubusercontent.com/bbtfr/dotfiles/master/zsh/themes/bira.zsh-theme -o $ZSH_CUSTOM/themes/bira.zsh-theme |
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
require 'pycall/import' | |
include PyCall::Import | |
pyfrom 'tensorflow.examples.tutorials.mnist', import: :input_data | |
pyimport 'tensorflow', as: :tf | |
DATA_DIR = '/tmp/tensorflow/mnist/input_data' | |
# Import data | |
mnist = input_data.read_data_sets.(DATA_DIR, one_hot: 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
05-25 23:39:36.555 29138-29138/com.sensetime.example.idcardscan D/Instrumentation: wdf startActivityForResult perm:null | |
[ 05-25 23:39:36.555 362: 362 W/ ] | |
read_meminfo() mem_free=147800 | |
[ 05-25 23:39:36.555 362: 362 W/ ] | |
create_subproc ret_fd=57 pid=29337 | |
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
01-10 07:35:17.417 12158-12158/com.sensetime.liveness D/Instrumentation: wdf startActivityForResult perm:null | |
01-10 07:35:17.425 12158-12158/com.sensetime.liveness D/ActivityThread: ACT-AM_ON_PAUSE_CALLED ActivityRecord{2b6d9e3a token=android.os.BinderProxy@3ebe3aeb {com.sensetime.liveness/com.sensetime.liveness.ui.MainActivity}} | |
01-10 07:35:17.429 12158-12158/com.sensetime.liveness D/ActivityThread: ACT-PAUSE_ACTIVITY handled : 1 / android.os.BinderProxy@3ebe3aeb | |
01-10 07:35:17.430 12158-12158/com.sensetime.liveness V/ActivityThread: Handling launch of ActivityRecord{22ff6e50 token=android.os.BinderProxy@1c3e8849 {com.sensetime.liveness/com.sensetime.stlivenesslibrary.ui.LivenessActivity}} | |
01-10 07:35:17.432 12158-12158/com.sensetime.liveness V/ActivityThread: ActivityRecord{22ff6e50 token=android.os.BinderProxy@1c3e8849 {com.sensetime.liveness/com.sensetime.stlivenesslibrary.ui.LivenessActivity}}: app=android.app.Application@1e099ee1, appName=com.sensetime.liveness, pkg=com.sensetime.liveness, comp={com.sen |
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
# 除Ruby和对应包之外,还需要安装imagemagick和disunity | |
require 'open-uri' | |
require 'fileutils' | |
require 'mini_magick' | |
RANGE = (1..580) | |
BASEURL = "http://dbcj6kgtik9tl.cloudfront.net/toto_image_s3/jp_v2/unit/unit_square_#INDEX#.Android.unity3d" | |
FileUtils.mkdir_p "tmp" |
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
# encoding: utf-8 | |
# Copyright (c) 2012, HipByte SPRL and contributors | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. |
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
# http://wiki.openssl.org/index.php/Android | |
# From the 'root' directory | |
$ . ./setenv-android.sh | |
$ cd openssl-*/ | |
$ perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org | |
$ ./config -no-shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir=$ANDROID_NDK_SYSROOT/usr | |
$ make depend | |
$ make all |
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
// This file has been generated automatically. Do not edit. | |
package com.bbtfr.hello; | |
public class JniTest extends java.lang.Object { | |
public native String stringFromJNI(); | |
} |
NewerOlder