Monday, December 20, 2010

Daily Bookmarks 20101220

a crawler using wget and xargs
http://www.xcombinator.com/2010/09/06/a-crawler-using-wget-and-xargs/
某分布式应用实践一致性哈希的一些问题 – Tim[后端技术]
http://timyang.net/architecture/consistent-hashing-practice/
kite1988的专栏 - CSDN博客 dblp
http://blog.csdn.net/kite1988/archive/2010/01.aspx

Text Processing in Python (a book)
http://gnosis.cx/TPiP/
命令行CURL教程 | Andy's Blog
http://www.21andy.com/blog/20080602/1154.html

Sunday, December 19, 2010

Daily Bookmarks 20101219

Artificial Intelligence - 人工智慧研究部落格
http://ai.mmdays.com/

中国人民大学数据库研究组面向领域的Deep Web数据集成项目
http://idke.ruc.edu.cn/domain_integration/help.htm
仲子说
http://www.wangzhongyuan.com/index.php
RUC DB-IIR 语义web与知识网格小组
http://iir.ruc.edu.cn/project/kg.jsp
林宣華的知識入口 - Knowledge Management
http://www.wke.csie.ncnu.edu.tw/scripts/shlin/index.asp?Sort=&View=&UID=&bClassIMG=&ViewName=&CID=56
piaip's Using (lib)SVM Tutorial
http://ntu.csie.org/~piaip/docs/svm/
The MetaQuerier Project at UIUC
http://metaquerier.cs.uiuc.edu/
QProber: Classifying and Searching "Hidden-Web" Text Databases
http://qprober.cs.columbia.edu/
Deep Web - Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/Deep_Web
Regular Expressions in grep
http://www.robelle.com/smugbook/regexpr.html
Web数据抽取 - Google 搜尋
http://www.google.com.tw/search?q=Web%E6%95%B0%E6%8D%AE%E6%8A%BD%E5%8F%96&hl=zh-TW&prmd=ivns&ei=X9wMTbv_BMPIce6nhLsG&start=20&sa=N
乐思网络信息采集系统 -- 用于信息资源整合与网页数据抓取,网站抓取,信息采集技术
http://www.knowlesys.cn/cn/products/web_data_miner.htm

Wednesday, December 15, 2010

Monday, December 13, 2010

Daily Bookmarks 20101213

Benson's Personal Blog: 八月 2009
http://bensontw.blogspot.com/2009_08_01_archive.html
专题:Linux下的文件共享服务全攻略_51CTO.COM
http://os.51cto.com/art/201010/231947.htm
Linux下的NFS快速配置教程与安全策略(1) - 51CTO.COM
http://os.51cto.com/art/201010/231717.htm
CentOS 5.5上安装openvpn全过程 - 51CTO.COM
http://os.51cto.com/art/201011/234004.htm

kite1988的专栏 - CSDN博客 DBLP 中文

http://blog.csdn.net/kite1988/archive/2010/01.aspx

Zeal's Blog · 计算机工程专业,如何找paper?
http://zeal.haliluya.org/blog/2006/05/26/how-to-find-computer-engineering-papers/
Benchmarking D2RQ v0.1
http://www4.wiwiss.fu-berlin.de/bizer/d2rq/benchmarks/index01.html
a crawler using wget and xargs
http://www.xcombinator.com/2010/09/06/a-crawler-using-wget-and-xargs/

Thursday, December 09, 2010

Daily Bookmarks 20101209

Consistent hashing - Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/Consistent_hashing
A Web Crawler in Perl | Linux Journal
http://www.linuxjournal.com/article/2200?page=0,0
Scraping Links With PHP
http://www.developertutorials.com/tutorials/php/scraping-links-with-php-8-01-05-958/
使用php simple html dom parser解析html标签 | Jphp-1号蟋蟀-关注PHP
http://www.init09.com/php/use-php-simple-html-dom-parser-html-tag.html
Parallel web scraping in PHP: cURL multi functions
http://www.developertutorials.com/tutorials/php/parallel-web-scraping-in-php-curl-multi-functions-375/
PHP Simple HTML DOM Parser
http://simplehtmldom.sourceforge.net/index.htm
[PHP] 使用 cURL + HTTP REFERER + Cookie + File:自製 my_wget 下載資料存到檔案 @ 第二十四個夏天後 :: 痞客邦 PIXNET ::
http://changyy.pixnet.net/blog/post/26475606
PHP 使用 CURL 同步抓取多個網頁 | Tsung's Blog
http://plog.longwin.com.tw/programming/2009/10/07/php-multi-thread-curl-2009
Key-Value 系統 分類整理 (NoSQL) | Fred Chu
http://fred.oracle1.com/weblog/2010/02/23/key-value-nosql-system-category-2009/
brad's life - Contributing to Open Source projects
http://brad.livejournal.com/2409049.html

檢索
我思故我在_博客_检索_百度空间 Good site
http://hi.baidu.com/rodimus/blog/category/%BC%EC%CB%F7

Tuesday, December 07, 2010

Daily Bookmarks 20101207

進階gdb
http://www.study-area.org/cyril/opentools/opentools/x1265.html
........: VIM
http://anrris-lab.blogspot.com/2009/08/vim.html

工程師的家 - 《五級》星星題--菱形
http://ehome.hifly.to/showthread.php?threadid=232
Virtual Memory
http://www.cs.duke.edu/~narten/110/nachos/main/node34.html#SECTION00074000000000000000
CSC546 - Operating Systems
http://condor.depaul.edu/~glancast/546class/docs/lec7.html

lighttpd 支援的項目 | Gea-Suan Lin's BLOG
http://blog.gslin.org/archives/2006/03/09/439/lighttpd-%E6%94%AF%E6%8F%B4%E7%9A%84%E9%A0%85%E7%9B%AE
flv streaming with lighttpd
http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd

High Scalability - High Scalability - YouTube Architecture
http://highscalability.com/youtube-architecture
YouTube: The Platform
http://techcrunch.com/2008/03/12/youtube-the-platform/
YouTube架构学习 - hideto - JavaEye技术网站
http://hideto.javaeye.com/blog/129726
Top 10 Largest Databases in the World -Good site
http://www.focus.com/fyi/operations/10-largest-databases-in-the-world/

Hash Maps with linear probing and separate chaining | Daniel Graziotin
http://task3.cc/308/hash-maps-with-linear-probing-and-separate-chaining/
SparkNotes: Hash Tables: Coding up a Hash Table
http://www.sparknotes.com/cs/searching/hashtables/section3.rhtml

ncache - Project Hosting on Google Code
http://code.google.com/p/ncache/
新浪使用的开源项目及开放平台 – 拾豆网
http://www.ctoof.com/archives/3002
Tags:memcacheq - 回忆未来[张宴] - 服务器系统架构与底层研发
http://blog.s135.com/tags/memcacheq/



强人推出恋爱约会指南!单身男女青年必备~ - 希奇古怪志 - 鲜为人志
http://www.i-oo.com/post/607.html
鲜为人摘_鲜为人摘 | 乐自有我
http://www.i-oo.net/a/xianzhai/

Chrome 的 WebSocket 測試 « Chui-Wen Chiu's Note
http://chuiwenchiu.wordpress.com/2009/12/14/chrome-%E7%9A%84-websocket-%E6%B8%AC%E8%A9%A6/

Monday, December 06, 2010

Daily Bookmarks 20101206

UCI Data Cleaning and Entity Resolution Project.
http://www.ics.uci.edu/~dvk/GDF/
WEST: Modern Technologies for Web People Search (IEEE ICDE 2009)
http://www.ics.uci.edu/~dvk/pub/ICDE09_dvk_WEST.html

Faceted Search
分面搜索(Faceted Search) – 腾讯CDC Good site
http://cdc.tencent.com/?p=1401
Search « Alibaba.com UED
http://www.aliued.com/tag/search/
LinkedIn Search: A Look Beneath the Hood
http://thenoisychannel.com/2010/01/31/linkedin-search-a-look-beneath-the-hood/
kafka0102的边城客栈 » 一周技术文档分享
http://www.kafka0102.com/2010/02/46.html
kafka0102的边城客栈 » 分享Poppen.de架构经验
http://www.kafka0102.com/2010/04/96.html
kafka0102的边城客栈 » 使用Zoie构建实时检索系统
http://www.kafka0102.com/2010/05/119.html
kafka0102的边城客栈 » twitter的新搜索架构
http://www.kafka0102.com/2010/10/347.html
People You May Know — Now With Faceted Search!
http://thenoisychannel.com/2010/05/15/people-you-may-know-now-with-faceted-search/

[Facebook] 計算粉絲團內特定文章的按"讚"數
http://patw.idv.tw/blog/archives/136
並行 HTTP請求在PHP中使用PECL的HTTP類 [答案:HttpRequestPool類]
http://zh-tw.w3support.net/index.php?db=so&id=168951
7-2 網頁抓取與分析:進階篇
http://mirlab.org/jang/books/perl/getWebPage02.asp?title=7-2%20%BA%F4%AD%B6%A7%EC%A8%FA%BBP%A4%C0%AAR%A1G%B6i%B6%A5%BDg
Roger Jang's Home Page 清華大學張智星
http://neural.cs.nthu.edu.tw/jang/

Wednesday, December 01, 2010

Daily Bookmarks 20101201

BBS to WordPress via XML-RPC 實作說明 | 野貓的零碎生活片段
http://blog.wildcat.tw/?p=206
Tweetrank
http://tweetrank.me/
HadoopDB Quick Start Guide
http://hadoopdb.sourceforge.net/guide/quick_start_guide.html#SECTION00030000000000000000
HadoopDB Join Testing on 3-Node Cluster @ 第二十四個夏天後 :: 痞客邦 PIXNET ::
http://changyy.pixnet.net/blog/post/25684989
HadoopDB
http://www.bullogger.com/blogs/dbanotes/archives/315847.aspx
[周报全文]HadoopDB混合数据库问世-周报全文-CNW.com.cn!
http://www.cnw.com.cn/weekly/htm2009/20090805_179407.shtml






