package main import ( "fmt" "time" ) func main() { ch := make(chan int) quit := make(chan bool) go func() { for{ select { case num := <-ch: fmt.Printl... ...
分类:
其他好文 时间:
2019-12-21 00:26:03
阅读次数:
66
time limit per test3 secondsmemory limit per test256 megabytesinput: standard inputoutput: standard output You are given a non-empty string s=s1s2…sn, ...
分类:
其他好文 时间:
2019-12-20 23:54:14
阅读次数:
181
C Berry Jam 题意:给2n个罐子,分别是[1,2n],站在[n,n+1]的中间,吃掉包含这个点的左边连续一段和右边连续一段,使得剩下的罐子红色的和蓝色的数量相等。吃最少的罐子。 题解:把红色蓝色变成+1和 1,那么就把左边的前缀和插进map里面,然后右边的后缀和在map里面查询相反数,查到 ...
分类:
其他好文 时间:
2019-12-20 20:13:58
阅读次数:
65
服务启动脚本(初始化、启动、登录) #!/bin/bash export PID=/usr/local/nestdb_master/bin/mysqld export PASSWORD=123456 function status() { ps -ef | grep -v 'grep'|grep $ ...
分类:
数据库 时间:
2019-12-20 16:52:06
阅读次数:
198
记一笔MyBatis的坑 1、sql查询concat()连接函数xml运行查询乱码 1 select concat(CONVERT(round(count(case when sq.LOANOVERDUE = 'Y' then 1 else null end) / count(1) * 100, 2 ...
分类:
其他好文 时间:
2019-12-20 16:46:17
阅读次数:
82
Testproject Testsuite Testcase 1、创建测试项目 打开RIDE,点击File New Project,选择项目路径,填入项目名称 2、右键点击新建的测试项目,选择New Suite,新建测试套件 3、右键点击测试套件,选择New Test Case,输入测试用例名称即可 ...
分类:
其他好文 时间:
2019-12-20 13:47:27
阅读次数:
75
今天要给大家说的是策略模式。先不做解释,先看代码,体会一下策略模式的神奇。 修改前的代码 大家日常开发中一定见过类似上面的场景吧,写了那么多if else或者用switch case,看着都让人头晕。现在让我们给他来个大变身吧。数码宝贝究极进化。 修改后的代码 首先定义一个支付策略接口,所有的支付方 ...
分类:
其他好文 时间:
2019-12-20 12:15:52
阅读次数:
85
优雅关闭web服务 DBHelper, err = gorm.Open("mysql", "root:root@(115.159.59.129:3306)/test?charset=utf8&parseTime=True&loc=Local") if err != nil { log.Fatal("... ...
分类:
Web程序 时间:
2019-12-20 01:07:30
阅读次数:
153
-r or -R is recursive,-n is line number, and-w stands for match the whole word.-l (lower-case L) can be added to just give the file name of matching f ...
分类:
其他好文 时间:
2019-12-19 23:43:21
阅读次数:
133
这道题差点把我写哭,主要还是自己考虑的不够全面,先看一下题,我再说一下坑。 给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: A?1?? = 能被 5 整除的数字中所有偶数的和; A?2?? = 将被 5 除后余 1 的数字按给出顺序进行交错求和,即计算 n?1???n?2??+n ...
分类:
其他好文 时间:
2019-12-19 22:55:03
阅读次数:
76