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
# coding: utf-8 | |
import glob | |
files = glob.glob("*") # get the file list of current directory | |
out = open("m.bat","w") # generate bat file | |
i = 1 # where the index start from | |
for f in files: | |
newname = "%03.d%s" %(i,f) # output new file name like 001filename, 002filename | |
out.writelines("move %s %s\n"%(f, newname)) | |
i = i +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
#!/bin/env python | |
# coding=utf-8 | |
# | |
# a basic url decoder can be helpful to find out the real page link, when you google refered page was blocked by the GFW | |
# | |
from urllib2 import quote, unquote | |
from getopt import getopt, GetoptError | |
import sys |
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 <sstream> // for stringstream | |
#include <iostream> | |
template <class T> | |
T convert(const char* arg) | |
{ | |
T result; | |
std::stringstream ss; | |
ss << arg; | |
ss >> result; |
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 <iostream> | |
#include <vector> | |
int main(void) | |
{ | |
std::vector<int> vecInt(3); | |
vecInt[0] = 1; | |
vecInt[1] = 2; | |
vecInt[2] = 3; |
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
#! /bin/bash | |
# rename files | |
# | |
# FIXME | |
# 1. filename with more than one year number | |
# a file name with more than one year number, like | |
# Chen2000-tech-Guanling-Chen-TR2000-381, the shell doesn't | |
# know how to deal with it, as the result of grep "-Po" returned | |
# with two number "2000\n" and "2000" | |
# |
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
\documentclass[UTF8,10pt]{ctexart} | |
\usepackage[a4paper,%%textwidth=129mm,textheight=185mm, %%193-8 | |
text={160mm,260mm},centering]{geometry} | |
\pagestyle{empty} | |
\begin{document} | |
\title{用散点图示范ggplot2的核心概念} | |
\author{肖凯} | |
\maketitle | |
\abstract{ | |
本文稿是第五届R语言会议演讲内容的一部分,试图用散点图示例来说明ggplot2包的核心概念,以方便初学者快速上手。同时这也是笔者应用knitr包的一个练习。该示例所用数据是ggplot2包内带的mpg数据集。} |
NewerOlder