本文内容本属于《【精解】EOS TPS 多维实测》的内容,但由于在编写时篇幅过长,所以我决定将这一部分单独成文撰写,以便于理解。

关键字:eos, txn_test_gen_plugin, signed_transaction, ordered_action_result, C++, EOS插件

txn_test_gen_plugin 插件

这个插件是官方开发用来测试块打包交易量的,这种方式由于是直接系统内部调用来模拟transaction,没有中间通讯的损耗,因此效率是非常高的,官方称通过这个插件测试到了8000的tps结果,而就我的测试结果来讲,没有这么恐怖,但也能到2000了,熟不知,其他的测试手段,例如cleos,eosjs可能只有百级的量。下面,我们一同来研究一下这个插件是如何实现以上功能的,过程中,我们也会思考EOS插件的架构体系,以及实现方法。通过本文的学习,如果有好的想法,我们也可以自己开发一个功能强大的插件pr给eos,为EOS社区做出我们自己的贡献。

关于txn_test_gen_plugin插件的使用,非常易于上手,本文不做分析,这方面可以直接参考官方文档。

插件的整体架构

插件代码整体结构中,我们上面介绍的核心功能的实现函数都是包含在一个结构体struct txn_test_gen_plugin_impl中。剩余的其他代码都是对插件本身的通讯进行描述,包括如何调用,如何响应等,以及整个插件的生命周期的控制:

  • set_program_options,设置参数的阶段,是最开始的阶段,内容只设置了txn-reference-block-lag的值,默认是0,-1代表最新头区块。
  • plugin_initialize,这一时期就把包含核心功能的结构体txn_test_gen_plugin_impl加载到程序运行时内存中了,同时初始化标志位txn_reference_block_lag为txn-reference-block-lag的值。
  • plugin_startup,我们通过基础插件http_plugin的支持获得了http接口的能力,这一时期,就暴露出来本插件的对外接口。
  • plugin_shutdown,调用stop_generation函数,重置标志位running为false,计时器关闭,打印关闭提示日志。

下面是对外暴露的三个接口之一的stop_generation函数的源码:

void stop_generation() {if(!running)throw fc::exception(fc::invalid_operation_exception_code);timer.cancel();running = false;ilog("Stopping transaction generation test");
}

接下来,我们主要集中精力在结构体txn_test_gen_plugin_impl上,研究路线是以剩余两个接口分别为入口进行逐一分析。

create_test_accounts 接口

关于这个接口,调用方法是

curl --data-binary '["eosio", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]' http://localhost:8888/v1/txn_test_gen/create_test_accounts

传入的参数是eosio以及其私钥。我们进入到函数create_test_accounts中去分析源码。

准备知识

首先,整个函数涉及到的所有transaction都是打包存入到一个vector集合std::vector trxs;中去。

trxs是一个事务集,它包含很多的trx,而其中每一个trx包含一个actions集合vector actions;

一、准备账户

trxs的第一个trx,内容为账户创建:

  • 定义3个账户:txn.test.a,txn.test.b, txn.test.t
  • 辅助功能:controller& cc = app().get_plugin<chain_plugin>().chain();,通过cc可以随时调用本地区块链上的任意信息。
  • 通过fc::crypto::private_key::regenerate函数分别生成他们的私钥,要传入生成秘钥的seed。
  • 通过私钥直接调用get_public_key()即可获得公钥
  • 设置每个账户的owner和active权限对应的公钥,一般来讲他们是相同的
  • 账户的创建者均为我们外部调用create_test_accounts接口时传入的账户eosio,注意:eosio的私钥是通过字符串传入的,要通过fc::crypto::private_key转换成私钥对象
  • 将每一个账户的创建组装好成为一个action,存入trx的actions集合中去。
  • trx的actions成员已经设置完毕,完成剩余trx的组装工作,包括
    • expiration,通过cc获得当前头区块的时间,加上延迟时间,这里是30s,fc::seconds(30)
    • reference_block,值为通过cc获取当前的头区块,意思为本transaction的引用区块,所有的信息是引用的这个区块为头区块的环境
    • sign,签名,使用的是创建者eosio的私钥对象,上面我们已经准备好了,签名的数据是data的摘要
      • 当前trx的actions中的元素的data并不是如文首的transaction中的data的加密串的结构,而是明文的,这里的加密是数字摘要技术,感兴趣的朋友可以去《应用密码学初探》进行了解。
      • 摘要的源码函数是:sig_digest(chain_id, context_free_data),其中参数使用到了chain_id,而context_free_data就是上面提到的明文data内容,所以它是要与链id一起做数字摘要的(这一点我在使用eosjs尝试自己做摘要的时候并未想到)

