三少GG

解决一些遇到的小麻烦
私信 关注
三少GG
码龄12年

解决一些遇到的小麻烦

  • 3,554,139
    被访问量
  • 455
    原创文章
  • 506
    作者排名
  • 762
    粉丝数量
  • 毕业院校 北京大学
  • 目前就职 腾讯
  • 于 2009-04-05 加入CSDN
获得成就
  • 获得138次点赞
  • 内容获得292次评论
  • 获得322次收藏
荣誉勋章
兴趣领域
  • #算法
    #CV(computer vision)#TensorFlow#推荐算法
TA的专栏
  • golang
    22篇
  • 云计算/大数据
    94篇
  • IOS 常规
    23篇
  • Android 常规
    47篇
  • 重构Java
    15篇
  • 重构C/C++
    150篇
  • 技术面经
    19篇
  • Coding实战
    13篇
  • Web网站设计
    81篇
  • Android 多媒体
    56篇
  • PKU Research
    64篇
  • 开源硬件Raspberry
    17篇
  • 流媒体基础
    51篇
  • Ubuntu/OS X系统
    101篇
  • 杂记/八卦
    65篇
  • 最近
  • 文章
  • 资源
  • 问答
  • 课程
  • 帖子
  • 收藏
  • 关注/订阅

Mysql报错:Your password has expired. To log in

https://stackoverflow.com/questions/33387879/mysql-password-expired-cant-connectMySQL password expiryResetting the password will only solve the problem temporarily. From MySQL 5.7.4 to 5.7.10 (...
翻译
405阅读
0评论
0点赞
发布博客于 2 年前

/run/udev/data 磁盘满

临时办法:https://groups.google.com/forum/m/#!topic/nomad-tool/6L6QbL6QzY4 I've run 'udevadm info --cleanup-db' which has resolved the issue.  未查明具体原因。 
原创
1159阅读
0评论
1点赞
发布博客于 2 年前

/run/udev/data 磁盘满

临时办法:https://groups.google.com/forum/m/#!topic/nomad-tool/6L6QbL6QzY4 I've run 'udevadm info --cleanup-db' which has resolved the issue.  未查明具体原因。 
原创
1159阅读
0评论
1点赞
发布博客于 2 年前

golang map并发读写

对应报错:fatal error: concurrent map writesfatal error: concurrent map read and map writehttps://wrfly.kfd.me/posts/read-and-write-in-high-concurrency/http://colobu.com/2017/07/11/dive-into-sync-Map/https...
原创
966阅读
0评论
1点赞
发布博客于 3 年前

docker "No ElasticSearch Node Available"

原因: https://github.com/olivere/elastic/issues/312外网访问的解决办法: https://github.com/olivere/elastic/wiki/Docker其余尝试(不太妥当):Automatically set `network.publish_host` during startuphttps://github.com/docker-li...
原创
2264阅读
0评论
1点赞
发布博客于 3 年前

ElasticSearch Web GUI配置

一. ElasticHQhttps://github.com/ElasticHQ/elasticsearch-HQError message was:- Unable to Connect to Server! Received Status Code: 0. A status code of 0, could mean the host is unreachable or nothing is ...
原创
5183阅读
0评论
0点赞
发布博客于 3 年前

elasticsearch docker安装

必看:https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.htmlhttp://www.xiaozhugrape.com/2018/03/29/elasticsearch%E6%9C%AC%E5%9C%B0%E5%AE%89%E8%A3%85docker%E5%AE%89%E8%A3%85/1. 在配置阶段:...
原创
2420阅读
0评论
1点赞
发布博客于 3 年前

蓝屏0x0000007B

基础原因:蓝屏停机码7B的出错案列比较多,这是一个和硬盘有关的故障,所以只要从这方面去逐一排障即可https://jingyan.baidu.com/article/c14654139672b90bfcfc4ce1.htmlstop:OXOOOOOO7B(硬盘蓝屏)蓝屏故障:1.硬盘随着新旧主板的更换蓝屏          2.标准IDE和AHCI控制器没有安装驱动3.磁盘有错误,文件目录损坏4....
原创
7923阅读
0评论
0点赞
发布博客于 3 年前

unicode编码

unicode一览表https://apps.timwhitlock.info/emoji/tables/unicode关于编码:必看  https://zhuanlan.zhihu.com/p/27827951
原创
682阅读
0评论
0点赞
发布博客于 4 年前

mysql存储表情微信昵称

