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.mockito.exceptions.base.MockitoException; | |
import org.mockito.internal.verification.VerificationModeFactory; | |
import org.mockito.internal.verification.api.VerificationData; | |
import org.mockito.internal.verification.api.VerificationDataInOrder; | |
import org.mockito.internal.verification.api.VerificationInOrderMode; | |
import org.mockito.invocation.Invocation; | |
import org.mockito.invocation.MatchableInvocation; | |
import org.mockito.verification.VerificationMode; | |
import java.util.ArrayList; |
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
require 'socket' | |
PORT = 12321 | |
def process_message(message,packet_info) | |
message = Marshal.load(message) | |
case message[:type] | |
when :broadcast | |
return reply_broadcast(message,packet_info) | |
when :reply | |
return deal_reply(message,packet_info) |
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
#TODO 应该将每个点数组抽象成图形,然后实现normalize!以及rot方法 | |
#fuck it, it works. | |
class Point | |
attr :x,true | |
attr :y,true | |
attr :z,true | |
def hash | |
x<<16|y<<8|z | |
end | |
def ==(o) |
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
//Inspired by http://www.zhihu.com/question/20125963/answer/18158192 (chinese) | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define MAXN 5 | |
typedef void* (*loop_func)(void* params); | |
typedef void (*branch)(loop_func,void*); | |
void conditionFalse(loop_func loopfunc,void* params){ | |
(*loopfunc)(params); | |
} | |
void conditionTrue(loop_func loopfunc,void* params){ |