Tags » 技术笔记

A powerful parser for Java and Android: Jparsec

Today I want to talk about a powerful Java parser: Jparsec (http://jparsec.codehaus.org/). I recently used it for one of my projects and found it really helpful. 823 more words


TSQL: Search keyword in XML Column

Sometimes you would need to search certain keyword inside a XML column using a like clause, here is a simple example:

SELECT XmlColumn, OtherColumns FROM TableWithXmlColumn
WHERE cast(XmlColumn as varchar(max)) LIKE '%keyword%'
… 10 more words

关于二分查找(Binary Search)及其变种形式的总结



注意1:如果是start < end,那么当target等于num时,会找不到该值。 注意2:因为num > target, 所以如果有num == target, index一定小于mid,能不能写成end = mid呢?举例来说:num = {1, 2, 5, 7, 9}; 如果写成end = mid,当循环到start = 0, end = 0时(即num = 1, num = 1时),mid将永远等于0,此时end也将永远等于0,陷入死循环。也就是说寻找target = -2时,程序将死循环。 447 more words

Binary Search



每天在命令行下,一大部分的工作都是一遍又一遍的输入 cd ~/some/very/deep/often-used/directory这样来切换目录,现在利用一个简单的配置可以实现如下效果:

首先进入我的日常工作目录,标记一个书签mark sanguo

cd /Users/kimi/work/123guo/sanguo
mark sanguo
以后我再进入这个目录只需要g sanguo即可
g sanguo

#app -> /Applications
#sanguo -> /Users/kimi/work/123guo/sanguo
#web -> /Library/WebServer/Documents… 113 more words


Microsoft SQL Server - Search specified column or table in all database at a DB Server

In a development environment normally there are multiple databases installed at one DB Server, and there is a system store procedure called: “sp_msforeachdb” can help us to search a specified column or table easily in these different databases(or other tasks need to be done in different DBs), and here are the sample script: 185 more words


GitHub Tips

  1. Config GitHub with Putty/Pageant
    1. Install Putty from here, run PuTTY.exe and create a new SSH session to “github.com’ and save it
    2. Run PUTTYGEN.EXE generate a pair of public/priviate key pair, copy the public key content to a text file(like ‘yourpublickey.txt’), save the private key to a text file(like ‘yourprivatekey.ppk’) at the same folder(like: c:\ssh)
  2. 144 more words

Very useful windows shortcuts which can run from command line or explorer

Run commands

Calc – Calculator
Cfgwiz32 – ISDN Configuration Wizard
Charmap – Character Map
Chkdisk – Repair damaged files
Cleanmgr – Cleans up hard drives… 385 more words