小编wen*_*ens的帖子

摩卡监视器应用程序输出

我正在为我的网络应用程序构建一个日志记录模块nodejs.我希望能够测试使用mocha我的模块输出正确的消息给terminal.我一直在环顾四周,但没有找到任何明显的解决方案来检查这一点.我已经找到

process.stdout.on('data', function (){})
Run Code Online (Sandbox Code Playgroud)

但无法让这个工作.有人有什么建议吗?

mocha.js node.js

12
推荐指数
3
解决办法
6860
查看次数

在Mac上停止node.js进程

我有一个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端口的那些(节点)?

sockets macos bash node.js

10
推荐指数
2
解决办法
2万
查看次数

PlayN/GWT - 您是否忘记继承所需的模块?

当我尝试用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)

html java gwt playn

9
推荐指数
1
解决办法
2万
查看次数

Android/Eclipse模拟器如何擦除数据?

我在尝试上述问题时遇到了以下错误.有谁知道出了什么问题?

$ 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)

android android-emulator

8
推荐指数
3
解决办法
1万
查看次数

通过在Android中传递图像文件路径来裁剪图像

我试过下面的代码.但是,它始终会产生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)

android image crop

6
推荐指数
1
解决办法
1万
查看次数

将Twitter的日期格式转换为python中的Datetime

返回的日期时间格式Twitter为以下形式:

Thu Apr 23 13:38:19 +0000 2009
Run Code Online (Sandbox Code Playgroud)

我希望它的datetime格式为数据库enty和查询...

python-2.7

6
推荐指数
1
解决办法
7025
查看次数

在Dreamhost中从SSH执行'git pull'到没有密码的GitHub

我在使用git命令(例如git pull)时遇到困难,而不必使用GitHub输入用户名和密码.

我可以通过SSH连接到我的Dreamhost服务器并手动运行git pull.然后我必须输入我的GitHub用户名和密码.这是罚款和花花公子,但我想运行git pull WITHOUT不必输入我的GitHub的凭据每次.

发现我需要添加SSH密钥,但服务器仍然要求GitHub凭据.

我做了以下事情:

  1. 使用PuTTy SSH进入Dreamhost共享服务器

  2. 做了以下事情:

$ 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)

git ssh github dreamhost ssh-keys

4
推荐指数
1
解决办法
5431
查看次数

允许滚动和排序到GWT网格

美好的一天.我正在使用表格制作应用程序GWT Grid.现在,我想我GWT Grid有一个scrollbar当rowCount时大于15头是不是滚动区域的一部分.

我的问题是:

  1. 如何在不包含标题的情况下启用表/网格内容滚动?
  2. 如何使我的表头看起来像一个按钮,用户可以单击它来对特定列进行排序?

当rowCount> 15(包括标题)时,我的当前代码将允许滚动.请帮忙.提前致谢.

sorting grid gwt scroll scrollbar

3
推荐指数
1
解决办法
6869
查看次数

将Datetime格式转换为varchar格式样式解决方法

我有一个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)

我看过:

http://databases.aspfaq.com/database/what-are-the-valid-styles-for-converting-datetime-to-string.html

但是,我找不到任何足够的风格.只有 - .

sql t-sql sql-server datetime

3
推荐指数
1
解决办法
1万
查看次数

如何将延迟重定向添加到Django页面?

我知道这是相当简单的重定向添加到DjangoHttpResponseRedirect,但有可能使延迟重定向?

我要添加的内容就像是用户的确认页面,基本上会说" 您的请求已成功 "3秒钟,然后被带回登录页面或其他内容.

我已经读到了JQuery,但据我所知,这是为了JavaScript我想尽可能保持这个Python.

有任何想法吗?

python django

3
推荐指数
1
解决办法
1970
查看次数