06 2020 档案

摘要:#define assert_static(e) do{ enum{ assert_static__ = 1 / (e) }; } while(0)template<typename T, typename U>int bit_copy(T& a, U& b) { assert_static(siz 阅读全文
posted @ 2020-06-30 17:20 zJanly 阅读(179) 评论(0) 推荐(0) 编辑
摘要:int m=9;struct C{ int f() const{ return ++e; }private: mutable int e; static int d;};int C::d = 2;int main(int argc, char *argv[]){ int c = 4; std::co 阅读全文
posted @ 2020-06-30 16:47 zJanly 阅读(328) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/8df45004bbcb #include <stdio.h>#include <pthread.h>#include <unistd.h>thread_local int a = 0;void* f(void *){ static int i=1 阅读全文
posted @ 2020-06-30 15:30 zJanly 阅读(169) 评论(0) 推荐(0) 编辑
摘要:https://en.cppreference.com/w/ The zero-overhead principle is a C++ design principle that states: You don't pay for what you don't use. What you do us 阅读全文
posted @ 2020-06-30 13:46 zJanly 阅读(145) 评论(0) 推荐(0) 编辑
摘要:#include "stdio.h"struct A{ virtual ~A(){ printf("ok"); } virtual int f() = 0;};struct B: virtual public A{ int f(){ return 4; }};struct C: virtual pu 阅读全文
posted @ 2020-06-29 16:20 zJanly 阅读(257) 评论(0) 推荐(0) 编辑
摘要:https://studygolang.com/articles/11860 协程栈详细布局 我们前面说到,在创建一个协程时就为其创建了一个初始的栈,用来执行函数调用。协程栈的大概布局情况如下: 这里不仅弄出了stackGuard,还弄了一个stackLimit,至于它们有什么用途,我们会在下面仔细 阅读全文
posted @ 2020-06-24 17:07 zJanly 阅读(242) 评论(0) 推荐(0) 编辑
摘要:#include "stdio.h"//typedef struct {void *_, __;} interface;typedef void * interface[2];#define DATA(interface) *(void **)((char *)(interface) + sizeo 阅读全文
posted @ 2020-06-24 15:55 zJanly 阅读(92) 评论(0) 推荐(0) 编辑
摘要:sudo chmod +s /usr/bin/gdb 阅读全文
posted @ 2020-06-24 11:38 zJanly 阅读(255) 评论(0) 推荐(0) 编辑
摘要:在c++中,当我们定义一个类的时候,如果我们什么都不定义的时候,c++编译器会默认的为我们生成一些函数。 例如定义一个Example类。 class Example{ }; 当我们定义一个Example类的时候,不定义任何操作的时候,c++编译系统将为Example类生成如下默认操作函数: 1. 默 阅读全文
posted @ 2020-06-23 17:24 zJanly 阅读(364) 评论(0) 推荐(0) 编辑
摘要:1. 多继承 1.1 多继承概念 一个类有多个直接基类的继承关系称为多继承 多继承声明语法 class 派生类名 : 访问控制 基类名1, 访问控制 基类名2, ... { 数据成员和成员函数声明 }; 类 C 可以根据访问控制同时继承类 A 和类 B 的成员,并添加自己的成员: 1.2 多继承的派 阅读全文
posted @ 2020-06-23 09:20 zJanly 阅读(648) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/718c24af400f int r=0; r=set_noblock(socket_); if((r=connect(socket_, (struct sockaddr*)addr, sizeof(sockaddr_in_t))) <0){ in 阅读全文
posted @ 2020-06-22 17:16 zJanly 阅读(181) 评论(0) 推荐(0) 编辑
摘要:前言最近在复习一些 C++基础知识,写了一些 C++的代码,当我在类中定义了虚函数并且直接在类定义内部实现这些虚函数时,编译器就会报警告:’xxx‘ has no out-of-line virtual method definitions;its vtable will be emitted in 阅读全文
posted @ 2020-06-19 14:09 zJanly 阅读(499) 评论(0) 推荐(0) 编辑
摘要:避免未定义行为(使用引用时的未定义行为)一个变量在使用const_cast去掉指针或者引用的const限定符后,“如果常量本身不是常量,获得的权限是合法的, 如果本身是常量,使用const_cast再写的后果是未定义的。”int main(){ const int a = 1; int & b = 阅读全文
posted @ 2020-06-19 14:07 zJanly 阅读(352) 评论(0) 推荐(0) 编辑
摘要:http://tinylab.org/myths-about-urandom/ Chen Jie 创作于 2015/06/27 打赏 原文:Myths about /dev/urandom 作者:Thomas Hühn 译者:Chen Jie 1 译之前言 你知道 /dev/random 与 /de 阅读全文
posted @ 2020-06-18 09:41 zJanly 阅读(416) 评论(0) 推荐(0) 编辑
摘要:https://hyperledger-fabric.readthedocs.io/en/v0.6/API/AttributesUsage.html?highlight=transaction%20certificate https://hyperledger-fabric.readthedocs. 阅读全文
posted @ 2020-06-17 13:34 zJanly 阅读(171) 评论(0) 推荐(0) 编辑
摘要:https://www.cntofu.com/book/73/ch2-cgo/ch2-02-basic.md // #cgo CFLAGS: -DPNG_DEBUG=1 -I./include // #cgo LDFLAGS: -L/usr/local/lib -lpng // #include < 阅读全文
posted @ 2020-06-12 10:34 zJanly 阅读(262) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/40c4ba729eac package mainimport ( "context" "fmt" "time")func emain() { d := time.Now().Add(1 * time.Second) ctx, cancel := 阅读全文
posted @ 2020-06-11 13:52 zJanly 阅读(166) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/e5df3cd0708b Context背景 和 适用场景 golang在1.6.2的时候还没有自己的context,在1.7的版本中就把golang.org/x/net/context包被加入到了官方的库中。golang 的 Context包,是 阅读全文
posted @ 2020-06-11 11:23 zJanly 阅读(269) 评论(0) 推荐(0) 编辑
摘要:https://github.com/ZtesoftCS/go-ethereum-code-analysis/ https://www.jianshu.com/p/a6a45fd0597d 阅读全文
posted @ 2020-06-10 16:45 zJanly 阅读(210) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/qcblog/p/8998045.html http://www.doc88.com/p-0971398500383.html https://wenku.baidu.com/view/65d4db50be23482fb4da4c13.html 一、概 阅读全文
posted @ 2020-06-10 14:20 zJanly 阅读(507) 评论(0) 推荐(0) 编辑
摘要:https://wenku.baidu.com/view/e02b6b7a591b6bd97f192279168884868662b864.html 阅读全文
posted @ 2020-06-09 17:00 zJanly 阅读(140) 评论(0) 推荐(0) 编辑
摘要:众所周知,为了保障商用密码的安全性,国家商用密码管理办公室制定了一系列密码标准,包括SM1(SCB2)、SM2、SM3、SM4、SM7、SM9、祖冲之密码算法(ZUC)那等等。 其中SM1、SM4、SM7、祖冲之密码(ZUC)是对称算法;SM2、SM9是非对称算法;SM3是哈希算法。目前,这些算法已 阅读全文
posted @ 2020-06-09 09:54 zJanly 阅读(1430) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/liangjisheng/article/details/79435139 回顾 - 什么是群 一、定义 定义1 设G是定义了一个二元运算+的集合,如果这个运算满足下列性质: (1)封闭性——如果a和b都属于G,则a+b也属于G。 (2)结合律——对于G中 阅读全文
posted @ 2020-06-08 10:26 zJanly 阅读(7999) 评论(0) 推荐(1) 编辑
摘要:1,要熟悉超奇异椭圆曲线域上群元素数学性质,比如:E(x,y):y^2=x^3+x这种椭圆曲线,每个群元素都是椭圆曲线上的点,比如P(x,y),那么这个P就可以抽象表示成图中定义里面的g,u,v等。2,要学习这种基于椭圆曲线上加法和点乘的运算原理。3,有了以上基础,就可以了解配对运算的原理了,比如w 阅读全文
posted @ 2020-06-03 14:27 zJanly 阅读(7478) 评论(0) 推荐(0) 编辑
摘要:openssl speed [md2] [mdc2] [md5] [hmac] [sha1] [sha256] [sha512] [whirlpool] [rmd160] [idea-cbc] [seed-cbc] [rc2-cbc] [rc5-cbc] [bf-cbc] [des-cbc] [de 阅读全文
posted @ 2020-06-03 13:47 zJanly 阅读(468) 评论(0) 推荐(0) 编辑
摘要:https://tools.ietf.org/html/rfc8032#section-5.1.7package mainimport ( "crypto/ecdsa" "crypto/ed25519" "crypto/elliptic" "crypto/rand" "fmt" "time")fun 阅读全文
posted @ 2020-06-03 10:54 zJanly 阅读(144) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示