Skip to content

Instantly share code, notes, and snippets.

View mlzxy's full-sized avatar

Xinyu Zhang mlzxy

View GitHub Profile
@mlzxy
mlzxy / tmux_local_install.sh
Last active May 20, 2016 19:56 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Exit on error #
set -e
# Clean up #
rm -rf ~/programs/libevent
rm -rf ~/programs/ncurses
rm -rf ~/programs/tmux
# Variable version #
@mlzxy
mlzxy / CMakeLists.txt
Created April 17, 2016 19:47
Learn OpenCL
cmake_minimum_required(VERSION 3.3)
project(opencl_learning)
## Set
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
## Package Find
ROOT=`pwd`
NUMBER_OF_CORES=4
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -q -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" # If you are OK with all defaults
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev
sudo apt-get install -y --no-install-recommends libboost-all-dev
sudo apt-get install -y libatlas-base-dev
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
void query(char* name, char* addr, inquiry_info * ii){
import paho.mqtt.client as mqtt
from gpiozero import LED
from time import sleep
import threading
IP = "192.241.199.185"
PORT = 1883
class Light:
def __init__(self):
@mlzxy
mlzxy / lipreadtrain.py
Last active March 4, 2016 03:52
LSTM Network Training Script for 253 Final Project.
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import json
from keras.preprocessing import sequence
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Masking, TimeDistributedDense
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM
@mlzxy
mlzxy / career-affair.md
Last active February 15, 2016 01:40
TODO

自己之前也投过一些简历,参加过career affair, 但并不成功。 身边很多同学都找到了实习,自己却还没着落。

痛定思痛,思考了很多。 这其中诚然有运气成分,但更重要的是太不重视细节,没有把这件事真正放在心上,而忽视细节更是自己性格的致命伤。

module HW where
import Control.Monad.State hiding (when)
tick :: Int -> State String ()
tick _= do
-- get last intermediate valueP
@mlzxy
mlzxy / edf.py
Created February 5, 2016 00:13
edf scheduler for my hw
inputArg = [['A', 1, 4], ['B', 2, 8], ['C', 1, 5], ['D', 2, 7]]
FINISHED = float('inf')
OVER = -1
# This script installs Caffe and pycaffe on Ubuntu 14.04 x64 or 14.10 x64. CPU only, multi-threaded Caffe.
# Usage:
# 0. Set up here how many cores you want to use during the installation:
# By default Caffe will use all these cores.
NUMBER_OF_CORES=4
# 1. Execute this script, e.g. "bash compile_caffe_ubuntu_14.04.sh" (~30 to 60 minutes on a new Ubuntu).
# 2. Open a new shell (or run "source ~/.bash_profile"). You're done. You can try
# running "import caffe" from the Python interpreter to test.
#http://caffe.berkeleyvision.org/install_apt.html : (general install info: http://caffe.berkeleyvision.org/installation.html)