为什么现在用联通玩转流量客户端流量玩还这么卡

在 Sublime Text 直接运行 Javascript 调试控制台 - 简书
在 Sublime Text 直接运行 Javascript 调试控制台
sublime text javascript
Sublime Text是深受喜欢的多语言编辑器,很多开发人员都选择它作为自己的主力编辑器进行创作,并且凭借其强大的可扩展性,Sublime Text功能也越来越丰富。但是有个问题,那就是Sublime Text不支持一些语言的运行,例如javascript,我们通常通过写一个HTML页面来嵌入JS,然后再用Chrome或者Firefox的开发者工具来调试。而实际上我们也可以通过添加Build System的方法来让Sublime Text支持Javascript Console控制台调试。
利用 Node.js 添加 JavaScript 控制台
为Sublime Text添加此Build System.只需打开Sublime Text,选择 Tools & Build System & New Build System... ,如图所示:
sublime build system
粘贴以下内容
{"cmd": ["node", "$file"],"selector": "source.js"}
并保存为Node.sublime-build,或者其他名字。保存位置Data\Packages\User文件夹下面
node.js build system
在 Tools & Build System 里选择刚刚创建好的“ Node”,就可以调试了。你需要做的就是在写好js文件后,按下Command + B按钮。
sublime javascript console
在Node.js的情况下,使用console.log()函数。
keep simpleSublime Text 2搭建Go开发环境,代码提示+补全+调试
- Go语言中文网 - Golang中文社区
<meta name="author" content="polaris ">
Sublime Text 2搭建Go开发环境,代码提示&#43;补全&#43;调试
· 10094 次点击 ·
开始浏览 & &
本文转自:http://blog.csdn.net/lvanneo/article/details/,并做部分修改。
本文在已安装Go环境的前提下继续。
1、安装Sublime Text 2
2、安装Package Control。
运行Sublime,按下 Ctrl+`(`在Tab键上边),然后输入以下内容:
import urllib2,os, h = &#39;e96f11eeadd761d777e62404&#39; + &#39;e330c659d4bb41d3bdf022e94cab3cd0&#39;; pf = &#39;Package Control.sublime-package&#39;; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else N urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( &#39;http://sublime.wbond.net/&#39; + pf.replace(&#39; &#39;, &#39;%20&#39;)).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), &#39;wb&#39; ).write(by) if dh == h else N print(&#39;Error validating download (got %s instead of %s), please try manual install&#39; % (dh, h) if dh != h else &#39;Please restart Sublime Text to finish installation&#39;)
3、安装GoSublime、GoGDB
1)重启Sublime,然后从菜单栏中打开
Perferences-&Package Control,或者按Ctrl+Shift+P打开。
2)在Package Control 中输入 :install,选中
Package Control: Install Package 后确定。
3)接着输入:GoSublime
后确定,留意状态栏等待安装完毕。
4)重复第二步操作后输入:GoGDB
(GoSublime、GoGDB这两个插件已能满足一般的编写和调试需要,如果还需要其他的插件可仿照第二、三步进行添加)
4、配置GoSublime
从菜单中打开 Perferences-&Package Settings-&GoSublime-&Settings-Default ,
会打开GoSublime的settings文件,在 &#34;env&#34;:{} 的{}中添加go的安装路径,如下:
&#34;env&#34;: {
&#34;path&#34;:&#34;D:\\GO\\bin&#34;
5、配置GoGDB
从菜单中打开 Perferences-&Package Settings-&GoGDB-&Settings-Default ,
会打开GoGDB的settings文件,找到&#34;workingdir&#34;和&#34;commandline&#34;所在位置,
指定好开放项目的路径及执行文件名称,如下:
&#34;workingdir&#34;: &#34;D:/GoPath&#34;,
&#34;commandline&#34;: &#34;gdb --interpreter=mi ./main.exe&#34;,至此,所有配置完成。
6、安装gocode
可参考/nsf/gocode/文档
在控制台中输入如下内容(要求已安装Go和Git),编译gocode:
在Windows下控制台中输入:
go get -u -ldflags -H=/nsf/gocode
在Mac下控制台中输入:
go get -/nsf/gocode
go /nsf/gocode
把生成的gocode.exe放到%GOROOT%\bin下。
7、安装gdb
这个我也不懂,网上下载一个好了。但是,不管是32位的还是64位的,名字都改为gdb.exe,放到%GOROOT%\bin下。
这里我准备了一个 gdb.exe 和 gocode.exe,以及本文教程,。
8、GoGDB使用教程
Launch with F5
Step over with F10
Step into with F11
Step out with Shift+F11
更多操作请参考:/quarnster/SublimeGDB
注:GoGdb是基于SublimeGDB修改的,使用方法相同。
9、开始写一个
然后,Ctrl+B ,输入编译指令: go build -gcflags &#34;-N -l&#34; gotest.go
(注:参数 -gcflags &#34;-N -l&#34; 必须添加,调试需要关闭内联优化)
10094 次点击 &
请尽量让自己的回复能够对别人有帮助
支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
支持 @ 本站用户;支持表情(输入 : 提示),见
记住登录状态
本文转自:http://blog.csdn.net/lvanneo/article/details/,并做部分修改。
本文在已安装Go环境的前提下继续。
1、安装Sublime Text 2
2、安装Package Control。
运行Sublime,按下 Ctrl+`(`在Tab键上边),然后输入以下内容:
import urllib2,os, h = &#39;e96f11eeadd761d777e62404&#39; + &#39;e330c659d4bb41d3bdf022e94cab3cd0&#39;; pf = &#39;Package Control.sublime-package&#39;; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else N urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( &#39;http://sublime.wbond.net/&#39; + pf.replace(&#39; &#39;, &#39;%20&#39;)).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), &#39;wb&#39; ).write(by) if dh == h else N print(&#39;Error validating download (got %s instead of %s), please try manual install&#39; % (dh, h) if dh != h else &#39;Please restart Sublime Text to finish installation&#39;)
3、安装GoSublime、GoGDB
1)重启Sublime,然后从菜单栏中打开
Perferences-&Package Control,或者按Ctrl+Shift+P打开。
2)在Package Control 中输入 :install,选中
Package Control: Install Package 后确定。
3)接着输入:GoSublime
后确定,留意状态栏等待安装完毕。
4)重复第二步操作后输入:GoGDB
(GoSublime、GoGDB这两个插件已能满足一般的编写和调试需要,如果还需要其他的插件可仿照第二、三步进行添加)
4、配置GoSublime
从菜单中打开 Perferences-&Package Settings-&GoSublime-&Settings-Default ,
会打开GoSublime的settings文件,在 &#34;env&#34;:{} 的{}中添加go的安装路径,如下:
&#34;env&#34;: {
&#34;path&#34;:&#34;D:\\GO\\bin&#34;
5、配置GoGDB
从菜单中打开 Perferences-&Package Settings-&GoGDB-&Settings-Default ,
会打开GoGDB的settings文件,找到&#34;workingdir&#34;和&#34;commandline&#34;所在位置,
指定好开放项目的路径及执行文件名称,如下:
&#34;workingdir&#34;: &#34;D:/GoPath&#34;,
&#34;commandline&#34;: &#34;gdb --interpreter=mi ./main.exe&#34;,至此,所有配置完成。
6、安装gocode
可参考/nsf/gocode/文档
在控制台中输入如下内容(要求已安装Go和Git),编译gocode:
在Windows下控制台中输入:
go get -u -ldflags -H=/nsf/gocode
在Mac下控制台中输入:
go get -/nsf/gocode
go /nsf/gocode
把生成的gocode.exe放到%GOROOT%\bin下。
7、安装gdb
这个我也不懂,网上下载一个好了。但是,不管是32位的还是64位的,名字都改为gdb.exe,放到%GOROOT%\bin下。
这里我准备了一个 gdb.exe 和 gocode.exe,以及本文教程,。
8、GoGDB使用教程
Launch with F5
Step over with F10
Step into with F11
Step out with Shift+F11
更多操作请参考:/quarnster/SublimeGDB
注:GoGdb是基于SublimeGDB修改的,使用方法相同。
9、开始写一个
然后,Ctrl+B ,输入编译指令: go build -gcflags &#34;-N -l&#34; gotest.go
(注:参数 -gcflags &#34;-N -l&#34; 必须添加,调试需要关闭内联优化)
648 人在线
&最高记录 1223
&2012- Go语言中文网,中国 Golang 社区,致力于构建完善的 Golang 中文社区,Go语言爱好者的学习家园。
Powered by
&o&服务器由
赞助 &·&CDN 由
VERSION: V3.0.0&·&3.740758ms&·&为了更好的体验,本站推荐使用 Chrome 或 Firefox 浏览器
登录和大家一起探讨吧
记住登录状态
还不是会员Debug PHP with Sublime Text 2 and Xdebug on Ubuntu
Debug PHP with Sublime Text 2 and Xdebug on Ubuntu
Today we are going to setup our &to start debugging PHP with&&and&.
The process is quite simple and is mostly extracted from the README of the &github project.
1Install xdebug
We are going to install the standard package with:
sudo apt-get install php5-xdebug
After installing customize the xdebug settings with:
sudo gedit /etc/php5/conf.d/xdebug.ini
We will add to that file if not already present this settings :
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
That will enable remote debugging for localhost in the port 9000. Now restart apache:
sudo service apache2 restart
2Download and unzip Python 2.6
In newer Ubuntu systems you cannot install the old Python 2.6 so we need to manually download it and unzip it into the Sublime Text 2 folder.
From the Lucid repository download the old&&for your system (amd64 for 64bits systems and i386 for 32bits). I downloaded the amd64 version into my user folder:
wget http://ubuntuarchive.eweka.nl/ubuntu//pool/main/p/python2.6/python2.6_2.6.5-1ubuntu6_amd64.deb
Now we are going to extract its contents to a folder called python2.6.
For the amd64 version:
dpkg-deb -x python2.6_2.6.5-1ubuntu6_amd64.deb python2.6
For the i386 version:
dpkg-deb -x python2.6_2.6.5-1ubuntu6_i386.deb python2.6
Finally we will copy the usr/lib/python2.6 folder from the extracted folder to our Sublime Text 2 folder (in my case ~/programas/sublime_text2 ):
cp -R python2.6/usr/lib/python2.6/ ~/programas/sublime_text2/lib/
3Install SublimeXdebug Package
We will install
through . If you need help installing Package Control you can read our previous post:
With Package Control installed we will install SublimeXdebug with:&
Ctrl + Shift + P & install & Xdebug
Then restart your Sublime Text 2 and your system is already to start debugging.
4Install and configure a remote debugger
Now we only need a tool to remote debugging. I've tested the &add-on and the &extension.
We will use the Chrome Xdebug. After&&and installing the Chrome extension you have to restart Chrome. Once restarted you we will see a new icon in the Chrome address bar:
Clicking on it will enable/disable the debug. But we first need to adjust the extension to use the Sublime Text sessionkey.
In Chrome go to Tools & Extensions
And open the Xdebug Helper preferences:
As you see we added the "sublime.xdebug" sessionkey and enabled debugging only for localhost.
We are done. We can start debugging!
5Example debug
In Sublime we have created a test.php file in the folder www/test with this PHP content:
for ($i=0; $i & 50; $i++) {
echo 'This is the line: ' . ($i + 1) . '';
Put your cursor in the echo line and press Ctrl + F8. This will create a breakpoint in that line.
Now start debugging with Shift + F8 & Start debugging. Sublime will start waiting for a remote debug connection.
In Chrome navigate to http://localhost/test/test.php&and click in the Xdebug Helper button to set it green. Reload the page and you will notice that it's freezed. That's because it is already captured by Sublime.
Now in Sublime start looping the for bucle with Ctrl + Shift + F5. You will see the variables values changing in the Xdebug Context tab.
6SublimeXdebug shortcuts
Shift+f8: Open XDebug quick panel
f8: Open XDebug control quick panel when debugger is connected
Ctrl+f8: Toggle breakpoint
Ctrl+Shift+f5: Run to next breakpoint
Ctrl+Shift+f6: Step over
Ctrl+Shift+f7: Step into
Ctrl+Shift+f8: Step out&
7References
Joomla! services
Need help with your Joomla! website?
We can help you with:
Joomla! extensions
Joomla! templates
Joomla! security and optimization
Joomla! hosting
Magento services
Need help with your Magento store?&
We can help you with:
Magento extensions
Magento customizations
Magento security and optimization
Magento optimized hosting
Magento SEO
Check out our:
Prestashop services
Need help with your Prestashop store?&
We can help you with:
Prestashop modules
Prestashop customizations
Prestashop security and optimization
Prestashop hosting
Prestashop SEO
Check out our:
y gestión para transportistas?
Didtrans es el software de transporte que ayuda y mejora la gestión del transporte de forma fácil y sencilla.
Visíta la web del programa,
y preguntanos cualquier duda que tengas.说起来惭愧,自从开始使用Sublime Text之后,再也没有debug过PHP的代码,最近把debug的环境搭建了一下,在这里记录一下。
安装XDebug
sudo apt-get install php5-xdebug
编辑xdebug.ini文件,添加如下配置
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log="/var/log/xdebug/xdebug.log"
其中参数代表的含义如下:
;load xdebug extension
zend_extension_ts = path/tp/xdebug
;是否开启自动跟踪
xdebug.auto_trace = On
;是否开启异常跟踪
xdebug.show_exception_trace = On
;是否开启远程调试自动启动
xdebug.remote_autostart = Off
;是否开启远程调试
xdebug.remote_enable = On
;允许调试的客户端IP
xdebug.remote_host=127.0.0.1
;远程调试的端口(默认9000)
;xdebug.remote_port=9000
;调试插件dbgp
xdebug.remote_handler=dbgp
;是否收集变量
xdebug.collect_vars = On
;是否收集返回值
xdebug.collect_return = On
;是否收集参数
xdebug.collect_params = On
;跟踪输出路径
xdebug.trace_output_dir="path/to/xdebug/trace"
;是否开启调试内容
xdebug.profiler_enable=On
;调试输出路径
xdebug.profiler_output_dir="path/to/xdebug/profiler"
重启nginx和php
sudo /etc/init.d/nginx restart
sudo /etc/init.d/php-fpm restart
然后在Sublime Text使用安装xdebug client,用ctrl+shift+p调出搜索框,输入Package Control: 选中其中的Package Control: Install&Package,输入Xdebug client,找到xdebug client,安装,安装完成后要重启Sublime。其操作如下:
要调试某一个项目,首先得把这个项目在sublime下保存成一个project。
sublime-&project-&save project as ...
接下来配置项目
sublime-&project-&edit poject
配置文件类似以下内容:
"folders":
"follow_symlinks": true,
"path": "."
"settings": {
"xdebug": {
"url": "http://my.local.website/",
再在chrome中安装扩展。在下载和安装Chrome扩展后,你必须重新启动浏览器。重新启动后,你将看到在Chrome的地址栏的新图标:
点击它,将启用/禁用调试。但是,我们首先需要调整扩展中使用&Sublime Text 的会话密钥。
在Chrome中Tools & Extensions
打开Xdebug helper options:
开启调试方式也比较简单,在想要加断点的地方右键
xdebug-&Add/Remove breakpoint
这样项目在运行到本行的时候就会停止下来
然后开始调试,在菜单栏选择
tools-&xdebug-&start debugging(launch browser)
sublime会自动打开浏览器,进入配置时写的网站链接,进行调试。
调试中所用的功能可以在调试文件中右键查看之。
快捷键说明如下
Start/Stop debugging session
Start Debugging -&Ctrl+Shift+F9&or&?+Shift+F9
Start Debugging (Launch Browser)
Restart Session
Stop Debugging -&Ctrl+Shift+F10&or&?+Shift+F10
Stop Debugging (Launch Browser)
Stop Debugging (Close Windows)
Breakpoints
Add/Remove Breakpoint -&Ctrl+F8&or&?+F8
Set Conditional Breakpoint -&Shift+F8
Clear Breakpoints
Clear All Breakpoints
Watch expressions
Set Watch Expression
Edit Watch Expression
Remove Watch Expression
Clear Watch Expressions
Session commands
Continuation commands
Run -&Ctrl+Shift+F5&or&?+Shift+F5
Run To Line
Step Over -&Ctrl+Shift+F6&or&?+Shift+F6
Step Into -&Ctrl+Shift+F7&or&?+Shift+F7
Step Out -&Ctrl+Shift+F8&or&?+Shift+F8
Restore Layout / Close Windows -&Ctrl+Shift+F11&or&?+Shift+F11
Settings - Default
Settings - User
问题无法跟踪断点
这可能是xdebug端口被占用,按Ctrl+`或者菜单栏View-&show Console查看错误信息,有可能是xdebug端口已经被占用的缘故。
在sublime xdebug中关闭调试,或者重启sublime可以解决这个问题,如果还不行,可以修改端口号,如xdebug.ini中的端口号修改为为1000,在perferences-&package settings-&xdebug-&setting-user文件中加入如下内容:
"port": 10000
弄好这个还是费了些时间~~
php环境在server上,在本地调试
可以再在perferences-&package settings-&xdebug-&setting-user文件中加入如下内容:
"path_mapping": {
"/absolute/path/to/file/on/server" : "/path/to/file/on/computer",
"/var/www/htdocs/example/" : "C:/git/websites/example/"
阅读(...) 评论()

我要回帖

更多关于 中国联通无限流量卡 的文章

 

随机推荐