1,去修改表字符集utf8mb4:ALTER TABLE UGC_REVIEW_CONTENT  CHARSET=utf8mb4 COMMENT='晒单/推荐的评论内容';执行完后,再在手机端的app测试,依然报同样的错误。2,再去修改数据库的字符集utf8mb4: vim my.cnfinit-connect='SET NAMES utf8mb4'characte
转载
3128阅读
0评论
0点赞
发布博客于 4 年前

重试机制

http://docs.aws.amazon.com/general/latest/gr/api-retries.htmlError Retries and Exponential Backoff in AWSNumerous components on a network, such as DNS servers, switches, load balancers, an
原创
1486阅读
0评论
0点赞
发布博客于 4 年前

grpc类型与struct的转换

https://www.reddit.com/r/golang/comments/4p9i51/looking_for_a_reverse_protobuf_compiler_to/如何解决:1. 手动双向转换2. kubernates单向工具:https://github.com/kubernetes/kubernetes/tree/master/cmd/libs
原创
2267阅读
0评论
0点赞
发布博客于 4 年前

mongodb自增字段

创建一个自增的序列字段MongoDB使用所有文档中的顶层文档里的 _id 字段作为主键。 _id 必须是唯一的,并且总是有使用 unique constraint 的索引。然而,除了唯一约束外,你可以在你的集合中为 _id 字段使用任何值。这个教程介绍了为 _id 字段创建自增序列数字的两种方法,如下:使用计数集合乐观循环##########http://blo
原创
4878阅读
0评论
0点赞
发布博客于 4 年前

golang代码案例

1.网络mgonsqetcdconsul
原创
1441阅读
1评论
0点赞
发布博客于 4 年前

ip查询

(高精度但不提供API的 https://www.opengps.cn/Default.aspx)优先级:1. 百度 http://lbsyun.baidu.com/index.php?title=webapi/ip-api2.淘宝 http://ip.taobao.com/instructions.php提供完善的统计分析报表,省准确度超过99.8%,市准确度超过
原创
934阅读
0评论
0点赞
发布博客于 4 年前

Mac OSX下Sublime Text配置使用ctags实现代码跳转

https://www.smslit.top/2015/11/14/macSTctags-Develop/配置ST的CTags插件需要配置一下CTags插件,更改一下默认配置,主要修改其中ctags目录,因为配置中没有写入ctags的目录。打开 菜单栏->Sublime Text->Preferences->Package Settings->CTags->Se
转载
3926阅读
0评论
1点赞
发布博客于 4 年前

Mac下 终端配置 iterm2+oh-my-zsh

1.Iterm22.Oh-my-zsh3.Fish4.fuck
原创
2517阅读
0评论
0点赞
发布博客于 4 年前

ruby入门

Ubuntu 通过 PPA 安装 Ruby最佳方法是通过 PPA 安装:sudo apt-add-repository ppa:brightbox/ruby-ngsudo apt-get updatesudo apt-get install ruby2.2 ruby2.2-devruby -vPPA 的优点是可以用 apt 统一更新,不用处理 PAT
转载
1080阅读
0评论
0点赞
发布博客于 4 年前

Maven入门

本文介绍下在Ubuntu上安装Apache的Maven包,我们有几种不同的安装方式,默认情况下, Apache Maven 3.0.5其实已经安装到你的Ubuntu系统下了 Maven安装到Ubuntu 14.x, 15.x系统去 $ sudo  apt-get install maven检测版本, $  mvn --versionApache Mave
转载
938阅读
0评论
0点赞
发布博客于 4 年前

consul部署 docker篇

入门必看https://livewyer.io/blog/2015/02/05/service-discovery-docker-containers-using-consul-and-registrator/
原创
1731阅读
0评论
0点赞
发布博客于 4 年前

Mac多屏下焦点切换

Mac多显示器之间的焦点切换http://xuquan.me/blog/switch-multi-display.html多显示器之间的焦点切换非常麻烦,每次码代码时需要切换到浏览器查资料都需要用鼠标点外接的显示器,需要切换回来写代码时又要用鼠标点回来,作为一名高效(搞笑)的键盘党,这能忍???于是速度网上查找攻略,果然找到完美解决办法,如下:首先需要到
转载
14084阅读
1评论
0点赞
发布博客于 4 年前

couchbase + docker

官方docker文件:https://hub.docker.com/_/couchbase/单机集群测试:https://developer.couchbase.com/documentation/server/4.5/install/docker-deploy-multi-node-cluster.html
原创
1640阅读
0评论
1点赞
发布博客于 4 年前

etcd+confd

Confd适用于需要本地化文件配置的情景,比如动态获取配置后生成nginx配置文件。此时无法修改程序代码从而读取。其余情况,直接使用etcd即可http://www.tuicool.com/articles/BvAruif使用etcd+confd管理nginx配置
原创
1117阅读
0评论
0点赞
发布博客于 4 年前

etcd部署-docker篇

etcd discovery分为两种:自定义的discovery #利用一个已有的etcd集群来提供discovery服务来搭建一个新的etcd集群公共的discovery     #discovery.etcd.io这里我们使用公共的etcd discovery服务进行集群搭建:1:创建一个用于discovery的token(size=3 表示集群的大小)
原创
5618阅读
0评论
0点赞
发布博客于 4 年前

微信ios/Safari中的new Date()格式化坑

I suggest you use: new Date (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] )To split the string you could tryvar s = '2011-06-21T14:27:28.593Z';var a = s.split(/[^0-9]/);
原创
3638阅读
0评论
0点赞
发布博客于 5 年前