这一部分的源码展示如下:

name newaccountA("txn.test.a");
name newaccountB("txn.test.b");
name newaccountC("txn.test.t");
name creator(init_name);abi_def currency_abi_def = fc::json::from_string(eosio_token_abi).as<abi_def>();controller& cc = app().get_plugin<chain_plugin>().chain();
auto chainid = app().get_plugin<chain_plugin>().get_chain_id();fc::crypto::private_key txn_test_receiver_A_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'a')));
fc::crypto::private_key txn_test_receiver_B_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'b')));
fc::crypto::private_key txn_test_receiver_C_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'c')));
fc::crypto::public_key  txn_text_receiver_A_pub_key = txn_test_receiver_A_priv_key.get_public_key();
fc::crypto::public_key  txn_text_receiver_B_pub_key = txn_test_receiver_B_priv_key.get_public_key();
fc::crypto::public_key  txn_text_receiver_C_pub_key = txn_test_receiver_C_priv_key.get_public_key();
fc::crypto::private_key creator_priv_key = fc::crypto::private_key(init_priv_key);//create some test accounts
{signed_transaction trx;//create "A" account{auto owner_auth   = eosio::chain::authority{1, {{txn_text_receiver_A_pub_key, 1}}, {}};auto active_auth  = eosio::chain::authority{1, {{txn_text_receiver_A_pub_key, 1}}, {}};trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, newaccount{creator, newaccountA, owner_auth, active_auth});}//create "B" account{auto owner_auth   = eosio::chain::authority{1, {{txn_text_receiver_B_pub_key, 1}}, {}};auto active_auth  = eosio::chain::authority{1, {{txn_text_receiver_B_pub_key, 1}}, {}};trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, newaccount{creator, newaccountB, owner_auth, active_auth});}//create "txn.test.t" account{auto owner_auth   = eosio::chain::authority{1, {{txn_text_receiver_C_pub_key, 1}}, {}};auto active_auth  = eosio::chain::authority{1, {{txn_text_receiver_C_pub_key, 1}}, {}};trx.actions.emplace_back(vector<chain::permission_level>{{creator,"active"}}, newaccount{creator, newaccountC, owner_auth, active_auth});}trx.expiration = cc.head_block_time() + fc::seconds(30);trx.set_reference_block(cc.head_block_id());trx.sign(creator_priv_key, chainid);trxs.emplace_back(std::move(trx));
}

二、token相关

trxs的第二个trx,内容为token创建和issue,为账户转账为之后的测试做准备

  • 为账户txn.test.t设置eosio.token合约,之前在操作cleos set contract的时候可以通过打印结果发现,是有setcode和setabi两个步骤的。

    • setcode handler:

      • 设置handler的账户为txn.test.t
      • 将wasm设置为handler的code,wasm是通过eosio.token合约的eosio_token_wast文件获取的,vector<uint8_t> wasm = wast_to_wasm(std::string(eosio_token_wast))
      • 将handler加上相关权限组装成action装入trx的actions集合中。
    • setabi handler:
      • 设置handler的账户为txn.test.t
      • 设置handler的abi,将文件eosio_token_abi(json格式的)转成json转储为abi_def结构,然后通过fc::raw::pack操作将结果赋值给abi
      • 将handler加上相关权限组装成action装入trx的actions集合中。
  • 使用账户txn.test.t创建token,标志位CUR,总发行量十亿,装成action装入trx的actions集合中。
  • issue CUR 给txn.test.t 600枚CUR,装成action装入trx的actions集合中。
  • 从txn.test.t转账给txn.test.a 200枚CUR,装成action装入trx的actions集合中。
  • 从txn.test.t转账给txn.test.b 200枚CUR,装成action装入trx的actions集合中。
  • trx的actions成员已经设置完毕,完成剩余trx的组装工作(同上),这里只介绍不同的部分
    • max_net_usage_words,指定了网络资源的最大使用限制为5000个词。

这一部分的源码展示如下:

