golang在函数中改变slice值 package mainimport ( "fmt" "time")func main() { registerChan:=make(chan string) go func(){ registerChan<-"hi" }() go func(){ registerChan<-"hello" }() sch
git 合并本地两个分支 常常会遇到提pr之后,迟迟没有被审阅合并,又需要集成测试的情况,这时候就需要在本地将几个分支合并到一个临时分支tmp 方法1:git merge br1 br2 方法2:git rebase br1 br2
golang reflection Golang的reflection基础概念整理:package mainimport ( "fmt" "reflect")func main() { type MyInt int var x MyInt = 7 v := reflect.ValueOf(x) fmt.Println("v.Kind(): ",v.Kind()) fmt.Pri
git删除中间某个commit 1.git log获取commit信息 2.git rebase -i (commit-id) commit-id 为要删除的commit的下一个commit号 3.编辑文件,将要删除的commit之前的单词改为drop 4.保存文件退出大功告成 5.git log查看
golang url parameters中包含array url parameter中这样定义:arrayname=…&arrayname=…package mainimport ( "fmt" "net/url")func main() { v := url.Values{} v.Set("name", "Ava") v.Add("friend", "Jess") v.Add("friend", "Sar
.h .lib .dll文件作用和区别 简而言之(1).h是头文件,lib和dll都是库文件。(2)头文件包含声明,库文件则包含实现。(3)lib是静态链接时使用的,如果采用静态链接库,则lib包含了实际执行代码和符号表等,无论你愿不愿意,lib 中的指令都全部被直接包含在最终生成的 EXE 文件中了(因此比较耗费内存)。dll用于动态链接,该 dll 不必被包含在最终 EXE 文件中,EXE 文件执行时
rabbitmq的模型 AMQP 0-9-1 Model in Brief The AMQP 0-9-1 Model has the following view of the world: messages are published to exchanges, which are often compared to post offices or mailboxes. Exchanges then distribut
golang noblocking send // Basic sends and receives on channels are blocking.// However, we can use `select` with a `default` clause to// implement _non-blocking_ sends, receives, and even// non-blocking multi-way `select`
git pull request下有多个commit 如果pull request没有合并,那么每次git commit 都会在该pr下生成一个新的commit,若是git commit --amend那么就是追加在上次的commit下。还有一种可能是本地代码不是最新的,然后提交git commit;git push,发现pr下包含了上次的commit,那么解决方案是拉取最新代码,然后rebase,再git push -f
spring boot起手式踩的坑 通过start.springboot.io生成了一个springboot项目架构,但是以java application形式启动程序时候,总是自动关闭服务,tomcat也没有起起来报如下错误:44:27.566 INFO 9440 --- [ Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springf
mongodb中用$set实现集合 正确方式: db.test.update({"_id":ObjectId("58525e16c409e14404a071a7")}, {$set: {'ids.id1': 1}})不成功的方式 db.test.update({"_id":ObjectId("58525e16c409e14404a071a7")}, {'ids.id1': 1})
唯一性索引的意义 原文转自:http://blog.itpub.net/17203031/viewspace-700089/索引是我们经常使用的一种数据库搜索优化手段。适当的业务操作场景使用适当的索引方案可以显著的提升系统整体性能和用户体验。在Oracle中,索引有包括很多类型。不同类型的索引适应不同的系统环境和访问场景。其中,唯一性索引Unique Index是我们经常使用到的一种。 唯一性索引uni
go命令中的三个点含义 An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and strings containing slashes. Such a pattern expands to all p
golang中踩的坑 笔者用iris做为web framework,controller中自定义一个struct用于接受body参数:var ( params struct { Docs []map[string]interface{} } ) err := ctx.ReadJSON(¶ms)上文是正确写法,如果将Docs的第一个字母改为小写,那么就会取不到参数很细节的东西但是排查起来很难
qt helloworld遇到的问题 在根目录下创建 一个文件夹,名称为hello,在该文件夹下创建一个hello.cpp文件,内容如下:#include QApplication>#include int main(int argc, char **argv){ QApplication a(argc, argv); QLabel mylabel("Hello the World"); mylabel.sh
设置mongodb定时清除文章 转自:http://www.cnblogs.com/huangxincheng/p/5718038.html 现在我想大家对ttlIndex有了大概的认识了,下面我们看看怎么创建,我使用的GUI工具是robomongo,大家可以在官网上下载一下即可。。。然后我们要查询一下https://docs.mongodb.com/manual/reference/method/db.c
jwt 八幅漫画理解使用JSON Web Token设计单点登录系统原文http://blog.leapoahead.com/2015/09/07/user-authentication-with-jwt/上次在 《JSON Web Token - 在Web应用间安全地传递信息》 中我提到了JSON Web Token可以用来设计单点登录系统。我尝试用八幅漫画先让大家理解如
<link>标签中的rel="sheetstyle"含义 rel是relationship的英文缩写stylesheet中style是样式的意思,sheet是表格之意,总起来是样式表的意思rel="stylesheet" 描述了当前页面与href所指定文档的关系.即说明的是,href连接的文档是一个新式表
程序员常去网站 w3school.com.cn(web开发|初级)csdn.net(综合|初中级)cnblogs.com(综合|中级)oschina.net(综合|中级)iteye.com(偏java|中级)51cto.com(偏服务端|中级)html-js.com(前端|初中级)html5cn.org(前端|初中级)infoq.com(综合|高级)