微信token server服务

解决方案:微信鉴权等作为单独的server,对外提供服务. 用grpc通信golang库: https://github.com/chanxuehong/wechat.v2/blob/master/mp/core/access_token_server.go   重写AccessTokenServer方案:https://cnodejs.org/topic/57b330b667
原创
2139阅读
0评论
0点赞
发布博客于 5 年前

vue缺点

https://github.com/RubyLouvre/avalon期待vue2的表现
原创
4332阅读
1评论
0点赞
发布博客于 5 年前

开源客服系统 ppmessage

1.  安装用 sudo2. sudo pip install PyMySQL 通过 pip list检查是否已安装。
原创
7221阅读
2评论
1点赞
发布博客于 5 年前

unity3d

1. 案例  非常棒的实践Unity3D手游开发实践http://www.jianshu.com/p/10693fee70a5
原创
1087阅读
0评论
0点赞
发布博客于 5 年前

react-redux-universal-hot-example错误

问题:  no suitable image foundERROR in dlopen(/Users/xxx/web/react-redux-universal-hot-example/node_modules/node-sass/vendor/darwin-x64-48/binding.node, 1): no suitable image found.  Did find:[0]
原创
1157阅读
0评论
0点赞
发布博客于 5 年前

boilerplate/starter kit/best practice

1. vue2. reacthttps://github.com/mxstbr/react-boilerplate3. react native4. angular (弃用)
原创
1020阅读
0评论
0点赞
发布博客于 5 年前

查看80端口占用

linux下如何查看80端口占用情况?是被哪个进程占用?如何终止等  查询端口是否被占用,被哪个进程占用有两种方式:1、netstat -anl | grep "80"2、sudo lsof -i:80  (首选)  终止进程的方式:kill pid
原创
1173阅读
0评论
0点赞
发布博客于 5 年前

Angular2学习指南

非常棒的视频学习:http://courses.angularclass.com/courses/angular-2-fundamentalsstarter-kit:babel:      https://github.com/blacksonic/angular2-babel-esnext-starterIf you're look
原创
727阅读
1评论
0点赞
发布博客于 5 年前

微信图片上传 invalid credential, access_token is invalid or not latest

这个问题可能是因为你部署的时候,起了多个进程,每个进程都去微信的服务器获取一次access_token,只有最后一个获取到的access_token才有效,比如,如果你用gunicorn去启django,并设置4个进程,那么你会发现,每上传4个图片可能只有一个成功,其它都失败。我就遇到这个问题了。access_token是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用access
原创
10520阅读
0评论
0点赞
发布博客于 5 年前

vue开发spa应用时 微信支付问题(尤其是ios)

临时解决办法: 两个都加上支付路径:http://example.com/#!/http://example.com/#!/orderhttps://blog.asaki.me/posts/chooseWXPay-fail/对着官方文档这句:“发起支付的页面目录必须与设置的精确匹配。”看了半个小时,我突然想到是不是URL hash生成的“/#!/目录”被微信
原创
12475阅读
2评论
1点赞
发布博客于 5 年前

[微信开发]invalid credential, access_token is invalid or not latest hint

