start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
# encoding: utf-8 | |
# a cralwer demo, crawl image of "Nao can dui hua" on http://baozoumanhua.com | |
import urllib2 | |
import urllib | |
import re | |
def get_all_page_urls(): | |
url = 'http://baozoumanhua.com/duihua/hot/page/' |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
double average(int i, ...); | |
int main(int argc, char *argv[]) | |
{ | |
double x = 22.5, y = 10.5, z = 13.2; | |
printf("x+y+z=%.2f\n", average(3, x, y, z)); |
#!/usr/bin/perl -w | |
# | |
# search - Search a file for text. Like grep, but prints a window. | |
# Perl, Unix/Linux/Windows... | |
# | |
# 23-Jan-2006, ver 1.20 | |
# | |
# USAGE: search [-hinBI][-s num] pattern [files ...] | |
# | |
# -h # usage help |
#!/bin/bash | |
# | |
# backup - Tiny script used to backup folders. This | |
# is an exercise for learning shell programming. | |
# | |
# | |
# Join elements in array | |
# |
#!/bin/sh | |
## | |
# Install autoconf, automake and libtool smoothly on Mac OS X. | |
# Newer versions of these libraries are available and may work better on OS X | |
# | |
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html | |
# | |
export build=~/devtools # or wherever you'd like to build |
// 2017.2.17 | |
#include <iostream> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
struct yfs_dir_entry { | |
uint32_t inode; /* Inode number */ | |
uint16_t rec_len; /* Directory entry length */ |
// Linux获取当前时区的时间 | |
#include <iostream> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <time.h> | |
int main(int argc, char *argv[]) | |
{ |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <time.h> | |
int main(int argc, char *argv[]) | |
{ | |
struct stat st; | |
char *f = "README"; |