This file contains 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
var t = new Date().getTime() | |
function getTime() { | |
return (new Date().getTime()-t)/1000; | |
} | |
function fun(n,order) { | |
console.log(getTime(),"卡片" + n + "正面") | |
setTimeout(function(){ | |
console.log(getTime(),"卡片" + n + "反面") | |
setTimeout(function(){ |
This file contains 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
conn,err := net.Dial("tcp", "test.com:1024") | |
if err != nil { | |
//这里如何确定出错的原因 | |
//是因为主机不可达,还是因为不能解析域名,或者说是连接被拒绝? | |
} |
This file contains 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
// Copyright 2006 Nemanja Trifunovic | |
// Copyright 2011 Jack.arain | |
/* | |
Permission is hereby granted, free of charge, to any person or organization | |
obtaining a copy of the software and accompanying documentation covered by | |
this license (the "Software") to use, reproduce, display, distribute, | |
execute, and transmit the Software, and to prepare derivative works of the | |
Software, and to permit third-parties to whom the Software is furnished to | |
do so, all subject to the following: |
This file contains 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
/** | |
* Created with JetBrains WebStorm. | |
* User: kiyangqi | |
* Date: 13-6-9 | |
* Time: 下午11:36 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
function StreamBuf() { | |
this.chunks = []; |
This file contains 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
INCLUDE (FindPackageHandleStandardArgs) | |
FIND_PATH (FFMPEG_ROOT_DIR | |
NAMES libavcodec/avcodec.h include/libavcodec/avcodec.h | |
PATHS ENV FFMPEG_ROOT | |
DOC "FFmpeg root directory") | |
FIND_PATH (FFMPEG_INCLUDE_DIR | |
NAMES libavcodec/avcodec.h | |
HINTS ${FFMPEG_ROOT_DIR} |
This file contains 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
#include <iostream> | |
#include <boost/bind.hpp> | |
class T { | |
public: | |
T() { | |
} | |
T(T&& other) { | |
std::cout << "moving" << std::endl; |
This file contains 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
#include <cstdlib> | |
#include <iostream> | |
#include <boost/bind.hpp> | |
#include <boost/asio.hpp> | |
#include <boost/thread/thread.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/enable_shared_from_this.hpp> | |
using boost::asio::ip::tcp; |
This file contains 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
#include <boost/asio.hpp> | |
namespace asio = boost::asio; | |
using asio::ip::tcp; | |
#include <boost/bind.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/enable_shared_from_this.hpp> | |
class session | |
: public boost::enable_shared_from_this<session> |
This file contains 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
var net = require("net"); | |
var server = net.createServer(function(req) { | |
req.on('data', function(data) { | |
req.write(data); | |
}); | |
}); | |
server.listen(8000); |
This file contains 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
template<typename Iterator> | |
struct IniGrammar | |
: qi::grammar<Iterator, std::map<std::string, std::string>()> | |
{ | |
IniGrammar() | |
: IniGrammar::base_type(start) | |
{ | |
using ascii::char_; | |
using qi::lexeme; | |
using spirit::skip; |
OlderNewer