查了好久,先发现下载到本地的文件size很小,只有100来字节,我以为只有头文件,老大说,你要么看看这文件的二进制流是什么,打开一看原来是一个error信息,是JSON字符串{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [2HYQIa0031ge10] "}
原创
108179阅读
1评论
4点赞
发布博客于 5 年前

css动画

可惜没有源码:https://isux.tencent.com/css-animation-skills.html
原创
518阅读
0评论
0点赞
发布博客于 5 年前

设计师-css片段

关键词: css snippets /  css component / css generator组件:http://components.onsen.io/高级:50 Useful CSS Snippets Every Designer Should Have http://www.hongkiat.com/blog/css-snip
原创
651阅读
0评论
0点赞
发布博客于 5 年前

vue示例及优秀案例

完整的示例:https://auth0.com/blog/build-an-app-with-vuejs/
原创
46078阅读
0评论
1点赞
发布博客于 5 年前

vue 多页面配置

推荐做法:https://github.com/yaoyao1987/vue-cli-multipage参考资料:另一种写法http://cnu4.github.io/2016/03/21/Webpack-Vue-MultiplePage/
原创
9380阅读
0评论
0点赞
发布博客于 5 年前

设计师常用资源和工具

1. UIkithttp://ui-cloud.com/browse/2.图标库:http://www.iconfont.cn/collections?personal=13.十大字体资源网站集合:设计师必备http://www.8kvv.com/index.php/arc_298.html4.Tagul文字云工具使用攻略
原创
739阅读
0评论
0点赞
发布博客于 5 年前

React Native自带组件介绍

ListView 组件介绍http://taobaofed.org/blog/2015/12/09/using-js-to-build-an-crossplatform-native-app-an-introduction-to-listview/分页除了简单的渲染之外,另外一个要考虑的问题就是 当数据量很大的时候如何分页加载 。这种情形分两种情况考虑:
原创
1460阅读
0评论
0点赞
发布博客于 5 年前

react native第三方组件问题

组件 react-native-router-flux 中的tabbar 在安卓机器上反应速度非常慢,已有issue提问:  https://github.com/aksonov/react-native-router-flux/issues/199   Extremely slow on android #199看似原因: For future refer
原创
1423阅读
0评论
0点赞
发布博客于 5 年前

react native白屏及性能优化

白屏Trick:  http://liuyy.coding.me/2016/07/22/react-native/react-native_launch/  给android端设置启动图为了解决这个问题,找了很多的资料,参考了 ReactNative安卓首屏白屏优化, 也并没有解决掉启动慢点问题 , 原因是全react-native的应用,内存换效率的做法并不起作用。于是我决定曲线
原创
8428阅读
0评论
0点赞
发布博客于 5 年前

Android/Ios组件名称一览表

1.轮播类Carousel   Swiper   ViewPager2. tab bar   3.
原创
2229阅读
0评论
0点赞
发布博客于 5 年前

Flux/Redux架构初步

https://github.com/react-guide/redux-tutorial-cn // 章节 0 - introduction.js // 为什么要有这个教程呢? // 在我尝试学习 Redux 的时候,我发现之前的阅读过的一些文章加上个人的经验, //
原创
1796阅读
0评论
0点赞
发布博客于 5 年前

直播解决方案/sdk的选择

直播App:趣拍微视频云服务、七牛云、乐视云、网易云信、VTC云通信、gensee视频播放:Vitamio七牛  Tusdk 大牛直播 趣拍吐槽:布芝稻 ,码农1.不要用网易,功能不完全,推流有内建参数,无法设置高码流和高帧数,延迟高;2.不要用趣拍,稳定性差,延迟高,SDK太大;3.不要用七牛,刚发布bu
原创
11340阅读
4评论
0点赞
发布博客于 5 年前

react-native学习资料和真实案例

1.React Native Traininghttps://unbug.gitbooks.io/react-native-training/content/2.配套视频http://list.youku.com/albumlist/show?id=27615900&ascending=1&page=1专题文章http://gold.xitu.i
原创
1719阅读
0评论
0点赞
发布博客于 5 年前

React Native常见报错

一。 Failed run android simulator : No connected devices! https://github.com/facebook/react-native/issues/3091When you have the platform, and the device, you can then boot the device w
原创
9365阅读
2评论
1点赞
发布博客于 5 年前

【后台开发科普web系列】js

1. Javascript 面向对象编程(一):封装http://www.ruanyifeng.com/blog/2010/05/object-oriented_javascript_encapsulation.html2. vue.js  把html/js/css放在一个文件内
原创
669阅读
0评论
0点赞
发布博客于 5 年前

【唯一讲明白的】CSS中position属性( absolute | relative | static | fixed )详解

我们先来看看CSS3 Api中对position属性的相关定义:static:无特殊定位,对象遵循正常文档流。top,right,bottom,left等属性不会被应用。 relative:对象遵循正常文档流,但将依据top,right,bottom,left等属性在正常文档流中偏移位置。而其层叠通过z-index属性定义。 absolute:对象脱离正常文档流,使用top,right
转载
1302阅读
1评论
1点赞
发布博客于 5 年前

【后台开发科普web系列】css

1. 关于cssCSS动画简介: 两大组成部分:transition和animationhttp://www.ruanyifeng.com/blog/2014/02/css_transition_and_animation.html
原创
591阅读
0评论
0点赞
发布博客于 5 年前

kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)

