Skip to content

Instantly share code, notes, and snippets.

View CheYulin's full-sized avatar

CHE Yulin CheYulin

  • Huawei
  • Shen Zhen
View GitHub Profile
@CheYulin
CheYulin / Makefile
Created August 10, 2016 23:57 — forked from jl2/Makefile
A simple trie data structure in C++.
trie: main.cpp Makefile
clang++ -O3 -std=c++11 -stdlib=libc++ -Wall -o trie main.cpp -lboost_system
@CheYulin
CheYulin / mapread.c
Created August 19, 2016 12:36 — forked from marcetcheverry/mapread.c
mmap and read/write string to file
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, const char *argv[])
{
@CheYulin
CheYulin / mmap.c
Created August 26, 2016 14:46 — forked from piki/mmap.c
some fun with mmap and madvise
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#define CHECK(thing) if (!(thing)) { perror(#thing); exit(1); }
#define MAX_PAGE_IN 104857600
cheyulin
@CheYulin
CheYulin / moveClear.js
Created October 26, 2016 13:28 — forked from prgg/moveClear.js
滑动解锁
(function(){
//处理对象&初始变量
var float_obj = document.getElementById('float_footer'),
float_cur = document.getElementById('float_footer_cur'),
float_cur_startClass = float_cur.className,
eventOff,eventMaxWidth = 195,startX,clientX;
//按下鼠标&触点
function clearStart(event){
if(/ui-slider-handle/.test(event.target.className)){
@CheYulin
CheYulin / iterm2-solarized.md
Created April 2, 2017 02:33 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@CheYulin
CheYulin / Scan.py
Created August 7, 2017 12:14 — forked from enjoylife/Scan.py
Python implementation of SCAN: A Structural Clustering Algorithm for Networks
# -*- coding: utf-8 -*-
"""
SCAN: A Structural Clustering Algorithm for Networks
As described in http://ualr.edu/nxyuruk/publications/kdd07.pdf
"""
from collections import deque
import numpy as np
from scipy.sparse import csr_matrix
@CheYulin
CheYulin / tmux_local_install.sh
Created August 13, 2017 14:46 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@CheYulin
CheYulin / gist:8b55c5fce03d48330714619fe30de431
Created September 16, 2018 04:16
edge-list-to-csr-sorted-neighbors
//
// Created by yche on 9/2/18.
//
#include <chrono>
#include <cassert>
#include <algorithm>
#include "../utils/log.h"
@CheYulin
CheYulin / gist:17152bb652cc3cf0057907d262c81976
Created January 3, 2019 12:05 — forked from windwiny/gist:c85dd8c2571b4374f874
Linux 基于策略的路由(Linux Policy Routing)(Linux 多个网卡使用相同网段的IP地址设置)
----
Linux 基于策略的路由(Linux Policy Routing)
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部
ip rule