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
# 安装xlsReadWrite包之后要运行xls.getshlib() | |
# 但是 http://dl.dropbox.com/u/2602516/swissrpkg/bin/win32/shlib/xlsReadWrite_1.5.4_dll.zip 在墙外 | |
# 所以找人下载之后放在本地web服务器上 http://127.0.0.1/download/win32/shlib/xlsReadWrite_1.5.4_dll.zip | |
# 运行的时候 用 xls.getshlib(md5=FALSE) | |
xls.getshlib <- function (pkgvers = NA, url = NA, md5 = TRUE, reload.shlib = TRUE, | |
tmpdir = tempdir()) | |
{ | |
require(tools) | |
printmsg <- function(x) { |
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
'批量转换文件夹中的xls为csv | |
'地址 http://www.cnblogs.com/snippet/archive/2010/07/06/xls2csv.html | |
Option Explicit | |
Sub covertFile(ByRef sFilename As String) | |
Dim oWorkbook As Workbook | |
Set oWorkbook = Workbooks.Open(Filename:=sFilename) | |
oWorkbook.SaveAs Filename:=sFilename & ".csv", FileFormat:= _ | |
xlCSV, CreateBackup:=False |
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
# 数据文件的下载地址 http://dl.vmall.com/c0a13rrt7p | |
# 基金基本信息数据来自 http://quote.eastmoney.com/center/fund.html | |
# 历史行情数据来自天相 | |
setwd("C:/etf/data") | |
etf <- read.csv("etf.csv") | |
lof <- read.csv("lof.csv") | |
colnames(etf) <- c("jjdm","jjmc","bdzs","glr","clgm","zcgm","clsj","tgr") | |
colnames(lof) <- c("jjdm","jjmc","bdzs","glr","clgm","zcgm","clsj","tgr","tgfl","glfl") |
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
#解决安装Pygments后出现Liquid error: bad file descriptor的问题 | |
diff --git a/lib/albino.rb b/lib/albino.rb | |
index 387c8e9..b77d55e 100644 | |
--- a/lib/albino.rb | |
+++ b/lib/albino.rb | |
@@ -1,4 +1,5 @@ | |
require 'posix-spawn' | |
+require 'rbconfig' | |
## |
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
require(utils) | |
require(tcltk) | |
require(RCurl) | |
img.upload <- function(){ | |
if(any(ls(envir=.GlobalEnv)=="fileName")) { | |
rm(fileName,envir=.GlobalEnv) | |
} | |
if(any(ls(envir=.GlobalEnv)=="uploadInfo")) { |
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
require 'json' | |
# JSON parser tag, creating map for use in jekyll markdown | |
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com) | |
# Released under APL 2.0 | |
# usage: {% jsonball varname from TYPE PARAM %} | |
# | |
# where TYPE is one of {data,var,file,page}, described below |
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
# This goes in _plugins/excerpt.rb | |
module Jekyll | |
class Post | |
alias_method :original_to_liquid, :to_liquid | |
def to_liquid | |
original_to_liquid.deep_merge({ | |
'excerpt' => content.match('<!--more-->') ? content.split('<!--more-->').first : nil | |
}) | |
end | |
end |
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
# Jekyll archive page generator with pagination. | |
# | |
# Based on the category generator from | |
# http://recursive-design.com/projects/jekyll-plugins/, | |
# which is copyright (c) 2010 Dave Perrett, | |
# http://recursive-design.com/ and is licensed under the MIT | |
# license (http://www.opensource.org/licenses/mit-license.php), and | |
# on the pagination code from Jekyll itself. | |
# | |
# This code is copyright (c) 2011 Benjamin Curtis, and is licensed |
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
require(XML) | |
pg1 = 'http://www.wxtj.gov.cn/tjxx/tjsj/ydzyzb/index.shtml' | |
pg2 = 'http://www.wxtj.gov.cn/tjxx/tjsj/ydzyzb/index_2.shtml' | |
pg3 = 'http://www.wxtj.gov.cn/tjxx/tjsj/ydzyzb/index_3.shtml' | |
pg4 = 'http://www.wxtj.gov.cn/tjxx/tjsj/ydzyzb/index_4.shtml' | |
url1 = htmlTreeParse(pg1, useInternal = TRUE) | |
url2 = htmlTreeParse(pg2, useInternal = TRUE) | |
url3 = htmlTreeParse(pg3, useInternal = TRUE) |
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
<div id="recent"> | |
<!-- Feedsky FEED JS发布代码开始 --> | |
<script src="http://feed.feedsky.com/yanping/jsout&n=5&e=utf8"> | |
</script> | |
<div class="reader-publisher-module" id="readerpublishermodule0" style="border: 1px solid rgb(188, 204, 235); margin: 0.5em; padding: 0pt; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; text-align: left; text-indent: 0pt; text-decoration: none; font-weight: normal; font-family: arial,sans-serif; font-size: 10pt; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;"> | |
<h3 style="border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color rgb(188, 204, 235); border-width: medium medium 1px; margin: 0pt 0.5em; padding: 0.2em 0pt; background: transparent none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background- |