https://github.com/Homebrew/legacy-homebrew/issues/49879sudo chown -R $(whoami):admin /usr/localcd $(brew --prefix) && git fetch origin && git reset --hard origin/masterthen I couldbrew
原创
7199阅读
1评论
1点赞
发布博客于 5 年前

NSNotificationCenter

在我们的应用程序中,一个大的话题就是两个对象之间如何通信。我们需要根据对象之间的关系来确定采用哪一种通信方式。对象之间的通信方式主要有以下几种:直接方法调用Target-ActionDelegate回调(block)KVO通知一般情况下,我们可以根据以下两点来确定使用哪种方式:通信对象是一对一的还是一对多的对象之间的耦合度,是强耦合还是松耦合
转载
829阅读
0评论
0点赞
发布博客于 5 年前

避免循环引用

ARC转换总结+避免循环引用字数970 阅读227 评论0 喜欢2参考上面的文章写得已经非常全面了,不过还是有些东西需要补充一下。循环引用循环引用和ARC没有直接关系,但是在转换的过程中遇到了相关问题,所以就着重说明一下。循环引用的原因任何一种语言,都必须有它的内存管理方式。比如C语言中,我们用malloc申请一块内存,放入数据。当这块内
转载
2697阅读
0评论
0点赞
发布博客于 5 年前

UILabel在Autolayout中的多行显示/动态高度

UILabel在Autolayout中的使用字数471 阅读237 评论1 喜欢1UILabel在Autolayout中是有些特别的,因为这种可以显示文本的控件会根据自身文字的大小,长度等来确定自己的大小。在使用Autolayout时,UILabel这种控件即使不设置宽度和高度,只设置x和y,也是没有问题的。比如我们先在有一个label,我只设置了它的x是距离左面16p
转载
4679阅读
0评论
0点赞
发布博客于 5 年前

xib/纯代码/storyboard之争

选xib###代码手写UI,xib和StoryBoard间的博弈,以及Interface Builder的一些小技巧https://www.zhihu.com/question/20256649什么时候使用storyboard?组织多种view的层级关系,也就是传说中的segue。使用一些列表或表格单元的模板的时候。除过不能使用story
原创
1181阅读
0评论
0点赞
发布博客于 5 年前

如何在 Go 语言中使用 Redis 连接池-Radix.v2

一、关于连接池一个数据库服务器只拥有有限的资源,并且如果你没有充分使用这些资源,你可以通过使用更多的连接来提高吞吐量。一旦所有的资源都在使用,那么你就不能通过增加更多的连接来提高吞吐量。事实上,吞吐量在连接负载较大时就开始下降了。通常可以通过限制与可用的资源相匹配的数据库连接的数量来提高延迟和吞吐量。如果不使用连接池,那么,每次传输数据,我们都需要进行创建连接,收发数据,关闭连
转载
2934阅读
0评论
0点赞
发布博客于 5 年前

ios布局-与xib结合

Create an IBDesignable UIView subclass with code from an XIB file in Xcode 6http://supereasyapps.com/blog/2014/12/15/create-an-ibdesignable-uiview-subclass-with-code-from-an-xib-file-in-xcode-6
原创
904阅读
0评论
0点赞
发布博客于 5 年前

ios布局

http://blog.cnbluebox.com/blog/2014/12/13/autolayout1/如何做好IOS View的布局http://blog.cnbluebox.com/blog/2015/09/18/howtolayoutview/
原创
754阅读
0评论
0点赞
发布博客于 5 年前

'Application windows are expected to have a root view controller at the end of application launch'

http://stackoverflow.com/questions/30884896/application-windows-are-expected-to-have-a-root-view-controller-at-the-end-of-a“Application windows are expected to have a root view controlle
原创
2222阅读
0评论
2点赞
发布博客于 5 年前

轮播/Carousel/广告位/banner***scrollview

