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-get install python-setuptools zlib1g-dev libbz2-dev libreadline-dev libgdbm-dev libssl-dev libsqlite3-dev curl build-essential libxml2-dev libxslt1-dev libreadline5 libreadline6-dev libxml2 tk-dev libexpat1-dev libncursesw5-dev | |
sudo easy_install pythonbrew | |
pythonbrew_install |
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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
import os,socket,threading,time | |
#import traceback | |
allow_delete = False | |
local_ip = socket.gethostbyname(socket.gethostname()) | |
local_port = 8888 | |
currdir=os.path.abspath('.') |
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
# show git branch | |
function git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
echo "("${ref#refs/heads/}")"; | |
} | |
PS1="${HOSTNAME}:\w\[\033[1;32m\]\$(git_branch)\[\033[0m\]$"; |
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
(function($){ | |
// Settings | |
var repeat = localStorage.repeat || 0, | |
shuffle = localStorage.shuffle || 'false', | |
continous = true, | |
autoplay = false, | |
playlist = []; | |
// Load playlist | |
for (var i=0; i<playlist.length; i++){ |
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
package org.gradle; | |
import java.io.PrintWriter; | |
import java.io.ByteArrayOutputStream; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.BufferedReader; | |
import java.util.zip.GZIPOutputStream; | |
import java.util.zip.GZIPInputStream; | |
import org.apache.commons.collections.list.GrowthList; |
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
#!/bin/bash | |
#./genDb.sh `pwd` | |
#export CSCOPE_EDITOR=`which vim` | |
CSCOPE_FILE=cscope.out | |
if [ -n "$1" ]; then | |
echo "Source code directory: " $1 | |
echo "Create file map : " $CSCOPE_FILE | |
find $1 -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.java" -o -name "*.aidl" -o -name "*.mk" > $CSCOPE_FILE | |
#cscope -bkq -i $CSCOPE_FILE |
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
if [ "$(adb shell dumpsys power | grep mScreenOn= | grep -oE '(true|false)')" == false ] ; then | |
echo "Screen is off. Turning on." | |
adb shell input keyevent 26 # wakeup | |
adb shell input keyevent 82 # unlock | |
echo "OK, should be on now." | |
else | |
echo "Screen is already on." | |
fi |
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
class Struct: | |
def __init__(self, **entries): | |
self.__dict__.update(entries) | |
a = Struct(x = 5,y = 6) | |
print a.x | |
print vars(a) | |
print a.__dict__ |
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
# for 16.04 | |
# https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide | |
# caffe dependencies | |
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler | |
sudo apt-get install --no-install-recommends libboost-all-dev | |
sudo apt-get install libatlas-base-dev | |
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev | |
# Caffe requires the CUDA nvcc compiler to compile its GPU code and CUDA driver for GPU operation. | |
# To install CUDA, go to the NVIDIA CUDA website and follow installation instructions there. |
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 struct,array | |
import cv2 | |
import numpy as np | |
i = 0 | |
def showvec(fn, width=24, height=24, resize=4.0): | |
f = open(fn,'rb') | |
HEADERTYP = '<iihh' # img count, img size, min, max |