Skip to content

Instantly share code, notes, and snippets.

View panthole's full-sized avatar
:octocat:
Coding

Lingyue Pan panthole

:octocat:
Coding
View GitHub Profile
python3 nucleus.py train --dataset=../../datasets/nucleus --subset=train --weights=coco
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always in your notebook
# Notebook config
c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem' #location of your certificate file
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False #so that the ipython notebook does not opens up a browser by default
c.NotebookApp.password = u'sha1:4a023b5f6d3e:bf90fad3935aaec912516f356710755612bd0164' #the encrypted password we generated above
@panthole
panthole / 1) Install
Created May 17, 2017 06:28 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@panthole
panthole / RxJava.md
Created December 23, 2016 02:33 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@panthole
panthole / RarrangeControl.java
Last active August 13, 2016 06:51
弹幕异步图片下载
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
@panthole
panthole / TimingLogger.java
Created August 11, 2016 09:28
Android记录方法执行时间
TimingLogger timings = new TimingLogger(TAG, "methodA");
// ... do some work A ...
timings.addSplit("work A");
// ... do some work B ...
timings.addSplit("work B");
// ... do some work C ...
timings.addSplit("work C");
timings.dumpToLog();
@panthole
panthole / ArrayList<Object>Copy.java
Created August 10, 2016 08:31
ArrayList<Object>深浅拷贝分析
例如我有一个ArrayList里面包含3个int[]数组
int [] arr1 = new int [10];
int [] arr2 = new int [10];
int [] arr2 = new int [10];
ArrayList al = new Arraylist();
@panthole
panthole / JPEGHelper.java
Last active August 9, 2016 14:16
Android图片压缩保存
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import com.iqiyi.qixiu.utils.Log;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@panthole
panthole / SoftListenLayout.java
Created August 9, 2016 08:20
Android 监听软键盘弹起消失的布局
import android.content.Context;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import java.util.ArrayList;
public class SoftListenLayout extends RelativeLayout {
private OnKeyboardChangedListener onKeyboardChangedListener;