摘要: 问题描述(转换为矩阵形式): n行n列的矩阵,每一行,每一列,没有斜线,只能有一个1,对应情况有多少种? 1.回溯法 用三个map分别记录每一列,没一正斜线和每一反斜线中是否有1 columnMap[int]byte,flag1Map[int]byte,flag2Map[int]byte 由于矩阵为 阅读全文
posted @ 2018-01-13 15:59 孤独风中一匹狼 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 由于想给一个结构体的部分成员赋值,但是有不知道具体名字,故将tag的json名字作为索引,按照json名字来一一赋值 2.通过结构体字段名称进行反射 阅读全文
posted @ 2017-11-05 22:30 孤独风中一匹狼 阅读(12566) 评论(0) 推荐(3) 编辑
摘要: 二、limit用法 1.分页 设页数为page ,每页记录为a select * from table limit (page-1)*a 阅读全文
posted @ 2017-10-21 21:43 孤独风中一匹狼 阅读(6131) 评论(0) 推荐(0) 编辑
摘要: 1. 安装nsq brew install nsq 2.启动nsq https://nsq.io/overview/quick_start.html 3.golang client 输出: 2018/07/30 12:14:27 INF 2 [fwd/ch1] (127.0.0.1:4150) co 阅读全文
posted @ 2017-10-08 13:59 孤独风中一匹狼 阅读(2407) 评论(0) 推荐(0) 编辑
摘要: 大致思路:序列化未知json放入一个interface{}中再通过反射将其内容解析出来 阅读全文
posted @ 2017-09-09 15:15 孤独风中一匹狼 阅读(1017) 评论(0) 推荐(0) 编辑
摘要: 测试文本test.txt 实验结果result.sql 阅读全文
posted @ 2017-08-27 18:01 孤独风中一匹狼 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1.datetime 时区转换:convert_tz(dt,from_tz,to_tz) SELECT convert_tz(utc_timestamp(), '+00:00', '+08:00') 得到当前东八区时间 时间格式化 date_format(operation_time,'%Y-%m-%d %H:%i') SELECT date_format(convert_tz(utc_time... 阅读全文
posted @ 2017-08-27 17:45 孤独风中一匹狼 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 描述:9*9的方格,每一行每一列必须是1~9,每一个单元的3*3方格必须是1~9 阅读全文
posted @ 2017-08-20 00:13 孤独风中一匹狼 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 描述: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Yo 阅读全文
posted @ 2017-08-19 14:48 孤独风中一匹狼 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目描述: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes 阅读全文
posted @ 2017-08-19 14:42 孤独风中一匹狼 阅读(198) 评论(0) 推荐(0) 编辑