Skip to content

Instantly share code, notes, and snippets.

View huanghantao's full-sized avatar
:octocat:
fighting

codinghuang huanghantao

:octocat:
fighting
View GitHub Profile
@huanghantao
huanghantao / AESUtil.go
Created December 21, 2018 08:54
AESUtil
package AESUtil
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"fmt"
)
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
@huanghantao
huanghantao / RSAUtil.go
Last active March 3, 2019 02:52
RSAUtil
package RSAUtil
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/pem"
"errors"
@huanghantao
huanghantao / parsePkg.go
Last active June 4, 2019 11:14
解析apk应用包的例子
package main
import (
"flag"
"fmt"
"log"
"github.com/shogo82148/androidbinary/apk"
)
@huanghantao
huanghantao / reflect.go
Last active July 5, 2019 05:59
存储反射类型以及执行存储的反射类型的方法
package main
import (
"fmt"
"reflect"
)
var typeRegistry = make(map[string]reflect.Type)
func registerType(typedNil interface{}) {
@huanghantao
huanghantao / topographicalSort.go
Last active January 2, 2020 09:08
拓扑排序--golang
package main
import "fmt"
func main() {
// Directed Acyclic Graph
vertices := map[int][]int{
1: []int{4},
2: []int{3},
3: []int{4, 5},

03 | 右值和移动究竟解决了什么问题?

非const左值引用不能使用右值对其赋值:

std::string& r = std::string(); //错误!std::string()产生一个临时对象,为右值

假设可以的话,就会遇到一个问题:如何修改右值的值?因为引用是可以后续被赋值的。根据上面的定义,右值连可被获取的内存地址都没有,也就谈不上对其进行赋值。

query构造

例子1

"query": {
  "bool": {
    "must": {
      "multi_match": {
        "query": "5833",

C++版本是-std=c++11

#include <iostream>

class Codinghuang
{
public:
    Codinghuang()
    {

vscode配置--golang.md

launch.json文件

主要是代码调试用的。

主函数配置文件:

{

vscode配置--C++.md

C++

c_cpp_properties.json

作用:头文件搜索路径配置。

{