//set txn.test.t contract to eosio.token & initialize it
{signed_transaction trx;vector<uint8_t> wasm = wast_to_wasm(std::string(eosio_token_wast));setcode handler;handler.account = newaccountC;handler.code.assign(wasm.begin(), wasm.end());trx.actions.emplace_back( vector<chain::permission_level>{{newaccountC,"active"}}, handler);{setabi handler;handler.account = newaccountC;handler.abi = fc::raw::pack(json::from_string(eosio_token_abi).as<abi_def>());trx.actions.emplace_back( vector<chain::permission_level>{{newaccountC,"active"}}, handler);}{action act;act.account = N(txn.test.t);act.name = N(create);act.authorization = vector<permission_level>{{newaccountC,config::active_name}};act.data = eosio_token_serializer.variant_to_binary("create", fc::json::from_string("{\"issuer\":\"txn.test.t\",\"maximum_supply\":\"1000000000.0000 CUR\"}}"));trx.actions.push_back(act);}{action act;act.account = N(txn.test.t);act.name = N(issue);act.authorization = vector<permission_level>{{newaccountC,config::active_name}};act.data = eosio_token_serializer.variant_to_binary("issue", fc::json::from_string("{\"to\":\"txn.test.t\",\"quantity\":\"600.0000 CUR\",\"memo\":\"\"}"));trx.actions.push_back(act);}{action act;act.account = N(txn.test.t);act.name = N(transfer);act.authorization = vector<permission_level>{{newaccountC,config::active_name}};act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"txn.test.t\",\"to\":\"txn.test.a\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}"));trx.actions.push_back(act);}{action act;act.account = N(txn.test.t);act.name = N(transfer);act.authorization = vector<permission_level>{{newaccountC,config::active_name}};act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"txn.test.t\",\"to\":\"txn.test.b\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}"));trx.actions.push_back(act);}trx.expiration = cc.head_block_time() + fc::seconds(30);trx.set_reference_block(cc.head_block_id());trx.max_net_usage_words = 5000;trx.sign(txn_test_receiver_C_priv_key, chainid);trxs.emplace_back(std::move(trx));
}

发起请求

目前trxs集合已经包含了两个trx元素,其中每个trx包含了多个action。下面要将trxs推送到链上执行

  • push_transactions函数,遍历trxs元素,每个trx单独发送push_next_transaction
  • push_next_transaction函数,首先将trx取出通过packed_transaction函数进行组装成post的结构
  • packed_transaction函数,通过set_transaction函数对trx进行摘捡,使用pack_transaction函数进行组装
  • pack_transaction函数,就是调用了一下上面提过的fc::raw::pack操作,然后通过accept_transaction函数向链发起请求
  • accept_transaction函数,是chain_plugin的一个函数,它内部调用了incoming_transaction_async_method异步发起交易请求。

这部分代码比较杂,分为几个部分:

push_transactions函数:

void push_transactions( std::vector<signed_transaction>&& trxs, const std::function<void(fc::exception_ptr)>& next ) {auto trxs_copy = std::make_shared<std::decay_t<decltype(trxs)>>(std::move(trxs));push_next_transaction(trxs_copy, 0, next);
}

push_next_transaction函数:

static void push_next_transaction(const std::shared_ptr<std::vector<signed_transaction>>& trxs, size_t index, const std::function<void(const fc::exception_ptr&)>& next ) {chain_plugin& cp = app().get_plugin<chain_plugin>();cp.accept_transaction( packed_transaction(trxs->at(index)), [=](const fc::static_variant<fc::exception_ptr, transaction_trace_ptr>& result){if (result.contains<fc::exception_ptr>()) {next(result.get<fc::exception_ptr>());} else {if (index + 1 < trxs->size()) {push_next_transaction(trxs, index + 1, next);} else {next(nullptr);}}});}

packed_transaction函数,set_transaction函数以及pack_transaction函数的代码都属于本插件源码之外的EOS库源码,由于本身代码量也较少,含义在上面已经完全解释过了,这里不再粘贴源码。

accept_transaction函数也是EOS的库源码

void chain_plugin::accept_transaction(const chain::packed_transaction& trx, next_function<chain::transaction_trace_ptr> next) {my->incoming_transaction_async_method(std::make_shared<packed_transaction>(trx), false, std::forward<decltype(next)>(next));
}incoming_transaction_async_method(app().get_method<incoming::methods::transaction_async>())

start_generation 接口

该接口的调用方法是:

curl --data-binary '["", 20, 20]' http://localhost:8888/v1/txn_test_gen/start_generation

