我System.Console.WriteLine("How can I see this debugging information in a browser");
在asp.net mvc4项目的内部模型中写道.如何在浏览器中或至少在visual studio中看到这个小小的字符串.在visual studio的输出窗口中找不到它.也许我需要从nuget安装一些插件...
我刚刚将Golang从1.3
版本升级到了版本1.4.2
.由于错误而无法编译:
../../my/mandrill.go:5: import /path/to/go/home/pkg/darwin_amd64/github.com/keighl/mandrill.a: object is [darwin amd64 go1.3.3 X:precisestack] expected [darwin amd64 go1.4.2 X:precisestack]
FAIL folder [build failed]
Run Code Online (Sandbox Code Playgroud)
在线 m "github.com/keighl/mandrill"
package my
import (
"fmt"
m "github.com/keighl/mandrill"
)
Run Code Online (Sandbox Code Playgroud)
我猜一些导入规则已经改变了1.4.2
.但无法弄清楚如何更改我的导入代码以使其编译.
我可以在workflow
文件夹中运行测试nosetests
:
workflow maks$ nosetests
..........
----------------------------------------------------------------------
Ran 10 tests in 0.093s
OK
Run Code Online (Sandbox Code Playgroud)
我的测试住在test
文件夹中:
workflow maks$ ls
__pycache__ iterations.py test
data iterationsClass.py testData
env iterationsClass.pyc
Run Code Online (Sandbox Code Playgroud)
但是当我搬到父母目录时:
(py3env)Makss-Mac:workflow maks$ cd ..
Run Code Online (Sandbox Code Playgroud)
它无法找到测试.
(py3env)Makss-Mac:Packages maks$ nosetests
----------------------------------------------------------------------
Ran 0 tests in 0.005s
OK
Run Code Online (Sandbox Code Playgroud)
那么如何在所有子目录中进行nosetest搜索测试呢?
我跑了go test
并且犯了错误:
*** Test killed with quit: ran too long (10m0s).
FAIL call/httptest 600.050s
Run Code Online (Sandbox Code Playgroud)
如何延长超时并使其超过10分钟?
我可以:
但是如何使用节点检查器调试nodeunit测试?
我试过了,但没有工作:
nodeunit --debug myNodeUnitModule_test.js
它不起作用.nodebug /usr/local/bin/nodeunit myNodeunit_test.js
但是它既不在ubuntu(No such file or directory
)也不在mac(env: node\r: No such file or directory
)上工作几乎工作 节点--debug/usr/local/bin/nodeunit ./routes/edit/bodyTelInfoArraysToObject_test.js
其中/usr/local/bin/nodeunit
是命令采用的路径which nodeunit
获得输出:
debugger listening on port 5858
并在那里执行测试.
但我不能跳进debuggin:当我localhost:8080
在chrome中打开url 来观看调试时:
在我的nodeunit测试中,我写debugger
了停止调试那里.但没什么.
我想创建全局错误处理程序以通过电子邮件发送它.
package main
import (
"github.com/gorilla/mux"
"log"
"net/http"
)
func main() {
rtr := mux.NewRouter()
rtr.HandleFunc("/", withPanic).Methods("GET")
http.Handle("/", rtr)
log.Println("Listening...")
http.ListenAndServe(":3001", http.DefaultServeMux)
}
func withPanic(w http.ResponseWriter, r *http.Request) {
panic("somewhere here will be panic, but I don't know where exactly")
}
Run Code Online (Sandbox Code Playgroud)
如何使其全球化.如果我知道错误发生在哪里会很容易
if err != nil {
sendMeMail(err)
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我不确切知道错误发生在哪里,该怎么办?所以我应该添加一个全局的recover
ish处理程序.但是如何做到这一点我完全不知道.
我添加defer recover
到开头main
但它从不执行请求http://localhost:3001
.因此不会通过电子邮件发送恐慌.
package main
import (
"errors"
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)
func main() {
defer func() {
if r := …
Run Code Online (Sandbox Code Playgroud) 我可以在element selector
使用时触发click事件trigger
$('element selector').trigger('click')
Run Code Online (Sandbox Code Playgroud)
是否可以触发班次点击.我的意思是shift+鼠标左键单击.
在崇高的终端(ctrl +`)中我每分钟都有一些行:
Checking for updates:
Sync Enabled: True
Sync Timeout: 60000
Latest Update at: Thu Jan 1 00:00:00 1970
Thread is: Thread-4
Paths: [{'path': '', 'display': ''}]
Run Code Online (Sandbox Code Playgroud)
它打断了我对deblging sublging插件的打扰.
如何禁用此功能Checking for updates
?
我尝试了两件事来禁用它:
我说行"update_check": false
到/Users/maks/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings
:
{"ignored_packages":["JavaScript控制台","Vintage"],"update_check":false}
并重新启动了崇高.但没什么......
我试图60000
在sublime文件夹的所有文件中找到字符串:/Users/maks/Library/Application Support/Sublime Text 3
但没有找到任何好处.也许60000毫秒是默认值.
更新
创建函数来搜索包和已安装包中的文本:
searchInSubl()
{
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages; zgrep -e $1 *.sublime-package ; cd ../Packages; grep -R -e $1 *
}
Run Code Online (Sandbox Code Playgroud)
在它的帮助下,我用不同的词搜索:"检查更新","同步启用","同步超时","60000","最新更新","线程是","路径".但没有找到.
看似这个更新是内部sublime …
我在Android Studio中创建了简单的测试.它只是打印hello from test
并比较1
与5
package com.example.maks.firstapp.test;
import android.test.InstrumentationTestCase;
public class ExampleTest extends InstrumentationTestCase {
public void test() throws Exception {
System.out.println("hello from test");
final int expected = 1;
final int reality = 5;
assertEquals(expected, reality);
}
}
Run Code Online (Sandbox Code Playgroud)
我跑了,但没有看到hello from test
任何地方.
输出:
Running tests
Test running started
junit.framework.AssertionFailedError: expected:<1> but was:<5>
at com.example.maks.firstapp.test.ExampleTest.test(ExampleTest.java:15)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1661)
Finish
Run Code Online (Sandbox Code Playgroud)
凡System.out.println
不实际打印
我尝试使用 …
我可以为常用方法创建方法别名:
func method1() {
fmt.Println("method1")
}
var Method1 = method1
Run Code Online (Sandbox Code Playgroud)
但是对于方法接收器不能做同样的事情:
type Person struct {
Name string
}
func (p *Person) methodReciver() {
fmt.Println("method reciver")
}
var MethodReciver = methodReciver
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我得到了错误在线var MethodReciver = methodReciver
:
undefined: methodReciver
Run Code Online (Sandbox Code Playgroud)
完整代码:
package main
import (
"fmt"
)
type Person struct {
Name string
}
func method1() {
fmt.Println("method1")
}
var Method1 = method1
func (p *Person) methodReceiver() {
fmt.Println("method receiver")
}
var MethodReceiver = methodReceiver
func main() {
method1()
Method1()
p := …
Run Code Online (Sandbox Code Playgroud) go ×4
alias ×1
android ×1
asp.net ×1
asp.net-mvc ×1
gorilla ×1
java ×1
javascript ×1
jquery ×1
node.js ×1
nodeunit ×1
nose ×1
python ×1
python-3.x ×1
sublimetext ×1
sublimetext3 ×1