2013-04-26 17:16:00.017 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.
2013-04-26 17:16:00.019 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for test-toolkit-1366967755495.
2013-04-26 17:16:00.020 INFO net.spy.memcached.MemcachedConnection: Reconnecting {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2013-04-26 17:16:00.034 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@79de256f
2013-04-26 17:16:00.161 INFO net.spy.memcached.auth.AuthThread: Authenticated to /10.249.194.159:11211
2013-04-26 17:16:00.163 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Discarding partially completed op: Cmd: 0 Opaque: 28 Key: test-toolk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find the months which First day is monday | |
# My related Blog: http://oldratlee.com/post/2012-11-13/1-st-day-is-monday-month-count | |
dayCountOfMonthOfYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
dayCountOfMonthOfLeapYear = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
print "Day count of non-leap year: ", sum(dayCountOfMonthOfYear) | |
# 365, day count of non-leap year | |
print "Day count of leap year: ", sum(dayCountOfMonthOfLeapYear) | |
# 366, day count of Leap year |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# open -a '/Applications/Sublime Text 2.app' "$@" | |
open -a 'Sublime Text 2' "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.util.concurrent.Executors; | |
public class HttpServerTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.math.BigInteger; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.fail; | |
/** | |
* @author ding.lid | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 通过的UT Case: | |
assertEquals(0, Candy.calcCandyCount(new int[]{})); | |
assertEquals(1, Candy.calcCandyCount(new int[]{1,})); | |
assertEquals(1, Candy.calcCandyCount(new int[]{100,})); | |
assertEquals(2, Candy.calcCandyCount(new int[]{1, 1,})); | |
assertEquals(3, Candy.calcCandyCount(new int[]{1, 2,})); | |
assertEquals(3, Candy.calcCandyCount(new int[]{2, 1,})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> | |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> | |
<param name="Target" value="System.out"/> | |
<param name="Threshold" value="DEBUG"/> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<param name="ConversionPattern" | |
value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> | |
</layout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.sun.btrace.AnyType; | |
import com.sun.btrace.annotations.Kind; | |
import com.sun.btrace.annotations.Location; | |
import com.sun.btrace.annotations.OnMethod; | |
import com.sun.btrace.annotations.ProbeMethodName; | |
import static com.sun.btrace.BTraceUtils.print; | |
import static com.sun.btrace.BTraceUtils.printArray; | |
/* |
OlderNewer