blogv3_html/posts/4.html
2017-08-16 18:01:06 +08:00

195 lines
9.1 KiB
HTML
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page 4 - 风笑痴</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="lunny">
<meta name="keywords" content="lunny,golang,xorm,tango,blog"/>
<meta name="description" content="风笑痴,一个脱离了低级懒惰的人"/>
<link href="/css/pure-min.css" type="text/css" rel="stylesheet" media="all">
<link href="/css/blog.css" type="text/css" rel="stylesheet" media="all">
<link href="/css/railscasts.css" type="text/css" rel="stylesheet" media="all"/>
</head>
<body class="post-list" data-perma="post-page-4">
<div class="pure-g-r" id="layout">
<div class="sidebar pure-u">
<header class="header">
<hgroup>
<h1 class="brand-title">
<a href="/" class="brand-title">风笑痴</a>
</h1>
<h2 class="brand-tagline">一个脱离了低级懒惰的人</h2>
</hgroup>
<nav class="nav">
<ul class="nav-list">
<li class="">
<a href="/">文章</a>
</li>
<li class="">
<a href="/archive">归档</a>
</li>
<li class="">
<a href="/about" target="_blank" >关于</a>
</li>
</ul>
</nav>
</header>
</div>
<div class="pure-u-1">
<div class="content">
<div class="page-header">
<h1>所有文章</h1>
</div>
<div class="post">
<h3 class="post-header"><a href="/2012/1/19/%e5%bc%80%e6%ba%90%e8%ae%b8%e5%8f%af%e8%af%81%e7%9a%84%e5%8c%ba%e5%88%ab%e5%9b%be%e7%a4%ba.html">开源许可证的区别图示</a></h3>
<div class="post-meta">
<small>2012-1-19</small>
</div>
<div class="post-description"><p>看了<a href="http://www.ruanyifeng.com">阮一峰</a>的一片关于开源许可证的文章<a href="http://www.ruanyifeng.com/blog/2011/05/how_to_choose_free_software_licenses.html">《如何选择开源许可证?》</a>,感觉里面这个图还有改进的余地,因此在他这个图的基础上作了一点改动。所有的许可证从左至右是从限制较多到限制较少的进行排列。如下图所示:</p>
<p><a href="/static/media/images/2012/01/OpenSource.png"><img src="/static/media/images/2012/01/OpenSource.png" alt="开源许可证" title="开源许可证" /></a></p>
</div>
<div class="more">
<a href="/2012/1/19/%e5%bc%80%e6%ba%90%e8%ae%b8%e5%8f%af%e8%af%81%e7%9a%84%e5%8c%ba%e5%88%ab%e5%9b%be%e7%a4%ba.html" class="btn pure-button pure-button-primary">继续阅读..</a>
</div>
</div>
<div class="post">
<h3 class="post-header"><a href="/2011/8/25/Chrome%e6%89%a9%e5%b1%95%e6%9b%b4%e6%96%b0%ef%bc%9aSmart-RSS-Subscriber-for-Google-Reader%e2%84%a2%ef%bc%88v0.1.5%ef%bc%89.html">Chrome扩展更新Smart RSS Subscriber for Google Reader™v0.1.5</a></h3>
<div class="post-meta">
<small>2011-8-25</small>
</div>
<div class="post-description"><p>就是原先的Google Reader RSS Subscriber因为google的品牌政策所以修改了扩展名称另做了少量修改和修复。扩展地址为
<a href="https://chrome.google.com/webstore/detail/ngjinemddlnikfdlbnbdbajdhagbcjmg">https://chrome.google.com/webstore/detail/ngjinemddlnikfdlbnbdbajdhagbcjmg</a></p>
</div>
<div class="more">
<a href="/2011/8/25/Chrome%e6%89%a9%e5%b1%95%e6%9b%b4%e6%96%b0%ef%bc%9aSmart-RSS-Subscriber-for-Google-Reader%e2%84%a2%ef%bc%88v0.1.5%ef%bc%89.html" class="btn pure-button pure-button-primary">继续阅读..</a>
</div>
</div>
<div class="post">
<h3 class="post-header"><a href="/2011/7/4/%e7%94%a8VBScript%e5%ae%9e%e7%8e%b0%e7%94%9f%e6%88%90%e7%9b%ae%e5%bd%95%e6%a0%91%e4%bb%a5Excel%e6%a0%bc%e5%bc%8f%e4%bf%9d%e5%ad%98.html">用VBScript实现生成目录树以Excel格式保存</a></h3>
<div class="post-meta">
<small>2011-7-4</small>
</div>
<div class="post-description"><p>帮朋友实现这个功能本想采用Python熟门熟路的但是朋友机器可能没有安装。对于小白担心他会有更多的麻烦只好试试好久没用的VBScript了。保存为Excel格式其实偷了懒保存的是HTML格式不过可以很容易的转到Excel中。实现代码如下</p>
<pre><code class="language-vbscript">''''''''''''''''''''''''''''''''''''
' Copyright (C) 2011
' Author: Lunny Xiao
' Email: xiaolunwen@gmail.com
' Date: 2011-7-1
' Description: traversing directory and building directory tree as html file format. If you want excel format,
' you can open the html, select all content and paste to a new excel file. That's all.
''''''''''''''''''''''''''''''''''''
'Option Explicit
set fso = createobject(&quot;scripting.filesystemobject&quot;)
Sub TraverFolder(fd, folder, level)
Set f = fso.GetFolder(folder)
Set files = f.Files
Set sfs = f.SubFolders
dim i
dim j
i = 0
For Each a in sfs
fd.write(&quot;\n&quot;)
For j = 1 To level
fd.write(&quot;\n\n&quot;)
Next
fd.write(&quot;\n&quot; &amp; a.name &amp; &quot;\n\n&quot;)
TraverFolder fd, a.Path, (level+1)
Next
i = 0
For Each b In files
fd.write(&quot;\n&quot;)
For j = 1 To level
fd.write(&quot;\n\n&quot;)
Next
fd.write(&quot;\n&quot; &amp; b.name &amp; &quot;\n\n&quot;)
Next
If i = 0 Then
fd.write(vbcrlf)
End If
End Sub
msg=&quot;请输入根目录:&quot;
dir=Inputbox(msg, &quot;根目录&quot;)
set ts = fso.opentextfile(&quot;d:\\res.html&quot;, 2, true)
ts.write(&quot;\n&quot;)
TraverFolder ts, dir, 0
ts.write(&quot;\n&quot;)
ts.close()
</code></pre>
<ul>
<li>使用方法</li>
</ul>
<p>将上述代码保存为一个.vbs文件直接双击该文件会弹出框询问根目录可从资源管理器复制粘贴。点击确定会在D盘根目录生成一个res.html文件。打开该文件全选复制粘贴到一个新的Excel文件即可。</p>
</div>
<div class="more">
<a href="/2011/7/4/%e7%94%a8VBScript%e5%ae%9e%e7%8e%b0%e7%94%9f%e6%88%90%e7%9b%ae%e5%bd%95%e6%a0%91%e4%bb%a5Excel%e6%a0%bc%e5%bc%8f%e4%bf%9d%e5%ad%98.html" class="btn pure-button pure-button-primary">继续阅读..</a>
</div>
</div>
<div class="post">
<h3 class="post-header"><a href="/2011/5/25/Python%e5%ae%9e%e7%8e%b0%e5%9b%be%e4%b9%a610%e4%bd%8dISBN%e5%8f%b7%e8%bd%ac%e6%8d%a2%e4%b8%ba13%e4%bd%8d.html">Python实现图书10位ISBN号转换为13位</a></h3>
<div class="post-meta">
<small>2011-5-25</small>
</div>
<div class="post-description"><p>ISBN是图书的一个国际通用编号详细信息可参考维基百科中的词条<a href="http://zh.wikipedia.org/wiki/ISBN">http://zh.wikipedia.org/wiki/ISBN</a></p>
<p>ISBN在07年前使用的是10位编号07年后并入国际货品编号升级为13位以下为将10位编号转换为13位编号的Python代码</p>
<pre><code class="language-python">def isbn10to13(isbn):
if len(isbn) != 10:
return None
isbn = &quot;978&quot;+isbn[:-1]
sum = 0
for i, b in enumerate(isbn):
sum += (1 if i % 2 == 0 else 3) * int(b)
return &quot;%s%d&quot; % (isbn, (10 - sum % 10) % 10)
</code></pre>
<p>输入内容为10位的ISBN号去除连接符“-”的字符串输出内容为13位的ISBN号去除连接符“-”的字符串。主要的工作在于计算出最后一位的校验码。</p>
</div>
<div class="more">
<a href="/2011/5/25/Python%e5%ae%9e%e7%8e%b0%e5%9b%be%e4%b9%a610%e4%bd%8dISBN%e5%8f%b7%e8%bd%ac%e6%8d%a2%e4%b8%ba13%e4%bd%8d.html" class="btn pure-button pure-button-primary">继续阅读..</a>
</div>
</div>
</div>
<div class="pagination pure-g">
<ul>
<li class="prev pure-u-1-3"><a href="/posts/3.html">← 更新的</a></li>
<li class="next pure-u-1-3"><a href="/posts/5.html">以前的 →</a></li>
</ul>
</div>
<div class="footer">
<p>&copy; 风笑痴 2015
powered by <a href="http://github.com/go-xiaohei/pugo">PuGo</a> with <a href="http://purecss.io" target="_blank">Pure</a>
</p>
</div>
</div>
</div>
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/js/highlight.pack.js"></script>
<script>
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
</script>
</body>
</html>