Skip to content

Instantly share code, notes, and snippets.

@larryxiao
larryxiao / * - pdf
Last active October 18, 2017 08:56
extract text from pdf then remove unnecessary characters change '\n' into '||' change \f' into ' '
libreoffice --convert-to pdf *.ppt
libreoffice --headless --convert-to pdf *.ppt
@larryxiao
larryxiao / gist:6848069
Created October 6, 2013 01:10
finding files recursively then copy to destination folder
find $directory -type f -name \*.in
-exec cp {} /home/destination/folder \;
@larryxiao
larryxiao / watchop.py
Last active December 27, 2015 15:19 — forked from pocketwalker/watchop.py
#!/usr/bin/python
#coding=utf-8
from bs4 import BeautifulSoup
import sys, re
import urllib, urllib2
import xml.etree.ElementTree as ET
import webbrowser
#import codes, Queue, threading, time
def spider(net):
import random
class Markov(object):
def __init__(self, open_file):
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
self.database()

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@larryxiao
larryxiao / Makefile
Last active August 29, 2015 13:57
CUDA / OpenCL ready Solid Classes
all:
nvcc -gencode arch=compute_20,code=sm_20 GPU_solid.cu
@larryxiao
larryxiao / tips.md
Created May 11, 2014 12:13
Something about Mac OS X
@larryxiao
larryxiao / sc.cu.v
Last active August 29, 2015 14:02
pastebin
module sc_cu (op, func, z, wmem, wreg, regrt, m2reg, aluc, shift,
aluimm, pcsource, jal, sext);
input [5:0] op,func;
input z;
output wreg,regrt,jal,m2reg,shift,aluimm,sext,wmem;
output [3:0] aluc;
output [1:0] pcsource;
wire r_type = ~|op;
wire i_add = r_type & func[5] & ~func[4] & ~func[3] &
~func[2] & ~func[1] & ~func[0]; //100000
@larryxiao
larryxiao / my_first_app.cpp
Created July 7, 2014 08:24
GraphLab my_first_app.cpp
#include <string>
#include <iostream>
#include <graphlab.hpp>
struct web_page {
std::string pagename;
double pagerank;
web_page():pagerank(0.0) { }
explicit web_page(std::string name):pagename(name),pagerank(0.0){ }
void save(graphlab::oarchive& oarc) const {
@larryxiao
larryxiao / knc_db.txt
Created August 31, 2014 07:56
SCC SJTU
# Performance Monitoring Events for Generation Intel Core Processors Code Name Knights Corner Core-KNC V4
# 8/9/2013 7:33:41 AM
CODE UMASK NAME DESCRIPTION COMMON COUNTER OVERFLOW OTHER DEFAULT EM_TRIGGER
0x00 0x00 DATA_READ Number of memory data reads which hit the internal data cache (L1). Cache accesses resulting from prefetch instructions are included. 20013 "0,1" 1000003 0x53 0 0
0x01 0x00 DATA_WRITE Number of memory data writes which hit the internal data cache (L1). 20013 "0,1" 1000003 0x53 0 0
0x02 0x00 DATA_PAGE_WALK Number of data page walks 20013 "0,1" 1000003 0x53 0 0
0x03 0x00 DATA_READ_MISS Number of memory read accesses that miss the internal data cache whether or not the access is cacheable or noncacheable. Cache accesses resulting from prefetch instructions are included. 20013 "0,1" 1000003 0x53 0 0
0x04 0x00 DATA_WRITE_MISS Number of memory write accesses that miss the internal data cache whether or not the access is cacheable or noncacheable 20013 "0,1" 1000003 0x53 0 0
0