boxing computer
框计算_互动百科
http://www.hudong.com/wiki/%E6%A1%86%E8%AE%A1%E7%AE%97
百度槓Google 強打框計算 - 線上國度 - 網路文化 - udn數位資訊
http://mag.udn.com/mag/digital/storypage.jsp?f_ART_ID=208892
百度“框計算”一周年 發布新標識_新華網
http://big5.xinhuanet.com/gate/big5/news.xinhuanet.com/eworld/2010-08/21/c_12469187.htm

框计算
框計算是什麼? What is box computing? « 搜尋引擎 « 台灣搜尋引擎優化與行銷研究院:SEO:SEM Good site


YTS
Yahoo! 把 Traffic Server 的 source code 放出來了 | Gea-Suan Lin's BLOG
http://blog.gslin.org/archives/2009/10/30/2133/yahoo-%E6%8A%8A-traffic-server-%E7%9A%84-source-code-%E6%94%BE%E5%87%BA%E4%BE%86%E4%BA%86
Yahoo釋出雲端運算加速器 "Traffic Server" ,個人想法分享 @ Min's Web Life: 談網路產業研究與生活閒聊 :: 痞客邦 PIXNET ::
http://miin1130.pixnet.net/blog/post/24670966
雅虎开源Traffic Server | BING必应CHENG
http://www.52bingcheng.com/2009/11/01/traffic_server/

Tuesday, November 30, 2010

Daily Bookmarks 20101130

MongoDB与Tokyo Tyrant性能比较(1):基础CRU操作 - 老赵点滴 - 追求编程之美 Good
http://blog.zhaojie.me/2010/02/mongodb-tokyo-tyrant-benchmark-1-basic-cru-operations.html
理想的Tokyo Tyrant | 青春舞曲
http://shawnma.xomud.com/2010/06/ideal-tokyo-tyrant/
東京暴君臥軌記 Tokyo Tyrant on Rails « hiroshi yui
http://ghostsinthelab.org/?p=1934
Using Tokyo Tyrant in Production — The AboutUs Weblog
http://blog.aboutus.org/2009/08/11/using-tokyo-tyrant-in-production/
NFS,Memcached,Tokyo tyrant实现session共享性能测试_跳动的鬼魂_百度空间
http://hi.baidu.com/yts_dayou/blog/item/dbbfab349122051d91ef398e.html
tokyocabinet « SpawN
http://www.lixiaodou.cn/tag/tokyocabinet/
吴道林的博客 » Tokyo Cabinet数据库的四种数据结构说明 good site about use
http://wudaolin.com/?p=69
ACID - Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/ACID
Tokyo Cabinet 的四种数据结构 - Willko's Blog - JavaEye技术网站 簡易用法
http://willko.javaeye.com/blog/506728
Rails Talk Tokyo Cabinet Database with Ruby on Rails (Ruby case good)
http://railstalk.com/2009/8/9/tokyo-cabinet-database-with-ruby-on-rails

Tokyo Tyrant备份和还原--展示过去,展望未来[周灵杰] Goood site
http://zhliji2.blogspot.com/2009/04/tokyo-trant.html

Sameer Parwani » Tokyo Cabinet and Tokyo Tyrant
http://sameerparwani.com/posts/tokyo-cabinet-and-tokyo-tyrant


ssh应用实例: NAT穿透 « Li's Blog
http://blog.lilinux.net/2010/02/ssh-instance/
轻量级开源简单队列服务 HTTPSQS 1.3 版本发布-仲伟涛-ZOL博客
http://blog.zol.com.cn/1905/article_1904914.html

other Good site
PK with php! - 记录与PHP的PK经历
http://www.pkphp.com/
阿福的技术BLOG_博客_Linux_百度空间
http://hi.baidu.com/ah__fu/blog/category/Linux/index/1
五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT)
http://www.awflasher.com/blog/archives/939
ini_set()的注意事项


Monday, November 29, 2010

Daily Bookmarks 20101129

Tokyocabinet/Tokyotyrant文档大合集
http://www.162cm.com/p/tokyotyrant.html#toc4
转贴:zz 分布式key-value存储方案介绍:Cassandra,LightCloud,TokyoCabinet 百度空间_应用平台
http://apps.hi.baidu.com/share/detail/7086038
redis - Project Hosting on Google Code
http://code.google.com/p/redis/

How FriendFeed uses MySQL to store schema-less data - Bret Taylor's blog
http://bret.appspot.com/entry/how-friendfeed-uses-mysql

FriendFeed 使用 MySQL 的经验 - DBA Notes
http://www.dbanotes.net/arch/friendfeed_mysql.html

Friendfeed的MySQL key/value存储 – Tim[后端技术]
http://timyang.net/data/friendfeed-mysql-schema-less/





海量小文件存储 » 超群.com的博客 Goood
http://www.fuchaoqun.com/2009/04/deal-with-tons-of-small-files/

keven的路 » Tokyo Cabinet 合輯
http://blog.wantongchina.com/?tag=tokyo-cabinet

Tokyo Cabinet: Beyond Key-Value Store - igvita.com
Tokyo Cabinet - Smile的日志 - 网易博客 Gooood
Tokyo Cabinet & Tokyo Tyrant | Ferrari != Ferrari Good plurk






11.1. pickle — Python object serialization — Python v2.7.1 documentation
http://docs.python.org/library/pickle.html
descriptor:Python Idiom: dictionary - 樂多日誌


http://blog.roodo.com/descriptor/archives/7727261.html

paoding-rose - Project Hosting on Google Code
http://code.google.com/p/paoding-rose/

青岛生物能源与过程研究所超级运算中心
http://scc.qibebt.cas.cn/introduction.php

Tokyo Tyrant - Tokyo Cabinet网络接口 - 开源中国社区
http://www.oschina.net/p/tokyo+tyrant

量子统计—免费网站流量统计,您的数据分析专家
http://www.linezing.com/

天天成长的博客
http://ddgrow.com/

第二次Hadoop开发者沙龙 雅虎北京研发中心 童琨 - 视频 - 优酷视频 - 在线观看
http://v.youku.com/v_show/id_XOTI1MzE5MTY=.html

为什么企业对NoSQL不感兴趣?101001-黄富强的博客-科学网
http://www.sciencenet.cn/m/user_content.aspx?id=368853

为什么Quora不使用NoSQL来做数据存储 « a db thinker's home
http://www.dbthink.com/?p=553

你需要知道的关于NoSQL数据库的10件事 « a db thinker's home
http://www.dbthink.com/?p=630

C

专注高品质网络解决方案服务提供商-一天创想(北京)科技有限公司
http://www.itbeing.com/

CDB

CDB(Constant DataBase)_旅 行_百度空间
http://hi.baidu.com/enter775/blog/item/06aff7d442c10008a08bb7a0.html
hash_ring

简评 Taobao Tair: 四不像 - fcicq’s blog-beta
http://www.fcicq.net/wp/?p=914

Sunday, November 28, 2010

Wednesday, November 24, 2010

Daily Bookmarks 20101124

Apache Axis - 维基百科,自由的百科全书
http://zh.wikipedia.org/zh/Apache_Axis


MC104 :: 觀看文章 - [轉貼] 貝式過濾法 (Bayesian filtering)
http://www.backup.idv.tw/viewtopic.php?t=1832


mongoDB « ChibaKuma's iNote Goood
http://chibakuma.net/blog/?cat=8


PHP 程式 學習 筆記本: apache 壓力測試結果.
http://calos-tw.blogspot.com/2010/03/apache.html


PHP 程式 學習 筆記本: [引用]Distributed Filesystem / Database , Database Optimization, NoSQL
http://calos-tw.blogspot.com/2010/03/distributed-filesystem-database.html


Mongodb | 遨遊飛翔 install
http://blog.shian.tw/mongodb.html





Large Scale Data Processing with MongoDB Map/Reduce (Part 1:Background)
http://steveeichert.com/2010/03/18/large-scale-data-processing-with-mongodb.html


NoSQL数据库探讨之一 - 为什么要用非关系数据库? - robbin的自言自语 - JavaEye技术网站
http://robbin.javaeye.com/blog/524977


使用 PHP 将 SQL 转换为 XML
http://www.ibm.com/developerworks/cn/xml/x-query2xml/


Python/XML HOWTO
http://pyxml.sourceforge.net/topics/howto/xml-howto.html


Python & XML: Chapter 1: Python and XML
http://oreilly.com/catalog/pythonxml/chapter/ch01.html


PythonXml - PythonInfo Wiki
http://wiki.python.org/moin/PythonXml


PyXMLFAQ -- Python XML Frequently Asked Questions
http://www.rexx.com/~dkuhlman/pyxmlfaq.html


Perl & XML: Chapter 3: XML Basics: Reading and Writing
http://oreilly.com/catalog/perlxml/chapter/ch03.html


Parsing XML documents with Perl's XML::Simple
http://articles.techrepublic.com.com/5100-10878_11-5363190.html


NoSQL 文档数据库 MongoDB - Bory.Chan
http://blog.chenlb.com/2010/03/nosql-mongodb.html


Joe Horn 的啟示錄 » [PHP] 試玩 MongoDB 的資料關聯
http://www.joehorn.idv.tw/archives/2010/08/08/840/
MongoDB — Documentation
http://docs.symfony-reloaded.org/guides/doctrine/MongoDB.html

安装 Tokyo Cabinet 和 Tokyo Tyrant - Bory.Chan
http://blog.chenlb.com/2009/03/install-tokyo-cabinet-and-tokyo-tyrant-start-ttserver.html

Tokyo Cabinet -- 小型 DBM + Tokyocabinet For PHP Extension -- 轉po -=- E.D.P 涼 ...Eat Diving Play -- EDP MyBlog
http://blog.twix.idv.tw/myblog/view/75

Fillano's Learning Notes | 練習開發 php extension - Tokyo Cabinet
http://fillano.blog.ithome.com.tw/post/257/64937

