-
数据结构:环形链表-约瑟夫环
定义节点 type CircularNode struct { No int Next *CircularNode } 定义环形链表 typ
2021-01-21, Views: 2027 , Topics: 数据结构
-
数据结构:双向链表
定义双向节点 type DoublyNode struct { No int Name string Pre *DoublyNod
2021-01-20, Views: 1644 , Topics: 数据结构
-
数据结构:单向链表
定义单链表结构体 定义了HeadNode头节点。 type SinglyLinkedList struct { HeadNode *Node } 定义节
2021-01-19, Views: 2294 , Topics: 数据结构
-
数据结构:队列-数组实现
非循环 当head和tail索引到最后一位时,队列将无法再使用。 func main() { queue := &ArrayQueue{arr:
2021-01-18, Views: 2270 , Topics: 数据结构
-
数据结构:稀疏数组
定义 稀疏固定有3列。 第一行为记录二维数组信息:第一行第一个元素为二维数组的行,第一行第二个元素为二维数组的列,第一行第三个元素为二维数组的非0个数。 第二行
2021-01-17, Views: 2061 , Topics: 数据结构
-
Go flag 使用
用途 使用命令行时指定字段赋值,类似Spring Boot以jar包方式启动时根据不同环境设置不同值。 示例 var s string var show bo
2021-01-14, Views: 3106 , Topics: Go
-
Go 类型断言和类型转换
示例 func main() { var i interface{} = "hello" s := i.(string) fmt.Pr
2021-01-13, Views: 1891 , Topics: Go
-
Go 中的注释
单行注释 // Add return a and b's sum func Add(a, b int) int { return a + b } //
2021-01-12, Views: 2786 , Topics: Go
-
GoLand 提示 Receiver has generic name
错误信息 The name of a method's receiver should be a reflection of its identity; of
-
Spring Boot使用 Jackson 注解
示例 Bean @Data //@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonIncl
2021-01-07, Views: 2189 , Topics: Spring Boot Jackson JSON
-
Linux tcpdump 保存为 pcap 文件
说明 pcap文件可适用Wireshark软件打开。 查看网卡 ifconfig 输出 eth0 Link encap:Ethernet HWadd
-
PostgreSQL distinct 和 distinct on 区别
数据 city空值的为null z-blog=# select city, id, ip from ip_pool; city | id |
2021-01-05, Views: 2567 , Topics: PostgreSQL
-
PostgreSQL update from 根据 A 表更新 B 表
准备工作 -- 创建表1 create table t1(id integer, name text); -- 创建表2 create table t2(id
2021-01-04, Views: 5186 , Topics: PostgreSQL
-
PostgreSQL 查询表中的自增序列名称
SQL 使用pg_get_serial_sequence函数,第一个参数为需要查询的表,第二个参数为自增的列。 select pg_get_serial_seq
2020-12-31, Views: 7164 , Topics: PostgreSQL
-
PostgreSQL 查看时区
查看当前时区 show timezone; 或者 show time zone; 查看内置时区 所有时区 select * from pg_timezone_n
2020-12-30, Views: 12352 , Topics: PostgreSQL
-
Linux 文件删除后未释放空间解决办法
现象 文件删除后,磁盘空间未释放。 排查 使用lsof命令查看哪些文件已经被删除,而系统扔持有该文件的句柄未释放(其他进程中正在使用该文件)。 lsof | g
-
Linux tcpdump: no suitable device found
权限不够 使用root用户,或sudo sudo tcpdump
-
Spring Boot logback springProfile 区分部署环境
springProfile 读取spring.profiles.active设置的值,设置不同环境的不同逻辑。 固定值 dev:当spring.profiles
2020-12-25, Views: 11666 , Topics: logback Spring Boot
-
Spring Boot logback springProperty 设置默认值
springProperty 当没有读取到source字段中设置的log.path值时,设置为defaultValue字段中的${user.dir}/logs变
2020-12-24, Views: 7413 , Topics: logback Spring Boot
-
Spring Boot logback 设置默认值
使用 :- 设置默认值 ${A:-B} 如:${java.io.tmpdir:-/tmp}表示取java.io.tmpdir的值,如果没有值设置为/tmp。 $
2020-12-23, Views: 3490 , Topics: logback Spring Boot