很酷的Google Public Data Explorer

2011年10月9日

这个视频展示了一个用全息技术表现人均收入、平均寿命和人口数的变化,很炫的一个技术。

其实这个数据在Google Public Data Explorer也有,只是没有用这种全息技术而已,数据是从1980年开始的。

其它 ,

[VBA书籍] Pro Excel 2007 VBA

2011年10月5日

最近工作闲了很多,股票行情差到不想看,也就多了时间看看书。之前很少用Excel 2007和2010,所以开始学习2007或2010版本的VBA。
Apress的这本《Pro Excel 2007 VBA》介绍的内容和普通的VBA书籍有些不同,因此适用于对Excel VBA或其它语言有一定了解的学习者。对我来说,像第2章、第3章和第6章的内容之前一直比较少接触,而第9章的内容则可以直接跳过。
Pro Excel 2007 VBA

目录
第1章:宏记录器和代码模块
第2章:数据进入,数据出来
第3章:在Excel2007中使用XML
第4章:用户窗体
第5章:Excel2007的图表
第6章:透视表
第7章:调试和错误处理
第8章:Office整合
第9章:ActiveX和.Net

PDF下载:爱问
源码下载:Apress

VBA, 图书

使用正则表达式截取文本

2011年8月13日

在进行网页内容下载时,经常需要截取指定关键字内的部分文本,以前一般使用Instr、InstrRev、Mid、Left和Right这些字符串函数来分离,这样比较繁琐一些。其实也可以使用正则表达式来处理,这里做一个自定义函数,以后自己就可以这样使用了。

Function TextBetween(strInput As String, strStart As String, strEnd As String) As String
    Dim regEx As Object
    Dim Matches As Object
    Dim strPattern As String
 
    Set regEx = CreateObject("vbscript.regexp")
 
    strStart = Replace(strStart, "\", "\\")
    strEnd = Replace(strEnd, "\", "\\")
 
    strStart = Replace(strStart, "(", "\(")
    strEnd = Replace(strEnd, "(", "\(")
 
    strStart = Replace(strStart, ")", "\)")
    strEnd = Replace(strEnd, ")", "\)")
 
    strStart = Replace(strStart, "*", "\*")
    strEnd = Replace(strEnd, "*", "\*")
 
    strStart = Replace(strStart, ".", "\.")
    strEnd = Replace(strEnd, ".", "\.")
 
    strStart = Replace(strStart, "^", "\^")
    strEnd = Replace(strEnd, "^", "\^")
 
    strStart = Replace(strStart, "$", "\$")
    strEnd = Replace(strEnd, "$", "\$")
 
    strStart = Replace(strStart, "$", "\$")
    strEnd = Replace(strEnd, "$", "\$")
 
    strStart = Replace(strStart, "+", "\+")
    strEnd = Replace(strEnd, "+", "\+")
 
    strStart = Replace(strStart, "?", "\?")
    strEnd = Replace(strEnd, "?", "\?")
 
    strStart = Replace(strStart, "{", "\{")
    strEnd = Replace(strEnd, "{", "\{")
 
    strStart = Replace(strStart, "}", "\}")
    strEnd = Replace(strEnd, "}", "\}")
 
    strStart = Replace(strStart, "|", "\|")
    strEnd = Replace(strEnd, "|", "\|")
 
    strPattern = strStart & "(.*\n*.*)" & strEnd
    regEx.Pattern = strPattern
    regEx.IgnoreCase = True
    regEx.Global = True
    regEx.MultiLine = True
 
    On Error Resume Next
    Set Matches = regEx.Execute(strInput)
    TextBetween = Matches(0).submatches(0)
    Set regEx = Nothing
    Set Matches = Nothing
End Function
 
Sub Test()
    MsgBox TextBetween("abc-this is a test-abc", "-", "-")
End Sub

VBA , , ,

安装了bbPress插件

2011年7月27日

WordPress早前发布了官方的bbPress插件,这样就可以将这个轻量级的论坛程序整合到WordPress中,省去很多麻烦。虽然还是beta版,这里还是尝试着将它做成一个问答区

目前bbPress插件没有提供正式的中文语言包,不过可以从Dreamcolor Said这里下载到这个插件的DEV语言包。

其它

想法-基于Web的加载宏管理器

2011年7月25日

有一个这样的想法,其实是可以实现的,只是可能实用性不会太好。

现在的加载宏一般都是手动打开文件运行,感觉可以做一个基于网络的加载宏管理器插件。
先建一个网站,允许网友们上传自己的加载宏,出于安全的考虑,必须是公开源代码。加载宏在审核之后分类呈现,添加版本的适用信息,可以接受用户评分。
然后做一个加载宏插件,显示网站上可用的加载宏,选择自己需要的加载宏后可以一键安装。下面只是一个简单的模版窗口,还可以添加分类、搜索、管理已安装加载宏等等功能。
AddinTool

VBA , ,