技术起点 » Tokyo Cabinet高效的键值数据库
http://www.xinqdian.com/index.php/archives/22/

采用tokyo cabinet搭建表格型DBM--展示过去,展望未来[周灵杰]
http://zhliji2.blogspot.com/2009/05/tokyo-cabinetdbm.html

Berkeley DB_百度百科
http://baike.baidu.com/view/1281930.html?wtp=tt


嵌入式数据库系统Berkeley DB -gooooooooooooooood IBM
http://www.ibm.com/developerworks/cn/linux/l-embdb/index.html

利用Tokyo Tyrant构建兼容Memcached协议、支持故障转移、高并发的分布式key-value持久存储系统[原创] - 回忆未来[张宴] - 服务器系统架构与底层研发
http://blog.s135.com/post/362/


XML.com: Converting Between XML and JSON
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html

Tuesday, November 23, 2010

Saturday, November 20, 2010

Thursday, November 18, 2010

Daily Bookmarks 20101118

NoSQL数据库性能比较:MongoDB、Redis、Tokyo Tyrant - MySQL性能与调优 - TT数据库
http://www.searchdatabase.com.cn/showcontent_39157.htm


NoSQL的必要性和效率、成本分析 - MySQL开发 - TT数据库
http://www.searchdatabase.com.cn/showcontent_38986.htm


解析MongoDB的内部构造 - MySQL开发 - TT数据库
http://www.searchdatabase.com.cn/showcontent_41876.htm



社交网络数据库技术分析 - MySQL开发 - TT数据库
http://www.searchdatabase.com.cn/showcontent_38401.htm


Tokyo Tyrant(ttserver)在大数据量下的不稳定案例 - MySQL性能与调优 - TT数据库
http://www.searchdatabase.com.cn/showcontent_36766.htm


Production Deployments - MongoDB
http://www.mongodb.org/display/DOCS/Production+Deployments


Mongodb | 遨遊飛翔
http://blog.shian.tw/mongodb.html


Index of /CloudAgent/examples/c-binding
http://yangacer.twbbs.org/CloudAgent/examples/c-binding/


{|ihower.tw| blog } | 什麼是REST跟RESTful?
http://ihower.tw/blog/archives/1542


Blog/Essay: 非常棒的垃圾信過濾軟體 NOPAM
http://saintus.com/blog_read.php?topic=ch&f=20051015-223243


tokyo - 搜索 - TT数据库 - TechTarget中国
http://www.searchdatabase.com.cn/search.aspx?cx=006311256994434649565:dv5h1scnzoy&cof=FORID:9&q=tokyo

Sunday, October 24, 2010

Daily Bookmarks 20101024

WWW::Mechanize && Google Group
http://fayland.org/journal/GoogleGroup.html

mechanize 教程
http://blog.hieee.com/2010/08/23/

python mechanize
 http://blog.cycu.org/?e=125

http://www.higherpass.com/Perl/Tutorials/Using-Www-mechanize/3/

http://funningboy.blogspot.com/2010_02_01_archive.html

Saturday, October 23, 2010

blog

fyblog
http://www.flyy.info/index.php

Saturday, October 16, 2010

Friday, October 15, 2010

Search by Hashing

Search by Hashing
intro.

參考來源:

"Some of the most common search algorithms are serial search, binary search and search by hashing. The tool for comparing the performance between the different algorithms is called run-time analysis. Here, we present search by hashing, and discuss the performance of this method. But first, we present a simple search method, the serial search and its run-time analysis."
- Search by Hashing (在「Google 網頁註解」中檢視)

Search by Hashing

Search by Hashing
intro.

參考來源:

"Search by Hashing"
- Search by Hashing (在「Google 網頁註解」中檢視)

Sunday, October 03, 2010

Run a command at boot with Gentoo

Normally in Gentoo you would want to create an init script via rc-update to start a service at boot. However if there are a few miscellaneous commands you would like to run you can add them to local.start.

The local.start init script is similar to rc.local in other distributions. It is the last init script to be run after all other services have been started at the end of the boot process.

Add your commands to local.start file located here.
/etc/conf.d/local.start

You can also make commands run when the system is shutdown. These commands should be placed in local.stop located here.
/etc/conf.d/local.stop

1 Comment
gentooShareThis

參考來源:

"Add your commands to local.start file located here. /etc/conf.d/local.start You can also make commands run when the system is shutdown. These commands should be placed in local.stop located here. /etc/conf.d/local.stop"
- Run a command at boot with Gentoo | WiredRevolution.com (在「Google 網頁註解」中檢視)

Gentoo init.d rc-update 寫法

Gentoo init.d rc-update 寫法
滿獨特方面的如果要再開機就載入某些程式的話可以用的方式

參考來源:

"注意到了嗎?因為我們沒有定義depend() 所以會有dependency warning,但是我們定義的start()就會有正確執行出來。 這種作法我個人認為是相當高度模組化的作法,不同於debian, redhat, mandrake,suse等其他Linux distribution甚至FreeBSD, 一般執行 rc script都是自己寫shell script,使用大量的case conditional來判斷自訂的start|stop|restart 行為,甚至FreeBSD還會判斷start|stop|restart的大小寫,增加rc script的複雜性以及撰寫與維護難度,gentoo這作法只要 follow他的runscript style來寫,"
- Gentoo Taiwan 討論區 • 檢視主題 - 想請問有關no-ip的開機自動執行辦法 (在「Google 網頁註解」中檢視)

Saturday, October 02, 2010

Daily Bookmarks 20101002

rsync - intro
http://www.ntu.beautifulworldco.com/weblog/?p=385

http://news.ols3.net/techdoc/old/rsync.htm

让Google Calendar显示在LINUX桌面
http://blog.netoearth.com/html/201008/%E8%AE%A9google-calendar%E6%98%BE%E7%A4%BA%E5%9C%A8linux%E6%A1%8C%E9%9D%A2.htm

Linux VNC 虛擬桌面
http://cha.homeip.net/blog/2010/09/2643.html

Quick reStructuredText

Quick reStructuredText

http://docutils.sourceforge.net/docs/user/rst/quickref.html
Being a cheat-sheet for reStructuredText
Updated $Date: 2009-07-14 10:05:34 -0400 (Tue, 14 Jul 2009) $

Copyright: This document has been placed in the public domain.

The full details of the markup may be found on the reStructuredText page. This document is just intended as a reminder.

參考來源:

"Quick reStructuredText http://docutils.sourceforge.net/docs/user/rst/quickref.html Being a cheat-sheet for reStructuredText Updated $Date: 2009-07-14 10:05:34 -0400 (Tue, 14 Jul 2009) $ Copyright: This document has been placed in the public domain. The full details of the markup may be found on the reStructuredText page. This document is just intended as a reminder."
- Quick reStructuredText (在「Google 網頁註解」中檢視)

Friday, October 01, 2010

Port Forwarding(SSH tunneling)

Port Forwarding(SSH tunneling)
張貼者: barkley 於 1/25/2010 01:09:00 上午 | 2010/01/25
透過 ssh and sshd 能夠轉移 TCP 通訊的傳輸
但是需要先瞭解難以理解且愚蠢的語法
-L clientport:host:hostport

參考來源: 熱血OB: Port Forwarding(SSH tunneling) (在「Google 網頁註解」中檢視)

Remote port forwarding - exposing an internal webserver

Example 4: Remote port forwarding - exposing an internal webserver

