Submitted by gouki on 2015, August 13, 5:16 PM
BUG提醒工具其实有很多,比如可以在有BUG的时候发封邮件到你的常用邮箱,这样你的手机上(邮件APP)就会收到一条提醒。或者有短信SP通道的话,你也可以有类似处理。当然还有monolog,支持php-console插件,可以发送到你的chrome上面,我在这里再换个小方式,利用pubu.im这个IM工具(或者说。。。。说不出来)来做提醒
流程很简单
1、去pubu.im测试一个帐户。。这不用我多说吧
2、下载MAC客户端登录,自己添加自己为一个机器人,相当于自己和自己聊天,如果你的消息不算隐私,你可以直接用现成的:小布 这个通道
3、在聊天界面选择插件,点击更多,打开网页,添加“incoming”插件,生成一个URL,选择你刚才聊天组
4、根据提示信息在你的APP里写上一段测试代码,POST方式的,可以用curl/file_get_contents/Requests/guzzle等,工具实在太多,不想多说
5、测试通过后,可以尝试自己用set_error_handle,自己处理出错信息,在出错信息前进行判断:
if(debug_mode){ //send report }
6、你会发现 右上角弹了一个小窗,就是你刚才的测试标题!
----EOF---
就这样,你在工作的时候不需要打开手机,电脑上会直接有提醒哦~~~而且因为是聊天记录,你还可以往前翻,到底是什么BUG,嗯,再也不用客户端开发人员和你说,XXX接口出错了。。。因为他一出错你就收到,然后你就可以在他没有和你提的时候悄悄的改掉,等他提出来有BUG的时候,你说,在哪里?一定是你访问的姿势不对,不信你试试
哈哈
Tags: bug
PHP | 评论:1
| 阅读:21492
Submitted by gouki on 2015, August 10, 2:29 PM
这是一篇backup的文章。起因是我的命令行下的gdb出现了:
XML/HTML代码
- Starting program: /usr/local/Cellar/php56/5.6.9/bin/php /server/yii hprose
- Unable to find Mach task port for process-id 30717: (os/kern) failure (0x5).
- (please check gdb is codesigned - see taskgated(8))
于是google了一下,发现也有人在问类似的问题:
XML/HTML代码
- Because I need a Python-enabled gdb, I installed another version via
-
- brew tap homebrew/dupes
- brew install gdb
- I want to use this gdb with Eclipse CDT, where I entered the path to the binary in the Debugging settings. However, launching a program for debugging fails with the following message:
-
- Error in final launch sequence
- Failed to execute MI command:
- -exec-run
- Error message from debugger back end:
- Unable to find Mach task port for process-id 39847: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
- Unable to find Mach task port for process-id 39847: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
- What does "codesigned" mean in this context? How can I get this gdbrunning?
有一个5个点赞的,我发现无效:
XML/HTML代码
- t would seem you need to sign the executable. See these links for more information. You should be able to get away with self signing if you don't plan on redistributing that version of gdb.
-
- https://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
-
- https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/codesign.1.html
-
- Alternatively, you could disable code signing on your system, although this presents a security risk. To do so try running sudo spctl --master-disable in the Terminal.
24人点赞的看上去不错:
XML/HTML代码
- I.1 Codesigning the Debugger
-
- The Darwin Kernel requires the debugger to have special permissions before it is allowed to control other processes. These permissions are granted by codesigning the GDB executable. Without these permissions, the debugger will report error messages such as:
-
- Starting program: /x/y/foo
- Unable to find Mach task port for process-id 28885: (os/kern) failure (0x5).
- (please check gdb is codesigned - see taskgated(8))
- Codesigning requires a certificate. The following procedure explains how to create one:
-
- Start the Keychain Access application (in /Applications/Utilities/Keychain Access.app)
- Select the Keychain Access -> Certificate Assistant -> Create a Certificate... menu
- Then:
- Choose a name for the new certificate (this procedure will use "gdb-cert" as an example)
- Set "Identity Type" to "Self Signed Root"
- Set "Certificate Type" to "Code Signing"
- Activate the "Let me override defaults" option
- Click several times on "Continue" until the "Specify a Location For The Certificate" screen appears, then set "Keychain" to "System"
- Click on "Continue" until the certificate is created
- Finally, in the view, double-click on the new certificate, and set "When using this certificate" to "Always Trust"
- Exit the Keychain Access application and restart the computer (this is unfortunately required)
- Once a certificate has been created, the debugger can be codesigned as follow. In a Terminal, run the following command...
-
- codesign -f -s "gdb-cert" <gnat_install_prefix>/bin/gdb
- ... where "gdb-cert" should be replaced by the actual certificate name chosen above, and should be replaced by the location where you installed GNAT.
- source: https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gnat_ugn_unw/Codesigning-the-Debugger.html
这个4人点赞的简洁明了:
XML/HTML代码
- I made gdb work on OSX 10.9 without codesigning this way (described here):
-
- Install gdb with macports. (may be you can skip it)
-
- sudo nano /System/Library/LaunchDaemons/com.apple.taskgated.plist
- change option string from -s to -sp at line 22, col 27.
-
- reboot the computer.
-
- Use gdb
然而这都没有什么卵用,这时候一个2人点赞的说了一个重点:
XML/HTML代码
- It's a very old topic, but I am adding a response, because out of many available instructions, only one contained just the right steps to make a self-signed debugger work.
-
- You have to create a self-signed root certificate and then sign the gdb executable with it, but many people complained that it did not work for them. Neither did it for me until I stumbled upon this link.
-
- The key point missing in other manuals is that you have to restart your computer for the changes to take effect. Once I did that, everything worked as intended.
-
- I hope, this will help others.
是的,他在have to restart上加粗了!!!
最后一个回复表示使用了4人点赞的那个建议,并表示他就是这么完成的!原文来自:http://stackoverflow.com/questions/13913818/how-to-get-a-codesigned-gdb-on-osx
Linux | 评论:0
| 阅读:19789
Submitted by gouki on 2015, July 29, 1:36 PM
其实在fullcalendar2中已经有现成的代码了,但是因为我用的是1,所以借鉴网上的一些代码加了自己的处理。可能写的比较恶心!
JavaScript代码
- function isOverlapping(event){
- var array=calendar.fullCalendar('clientEvents');
- var start=Date.parse(event.start);
- if(event.end==null){
- var end=start+defaultEventMinutes*60*1000;
- }else{
- var end=Date.parse(event.end);
- }
- for(i in array){
- if(array[i]._id!=event._id){
- var currentStart=Date.parse(array[i].start);
- if(array[i].end==null){
- var currentEnd=currentStart+defaultEventMinutes*60*1000;
- }else{
- var currentEnd=Date.parse(array[i].end);
- }
-
-
-
-
- console.log("start :"+start);
- console.log("current start :"+currentStart);
- console.log("end :"+end);
- console.log("current End :"+currentEnd);
- if(start>currentStart&&start<currentEnd){
- console.log('开始时间在其他日程之间');
- return true;
- }
- if(end>currentStart&&end<currentEnd){
- console.log('结束时间在其他日程之间');
- return true;
- }
- if(start==currentStart||end==currentEnd){
- console.log('//开始时间或者结束时间等于别人的时间');
- return true;
- }
- if(start<currentStart&&end>currentStart){
- console.log('其他日程在当前的日期中间');
- return true;
- }
- }
- }
- return false;
- }
其中:
defaultEventMinutes 默认应该是等于fullcalendar中的120的,但由于不是每个人都将默认日程设置为120分钟,所以加了个变量自定义一下。
只要不是120,还需要设置一下:fullcalendar({defaultEventMinutes:defaultEventMinutes});
在使用的时候,有3个事件需要用到它,eventDrop,eventResize,drop。drop是指将外部的日程(或者颜色)拖放到日历上。eventDrop,eventResize都是针对指定日程的。
JavaScript代码
-
- if(isOverLapping(event)){
- alert('日程安排有冲突');
- revertFunc();
- return ;
- }
至此,处理日程安排重复算是搞定。折腾了一天,网上的那个是直接比较对象。不能用==,好尴尬,所以就采用时间戳了
Javascript | 评论:0
| 阅读:22534
Submitted by gouki on 2015, July 6, 3:39 PM
纯笔记做个记录
1、http://mirrors.aliyun.com/ ,这是阿里的源
2、这是dotdeb的说明:http://mirrors.aliyun.com/help/dotdeb
3、阿里云的说明:
XML/HTML代码
- 编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最后面添加以下条目(操作前请做好相应备份)
-
- deb http://mirrors.aliyun.com/dotdeb/packages.dotdeb.org wheezy all
- deb-src http://mirrors.aliyun.com/dotdeb/packages.dotdeb.org wheezy all
其实上面的源的写法是错误的,不需要package.dotdeb.org,应该是这样
XML/HTML代码
-
- deb http://mirrors.aliyun.com/dotdeb wheezy all
- deb-src http://mirrors.aliyun.com/dotdeb wheezy all
不过,如果是默认这样其实没有什么特别用,PHP还是5.4,所以如果要针对PHP,就需要再加上
XML/HTML代码
- deb http://mirrors.aliyun.com/dotdeb wheezy-php56 all
- deb-src http://mirrors.aliyun.com/dotdeb wheezy-php56 all
其实说白了就是看:http://mirrors.aliyun.com/dotdeb/dists/,看这一页支持哪些,然后加在源里就OK了。就象官网说的,如果是阿里云服务器,请使用aliyuncs,流量直接从内网走~
PHP | 评论:0
| 阅读:19110
Submitted by gouki on 2015, June 29, 3:48 PM
zephir是phaclon旗下的一个小组件,功能是用PHP来为PHP写扩展,听起来有点拗口,但事实上它就是这么做的,只是重新定义了一些语法。
http://zephir-lang.com有相应的介绍资料,我这里就不一一介绍了。
官方说,zephir的安装有两种方式,1、composer 2、git clone来安装
我两个都试了一下,发现基本上差不多,composer global require "phaclon/zephir" ,其实到最后还是用git clone来下载源码并安装罢了
OK,那我们就用composer 来安装吧。安装好后,可以执行zephir这个命令。首次启动时候会提醒你,zephir并未安装,是否要安装,原来,通过composer安装时,只是扔了一个可执行的zephir文件到/usr/bin目录下
按回车进行安装,会提示你json-c/json.h文件找不到,于是到~/.composer/vendor/phaclon/zephir目录下,执行"./install-json",还是提示json-c/json.h文件不存在,进入json-c目录一看,居然是空的,这时候就有多种方法了
1、git-clone一下json-c 编译安装
2、利用brew install json-c
建议使用第二种,第一种,要re2c,gcc,make等,而且我还是安装失败了。在使用brew install json-c 安装完后,再运行 zephir,就直接安装成功了。
做个笔记而已。
后记,测试了一下json_decode(json_encode(simplexml_load_string(......)),true)的处理,在处理4M左右的xml时,效率并没有提升很明显。PHP大约0.78,zephir大约0.72,快了0.06秒左右。多次测试平均都大约在0.06左右。如果文件很小时,几乎没有提升,那,我看来只能用来保密代码了。
Tags: php, zephir, phaclon
苹果相关 | 评论:0
| 阅读:20874