-
CppCon 2020 Template Metaprogramming: Type Traits
Part 1
Jody Hagins
jhagins@maystreet.com
coachhagins@gmail.com
## CppCon 2020 Template Metaprogramming: Type Traits
Introduction
## I ntended Audience Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques
• Type traits part of standard library for ~10 years
## I ntended Audience
• Beginner/Intermediate
• Gentle Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques
• Type traits part of standard library for ~10 years
• Fundamentals have been in use for ~20 years
## I
0 码力 |
403 页 |
5.30 MB
| 1 年前 3
-
Apache Cassandra static column 介绍与实战
假设我们有这样的场景:我们想在 Cassandra 中使用一张表记录用户基本信息(比如 email、密码等)以及用户状态更新。我们知道,用户的基本信息一般很少会变动,但是状态会经常变化,如果每次状态更新都把用户基本信息都加进去,势必会让费大量的存储空间。为了解决这种问题,Cassandra 引入了 static column。同一个 partition partition key 中被声明为 static 的列只有一个值的,也就是只存储一份。
解Spark、Hadoop或者Hbase相关的文章,欢迎关注微信公共帐号:iteblog_hadoop
## 定义 static column
在表中将某个列定义为 STATIC 很简单,只需要在列的最后面加上 STATIC 关键字,具体如下:
CREATE TABLE "iteblog_u #34; (
"username" text,
"id" timeuuid,
"email" text STATIC,
"encrypted_password" blob STATIC,
"body" text,
PRIMARY KEY ("username", "id")
);
it
0 码力 |
5 页 |
0 Bytes
| 2 年前 3
-
## RUST CHINA CONF 2023
第三届中国Rust开发者大会
6.17-6.18 @Shanghai
## Rustle: the first static analyzer for smart contracts in Rust
Matthew Jiang
Director of Security Team @ BlockSec
Outline
1 Motivation world vulnerabilities
## 😍
## Capability
## Rich Detectors
• Each detector can locate one specific type of security issues
- Rustle currently supports 30 different detectors
- For the complete list, refer arithmetic operation|High|
|self-transfer|missing check of sender != receiver|High|
|incorrect-json-type|incorrect type used in parameters or return values|High|
|unsaved-changes|changes to collections are not saved|High|
0 码力 |
28 页 |
4.49 MB
| 2 年前 3
-
## Finding Bugs using Path-Sensitive Static Analysis
## Welcome to CppCon 2021!
Join #visual_studio channel on CppCon Discord https://aka.ms/cppcon/discord
• Meet the Microsoft C++ team
• Ask any questions latest announcements
Take our survey
https://aka.ms/cppcon
## Agenda
• Intro to path-sensitive static analysis
• Path-sensitive checks in MSVC
• A look under the hood
• Upcoming features
• Lessons Lessons learned

## Static Analysis
tor v(5);
[0];
/nologo /analyze:only /analyze:plugin
.cpp(6) : warning C26446: Prefer
0 码力 |
35 页 |
14.13 MB
| 1 年前 3
-
[Image](/uploads/documents/b/c/a/c/bcac5eb4d797200129a99b4651c4aab0/p6_1.jpg)
Cross-site Scripting (XSS) - A type of security vulnerability where attackers inject malicious JavaScript snippets into applications through category. Concurrency issues can easily open up even with simple mistakes, like using the collection type mutableMapOf instead of ConcurrentHashMap.
Another common security vulnerability that falls under command injection attacks.
It is recommended to use fuzz testing in dynamic analysis to address this type of issue. Feeding unexpected input data in an effort to intentionally crash the app, exploit security
0 码力 |
13 页 |
1.80 MB
| 2 年前 3
-
Programming
Static polymorphism
## Generic Programming
Same code works on different, unrelated types
Static polymorphism
## C++ Templates
Same code works on different, unrelated types
Static polymorphism ## template declaration;
declaration can be
• class / struct
• function
• type alias
• variable
• concept
template-parameter is
class | typename identifier [= default-value] org/z/3Kn6exqf5
## Type Alias Template Definition
template using ptr = T*;
template
using result_type = typename std::common_type<
typename st
0 码力 |
175 页 |
1.16 MB
| 1 年前 3
-
manipulated like any other value. The standard example is the type of lists of a given length $ ^{1} $ , Vect n a, where a is the element type and n is the length of the list and can be an arbitrary term contain values, and where those values describe properties, for example the length of a list, the type of a function can begin to describe its own properties. Take for example the concatenation
of two list's length is the sum of the lengths of the two input lists. We can therefore give the following type to the app function, which concatenates vectors:
app : Vect n a -> Vect m a -> Vect (n + m)
0 码力 |
223 页 |
1.21 MB
| 2 年前 3
-
## GARMIN $ ^{®} $
## Back to Basics
## Casting
Or: how to subvert the
type system
## An Introduction
struct region { int size; };
void init_region(char* backing_buffer, size_t buffer_size) {
Why do we need casts?
## I T'S ABOUT THE BITS
## What is a
Type?
0x43
0x50
0x50
0x43
0x4F
0x4E
0x21
0x00
## What is a
Type?
0x50
0x50
int[2]
0x43
0x4F
0x4E
0x21
0x00
Value $ ^{*} v142
## What is a
Type?
| 0x43 | 0x50 | 0x50 | 0x43 | 0x4F | 0x4E | 0x21 | 0x00 |
| Type | Value 0 码力 |
117 页 |
1.57 MB
| 1 年前 3 -
[Image](/uploads/documents/8/b/f/4/8bf4eba330312939310c1e875bc9454a/p1_4.jpg)
## What problem does it solve?
Q Type / to search
Code Issues 3 Pull requests 1 Actions Projects Security Insights
reflect Public
Q Go krzysztof-jusiak [README]
Add file
[README] README.md -> reflect
[README]
Code
About
C++20 Static Reflection library
444d020 - 3 weeks ago 287 Commits
.github
reflection meta-programming cpp20
10 watching
// Overview / Examples / API / FAQ
14 forks
Report repository
## REFLECT: C++20 Static Reflection library
license MIT release v1.2.3 build try it online
https://en.wikipedia.org/wik 0 码力 |
12 页 |
1.47 MB
| 1 年前 3 -
Tokens 19
1.3 Syntax grammar 23
1.4 Documentation comments 42
2 Type system 43
Glossary 43
Introduction 44
2.1 Type kinds 45
2.1.1 Built-in types 46
kotlin.Any 46
kotlin.Nothing 46 types 48
2.1.3 Type parameters ..... 50
Function type parameters ..... 51
Mixed-site variance ..... 51
Declaration-site variance ..... 52
Use-site variance ..... 54
2.1.4 Type capturing .... . 55
2.1.5 Type containment ..... 60
2.1.6 Function types ..... 61
Suspending function types ..... 62
2.1.7 Flexible types ..... 63
Dynamic type ..... 64
Platform types ..... 64
2.1.8 Nullable 0 码力 |
310 页 |
1.39 MB
| 2 年前 3
|