2014-07-25 刘太华
项目用fabric做代码更新, 大体流程是利用fabric的接口, 登录到指定服务器上, 干一些事情. 而实际fabric在执行这个过程的时候, 使用的是ssh协议. 奇怪的问题是, 当在批量操作一些更新的时候, 批量是指可能对单个服务器目标同时有多个fabric的ssh连接操作, 此时会报错ssh_exchange_identification, 已经在一次更新中导致个别项目漏了更新. 仔细google, 已经看到第2页了, 找到的说法几乎都是把 sshd:ALL加入 /etc/hosts.allow中, 但是明显不是我这个问题的答案. 继续阅读 »
2016-09-04 Piasy
在拆轮子系列:拆 Okio{:target="_blank"} 最后我曾说过会对 Retrofit、OkHttp、Okio 三者进行一个小结,并且整理一套网络层的“微架构”,今天终于得以完成,在这里一起奉送给大家 :) 继续阅读 »
2017-08-17 Xie Jingyi
写在前面 前几天工作时遇到了一个匪夷所思的问题。经过几次尝试后问题得以解决,但问题产生的原因却仍令人费解。查找 SO 无果,我决定翻看 Python 的源码。断断续续地研究了几天,终于恍然大悟。撰此文以记。 more 本文环境: Ubuntu 16.04 (64 bit) Python 3.6.2 使用的 C 源码可以从 Python 官网 获取。 起因 工作时用到了 celery 作为异步任务队列,为方便调试,我写了一个脚本用以启动/关闭 celery 主进程。代码简化后如下: ```python import sys import subprocess ... celery_process = subproces 继续阅读 »
2014-06-07 AllanChan
Mac 解决方法 nano /etc/hosts 贴上如下代码 * ### Host Database# localhost is used to configure the loopback interface when the system is booting. Do not change this entry. 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 127.0.0.1 osxdaily.com 0.0.0.0 yahoo.com 继续阅读 »
2015-06-02 Eric Wang
在eclipse的 "problems" 选项卡中显示如下错误信息 java Description:Type Project facet Java 1.8 is not supported by target runtime Apache Tomcat v7.0 Resource:groupping ... 由StackOverflow上的回答可知,Java facet的版本总是需要和Java编译器的版本一致,所以最好的方式是通过Project Facets Properties面板进行修改。 1. 查看Problems面板信息 2. 打开Project Facets Properties面板 3. 修改configurat 继续阅读 »
2015-11-27 Oliver Wang
直接写 js function imgError(image) { image.onerror = null; // prevent event bubble image.src = "/images/noimage.gif"; return true; } html 使用 jQuery ```js $("img").error(function () { $(this).unbind("error").attr("src", "broken.gif"); }); //If you use this technique you can use the "one" method to av 继续阅读 »
2016-04-09 LEo
刚开始学习go语言的时候,看代码中某个类型实现了Error()方法,然后就可以将该类型赋值给error类型。当时还没学习接口,不懂为什么可以这样赋值。学习接口以后,才明白怎么回事。查看go源码,发现内置类型error其实是一个接口类型,并实现了Error()方法,如下: 继续阅读 »
2017-08-03 summer
问题 准备熟悉一下perl下的AES加密的功能,但是在安装Crypt::OpenSSL::AES模块时,系统一直提示找不到 openssl/aes.h 文件,openssl重新安装和升级到最新版本一直都是这样的错误。 ''' AES.xs:5:10: fatal error: 'openssl/aes.h' file not found #include ^ 1 error generated. make: *** [AES.o] Error 1 TTAR/Crypt-OpenSSL-AES-0.02.tar.gz /usr/bin/make -- NOT OK 'Y 继续阅读 »
2015-11-16 Klaus Ma
Error Message: Error response from daemon: Cannot start container 848ac591eec5ae7a0ada1a84 5fb588615e00331a99fa9d72631ce755d0e01158: [8] System error: failed to add interface veth0f084cf to sandbox: failed in prefunc: failed to set namespace on link "veth0f084cf": invalid argument 继续阅读 »
2015-08-10 Alex Sun
一般情况下,我们会使用try..catch..来进行异常处理,例如: ```javascript function sync() { throw new Error('sync error'); } try { sync(); } catch (err) { console.log('error caught:', err.message); } 继续阅读 »