http://shengpan.net/pscarouselview/谈谈组件封装的思路和实现--PSCarouselView前两天面试了一个应聘者,他的演示项目里有广告轮播功能。恰好之前我封装过一个实现了此功能的控件,于是就顺着他广告轮播的实现一直往下聊,从需求的抽象一直聊到各种实现的细节和需要考虑的问题等等。组件的封装是开发中比较有趣的一件事。今天我们就拿轮播控件举例,聊聊
原创
1378阅读
0评论
0点赞
发布博客于 5 年前

出现"-fembed-bitcode"错误的解决办法

错误提示-fembed-bitcode is not supported on versions of iOS prior to 6.0这时候到build setting里面设置查找”enable_bitcode”, 并把设置改为”NO” Impact of Xcode build options “Enable bitcode” Yes/No来
转载
2128阅读
0评论
0点赞
发布博客于 5 年前

开发订阅

知乎周刊:http://zhuanlan.zhihu.com/Weekly 码农周刊:http://weekly.manong.io/ Pycoder's Weekly:http://pycoders.com/archive/ Hacker News:https://news.ycombinator.com/ Startup News:http://news.dba
原创
743阅读
0评论
0点赞
发布博客于 5 年前

iOS大型项目开发架构

http://www.jianshu.com/p/921ab32c3c71#首先说说编程语言的选择,Objecive-C还是Swift?我还没有在项目中使用Swift,因为我说服不了自己去用它,它的优势在哪里,你也不能强迫队友去学习Swift。当然,不用不代表不会,一入行就用Swift开发无意义产品的人没资格戴着有色眼镜鄙视不会Swift的同行。你知道Objecive-C与
转载
7939阅读
0评论
0点赞
发布博客于 5 年前

iOS开发之UIViewController

http://blog.csdn.net/xyz_lmn/article/details/9022399  ViewController是iOS应用程序中重要的部分,是应用程序数据和视图之间的重要桥梁,ViewController管理应用中的众多视图。iOS的SDK中提供很多原生ViewController,以支持标准的用户界面,例如表视图控制器(UITableViewContro
转载
909阅读
0评论
0点赞
发布博客于 5 年前

工具篇 - 如果让你重新做一款APP

http://www.jianshu.com/p/e0d5c2114932fir.im Weekly - 如果让你重新做一款APP字数904 阅读1177 评论0 喜欢18设想下:如果让你重新做一款 APP ,你会用到哪些开发、设计等资源和工具?本期的 Weekly 为大家分享了最近不错的 APP 开发资源,大部分是关于 iOS 开发、 Android
转载
994阅读
0评论
0点赞
发布博客于 5 年前

category和extension

http://tech.meituan.com/DiveIntoCategory.html2、连类比事-category和extensionextension看起来很像一个匿名的category,但是extension和有名字的category几乎完全是两个东西。 extension在编译期决议,它就是类的一部分,在编译期和头文件里的@interface以及实现文件里的
转载
837阅读
0评论
0点赞
发布博客于 5 年前

redigo长连接/复用

https://github.com/garyburd/redigo/issues/104
原创
4550阅读
0评论
0点赞
发布博客于 5 年前

消息队列选型[首选Kafka](备选:RabbitMQ/NSQ/RocketMQ/disque/Kafka)

消息队列选型Sep 27, 2015什么是消息队列顾名思义,消息队列就是用存放消息的队列结构,简称MQ。那什么是消息呢?广义上来说,所有的网络通信都可以看做是消息的传递。在通信的过程中,添加一个队列缓冲,可以使得许多问题变得非常容易解决。图:不使用消息队列的网络架构图:使用消息队列的网络架构题外话:在最初的面向对象编程的设计中,对象之
转载
28009阅读
1评论
1点赞
发布博客于 5 年前

ELK学习

ELKstack 中文指南http://kibana.logstash.es/content/
转载
945阅读
0评论
0点赞
发布博客于 5 年前

docker-compose

非常棒的链接: https://yeasy.gitbooks.io/docker_practice/content/compose/index.htmlDocker Compose 项目Docker Compose 是 Docker 官方编排(Orchestration)项目之一,负责快速在集群中部署分布式应用。本章将介绍 Compose 项目情况以及安装和使用
原创
787阅读
0评论
0点赞
发布博客于 5 年前

时间序列数据库的秘密

时间序列数据库的秘密(1)—— 介绍作者 陶文 发布于 2015年8月11日什么是时间序列数据?最简单的定义就是数据格式里包含timestamp字段的数据。比如股票市场的价格,环境中的温度,主机的CPU使用率等。但是又有什么数据是不包含timestamp的呢?几乎所有的数据都可以打上一个timestamp字段。时间序列数据更重要的一个属性是如何去查询它。在查询的
转载
12536阅读
0评论
0点赞
发布博客于 5 年前