参数列表为:

  • 第一个参数为 salt,一般用于“加盐”加密算法的值,这里我们可以留空。
  • 第二个参数为 period,发送交易的间隔时间,单位为ms,这里是20。
  • 第三个参数为 batch_size,每个发送间隔周期内打包交易的数量,这里也是20。

翻译过来就是:每20ms提交20笔交易。

接下来,以start_generation 函数为入口进行源码分析。

start_generation 函数

  • 校验:

    • period的取值范围为(1, 2500)
    • batch_size的取值范围为(1, 250)
    • batch_size必须是2的倍数,batch_size & 1结果为假0才可以,这是一个位运算,与&,所以batch_size的值转为二进制时末位不能为1,所以就是2的倍数即可。
    • 对标志位running的控制。

这部分代码展示如下:

if(running)throw fc::exception(fc::invalid_operation_exception_code);
if(period < 1 || period > 2500)throw fc::exception(fc::invalid_operation_exception_code);
if(batch_size < 1 || batch_size > 250)throw fc::exception(fc::invalid_operation_exception_code);
if(batch_size & 1)throw fc::exception(fc::invalid_operation_exception_code);running = true;
  • 定义两个action,分别是:

    • 账户txn.test.a给txn.test.b转账1000枚CUR
    • txn.test.b转给txn.test.a同样1000枚CUR

这部分代码展示如下:

//create the actions here
act_a_to_b.account = N(txn.test.t);
act_a_to_b.name = N(transfer);
act_a_to_b.authorization = vector<permission_level>{{name("txn.test.a"),config::active_name}};
act_a_to_b.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string(fc::format_string("{\"from\":\"txn.test.a\",\"to\":\"txn.test.b\",\"quantity\":\"1.0000 CUR\",\"memo\":\"${l}\"}", fc::mutable_variant_object()("l", salt))));act_b_to_a.account = N(txn.test.t);
act_b_to_a.name = N(transfer);
act_b_to_a.authorization = vector<permission_level>{{name("txn.test.b"),config::active_name}};
act_b_to_a.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string(fc::format_string("{\"from\":\"txn.test.b\",\"to\":\"txn.test.a\",\"quantity\":\"1.0000 CUR\",\"memo\":\"${l}\"}", fc::mutable_variant_object()("l", salt))));

接下来,是对参数period和batch_size的储存为结构体作用域的变量以供结构体内其他函数调用,然后打印日志,最后调用arm_timer函数。

timer_timeout = period; // timer_timeout是结构体的成员变量
batch = batch_size/2; // batch是结构体的成员变量
ilog("Started transaction test plugin; performing ${p} transactions every ${m}ms", ("p", batch_size)("m", period));
arm_timer(boost::asio::high_resolution_timer::clock_type::now());

arm_timer 函数

从start_generation 函数过来,传入的参数是当前时间now,该函数主要功能是对计时器的初始化操作(计时器与文首的stop_generation函数中的关闭计时器呼应)。具体内容可分为两部分:

  • 设定计时器的过期时间,值为start_generation 接口的参数period与now相加的值,即从现在开始,过period这么久,当前计时器对象timer就过期。
  • 设定计时器的异步定时任务,任务体直接调用send_transaction函数,对函数的返回值进行处理,如果有报错信息(一般是服务中止)则调用stop_generation函数关闭插件。

注意stop_generation函数关闭的是定时任务的无限递归,中止定时任务,停止发送测试交易。但它并没有停止插件服务,我们仍旧可以通过再次请求插件接口启动无限测试交易。

这部分代码如下:

