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 sys | |
import Image | |
import codecs | |
sys.stdout = codecs.getwriter('utf8')(sys.stdout) | |
for infile in sys.argv[1:]: | |
try: | |
im = Image.open(infile) | |
width = im.size[0] | |
height = im.size[1] |
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
#include <stdio.h> | |
#include "matrix.h" | |
// #define DEBUG | |
#define UINT unsigned long | |
#define MAXN 2048 | |
void rand_gen(UINT c, int N, UINT A[][MAXN]) { | |
UINT x = 2, n = N*N; | |
for (int i = 0; i < N; i++) { | |
for (int j = 0; j < N; j++) { |
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
#include <stdio.h> | |
#include <assert.h> | |
#include <inttypes.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <CL/cl.h> | |
#define MAXGPU 8 | |
#define MAXN 2048 |
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 os | |
student = open('students') | |
for line in student.readlines(): | |
line = line[:-1] | |
print line | |
cmd = "useradd -m -s /bin/bash -d /home/pp2016/%s %s" % (line, line) | |
psw = "echo %s:%s | chpasswd" % (line, line) | |
print cmd |
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
mkdir -p ~/LLVM && cd ~/LLVM | |
wget -O - http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz | tar Jxf - | |
wget -O - http://llvm.org/releases/3.7.1/cfe-3.7.1.src.tar.xz | \ | |
tar Jxf - -C llvm-3.7.1.src/tools | |
cd /home/morris1028/LLVM/hw1 | |
mkdir build && cd build | |
cmake /home/morris1028/LLVM/llvm-3.7.1.src |
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
#include <cstdio> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#define _GNU_SOURCE | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <sched.h> | |
#include <errno.h> |
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
#include <cstdio> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#define _GNU_SOURCE | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <sched.h> | |
#include <errno.h> |
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
# Monokai-ish dark color scheme | |
# background = 39 40 34 (#272822) | |
defaults write TeXShop background_R 0.15 | |
defaults write TeXShop background_G 0.16 | |
defaults write TeXShop background_B 0.13 | |
# commands = 102 217 239 (#66D9EF) | |
defaults write TeXShop commandred 0.4 | |
defaults write TeXShop commandgreen 0.85 |
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
/* | |
$ npm install mkdirp --save | |
$ node hexo-migrate.js _post/ | |
$ cd file_migrate/_post | |
*/ | |
var fs = require("fs"); | |
var path = require("path"); | |
var mkdirp = require("mkdirp"); | |
function file_migrate(file_path) { |
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
* TypeError: undefined is not a function | |
``` | |
{% blockquote%} -> {% blockquote %} | |
``` | |
* Error: expected end of comment, got end of file | |
``` | |
{% XXX %} \text{#YYY} {% endXXX %} -> {% XXX %} \text{YYY} {% endXXX %} | |
``` | |
* void `{{` or `}}` or `{#` or `#}` in markdown file |