ios开源库

http://mobdevgroup.com/platform/ios/library/http://github.ibireme.com/github/list/ios/https://www.zhihu.com/question/22914651
转载
375阅读
0评论
0点赞
发布博客于 5 年前

玩转swift(二)

工具篇用CocoaPods做iOS程序的依赖管理http://blog.devtang.com/blog/2014/05/25/use-cocoapod-to-manage-ios-lib-dependency/使用 CocoaPods使用时需要新建一个名为 Podfile 的文件,以如下格式,将依赖的库名字依次列在文件中即可
原创
398阅读
0评论
0点赞
发布博客于 5 年前

玩转objective-c

https://www.zhihu.com/question/20264108李明杰www.helloworld.com/biancheng/yidong/451
原创
399阅读
0评论
0点赞
发布博客于 5 年前

玩转Swift(一)

The Swift Programming Language 中文版http://wiki.jikexueyuan.com/project/swift/著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。作者:Kate zhao链接:https://www.zhihu.com/question/31326119/answer/53
原创
2088阅读
0评论
0点赞
发布博客于 5 年前

mgo使用指南-高级篇(长连接/重连)

Keeping an mgo (any other db engine) connection aliveI have yet to write a service that would keep a connection alive and handle reconnecting. What's the best practice for this in Go and mgo
原创
7120阅读
1评论
0点赞
发布博客于 5 年前

golang time.time相关

JSON does not define any representation for encoding date/time information. It *appears* that people tend to use ISO-8601 for them [1]. May be that's what Go does. Note that the documentatio
原创
743阅读
0评论
0点赞
发布博客于 5 年前

golang mysql中timestamp,datetime,int类型的区别与优劣

首先 DATETIM和TIMESTAMP类型所占的存储空间不同,前者8个字节,后者4个字节,这样造成的后果是两者能表示的时间范围不同。前者范围为1000-01-01 00:00:00 ~ 9999-12-31 23:59:59,后者范围为1970-01-01 08:00:01到2038-01-19 11:14:07。所以可以看到TIMESTAMP支持的范围比DATATIME要小,容易出现超出的情况
原创
9648阅读
0评论
0点赞
发布博客于 5 年前

golang database 全局