void arm_timer(boost::asio::high_resolution_timer::time_point s) {timer.expires_at(s + std::chrono::milliseconds(timer_timeout));timer.async_wait([this](const boost::system::error_code& ec) {if(!running || ec)return;send_transaction([this](const fc::exception_ptr& e){if (e) {elog("pushing transaction failed: ${e}", ("e", e->to_detail_string()));stop_generation();} else { // 如果没有终止报错,则无限递归调用arm_timer函数,递归时传入的参数代替上面的now是当前timer对象的过期时间,这样在新的递归调用中,timer的创建会以这个时间再加上period,无间隔继续执行。arm_timer(timer.expires_at());}});});
}

send_transaction 函数

这个函数是本插件的核心功能部分,主要是发送测试交易,对transaction的处理,将我们上面start_generation 函数中设置的两个action打包到transaction中去,以及对transaction各项属性的设置。具体步骤为:

  • 声明trxs,并为其设置大小为start_generation 接口中batch_size的值。
std::vector<signed_transaction> trxs;
trxs.reserve(2*batch); 

接下来,与上面介绍的create_test_accounts 接口的账户准备过程相同,准备私钥公钥,不多介绍。继续准备trx的参数:

  • nonce,是用来赋值context_free_actions的
  • context_free_actions:官方介绍一大堆,总之就是正常action是需要代价的,要确权,要占用主网资源什么的,所以搞了一个context_free_actions,字面意思就是上下文免费的action,这里权当测试用,填入的数据也是随机nonce组装的。
  • abi_serializer,用来序列化abi的,传入的system_account_name的abi值,它是在这里被赋值,然而是在结构体的作用域中被调用的。
  • reference_block_num的处理,引用区块,上面我们也提到过,而这里面增加了一层判断,是根据标志位txn_reference_block_lag的值来比较,也就是说reference_block_num最后的值是最新区块号减去txn_reference_block_lag的值,但是最小值为0,不可为负数。
  • 通过reference_block_num获得reference_block_id

这部分代码如下:

controller& cc = app().get_plugin<chain_plugin>().chain();
auto chainid = app().get_plugin<chain_plugin>().get_chain_id();fc::crypto::private_key a_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'a')));
fc::crypto::private_key b_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'b')));static uint64_t nonce = static_cast<uint64_t>(fc::time_point::now().sec_since_epoch()) << 32;
abi_serializer eosio_serializer(cc.db().find<account_object, by_name>(config::system_account_name)->get_abi());uint32_t reference_block_num = cc.last_irreversible_block_num();
if (txn_reference_block_lag >= 0) {reference_block_num = cc.head_block_num();if (reference_block_num <= (uint32_t)txn_reference_block_lag) {reference_block_num = 0;} else {reference_block_num -= (uint32_t)txn_reference_block_lag;}
}block_id_type reference_block_id = cc.get_block_id_for_num(reference_block_num);

接下来,就是循环打包trx,我们设置的batch_size好比是20,现在我们已有两个action,每个action对应一个trx,则循环只需要执行10次,每次执行两个trx即可实现,每个trx相关的属性在上一阶段都已准备好。直接看代码吧。

for(unsigned int i = 0; i < batch; ++i) {{signed_transaction trx;trx.actions.push_back(act_a_to_b);trx.context_free_actions.emplace_back(action({}, config::null_account_name, "nonce", fc::raw::pack(nonce++)));trx.set_reference_block(reference_block_id);trx.expiration = cc.head_block_time() + fc::seconds(30);trx.max_net_usage_words = 100;trx.sign(a_priv_key, chainid);trxs.emplace_back(std::move(trx));}{signed_transaction trx;trx.actions.push_back(act_b_to_a);trx.context_free_actions.emplace_back(action({}, config::null_account_name, "nonce", fc::raw::pack(nonce++)));trx.set_reference_block(reference_block_id);trx.expiration = cc.head_block_time() + fc::seconds(30);trx.max_net_usage_words = 100;trx.sign(b_priv_key, chainid);trxs.emplace_back(std::move(trx));}
}

最后,执行

push_transactions(std::move(trxs), next);

这个部分与create_test_accounts 接口发起请求的部分一致,这里不再重复展示。

总结

到这里为止,我们已经完全分析透了txn_test_gen_plugin 插件的内容。本文首先从大体上介绍了插件的架构,生命周期,通讯请求与返回。接着介绍了核心结构体的内容,然后以对外接口为入口,沿着一条线将每个功能的实现完整地研究清楚。通过本文的学习,我们对于EOS插件的体系有了初步深刻的理解,同时我们也完全搞清楚了txn_test_gen_plugin 插件的功能,以及它为什么会达到一个比较高的tps的表现。

参考资料

  • EOSIO/eos
  • eos官方文档

更多文章请转到醒者呆的博客园。

转载于:https://www.cnblogs.com/Evsward/p/txn_test_gen_plugin.html

