2015年8月1日 星期六

MediaWiki 的維護工具

https://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot

基本 bot 概念的說明,最後列出了各種語言所寫的 bot ;更多的列表在 https://www.mediawiki.org/wiki/API:Client_code

https://www.mediawiki.org/wiki/Manual:Parameters_to_Special:Export

批次匯出/匯入的方式,適用於 1.16 版以後

https://www.mediawiki.org/wiki/Special:Version
https://en.wikipedia.org/wiki/Special:Version

目前的版本號;但是不同版本的 wiki 查詢網址也不同,滿冏的…

https://github.com/eldur/jwbf

jwbf 顧名思義就是用 java 寫成的。

https://github.com/MER-C/wiki-java

這也是用 java 寫的,但關注度似乎較低。

http://search.cpan.org/~lifeguard/MediaWiki-Bot-5.006002/lib/MediaWiki/Bot.pm

perl 寫的 bot

https://github.com/oliver-moran/mediawiki

node.js 寫的 bot

python 寫的 bot


https://www.mediawiki.org/wiki/Manual:Pywikibot
https://github.com/alexz-enwp/wikitools
https://github.com/mwclient/mwclient
https://github.com/earwig/mwparserfromhell

lamp on ubuntu安裝說明


https://help.ubuntu.com/community/ApacheMySQLPHP

這個頁面有些常用指令,如重開 apache :

sudo service apache2 restart

安裝 mediawiki 說明


https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu (Ubuntu限定)
https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki/zh-hant (資料較不詳細,參考用)


2015年7月29日 星期三

對某個目錄下所有檔案作某個動作的指令

參考 http://stackoverflow.com/questions/29232229/how-to-couple-xargs-with-pdftotext-converter-to-search-inside-multiple-pdf-files

主角是 find ,不使用 xargs 時,搭配 -exec 指令:

find ~/.personal/tips \
    -type f \
    -iname "*.pdf" \
    -exec pdftotext '{}' - ';' \
  | grep hot

使用 xargs 時,搭配 -print0 指令:

find ~/.personal/tips \
    -type f \
    -iname "*.pdf" \
    -print0 \
  | xargs -0 -J % -n 1 pdftotext % - \
  | grep hot

看來前者是比較簡潔一點

ubuntu上把pdf轉成純文字的解決方案

pdftotext


使用說明參考 http://linux.die.net/man/1/pdftotext

Options

-f number
Specifies the first page to convert.
-l number
Specifies the last page to convert.
-r number
Specifies the resolution, in DPI. The default is 72 DPI.
-x number
Specifies the x-coordinate of the crop area top left corner
-y number
Specifies the y-coordinate of the crop area top left corner
-W number
Specifies the width of crop area in pixels (default is 0)
-H number
Specifies the height of crop area in pixels (default is 0)
-layout
Maintain (as best as possible) the original physical layout of the text. The default is to 'undo' physical layout (columns, hyphenation, etc.) and output the text in reading order.

2015年7月24日 星期五

R存取期刊論文全文的介面:fulltext

https://github.com/ropensci/fulltext

真心希望早日打破各出版社聯合壟斷的局面

2015年7月20日 星期一

" 大數據(big data)"之"方法論(methodology)"

http://www.36dsj.com/archives/247 這篇講得不錯,四平八穩

http://www.36dsj.com/archives/8911 這篇從ML的角度來講,所以偏向AI

在規則的發現上,有兩種方式,一種從統計的角度出發(Association Rules),一種從NLP的角度下手(Grammar Induction)

關聯式規則(Association Rules, AR)

https://zh.wikipedia.org/wiki/%E5%85%B3%E8%81%94%E5%BC%8F%E8%A7%84%E5%88%99

http://blog.csdn.net/gjwang1983/article/details/45015203

http://blog.csdn.net/qq_25684755/article/details/46584805

https://github.com/dengyishuo/Top10Algorithm/blob/master/apriori/arules.md

應用在文字探勘,有以下應用

http://blog.csdn.net/u013946794/article/details/44246569

http://qxde01.blog.163.com/blog/static/6733574420132915952828/

http://qxde01.blog.163.com/blog/static/673357442013355192638/

2015年7月19日 星期日

程式語言間的語法比較: RosettaCode.org

以 perl 常用的 map / grep 為例

http://rosettacode.org/wiki/List_comprehensions#Perl

有中文的介紹可參考

这个网站的要旨到底是什么?比如说你会 A 语言,又想看看如果用 B 语言写的话会如何。那么通过很多问题的解决的对比,你应该可以了解到 B 语言的语法,以及它跟你会的 A 语言的关系了。然后你就会注意到语言的设计模式和行为——也就是这门语言的习惯。你也会看到哪些习惯你已经有了,哪些习惯正则阻碍你的发展。

2015年7月18日 星期六

ubuntu下對應到ultraedit的find in files的指令

http://edsionte.com/techblog/archives/3164

以前只會一招,就是用find搭配grep xargs,但是語法不好記,指令又長

這篇介紹的 grep -R -w -n "關鍵字" "目錄",非常好用

現在我幾乎找不到任何原因在 windows 下寫程式了…