重要的前提条件:type DBtype DB struct { // contains filtered or unexported fields}DB is a database handle representing a pool of zero or more underlying connections.It's safe for conc
原创
1560阅读
0评论
0点赞
发布博客于 5 年前

mgo使用指南

https://godoc.org/labix.org/v2/mgomgo使用指南mgo简介mgo(音mango)是MongoDB的Go语言驱动,它用基于Go语法的简单API实现了丰富的特性,并经过良好测试。官方网站:http://labix.org/mgo。golang.tc(golangtc.com)网站的数据存储就是是用的MongoDB
转载
6028阅读
0评论
1点赞
发布博客于 6 年前

go语言string、int、int64互相转换

#string到intint,err:=strconv.Atoi(string)#string到int64int64, err := strconv.ParseInt(string, 10, 64)#int到stringstring:=strconv.Itoa(int)#int64到stringstring:=strconv.FormatInt(int64,10)
原创
247678阅读
0评论
13点赞
发布博客于 6 年前

四种常见的 POST 提交数据方式

https://imququ.com/post/four-ways-to-post-data-in-http.html四种常见的 POST 提交数据方式文章目录application/x-www-form-urlencodedmultipart/form-dataapplication/jsontext/xmlHTTP/1.1 协议规定的 H
转载
1141阅读
0评论
0点赞
发布博客于 6 年前

利用reflect设置struct的字段

参考golang反射三大规则reflect.Value区分CanSet和Can not Set的, 所以, 必须要返回成Can set的reflect.Value如:s := reflect.ValueOf(&t).Elem()然后就可以happy的设值了, 可是不能随便设值的, 一个通用的方法就是使用Set(v Value)方法, 所以之前必须将值转成reflect.V
原创
5746阅读
0评论
0点赞
发布博客于 6 年前

Go Reflect

最近在看一些go语言标准库以及第三方库的源码时,发现go的reflect被大量使用,虽然反射的机制大多数语言都支持,但好像都没有go一样这么依赖反射的特性。个人觉得,reflect使用如此频繁的一个重要原因离不开go的另一个特性,空接口interface{},reflect配合空接口,让原本是静态类型的go具备了很多动态类型语言的特征。 另外,虽然反射大大增加了go语言的灵活性,但要完全掌握它
转载
1199阅读
0评论
0点赞
发布博客于 6 年前

ioutils.ReadAll()会清空对应的reader

Reading from a bytes.Buffer drains or consumes the bytes that were read. This means if you try to read again those will not be returned.Buffer.Bytes() returns the unread portion of the buffer
原创
2645阅读
0评论
0点赞
发布博客于 6 年前

golang 动态 实例化 结构体

1.  https://www.socketloop.com/tutorials/golang-fix-type-interface-has-no-field-or-no-methods-and-type-assertions-exampleGolang : Fix type interface{} has no field or no methods and type asser
原创
10560阅读
0评论
0点赞
发布博客于 6 年前

rest+go+mongodb

Building a REST Service with Golang - Part 3 (Adding a Backend)http://stevenwhite.com/building-a-rest-service-with-golang-3/How to implement JSON-API standard in MongoDB and Go https://w
原创
799阅读
0评论
0点赞
发布博客于 6 年前

mongo常用手册

http://docs.mongoing.com/manual/tutorial/create-an-auto-incrementing-field.html
原创
448阅读
0评论
0点赞
发布博客于 6 年前

mongodb适用场景(弊与利)

1.  不适合社交场景http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
原创
1463阅读
0评论
0点赞
发布博客于 6 年前

Go语言学习

1.https://gobyexample.com/
原创
560阅读
0评论
0点赞
发布博客于 6 年前

用Supervisor 守护Golang 应用进程的配置示例

Supervisor 可以监控服务器的进程,并在出现问题是自动重启。用Supervisor 来守护Golang 应用进程是不错的选择。下面是一份用Supervisor 守护Golang 应用进程的配置:[program:yourapp]command=/home/yourappuser/bin/yourapp # the location of your appautostart=
原创
4431阅读
0评论
0点赞
发布博客于 6 年前

[腾讯云]数据盘分区以及格式化

首先切换到root账户下  sudo -i手动格式化请根据以下步骤对数据盘进行分区以及格式化,并挂载分区使数据盘可用。注:执行以下命令时,请注意修改数据盘符,可以使用”fdisk -l”查看盘符等相关信息,以下均以xvdb为例,若是其他盘符,仅需将vdb替换为该盘符即可,如fdisk /dev/vdb替换为fdisk /dev/xvdb请确认路径为“/dev
原创
4700阅读
0评论
2点赞
发布博客于 6 年前

服务器session和jwt之争

1. sessionsession和cookie的目的相同,都是为了克服http协议无状态的缺陷,但完成的方法不同。session通过cookie,在客户端保存session id,而将用户的其他会话消息保存在服务端的session对象中,与此相对的,cookie需要将所有信息都保存在客户端。因此cookie存在着一定的安全隐患,例如本地cookie中保存的用户名密码被破译,或co
原创
18559阅读
1评论
6点赞
发布博客于 6 年前

高逼格saas服务的文档展示

1. mkdocs  http://www.mkdocs.org/theme主题: https://github.com/chrissimpkins/cinder   效果: http://sourcefoundry.org/cinder/Install the Cinder ThemeDownload the Cinder theme archive.
原创
1707阅读
0评论
0点赞
发布博客于 6 年前

unsupported locale setting

unsupported locale settingTraceback (most recent call last):  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard    callback()  File "/usr/lib/command-not-f
原创
2212阅读
0评论
0点赞
发布博客于 6 年前

Rest API规范

理解RESTful架构 http://www.ruanyifeng.com/blog/2011/09/restful.html作者: 阮一峰日期: 2011年9月12日div class="asset-body"越来越多的人开始意识到,网站即软件,而且是一种新型的软件。/div div id="more" class="asset-more"这种"互联网软件
原创
9641阅读
0评论
1点赞
发布博客于 6 年前

go常见error解决办法

1.unrecognized import path "golang.org/x/crypto/bcrypt"原因是网络被GFW墙啦!!!!用pandafan的代理进行设置。要为 shell 配置 HTTP 代理只需两步:设定环境 http_proxy ,bash中的命令为export http_proxy=http://SERVER:POR
原创
2979阅读
1评论
0点赞
发布博客于 6 年前

rejected execution (queue capacity 50)

测试过程中,会出现错误:?1[7]: index [yyyy], type [rrrr], id [1964986], message [RemoteTransportException[[2sdfsdf][inet[/xxxxxxxxxx:9300]][bulk/shard]]; nested: EsRejectedExec
原创
2117阅读
0评论
0点赞
发布博客于 6 年前