Remote port forwarding is sometimes useful for granting temporary access to services on clients which are otherwise unreachable (perhaps the client has an unreachable rfc1918 address behind a NAT or firewall). If the client is not configured to accept inbound SSH connections, this can be done with remote port forwarding on an outbound connection. (For OpenSSH, note that you may need to set "GatewayPorts yes" in "sshd_config" to achieve on the server what "ssh -g" would do on the client (allow any host to connect to the forwarded port).

Consider a PC which is running a webserver but is protected by firewall rules to accept no inbound connections (except from itself). Furthermore imagine this host has the unrouted private address 192.168.1.1 and can access the internet only outbound through a NAT. If you believe it is not too risky, you can briefly make that server publicly available with ssh port forwarding (such as while you're on the phone with someone) if you think the risk of serving sensitive data to a random hacker while it is publicly exposed is acceptably low and you can ssh from the PC to a host with a public address. To do so, you can establish an ssh connection such as this:

ssh -R4567:localhost:80 some-server
which will make it look like your PC's webserver is a server on "some-server" at port: 4567. Anyone who connects to:
http://some-server:4567/some/path
will get the same webpage you get on your PC when you connect to:
http://localhost:80/some/path

參考來源:

"ssh -R4567:localhost:80 some-server which will make it look like your PC's webserver is a server on "some-server" at port: 4567. Anyone who connects to: http://some-server:4567/some/path"
- NDC Logical Firewall - SSH Port Forwarding (在「Google 網頁註解」中檢視)

Promise Supertrak SX6000 Raid Card

Promise Supertrak SX6000 Raid Card
Q1.System 不要 Build 在 Array 內?

近來用一台 N 年前的高檔機器 HP LC2000 NetServer,其 CPU 為 P3-533 想說這機器放著也是放著,剛好拿來當 Backup Server 剛好,反正只裝 NFS Server 相信 P3-533 應該夠用了,安裝的 Raid Card 為 Promise SX6000,找到在 Google 上找到了一下些相關問題,順便就貼一下,主要是說 SX6000 所 Build 的 Array 最好是不要讓 System 也在內不然在系統 boot 時會出現不明的錯誤

參考來源:

"Q1.System 不要 Build 在 Array 內? 近來用一台 N 年前的高檔機器 HP LC2000 NetServer,其 CPU 為 P3-533 想說這機器放著也是放著,剛好拿來當 Backup Server 剛好,反正只裝 NFS Server 相信 P3-533 應該夠用了,安裝的 Raid Card 為 Promise SX6000,找到在 Google 上找到了一下些相關問題,順便就貼一下,主要是說 SX6000 所 Build 的 Array 最好是不要讓 System 也在內不然在系統 boot 時會出現不明的錯誤。"
- 不自量力 の Weithenn: Promise Supertrak SX6000 Raid Card (在「Google 網頁註解」中檢視)

CentOS 5.2+Raid 0+LVM+ISCSI配置详解

系统环境:CentOS 5.2

硬件配置:ASUS P5GC-MX +Intel E2160+Kinston 1GB 667*2+D-Link 530 1Gbps

硬盘1:Seagate 80GB/7200S/8MB/SATA

硬盘2:Seagate 1TB/7200S/32MB/SATA

硬盘3:Seagate 1TB/7200S/32MB/SATA

參考來源: CentOS 5.2+Raid 0+LVM+ISCSI配置详解 - LingPing的日志 - 网易博客 (在「Google 網頁註解」中檢視)

Thursday, September 30, 2010

vim 支援 utf-8 中文

經理解消化之後,在自己的 .vimrc 加入了以下的設定,令 vim/gvim 遇到中文檔時,懂得選擇正確的編碼。而在建立新檔時,也自動以 utf-8 編碼:

“Default encoding
set fileencodings=utf-8,big5,gbk,latin1
set fileencoding=utf-8

實驗証明,這已能滿足大部份所需,讀寫都不成問題。最後,有時要強迫改變檔案的編碼,所以再加入以下設定:

“Hot key to switch between Big5 and UTF-8
set =^U
set =^B
map :set fileencoding=utf-8
map :set fileencoding=big5

參考來源:

"經理解消化之後,在自己的 .vimrc 加入了以下的設定,令 vim/gvim 遇到中文檔時,懂得選擇正確的編碼。而在建立新檔時,也自動以 utf-8 編碼: “Default encoding set fileencodings=utf-8,big5,gbk,latin1 set fileencoding=utf-8 實驗証明,這已能滿足大部份所需,讀寫都不成問題。最後,有時要強迫改變檔案的編碼,所以再加入以下設定: “Hot key to switch between Big5 and UTF-8 set <C-u>=^U set <C-b>=^B map <C-u> :set fileencoding=utf-8<CR> map <C-b> :set fileencoding=big5<CR>"
- vim 支援 utf-8 中文 « 有涯小札 (在「Google 網頁註解」中檢視)

FreeBSD 的系統改為 UTF8

要將 FreeBSD 的系統改為 UTF8 只需修改下面這個檔案
#vi /etc/csh.cshrc

setenv LC_ALL zh_TW.UTF-8
setenv LANG zh_TW.UTF-8
setenv CLICOLOR
set color
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx

改完後先登出後再登入輸入 locale 就可看到如下的系統預設語系已經不是 C
#locale
LANG=zh_TW.UTF-8
LC_CTYPE=”zh_TW.UTF-8″
LC_COLLATE=”zh_TW.UTF-8″
LC_TIME=”zh_TW.UTF-8″
LC_NUMERIC=”zh_TW.UTF-8″
LC_MONETARY=”zh_TW.UTF-8″
LC_MESSAGES=”zh_TW.UTF-8″
LC_ALL=zh_TW.UTF-8

參考來源:

"要將 FreeBSD 的系統改為 UTF8 只需修改下面這個檔案 #vi /etc/csh.cshrc setenv LC_ALL zh_TW.UTF-8 setenv LANG zh_TW.UTF-8 setenv CLICOLOR set color setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx 改完後先登出後再登入輸入 locale 就可看到如下的系統預設語系已經不是 C #locale LANG=zh_TW.UTF-8 LC_CTYPE=”zh_TW.UTF-8″ LC_COLLATE=”zh_TW.UTF-8″ LC_TIME=”zh_TW.UTF-8″ LC_NUMERIC=”zh_TW.UTF-8″ LC_MONETARY=”zh_TW.UTF-8″ LC_MESSAGES=”zh_TW.UTF-8″ LC_ALL=zh_TW.UTF-8"
- Bryan手札-生活記趣 » FreeBSD 系統 utf8 化 (在「Google 網頁註解」中檢視)

Wednesday, September 29, 2010

Git原始碼管理

文章範圍
安裝 和 設定 Git
Git 基本操作
長樹枝了(分叉成不同的版本)
Ruby on Rails 上使用
Git 維護
本文章的來源大部分是由 Git 官方網站裡的基本 和更先進一點的教學翻譯的, 然後加入了自己寫的範例。 Railscasts裡的資料也有參考到。 此文章的內容會談到 Git 基本管理, 維護, 還有資料分枝。 此文章不會談到架設自己的 Git 伺服器 或 push 跟 pull 等跟別人合作的方法。

參考來源:

"文章範圍 安裝 和 設定 Git Git 基本操作 長樹枝了(分叉成不同的版本) Ruby on Rails 上使用 Git 維護 本文章的來源大部分是由 Git 官方網站裡的基本 和更先進一點的教學翻譯的, 然後加入了自己寫的範例。 Railscasts裡的資料也有參考到。 此文章的內容會談到 Git 基本管理, 維護, 還有資料分枝。 此文章不會談到架設自己的 Git 伺服器 或 push 跟 pull 等跟別人合作的方法。"
- 國網中心 Web 2.0 技術推廣 » Blog Archive » Git 原始碼管理 (在「Google 網頁註解」中檢視)

php中用strlen、mb_strlen函数计算中英文混排字符串长度

比较strlen和mb_strlen
当字符全是英文字符的时候,两者是一样。这里主要比较一下,中英文混排的时候,两个计算结果。(测试时编码方式是UTF8)
";
echo mb_strlen($str,"UTF8");
//输出结果
//14
//6
?>

參考來源:

"比较strlen和mb_strlen 当字符全是英文字符的时候,两者是一样。这里主要比较一下,中英文混排的时候,两个计算结果。(测试时编码方式是UTF8) <?php $str="中文a字1符"; echo strlen($str); echo "<br />"; echo mb_strlen($str,"UTF8"); //输出结果 //14 //6 ?>"
- php中用strlen、mb_strlen函数计算中英文混排字符串长度-php自学网 (在「Google 網頁註解」中檢視)

PHP字符串处理的十个技巧

2.截取文本,创建一个摘要

新闻性质的网站通常会截取一个大约200字左右的段落,并在次段落的末尾加上省略号来形成一个摘要,这时,你可以使用substr_replace()函数来实现此功能。由于篇幅的原因,这里只演示对40个字符的限制:

1
$article = "BREAKING NEWS: In ultimate irony, man bites dog.";
2

3
$summary = substr_replace($article, "...", 40);
4

5
//$summary = "BREAKING NEWS: In ultimate irony, man bi..."

參考來源:

"2.截取文本,创建一个摘要 新闻性质的网站通常会截取一个大约200字左右的段落,并在次段落的末尾加上省略号来形成一个摘要,这时,你可以使用substr_replace()函数来实现此功能。由于篇幅的原因,这里只演示对40个字符的限制: 1 $article = "BREAKING NEWS: In ultimate irony, man bites dog."; 2   3 $summary = substr_replace($article, "...", 40); 4   5 //$summary = "BREAKING NEWS: In ultimate irony, man bi...""
- PHP字符串处理的十个技巧 – Onexin ! Team (在「Google 網頁註解」中檢視)

PHP strip_tags() Function

Definition and Usage

The strip_tags() function strips a string from HTML, XML, and PHP tags.

Syntax

strip_tags(string,allow)

參考來源:

"Definition and Usage The strip_tags() function strips a string from HTML, XML, and PHP tags. Syntax strip_tags(string,allow)"
- PHP strip_tags() Function (在「Google 網頁註解」中檢視)

set coursorline-vim

vim
还可以修饰一下条横线:

:highlight CursorLine guibg=lightblue ctermbg=lightgray

參考來源:

"还可以修饰一下条横线: :highlight CursorLine guibg=lightblue ctermbg=lightgray]"
- Linux系统管理 - SALogs - 专注于Linux相关技术、Web架构 (在「Google 網頁註解」中檢視)

set cursorcolumn 無效note

2010年6月3日 ... 2、只有在gnome或gvim环境下set cursorcolumn命令才会生效,终端模式无效。 分享一份Vim7.2用户手册中文版点击下载. 原创文章,转载请注明: 转 ..

參考來源:

"2010年6月3日 ... 2、只有在gnome或gvim环境下set cursorcolumn命令才会生效,终端模式无效。 分享一份Vim7.2用户手册中文版点击下载. 原创文章,转载请注明: 转 .."
- set cursorcolumn gnome - Google 搜尋 (在「Google 網頁註解」中檢視)

php big utf8轉換

在某些機器上採big5 ,
從php送進去的utf8需要轉換成big5

big5 轉 utf-8
PHP 程式碼:
$str=iconv("big5","UTF-8",$str);

utf-8 轉 big5
PHP 程式碼:
$str=iconv("UTF-8","big5",$str);

參考來源:

"big5 轉 utf-8 PHP 程式碼: $str=iconv("big5","UTF-8",$str); utf-8 轉 big5 PHP 程式碼: $str=iconv("UTF-8","big5",$str);"
- php big5跟utf-8互轉的指令 (在「Google 網頁註解」中檢視)

Tuesday, September 28, 2010

qsort詳解--ref

是对一个二维数组的进行排序:

int a[1000][2]; 其中按照a[i][0]的大小进行一个整体的排序,其中a[i][1]必须和a[i][0]一起移动交换。

qsort(a,1000,sizeof(int)*2,comp);

int comp(const void *a,const void *b)
{
return ((int *)a)[0]-((int *)b)[0];
}

參考來源: 王博 (在「Google 網頁註解」中檢視)

Monday, September 27, 2010

CGI Programming 101: Chapter 12: Searching and Sorting

CGI Programming 101: Chapter 12: Searching and Sorting

Name Description
search-cgi.html Search CGI - Straight Looping (source code)
search.html Search CGI - Straight Looping (example)
search2-cgi.html Search CGI - Using grep (source code)
search2.html Search CGI - Using grep (example)
search3-cgi.html Search CGI - Using grep (with an array and a hash) (source code)
search4-cgi.html Search CGI - Straight Looping/Multiple Keywords (source code)
search4.html Search CGI - Straight Looping/Multiple Keywords (example)
sortedcat-cgi.html Kite Catalog Sorted By Price (source code)
sortedcat.cgi Kite Catalog Sorted By Price (example)

參考來源:

"CGI Programming 101: Chapter 12: Searching and Sorting Name Description search-cgi.html Search CGI - Straight Looping (source code) search.html Search CGI - Straight Looping (example)"
- CGI Programming 101: Chapter 12: Searching and Sorting (在「Google 網頁註解」中檢視)

Sunday, September 26, 2010

讓Firefox使用RAMDisk

讓Firefox使用RAMDisk

紀錄一下設定流程

Ubuntu使用RAMDisk很容易,不用另外裝套件,這是Kernel內建的功能,所以跟Linux發行版也沒太大關係。(好像從Kernel 2.6開始提供)

Google了一些資料,幾乎大家的作法都是另外在/tmp底下建立一個新目錄,然後到/etc/fstab設定tmpfs,最後再掛載。其實不用這麼麻煩,系統早就有準備 RAMDisk讓你用了,位置在/dev/shm,預設可用空間是實體記憶體的一半。(/etc/fstab檔案中看不到/dev/shm,所以很多人以為要自己建立)

Firefox到about:config,新增一個 browser.cache.disk.parent_directory字串,值設成/dev/shm,然後別忘記把browser.cache.disk.enable設成true,這樣就完工了。重新啟動Firefox就可以使用RAMDisk,很簡單

參考來源:

"讓Firefox使用RAMDisk 紀錄一下設定流程 Ubuntu使用RAMDisk很容易,不用另外裝套件,這是Kernel內建的功能,所以跟Linux發行版也沒太大關係。(好像從Kernel 2.6開始提供) Google了一些資料,幾乎大家的作法都是另外在/tmp底下建立一個新目錄,然後到/etc/fstab設定tmpfs,最後再掛載。其實不用這麼麻煩,系統早就有準備 RAMDisk讓你用了,位置在/dev/shm,預設可用空間是實體記憶體的一半。(/etc/fstab檔案中看不到/dev/shm,所以很多人以為要自己建立) Firefox到about:config,新增一個 browser.cache.disk.parent_directory字串,值設成/dev/shm,然後別忘記把browser.cache.disk.enable設成true,這樣就完工了。重新啟動Firefox就可以使用RAMDisk,很簡單"
- 在gentoo中为firefox设置ramdisk_雕刻刀_百度空间 (在「Google 網頁註解」中檢視)

Gentoo Linux on T43 (14) 内存虚拟盘加速系统

Gentoo Linux on T43 (14) 内存虚拟盘加速系统
目录

内核选项
创建内存盘
启动时自动创建
利用内存盘
更新 2008-03-24
延展阅读
对于一个喜欢折腾系统的人来说,为笔记本电脑建立内存虚拟盘,来弥补笔记本小硬盘天然的性能瓶颈问题,总是免不了的。

參考來源:

"Gentoo Linux on T43 (14) 内存虚拟盘加速系统 目录 内核选项  创建内存盘 启动时自动创建 利用内存盘  更新 2008-03-24 延展阅读 对于一个喜欢折腾系统的人来说,为笔记本电脑建立内存虚拟盘,来弥补笔记本小硬盘天然的性能瓶颈问题,总是免不了的。"
- Gentoo Linux on T43 (14) 内存虚拟盘加速系统 | DB2 学习笔记 (在「Google 網頁註解」中檢視)

論中原武術文化-禪宗自然門

煉精化氣又叫“易骨”,是形意拳的第一層功夫,目的在於練出明勁,即示形於外的剛猛之勁,同時還要打通任督二脈,完成小周天功。煉氣化神又叫“易筋”,是形意拳的第二層功夫,目的在於練出暗勁,即剛中含柔的勁,同時還要打通奇經八脈,完成大周天功,使氣血貫通周身。煉神還虛是形意拳的最高境界,又叫“易髓”,目的在於練出化勁,也就是將暗勁練到至柔至順,剛柔相濟,即所謂“陰陽混成,剛柔悉化”。拳經說:“拳無拳,意無意,無意之中是真意。”“有心有意都是假,拳到無心方見奇。”就是指化勁而言。這才是武學的極致。

參考來源:

"煉精化氣又叫“易骨”,是形意拳的第一層功夫,目的在於練出明勁,即示形於外的剛猛之勁,同時還要打通任督二脈,完成小周天功。煉氣化神又叫“易筋”,是形意拳的第二層功夫,目的在於練出暗勁,即剛中含柔的勁,同時還要打通奇經八脈,完成大周天功,使氣血貫通周身。煉神還虛是形意拳的最高境界,又叫“易髓”,目的在於練出化勁,也就是將暗勁練到至柔至順,剛柔相濟,即所謂“陰陽混成,剛柔悉化”。拳經說:“拳無拳,意無意,無意之中是真意。”“有心有意都是假,拳到無心方見奇。”就是指化勁而言。這才是武學的極致。"
- 論中原武術文化 (禪 宗 自 然 門) (在「Google 網頁註解」中檢視)

com.lang.c FAQ list Q 1.32 char a[] char *p

Q: What is the difference between these initializations?

char a[] = "string literal";
char *p = "string literal";
My program crashes if I try to assign a new value to p[i].

參考來源:

"Q: What is the difference between these initializations? char a[] = "string literal"; char *p = "string literal"; My program crashes if I try to assign a new value to p[i]."
- Question 1.32 (在「Google 網頁註解」中檢視)

可是我聽說 char a[ ] 和 char *a 是一樣的。

7.2 可是我聽說 char a[ ] 和 char *a 是一樣的。

並非如此。(你所聽說的應該跟函數的形式參數有關;參見問題 6.4) 數組不是指針。 數組定義 char a[6] 請求預留 6 個 字符的位置, 並用名稱 ``a" 表示。也就是說, 有一個稱為 ``a" 的位置, 可以放入 6 個字符。 而指針申明 char *p, 請求一個位置放置一個指 針, 用名稱 ``p" 表示。 這個指針幾乎可以指向任何位置: 任何字符和 任何連續的字符, 或者哪裡也不指(參見問題 5.1 和 1.10)。

參考來源:

"7.2 可是我聽說 char a[ ] 和 char *a 是一樣的。 並非如此。(你所聽說的應該跟函數的形式參數有關;參見問題  6.4) 數組不是指針。 數組定義 char a[6] 請求預留 6 個 字符的位置, 並用名稱 ``a" 表示。也就是說, 有一個稱為 ``a" 的位置, 可以放入 6 個字符。 而指針申明 char *p, 請求一個位置放置一個指 針, 用名稱 ``p" 表示。 這個指針幾乎可以指向任何位置: 任何字符和 任何連續的字符, 或者哪裡也不指(參見問題 5.1 和  1.10)。"
- 7.2 可是我聽說 char a[ ] 和 char *a 是一樣的。 (在「Google 網頁註解」中檢視)

my_memicmp from internet

int my_tolower(char ch)

{

if(ch >= 'A' && ch <= 'Z')

return (ch + 0x20);

return ch;

}

int my_memicmp(const void *buffer1,const void *buffer2,int count)

{

int f = 0;

int l = 0;

while (count--)

{

if ( (*(unsigned char *)buffer1 == *(unsigned char *)buffer2) ||

((f = my_tolower( *(unsigned char *)buffer1 )) ==

(l = my_tolower( *(unsigned char *)buffer2 ))) )

{

buffer1 = (char *)buffer1 + 1;

buffer2 = (char *)buffer2 + 1;

}

else

break;

}

return ( f - l );

}

參考:

參考來源:

"int my_memicmp(const void *buffer1,const void *buffer2,int count)"
- memicmp ( )【C语言库函数源代码】 - string.h - ammana_babi (在「Google 網頁註解」中檢視)

Saturday, September 25, 2010

Linux大小寫轉換方法

以下以小写转大写为例
(1)sed:
cat file | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'

(2)tr:
cat file | tr a-z A-Z
cat file | tr "[:lower:]" "[:upper:]"

(3)perl:
$string="abcdef";
$string =~ tr/[a-z]/[A-Z]/;
or
$string=uc($string); #大小转小写用lc,具体参见perldoc -f lc与perdoc -f uc

參考來源:

"以下以小写转大写为例 (1)sed: cat file | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'   (2)tr: cat file | tr a-z A-Z cat file | tr "[:lower:]" "[:upper:]"   (3)perl: $string="abcdef"; $string =~ tr/[a-z]/[A-Z]/; or $string=uc($string); #大小转小写用lc,具体参见perldoc -f lc与perdoc -f uc"
- Linux下大小写转换的方法小结 - TIPs - 冷月无声 (在「Google 網頁註解」中檢視)

GNU Gnulib Table of Contents

GNU Gnulib

Table of Contents
可以查查可以用的function

參考來源:

"GNU Gnulib Table of Contents"
- GNU Gnulib (在「Google 網頁註解」中檢視)

implement strcasestr

implement strcasestr

參考來源:

"用c语言实现函数strcasestr。函数原型:char*strcasestr(const char*haystack,const char*needle) 函数返回字符串指针"
- C字符串处理 - 好好学习,好好工作,好好生活 - BlogJava (在「Google 網頁註解」中檢視)

implement strcasecmp

使用google大法,发现VC没有strcasecmp和strncasecmp函数,只好为他做了一个补丁。
如下

在.h文文件中添加如下声明:
#ifdef _MSC_VER
int strcasecmp(char *s1, char *s2);
int strncasecmp(char *s1, char *s2, register int n);
#endif

在.c文件中添加如下实现
#ifdef _MSC_VER
int strcasecmp(char *s1, char *s2)
{
while (toupper((unsigned char)*s1) == toupper((unsigned char)*s2++))
if (*s1++ == '') return 0;
return(toupper((unsigned char)*s1) - toupper((unsigned char)*--s2));
}

int strncasecmp(char *s1, char *s2, register int n)
{
while (--n >= 0 && toupper((unsigned char)*s1) == toupper((unsigned char)*s2++))
if (*s1++ == '') return 0;
return(n < 0 ? 0 : toupper((unsigned char)*s1) - toupper((unsigned char)*--s2));
}
#endif

參考來源:

"使用google大法,发现VC没有strcasecmp和strncasecmp函数,只好为他做了一个补丁。"
- VC下编译libMPG123(补) : sunnyu (在「Google 網頁註解」中檢視)

Unix Incompatibility Notes: String and Memory Functions

Unix Incompatibility Notes:
String and Memory Functions
一些 String and Memory的函式介紹
有strstr memmem strcasecmp etc .

參考來源: Unix Incompatibility Notes: String and Memory Functions (在「Google 網頁註解」中檢視)

Thursday, September 23, 2010

GENTOO - APACHE, PHP, MYSQL

GENTOO - APACHE, PHP, MYSQL
By: John McFarlane
Abstract:
This document outlines the installation of a web server running Apache, PHP, and Mysql.

參考來源:

"GENTOO - APACHE, PHP, MYSQL By: John McFarlane <john.mcfarlane@rockfloat.com> Abstract: This document outlines the installation of a web server running Apache, PHP, and Mysql."
- Rockfloat Howto: Gentoo - Apache, PHP, Mysql (在「Google 網頁註解」中檢視)

Wednesday, September 22, 2010

libmysqlclient.so.15: cannot open shared object file: No such file or directory

libmysqlclient.so.15: cannot open shared object file: No such file or directory
裏面提供一些共享庫的概念,值得一讀,補充比較底層的資訊。以後比較有能去debug

參考來源:

"运行时使用非标准位置/usr/lib和/lib下的库的方式有三种: (1) 设置$LD_LIBRARY_PATH=库所在目录(多个目录用:分隔),系统加载工具ld.so/ld-linux.so将顺序搜索变量指定的目录。例如#$LD_LIBRARY_PATH=/usr/local/mysql/lib ./test_mysql (2) 以root身份把库路径加入/etc/ld.so.conf或在/etc/ld.so.conf.d中创建特定的.conf文件,然后运行ldconfig更新/etc/ld.so.cache。例如:在/etc/ld.so.conf.d下创建文件mysql.conf写入/usr/local/mysql/lib (3) 另一种办法就是把需要的库copy到/usr/lib或/lib,但这不是建议的方法,特别是尽量避免copy发到/lib。但这种方法可以在编译时免去用-L选项。"
- libmysqlclient.so.15: cannot open shared object file: No such file or directory - 最实用的Linux博客 - CSDN博客 (在「Google 網頁註解」中檢視)

怎样对一个链表排序

14.8 怎样对一个链表排序?

有时侯, 有时侯, 在建立链表时就一直保持链表的顺序要简单些 (或者用树代替)。 插入排序和归并排序算法用在链表最合适了。
如果你希望用标准库函数, 你可以分配一个暂时的指针数组, 填入链表 中所有节点的地址, 再调用 qsort(), 最后依据排序后的数组重新建立 链表。

參考來源:

"14.8 怎样对一个链表排序? 有时侯, 有时侯, 在建立链表时就一直保持链表的顺序要简单些 (或者用树代替)。 插入排序和归并排序算法用在链表最合适了。 如果你希望用标准库函数, 你可以分配一个暂时的指针数组, 填入链表 中所有节点的地址, 再调用 qsort(), 最后依据排序后的数组重新建立 链表。"
- 14.8 怎样对一个链表排序? (在「Google 網頁註解」中檢視)

qsort

qsort不能對鏈表做排序

參考來源:

"qsort的确好  但是不能对链表排序!哎 2叉FIND TREE好 Blog作者的回复: 库函数设计时一般只会包含最常用的功能,所以不可能做到面面俱到。 二叉搜索树实现简单,平均深度为O(logN),这是它的优点;但经过O(N*N)次插入/删除后,它的缺点就暴露出来了,那就是二叉树将严重失衡,甚至演化成了一棵单支树。因此,在一些应用中,常用AVL树或splay树代替二叉搜索树。"
- C语言中用qsort()快速排序 - C&C++ - Welcome to my blog (在「Google 網頁註解」中檢視)

Monday, September 20, 2010

Daily Bookmarks 20100920

Google Dev Fest 10
http://code.google.com/intl/zh-TW/events/devfests/2010/

懌飛blog taobao 工程師 給了DevFest 10 Beijing 一場talk
http://www.planabc.net/

資料
http://www.google.com/intl/zh-CN/events/devfests/2010/resources.html

Linked List part2
http://finalfrank.pixnet.net/blog/post/23074005

How to write a search engine in 9 lines of Shell
http://www.computing.dcu.ie/~humphrys/Notes/CGI/search.engine.html

Linux -裝Tex中文
http://blog.punkid.org/2008/05/31/latex-cjk-support-on-linux/

facebook social plugin
http://developers.facebook.com/docs/reference/plugins/live-stream
這個非常有參考價值的一些social plugin

D2前端技術論壇視頻

D2前端技術論壇視頻
http://www.d2forum.org/

滿值得看的
還有影片,有空閒時間可以邊消化。

參考來源:

"第四届D2前端技术论坛视频 2009-12-30 第四届D2宣传片"
- D2 前端技术论坛 (在「Google 網頁註解」中檢視)

Sunday, September 19, 2010

VIM兩個不錯的教學

Vim 內建視窗分割功能,可於編輯器內分割多重視窗及分頁來並行編輯檔案。

各編輯視窗 (Window) 可載入不同編輯緩衝區 (Buffer) 來進行編輯,不限於當前的編輯緩衝區。 編輯視窗也可載入共同的編輯緩衝區來編輯。 事實上編輯視窗基本上就是一個編輯緩衝區的觀察窗口 (viewport)。

由於可開啟多重編輯視窗來並行編輯,因此若能善用編輯視窗及編輯緩衝區等功能,便可提高編輯效率。

http://www.openfoundry.org/en/tech-article/2383
vi vim指令整理
http://www.vixual.net/blog/archives/234

參考來源:

"Vim 內建視窗分割功能,可於編輯器內分割多重視窗及分頁來並行編輯檔案。 各編輯視窗 (Window) 可載入不同編輯緩衝區 (Buffer) 來進行編輯,不限於當前的編輯緩衝區。 編輯視窗也可載入共同的編輯緩衝區來編輯。 事實上編輯視窗基本上就是一個編輯緩衝區的觀察窗口 (viewport)。 由於可開啟多重編輯視窗來並行編輯,因此若能善用編輯視窗及編輯緩衝區等功能,便可提高編輯效率。"
- Vim - 編輯緩衝區以及編輯視窗 (Buffers and Windows) (在「Google 網頁註解」中檢視)

Sunday, September 12, 2010

DOCKAPPS Date / Time apps

Date / Time apps



wmtimer



Page: 1 2 3

參考來源:

"Date / Time apps  Page: 1 2 3"
- dockapps.org (在「Google 網頁註解」中檢視)

Saturday, September 11, 2010

6cooltoostoTrack your time

6cooltoostoTrack your time

參考來源:

"Whatever your needs, here are 6 of the coolest tools for tracking your time. Most of them aren’t free, but then the best tools often aren’t."
- 6 Cool Tools to Track Your Time (在「Google 網頁註解」中檢視)

python range() xrange()比較

參閱

參考來源:

"在Python中提供了range() function,可以建立出一個數字 list 。 Ex: range(1, 10) #>>> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] range(1, 10, 2) #>>> [1,  3, 5, 7, 9]"
- Falldog的程式戰場 (在「Google 網頁註解」中檢視)

yaTimmer

Timers and Countdowns

yaTimer fully supports both normal timers and countdowns.

Countdown times are logged in exactly the same way as normal timers and is included on all reports.

Countdowns have a progress bar so you can see how much time is leftat a glance and you can set a sound to play when the countdown ends.

參考來源:

"Timers and Countdowns yaTimer fully supports both normal timers and countdowns. Countdown times are logged in exactly the same way as normal timers and is included on all reports. Countdowns have a progress bar so you can see how much time is leftat a glance and you can set a sound to play when the countdown ends."
- yaTimer Product Tour (在「Google 網頁註解」中檢視)

Monday, September 06, 2010

perl -MCPAN -e 'install LWP::Simple'

perl -MCPAN -e 'install LWP::Simple'

參考來源:

"perl -MCPAN -e 'install LWP::Simple'"
- punkcoder: slack-get::Can't locate LWP/Simple.pm (在「Google 網頁註解」中檢視)

991選課參考

1 4105400 01 電腦網路
Computer Networks
林柏青 3
3/0/0 3 必修 三B,C 教學大樓507 0 連結 碩博合開 ,列入電子商務學程科目 ,列入資通安全學程科目

1 4105476 01 網際網路資料庫系統
Web-based Database System
吳昇 3
3/0/0 3 選修 三E,F 工學院A館205 0 連結 碩博合開,開放資工系大三大四同學選修



-------------------cf.

1 4105402 01 網路安全攻防技術
Techniques of Network Attacks and Defenses
林柏青 3
3/0/0 3 選修 二E四E 工學院A館101 0 連結 碩博合開

參考來源:

"1 4105402 01 網路安全攻防技術 Techniques of Network Attacks and Defenses 林柏青 3 3/0/0 3 選修 二E四E 工學院A館101 0 連結 碩博合開"
- 國立中正大學開排選課系統 99學年度第1學期課程表--資訊工程研究所 (在「Google 網頁註解」中檢視)

Saturday, September 04, 2010

Perl學習網站收集

這支程式主要是用到perl 的二個module: Crypt::SSLeay 和 WWW::Mechanize,前者是為了讓LWP::UserAgent能作https的表單認證登入,後者則是為了用機器人填表。比較需要注意的是 WWW::Mechanize目前尚未支援JavaScript,所以有些用JavaScript的機器人動作都必須再以Form的Submit()方式來達成(叫用WWW::Mechanize中的form_submit())。

參考來源: Perl 手札-jiing's blog (jiing.org)-新浪部落 (在「Google 網頁註解」中檢視)

Wednesday, September 01, 2010

winestricks

winestricks

參考來源:

"用 WINE 裝 IE6, WMP10, hifree, or KKBOX KKBOX 有 Mac 版本,這邊只是裝好玩的,其實是可以用在 Linux 上。 以下是憑記憶所寫的步驟: 下載 Darwine,把 Darwine 和 TRiX.app 複製到 /Applications 下載 winetricks curl -o winetricks http://winezeug.googlecode.com/svn/trunk/winetricks chmod +x winetricks"
- jclin.org: 用 WINE 裝 IE6, WMP10, hifree, or KKBOX (在「Google 網頁註解」中檢視)

MonkeyGTD介紹

"GTD"是一门高效实用的工作信念,而"MonkeyGTD3"则是实现GTD的工具。
本文将基于GTD学习与实现的一些经验基础上,介绍MonkeyGTD3的基本概念与新增功能。适用对象:了解GTD,具有强烈工作优化欲望,使用Firefox作为主浏览器。
MonkeyGTD介紹

參考來源:

""GTD"是一门高效实用的工作信念,而"MonkeyGTD3"则是实现GTD的工具。 本文将基于GTD学习与实现的一些经验基础上,介绍MonkeyGTD3的基本概念与新增功能。适用对象:了解GTD,具有强烈工作优化欲望,使用Firefox作为主浏览器。"
- 欢迎使用MonkeyGTD 3.0 | GTD Life (在「Google 網頁註解」中檢視)

Wednesday, August 25, 2010

youwei web for co-traveling. build with

youwei web for co-traveling. build with

first class UI design
smarty
php
mysql
Smart guys
Source Code

參考來源:

"youwei web for co-traveling. build with first class UI design smarty php mysql Smart guys Source Code"
- youweinet - Project Hosting on Google Code (在「Google 網頁註解」中檢視)

Thursday, August 19, 2010

getopt

字符串optstring可以下列元素,
1.单个字符,表示选项,
2.单个字符后接一个冒号:表示该选项后必须跟一个参数。参数紧跟在选项后或者以空格隔开。该参数的指针赋给optarg。
3 单个字符后跟两个冒号,表示该选项后必须跟一个参数。参数必须紧跟在选项后不能以空格隔开。该参数的指针赋给optarg。(这个特性是GNU的扩张)。

參考來源:

"字符串optstring可以下列元素, 1.单个字符,表示选项, 2.单个字符后接一个冒号:表示该选项后必须跟一个参数。参数紧跟在选项后或者以空格隔开。该参数的指针赋给optarg。 3 单个字符后跟两个冒号,表示该选项后必须跟一个参数。参数必须紧跟在选项后不能以空格隔开。该参数的指针赋给optarg。(这个特性是GNU的扩张)。"
- getopt的用法 - 嵌入式 - IT博客 (在「Google 網頁註解」中檢視)

Tuesday, August 17, 2010

Alphabetical sort using strcmp question

Alphabetical sort using strcmp question

參考來源:

"for (i = 0; i < MAXLINE - 1; ++i)     {         for (j = i; j < MAXLINE; ++j)         {             if (strcmp(m[i], m[j]) > 0)             {                 const char *swap = m[i];                 m[i] = m[j];                 m[j] = swap;             }         }     }"
- Alphabetical sort using strcmp question - C / C++ answers (在「Google 網頁註解」中檢視)

缺盆这条道

《黄帝内经》里有“五脏六腑,心为之主”的说法,就是五脏六腑是由心来统摄的,心为君主。而心又靠什么来统摄五脏六腑呢?——“缺盆为之道”,就是缺盆是心统摄五脏六腑的通路。所以即使心这个君主能发布政令,假如通路受阻,也无法管好五脏六腑这些百姓。那么我们人体就必须要保证缺盆这条道路的通畅。凡是走肩膀的经脉,全部都走缺盆,所以缺盆的重要性不言而喻。

參考來源:

"《黄帝内经》里有“五脏六腑,心为之主”的说法,就是五脏六腑是由心来统摄的,心为君主。而心又靠什么来统摄五脏六腑呢?——“缺盆为之道”,就是缺盆是心统摄五脏六腑的通路。所以即使心这个君主能发布政令,假如通路受阻,也无法管好五脏六腑这些百姓。那么我们人体就必须要保证缺盆这条道路的通畅。凡是走肩膀的经脉,全部都走缺盆,所以缺盆的重要性不言而喻。"
- 18.肩部的保健 - 文化频道 - 西部网(陕西新闻网)WWW.CNWEST.COM (在「Google 網頁註解」中檢視)

缺盆穴

Sunday, August 15, 2010

4年前在做什麼

在google lucene 與gais搜尋到一個有趣的事情。
原來有這段歷史。

參考來源:

"回想起来:从Jack Xu确定我们使用Lucene这个方向到项目上线:我们用了将近4个月左右的时间:而当时Lucene 1.2还是一个在SourceForge孵化的项目。还要感谢当时网易的搜索产品经理:肖尚雷给我的机会,是他带我进入这个行业,让我能有时间从头到尾学习了Lucene这个项目的源代码。在Lucene之前,各个门户网站的搜索用的还是台湾中正大学中正大学资工所创立的一个索引/查询引擎GAIS,GAIS不提供源代码,只有可执行版本的工具包(有不同平台下的binary发布版)。四年过去了:Lucene项目发展很快并应用到大量的WEB和桌面应用中。网易也许是第一个使用Lucene引擎的,我也很高兴将Lucene推广并应用到了更多的项目中,包括:"
- 911 四年前的今天你在做什么? (车东[Blog^2]) (在「Google 網頁註解」中檢視)

socialtext介紹-價值中國

socialtext介紹-價值中國
唐鳳講到socialtext
很好奇

參考來源: “商业开源”的创新者 - 人物专访 - 价值中国网 (在「Google 網頁註解」中檢視)

Saturday, August 14, 2010

NodeJS探索

NodeJS探索

一、什么是NodeJS?
第一眼看到这个词,估计你和我一样,以为它不过是一个JavaScript框架吧?如果是,那么首先恭喜你,说明你的思维是正常的。其次鄙视你:凭什么带 JS的就一定是JavaScript框架?你丫做技术的吧?最看不起你们这帮做技术的了,跟姓韩的那谁似的,没一点文化。
生活经验告诉我们,牛人往往都不怎么正常,正常人往往都成不了牛人。比如说NodeJS的发明者,这家伙就曾叫嚣说:其实JavaScript更适合做服务器端的并发编程。估计很多人听到这话都笑了,嗯,原谅我的可耻,我也笑了。令人欣慰的是上帝没有笑。当年上帝说要光,于是就有人脱了个精光。今天,上帝说我相信这个人能成,于是这个人还真成了,他弄了这么个东西:NodeJS--基于V8引擎的,使用事件驱动模型而不是复杂的多线程来获得可伸缩性,类似 Ruby的EventMachine和Python的Twisted的轻量级WEBServer。
是不是很有意思?这意味着什么我想大伙都清楚吧?嗯,如果这东东真的可用,那就是说,以后前段后端都可以都用JavaScript来编程了,这对于JS程序员来说,真是一个莫大的福音,因为你们再也不用看着那帮做后台的孙子的脸色干活了,可以翻身做后端了。
好,废话到此,那接下来就请跟着我,开始NodeJS的探索之旅。

參考來源: NodeJS探索 « 老韩 (在「Google 網頁註解」中檢視)

Friday, August 06, 2010

Quanta Plus簡介

簡介

參考來源:

"一直都想介绍一下Quanta Plus这款linux下的IDE (基于Qt的程序)。这是我目前使用过的最好用,最上手的网页编辑器了,D.K的所有代码也都是在这个编辑器下写的。我曾经推荐过另一款linux下的IDE: Aptana。那相比Aptana,Quanta Plus有什么优势呢?"
- Quanta Plus : A Brief Review of an IDE under Linux (在「Google 網頁註解」中檢視)

Linux下Web開發工作介紹

Using Linux for Web Design and Development (Ubuntu)
Tags:

* Web Design Tools
* Linux
* Ubuntu

2006, August 28 - 12:48pm — Webmaster Tips

[Note: to install the following programs on Ubuntu, make sure that you have the Universe repository enabled. You can either use the terminal, or Synaptic. For more information on how to install software on Ubuntu, see this article. Generally you can just type the following in the terminal:

參考來源:

"Using Linux for Web Design and Development (Ubuntu)"
- Using Linux for Web Design and Development (Ubuntu) | Webmaster Tips (在「Google 網頁註解」中檢視)

Thursday, August 05, 2010

strcasestr

类似的还有strcasestr,是strstr的忽略大小写版本
memmem,是对付内部包含0值字节的版本,因为0会被str族函数认为是结束符

參考來源:

"类似的还有strcasestr,是strstr的忽略大小写版本 memmem,是对付内部包含0值字节的版本,因为0会被str族函数认为是结束符"
- strstr函数的功能 - C语言论坛 - 编程论坛 (在「Google 網頁註解」中檢視)

mememe1 like strstr

#include

/* ----------------------------------------------------------------------------
* memmem()
* ----------------------------------------------------------------------------
* function
* Like strstr(), but for binary data -- seeks to find 'tofind' in 'source'.
*
* returns
* A pointer to the matching data.
* NULL if not found.
*/
const void* memmem(
const void* source, size_t sourcesize,
const void* tofind, size_t tofindsize
) {
int value;
const void* found;

/* If either 'source' or 'tofind' are missing or blank then we are done */
if (!source || !tofind || !sourcesize || !tofindsize) return source;

value = *(const unsigned char*)tofind;

/* While we can find potential matches */
while ((found = memchr( source, value, sourcesize )))
{
/* Keep track of what amount remains of the source */
sourcesize -= (const unsigned char*)found - (const unsigned char*)source;

/* If there isn't enough of the source left to match, then return 'not found' */
if (sourcesize < tofindsize) return NULL;

/* Did we find an exact match? */
if (memcmp( found, tofind, tofindsize ) == 0) return found;

/* Ready to find the next potential match */
source = (const unsigned char*)found + 1;
sourcesize--;
}

/* No match found */
return NULL;
}

參考來源:

"Since you are working with binary data, you should avoid using string functions. Unfortunately, there is no equivalent of strstr() for binary memory, but it is easy enough to construct one:"
- Checking for null characters in the midd... - C++ Forums (在「Google 網頁註解」中檢視)

memmem strstr

strstr這個fucntion是針對搜尋C字串設計的
而memmem是針對搜尋某個character buffer設計的
聽出來有什麼不一樣了嗎
如果你的character buffer裡面包含有多個null terminator的話
用strstr就有可能會搜尋不到substring
因為strstr只會搜尋第一個null terminator之前的字串內容
這時候就需要memmem啦
不過這個function是GNU的extension喔
所以記得要定義#define _GNU_SOURCE才可以使用喔
又學到一課啦~

參考來源:

"strstr這個fucntion是針對搜尋C字串設計的 而memmem是針對搜尋某個character buffer設計的 聽出來有什麼不一樣了嗎 如果你的character buffer裡面包含有多個null terminator的話 用strstr就有可能會搜尋不到substring 因為strstr只會搜尋第一個null terminator之前的字串內容 這時候就需要memmem啦 不過這個function是GNU的extension喔 所以記得要定義#define _GNU_SOURCE才可以使用喔 又學到一課啦~"
- Infinite Waiting: strstr與memmem有啥差別!? - yam天空部落 (在「Google 網頁註解」中檢視)

Reading image file in binary mode

#include
#include
#include
#include

int main()
{
int rc = 0;
char buffer[BUFSIZ] = {0};

FILE* p_infile = 0;
FILE* p_outfile = 0;

int length = 0;
int done = 0;

printf( "Enter the file name for the input file to be copied: " );
fgets( buffer, BUFSIZ, stdin );
buffer[ strlen( buffer ) -1 ] = 0;

p_infile = fopen( buffer, "rb" ); /* the b is added for Windoze/DOS systems... */
if( !p_infile )
{
rc = errno;
printf( "error opening %s for reading\n", buffer );
}
else
{
printf( "Enter the file name for the output file to be written: " );
fgets( buffer, BUFSIZ, stdin );
buffer[ strlen( buffer ) -1 ] = 0;

p_outfile = fopen( buffer, "wb" ); /* the b is added for Windoze/DOS systems... */
if( !p_outfile )
{
rc = errno;
printf( "error opening %s for writing\n", buffer );
}
else
{
do
{
length = fread( buffer, 1, sizeof( buffer ), p_infile );
done = length < (int)sizeof( buffer );
fwrite( buffer, 1, length, p_outfile );
}
while( !done );
}
}

if( p_infile )
{
fclose( p_infile );
p_infile = 0;
}

if( p_outfile )
{
fclose( p_outfile );
p_outfile = 0;
}
return rc;
}

參考來源:

"Here is an example that may help if all you're doing is looking to copy the file. I call this code filecopy.c, but you can call it anything that you want."
- Please Help - Reading image file in binary mode - GIDForums (在「Google 網頁註解」中檢視)

my_strlen

unsigned int my_strlen(const char *szString)
{
unsigned int iBytes = 0;
while(*szString++ != '\0')
iBytes++;
return iBytes;
}

參考來源:

"unsigned int my_strlen(const char *szString) { unsigned int iBytes = 0; while(*szString++ != '\0') iBytes++; return iBytes; }"
- Explanation on strlen(buffer) (在「Google 網頁註解」中檢視)

Wednesday, August 04, 2010

範例:有一個檔案(points.bin)用整數記錄全班50位同學的成績, 寫一程式讓使用者查尋學生成績

範例:有一個檔案(points.bin)用整數記錄全班50位同學的成績, 寫一程式讓使用者查尋學生成績

#include < iostream.h >
#include < stdio.h >

void main(void)
{
int num;
int data;
FILE *file=fopen("points.bin","rb");
do
{
printf("num=");
scanf("%d",&num);
if ( num>=50 || num<0 )
break;
fseek(file, num*sizeof(int), SEEK_SET);
fread(&data, sizeof(int), 1, file);
printf("Student(%d)=%d\n",num,data);
} while(1);
fclose(file);
}

參考來源:

"fseek( input, 0, SEEK_END); // 先把讀寫位置移到檔尾 filelen = ftell( input ); // 再傳回檔案目前的讀寫位置 範例:有一個檔案(points.bin)用整數記錄全班50位同學的成績, 寫一程式讓使用者查尋學生成績"
- 第八章:檔案 (在「Google 網頁註解」中檢視)

Minidx.com

minidx.com search engine

參考來源:

"一时想不出博客叫什么名字好,因为是放在Minidx.com下面的,所以就叫全文检索博客好了。不过内容五花八门,可能什么都有吧。Minidx是我于05年开始开发的一个全文检索引擎,关于Minidx全文检索的信息,请访问:http://minidx.com,中文请到:http://cn.minidx.com。 如有问题请联系minidxer(at)gmail.com,谢谢配合! 相关技术交流类的问题请尽量通过在http://blog.minidx.com/guestbook或者相关文章里留言而不要发邮件,因为你的邮件很有可能被自动归类到SPAM里导致我没办法看到……"
- About | 中文Flex例子 (在「Google 網頁註解」中檢視)

dump_buffer

void dump_buffer(void *buffer, int buffer_size)
{
int i;

for(i = 0;i < buffer_size;++i)
printf("%c", ((char *)buffer)[i]);
}

參考來源:

"void dump_buffer(void *buffer, int buffer_size) { int i; for(i = 0;i < buffer_size;++i) printf("%c", ((char *)buffer)[i]); }"
- C, howto read binary file into buffer (在「Google 網頁註解」中檢視)

Tuesday, August 03, 2010

strstr c语言中的字符串分割(strstr)

1. int main(int argc,char **argv)
2. {
3. char temp[10];
4. char *haystack="aaa||a||bbb||c||ee||";
5. char *needle="||";
6. char* buf = strstr( haystack, needle);
7. while( buf != NULL )
8. {
9. strncpy(temp, haystack, buf-haystack);
10. temp[buf-haystack] =0;
11. printf( "%s\n ", temp); //haystack);
12.
13. haystack = buf + strlen(needle);
14.
15. buf = strstr( haystack, needle);
16. }
17. return 0;
18. }

參考來源:

"在前面C语言中利用strtok函数进行字符串分割介绍的strtok函数,比较适合多个字符(也就是字符串)作分隔符的场合,而很多时候我们仅仅需要某一个特定的字符来分割字符串,当然利用strtok也可以实现,不过这里介绍的strstr效率上来说更加适合。"
- c语言中的字符串分割(strstr) - ubuntu,debian,redhat -linuxany.com (在「Google 網頁註解」中檢視)

Monday, August 02, 2010

strtok

在搞了很久的search時,今天好像被雷打到,
懂了一些東西。
strtok的第二個NULL

在 Microsoft C strtok() 函數會採用兩個字串,做為引數。第一個是一系列的第二個字串所定義的分隔符號隔開的零個或多個語彙基元。strtok() 第一次呼叫傳回第一個引數中第一個語彙基元的指標。在原始字串中取得下一個語彙基元 (Token),strtok() 的呼叫必須由使用 NULL 做為第一個引數會告訴 strtok() 搜尋下一個在前一個語彙基元字串語彙基元。

使用 strtok() 時,請牢記下列資訊:

* 每次呼叫函式時使用相同的字串,所以由 strtok() 使用修改原始字串 strtok() 將會以 NULL 取代原始字串中的分隔符號。
* strtok() 到第二個引數可以隨時變更為不同的分隔符號。
* 只有單一字元都被視為分隔符號。

http://www.cplusplus.com/reference/clibrary/cstring/strtok/

http://life.iiietc.ncu.edu.tw/xms/forum/show.php?id=22791

參考來源: 資訊: strtok(): C 函式--補充的文件 (在「Google 網頁註解」中檢視)

General topics on UNIX programming

邊找regexec的時候剛好也找到解決opt的問題的網頁:
裏面有regex在C的範例,跟一些 Unix-like下的 programming教學。

http://mij.oltrelinux.com/devel/unixprg/
General topics on UNIX programming
The following entries cover some general programming topics under UNIX:

* Regular expressions
o notes
o summary
o example
* Parsing the command line
o notes
o summary
o examples
* Tasks, fork(), wait() and waitpid()
o notes
o summary
o examples
* Threads
o notes
o summary
o examples

Interprocess communication / UNIX IPC programming
The following entries cover topics specific to Inter-process communication mechanisms under UNIX:

* IPC: signals
o notes
o summary
o examples
* IPC: pipes
o notes
o summary
o examples
* IPC: named pipes
o notes
o summary
o examples
* IPC: BSD sockets
o notes
o summary
o examples
* IPC: POSIX Message queues
o notes
o summary
o examples
* IPC: POSIX Semaphores
o notes
o summary
o examples
* IPC: POSIX shared memory
o notes
o summary
o examples
* IPC: notes on POSIX objects -- the POSIX objects mess
o notes

參考來源:

"General topics on UNIX programming The following entries cover some general programming topics under UNIX: Regular expressions notes summary example Parsing the command line notes summary examples Tasks, fork(), wait() and waitpid() notes summary examples Threads notes summary examples"
- UNIX programming examples (在「Google 網頁註解」中檢視)