【源码解读】EOS测试插件:txn_test_gen_plugin.cpp相关推荐

  1. BitXHub 跨链插件(Fabric)源码解读

    前言 趣链科技的BitXHub跨链平台是业界较为完善的跨链开源解决方案,主要通过中继链.网关和插件机制对跨链流程中的功能.安全性和灵活性等进行了优化.本文对BitXHub的meshplus/pier- ...

  2. 目标检测之DarkNet-DarkNet源码解读<一>测试篇

    目标检测-DarkNet源码解读 DarkNet源码解读 1.一些思考  1.1 DarkNet的本质  1.2 深度学习分为两条线  1.3 检测任务的步骤 2.代码走读  2.1 程序入口  2. ...

  3. Feflow 源码解读

    Feflow 源码解读 Feflow(Front-end flow)是腾讯IVWEB团队的前端工程化解决方案,致力于改善多类型项目的开发流程中的规范和非业务相关的问题,可以让开发者将绝大部分精力集中在 ...

  4. Ubuntu 16.04下Caffe-SSD的应用(四)——ssd_pascal.py源码解读

    前言 caffe-ssd所有的训练时的参数,全部由ssd_pascal.py来定义,之后再去调用相关的脚本和函数,所以想要训练自己的数据,首先要明白ssd_pascal.py各个定义参数的大体意思. ...

  5. Amigo 源码解读

    Amigo 源码解读 现在 hotfix 框架有很多,原理大同小异,基本上是基于qq空间这篇文章 或者微信的方案.可惜的是微信的 Tinker 以及 QZone 都没有将其具体实现开源出来,只是在文章 ...

  6. 【JVM】Java类加载器设计原理(ClassLoader源码解读/ SPI机制/ 绕开双亲委派/ 常见Java虚拟机)

    目录 1. 什么是类加载器 2. 类加载器加载的过程 3. Class文件读取来源 4. 类加载器的分类 5. 那些操作会初始化类加载器 6. 类加载器的双亲委派机制 6.1 双亲委派机制机制的好处 ...

  7. 源码解读一:omit.js

    koroFileHeader插件 在插件市场下载koroFileHeader 在setting.json文件中配置一下内容 // 头部注释 "fileheader.customMade&qu ...

  8. Bert系列(三)——源码解读之Pre-train

    https://www.jianshu.com/p/22e462f01d8c pre-train是迁移学习的基础,虽然Google已经发布了各种预训练好的模型,而且因为资源消耗巨大,自己再预训练也不现 ...

  9. PyTorch 源码解读之即时编译篇

    点击上方"AI遇见机器学习",选择"星标"公众号 重磅干货,第一时间送达 作者丨OpenMMLab 来源丨https://zhuanlan.zhihu.com/ ...

  10. php service locator,Yii源码解读-服务定位器(ServiceLocator)

    SL的目的也是解耦,并且非常适合基于服务和组件的应用. Service Locator充当了一个运行时的链接器的角色,可以在运行时动态地修改一个类所要选用的服务, 而不必对类作任何的修改. 一个类可以 ...

最新文章

  1. HTTPS加密越来越流行,为何要加密?
  2. Microtransactions
  3. android防谷歌滑动效果,谷歌是如何做到这一点的?在Android应用程序中滑动ActionBar...
  4. 悄悄安装vcredist_x64.exe,不弹出对话框
  5. matlab中极点留数法,用MATLAB求留数.pdf
  6. PowerBuilder 五子棋
  7. 【零基础】PostgreSQL从入门到精通
  8. 最新QQ搭建代挂系统2.0全新打包内带i优支付在线充值系统
  9. 基于MATLAB的身份证号码的识别算法
  10. 关于ps的图片的批处理
  11. 计算机能连上手机热点却无法连上无线网络,笔记本电脑win10系统无法连接手机热点,却能连上WiFi怎么办?...
  12. C语言中各种格式字符说明
  13. JAVA PDF 转 PNG
  14. Linux 部署开源WAF模块 ModSecurity
  15. 什么是信息增益(Information Gain)
  16. python 爬虫 处理429错误
  17. 基恩士XG-XvisionEditor程序的上传与下载
  18. 渣土车空车未盖盖识别系统 OpenCv
  19. 《EffcativeSTL》
  20. 产品经理(PM)一秒理解MRD、PRD、BRD

热门文章

  1. Android 6.0 Permission权限与安全机制
  2. [leetcode] 题型整理之排列组合
  3. python使用pycurl抓取获取12306验证码
  4. 如何走技术路线的研究生论文?
  5. 注册表屏蔽IE9更新
  6. Linux搜寻文件或目录命令解析
  7. 关于大小端、位域的一些概念详解
  8. Python中在脚本中引用其他文件函数的方法
  9. 本地socket通讯 -转
  10. 蓝桥杯 ALGO-150 算法训练 6-1 递归求二项式系数值 java版