渴死的火烈鸟
standalone · 共 356 篇文章
[leetcode] Palindrome Partitioning II
http://leetcode.com/onlinejudge#question_132 Question: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Return 1 since the palindrome partitioning could be produ…
Profiling your Java code using Spring
Quite good article!!! http://www.unicon.net/node/740
2013-03-05 15:02 · java · 评论(0)
Twisted中的DeferredList
在这个blog上学习twisted。 http://blog.163.com/gzjck_gshock/blog/static/77206203201291461538770/ 里面的一个关于DeferredList的例子一开始对语法不太理解,copy并run了一遍就理解了,把代码贴在这里留作以后借鉴。 connecttest.py: from twisted.internet import reactor, defer, protocol class CallbackAndDisconnectProtocol(protocol.Protocol): def connectionMade(s…
2013-02-21 17:08 · python · 评论(0)
rrdtutorial
http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html RRD: Round Robin Database. RRDtool originated from MRTG (Multi Router Traffic Grapher). MRTG started as a tiny little script for graphing the use of a university's connection to the Internet. Terminology: Please read: http://bbs.chinaunix.net/fo…
2013-02-06 17:01 · 评论(0)
Execution Context in JavaScript
Do you know the output of the code below: (function() { console.log(typeof foo); // function pointer console.log(typeof bar); // undefined var foo = 'hello', bar = function() { return 'world'; }; function foo() { return 'hello'; } }()); If you are not clear about this question, please read this ar…
2013-01-18 22:46 · javascript · 评论(0)
Secrets of the JavaScript Ninja -- 1
**Chapter 3 Scoping and functions** Scoping rules in Javascript: Variable declarations are in scope from their point of declaration to the end of the function within which they are declared, regardless of block nesting. Look at this example: if(window){ var x = 13; } alert(x); // 13 Named functions…
2013-01-17 17:03 · javascript · 评论(0)
How to perform a batch delete in T-SQL
How to perform a batch delete in T-SQL http://resources.mdbitz.com/2010/03/how-to-perform-a-batch-delete-in-t-sql/
2013-01-14 17:32 · 评论(0)
How to invoke shell in perl and how to capture the error if any?
http://www.perlmonks.org/?node_id=57193 system("wc -l"); Will call the given command and return the return value of that command. This is usually not what you want, because most of the times wc -l will mean that you want to get the number of lines back from that call and not if that call was succes…
2013-01-11 16:08 · perl · 评论(0)
otp中supervisor的simple one for one重启策略
看这个分析的吧: http://uniseraph.iteye.com/blog/439873
2013-01-10 17:33 · erlang · 评论(0)
转载 TinyMQ 源码学习
很不错,从这个code和DiaoCow那里可以学到不少东西! git repo: https://github.com/evanmiller/tinymq http://diaocow.iteye.com/blog/1734253
2013-01-10 14:52 · erlang · 评论(0)
erl init stop
一直疑惑诸如command line erl -noshell -s Module Function Arguments -s init stop 后面加的init stop是干什么用的,看了stackoverflow上面一个问答清楚了: http://stackoverflow.com/questions/5269300/run-erlang-application-without-terminal-depending One useful variation is to also call the stop/0 function of the init module so that th…
2013-01-10 14:19 · erlang · 评论(0)
Makefile tutorial
Old but good. http://www.codeproject.com/Articles/31488/Makefiles-in-Linux-An-Overview You should also notice the use of special characters (- and @) preceding the commands. As explained before, - tells make to continue processing even an error occurs and @ tells make not to print command before ex…
2013-01-07 14:30 · linux · 评论(0)
Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };
http://www.perlmonks.org/index.pl?node_id=287647 open FILEHANDLE, 'somefile.txt' or die $!; my $string = do { local $/; }; The above idiom is a consise way to "slurp" the entire contents of a file into a scalar without using a loop, such as: open FILEHANDLE, 'somefile.txt' or die $!; my $string = '…
2012-12-28 16:25 · perl · 评论(0)