我正在为我的网络应用程序构建一个日志记录模块nodejs
.我希望能够测试使用mocha
我的模块输出正确的消息给terminal
.我一直在环顾四周,但没有找到任何明显的解决方案来检查这一点.我已经找到
process.stdout.on('data', function (){})
Run Code Online (Sandbox Code Playgroud)
但无法让这个工作.有人有什么建议吗?
我有一个node.js
使用一些套接字端口的应用程序.有时,当我退出应用程序时Ctrl + C
,某些节点进程仍在运行,仍然会分配套接字端口.因此,我无法重新启动我的应用程序,因为它无法打开这些端口.当我查看情况时ps
,我得到以下回复:
$ ps
PID TTY TIME CMD
40454 ttys000 0:00.11 -bash
41643 ttys001 0:00.00 (node)
41741 ttys001 0:00.00 (node)
Run Code Online (Sandbox Code Playgroud)
尝试kill -9 41643
不会杀死进程.它是某种无法杀死的僵尸吗?如何摆脱阻塞我的tcp
端口的那些(节点)?
当我尝试用HTML编译游戏时,我遇到了一个奇怪的问题.(我搜索了其他主题,他们指的是进口非法包裹的人,我不是.)
所以基本上,在我的主要包中调用的每个类都在我的主包之外调用了这个错误.这些类都是由我实现的,他们不会导入任何非法的东西(没有反射,没有I/O,只有自制类和jbox2d).似乎它忽略了导入或类似的东西.
为了测试这个,我创建了一个名为Test的空类.当它在我的主要包装中时我没有得到任何错误,而当我把它移到外面时,我得到了:
[INFO] [ERROR]第73行:没有源代码可用于类型progetto.saga.map.Test; 你忘了继承一个必需的模块吗?
在第73行,我就是这么做的 Test test = new Test()
这是我的.gwt.xml文件:
<module rename-to='theknowledgetower'>
<inherits name='playn.PlayN'/>
<inherits name='TheKnowledgeTowersAssets'/>
<source path='core'/>
<source path='html'/>
<public path="resources" />
<entry-point class='progetto.saga.html.TheKnowledgeTowersHtml'/>
</module>
Run Code Online (Sandbox Code Playgroud)
你们有什么想法吗?
编辑:这是我得到的错误(我在我的主程序包之外的主类中的每个自定义类都得到它)
[INFO] [ERROR] Line 53: No source code is available for type progetto.saga.navigable.Navigable; did you forget to inherit a required module?
[INFO] [ERROR] Line 59: No source code is available for type progetto.saga.entity.dynamicentity.Player; did you forget to inherit a required module?
[INFO] [ERROR] Line 110: No source code is available …
Run Code Online (Sandbox Code Playgroud) 我在尝试上述问题时遇到了以下错误.有谁知道出了什么问题?
$ adb devices
List of devices attached
emulator-5554 device
$ emulator -avd -wipe-data
PANIC: Could not open: -wipe-data
$ emulator -avd emulator-5554 -wipe-data
PANIC: Could not open: emulator-5554
Run Code Online (Sandbox Code Playgroud) 我试过下面的代码.但是,它始终会产生160*160尺寸的图像.
try {
//call the standard crop action intent (the user device may not support it)
Intent cropIntent = new Intent("com.android.camera.action.CROP");
//indicate image type and Uri
cropIntent.setDataAndType(Uri.fromFile(pictureFile), "image/*");
//set crop properties
cropIntent.putExtra("crop", "true");
//indicate aspect of desired crop
cropIntent.putExtra("aspectX", 100);
cropIntent.putExtra("aspectY", 100);
cropIntent.putExtra("scale", true);
//indicate output X and Y
cropIntent.putExtra("outputX", 500);
cropIntent.putExtra("outputY", 500);
//retrieve data on return
cropIntent.putExtra("return-data", true);
//start the activity - we handle returning in onActivityResult
startActivityForResult(cropIntent, CROP_IMAGE);
} catch(ActivityNotFoundException anfe) {
//display an error message
String errorMessage …
Run Code Online (Sandbox Code Playgroud) 返回的日期时间格式Twitter
为以下形式:
Thu Apr 23 13:38:19 +0000 2009
Run Code Online (Sandbox Code Playgroud)
我希望它的datetime
格式为数据库enty和查询...
我在使用git命令(例如git pull)时遇到困难,而不必使用GitHub输入用户名和密码.
我可以通过SSH连接到我的Dreamhost服务器并手动运行git pull
.然后我必须输入我的GitHub用户名和密码.这是罚款和花花公子,但我想运行git pull
WITHOUT不必输入我的GitHub的凭据每次.
发现我需要添加SSH密钥,但服务器仍然要求GitHub凭据.
我做了以下事情:
使用PuTTy SSH进入Dreamhost共享服务器
做了以下事情:
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/funkyserver/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <-- I left this empty
Enter same passphrase again: <-- I left this empty
Your identification has been saved in /home/funkyserver/.ssh/id_rsa.
Your public key has been saved in /home/funkyserver/.ssh/id_rsa.pub.
The key fingerprint is:
12:c3:12d:88:01:pp:12:b5:ca:33:8g:1q:64:ce:4a:81 funkyserver@wonkyninja <-- wonkyninja is Dreamhost's server name …
Run Code Online (Sandbox Code Playgroud) 美好的一天.我正在使用表格制作gwt应用程序GWT Grid
.现在,我想我GWT Grid
有一个scrollbar
当rowCount时大于15头是不是滚动区域的一部分.
我的问题是:
当rowCount> 15(包括标题)时,我的当前代码将允许滚动.请帮忙.提前致谢.
我有一个datetime列,我需要以下列格式显示:
YYYY/MM/DD 00:00:00:000
Run Code Online (Sandbox Code Playgroud)
有了CONVERT
,我找不到任何合适的款式.
的/
,因为它需要一个被比较的格式是非常重要VARCHAR
的是具有文本列YYYY/MM/DD 00:00
像下面的描述中的一部分:
如果我能找到一种方式/风格,那么我可以使用SUBSTRING函数将其与下面的值进行比较:
Diary item added for : 2013/08/20 14:12
Run Code Online (Sandbox Code Playgroud)
我看过:
但是,我找不到任何足够的风格.只有 - .
我知道这是相当简单的重定向添加到Django
同HttpResponseRedirect
,但有可能使延迟重定向?
我要添加的内容就像是用户的确认页面,基本上会说" 您的请求已成功 "3秒钟,然后被带回登录页面或其他内容.
我已经读到了JQuery
,但据我所知,这是为了JavaScript
我想尽可能保持这个Python
.
有任何想法吗?