使用node -v v0.10.29,npm -v 1.4.14(http://ppa.launchpad.net/chris-lea/node.js/ubuntu)
在进行项目的"npm install"时,"zlib@1.0.5 preinstall"总是喊"sh:1:node-waf:not found"
我已经看到了一些关于同样事情的其他问题,但我仍然不知道我必须做些什么来使"npm install"工作.
谢谢.
我将较旧的Android应用迁移到Android-Studio/Gradle.测试需求uiautomator-v18需要minSdkVersion=18.但是,我希望将minSdkVersion设置为15或16.
SO在同一件事上有很多问题,但我无法解决这个问题.
Exerpt AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.searcher"
android:versionCode="1"
android:versionName="0.0.1" >
<uses-sdk
tools:overrideLibrary="android.support.test.uiautomator.v18"/>
<!-- ... -->
</manifest>
Run Code Online (Sandbox Code Playgroud)
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.searcher"
minSdkVersion 15
targetSdkVersion 23
testApplicationId "com.example.searcher.test"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile files('libs/dagger-1.2.1.jar')
compile files('libs/dagger-compiler-1.2.1.jar')
compile files('libs/javawriter-2.1.2.jar')
compile files('libs/javax.inject.jar')
androidTestCompile(
'com.android.support:support-annotations:23.2.0',
'com.android.support.test:runner:0.4.1',
'com.android.support.test:rules:0.4.1',
'com.android.support.test.uiautomator:uiautomator-v18:2.1.1',
'org.hamcrest:hamcrest-library:1.3',
'org.mockito:mockito-core:1.10.5',
'junit:junit:4.12',
'com.google.dexmaker:dexmaker:1.1',
'com.google.dexmaker:dexmaker-mockito:1.1'
)
}
Run Code Online (Sandbox Code Playgroud)
以上给出了错误:
Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
> …Run Code Online (Sandbox Code Playgroud) bash: 4.3.42(1)-release (x86_64-pc-linux-gnu)
执行以下脚本:
# This is myscript.sh
line=$(ps aux | grep [m]yscript) # A => returns two duplicates processes (why?)
echo "'$line'"
ps aux | grep [m]yscript # B => returns only one
Run Code Online (Sandbox Code Playgroud)
输出:
'tom 31836 0.0 0.0 17656 3132 pts/25 S+ 10:33 0:00 bash myscript.sh
tom 31837 0.0 0.0 17660 1736 pts/25 S+ 10:33 0:00 bash myscript.sh'
tom 31836 0.0 0.0 17660 3428 pts/25 S+ 10:33 0:00 bash myscript.sh
Run Code Online (Sandbox Code Playgroud)
为什么内联执行的ps-snippet(A) 返回两行?
我认为使用 AWS Fargate 而不是 Lambda 的原因之一是它没有限制,例如最大运行时间(和其他)。然而,今天我发现该参数stopTimeout默认设置为30s,而其最大值为120s。请参阅 AWS 文档了解任务定义参数。
我是否误解了这个stopTimeout参数?我想运行一个可能需要 10-20 分钟的任务。如果我确实误解了什么,这个参数是什么意思?
我们正在向heroku部署一个简单的REST grails(2.3.7)应用程序.应用程序比"Hello World"少一点,但我们超过了512x的1x dyno限制(通常在600-700MB之间).
什么是这样的应用程序的内存使用情况的预期?
还有关于记忆的官方最低要求吗?
ES 1.7.3
我们有大约 2000 万个文件。每个文档都有一个唯一的 ID。当我们执行计数请求 (/index/type/_count) 时,我们得到的文档比索引少了大约 30K。
我通过在 ID 字段上发出请求来检查每个文档的存在。结果:没有遗漏。
是否有任何原因导致_count返回的数量不准确?
PS:我在做聚合时阅读了估计。这可能有关系吗?
使用sails.js(0.10.5):
我不知道如何使用水线/帆来实现groupBy / count。我想拥有的是:
SELECT customer_id, COUNT('') FROM customer_data GROUP BY customer_id;
or
SELECT customer_id, SUM(1) FROM customer_data GROUP BY customer_id;
Run Code Online (Sandbox Code Playgroud)
我无法使用count或sum(使用常量)来实现:
Customer.find({ groupBy:['customer_id'], count: true })
or
Customer.find({ groupBy:['customer_id'], sum: [1] })
Run Code Online (Sandbox Code Playgroud)
两者都将以错误结尾,第一个是“缺少计算”,第二个是“ SQL语法错误”。我可以使用sum与现有的列(sum: ['id'])进行分组,但这不会使我计数。
我使用的API错误吗?
我正在尝试使用(node.js)示例应用来对Google API进行身份验证,然后发出Google云端硬盘请求.我试图运行的示例来自使用jwt的googleapis node.js库的github自述文件:
var jwtClient = new googleapis.auth.JWT(
'123...xyz@developer.gserviceaccount.com',
'./key.pem',
null,
['https://www.googleapis.com/auth/drive'],
'my.personal@gmail.com');
jwtClient.authorize(function(err, tokens) {
if (err) {
console.log(err);
return;
}
// Make an authorized request to list Drive files.
drive.files.list({ auth: jwtClient }, function(err, resp) {
// handle err and response
});
});
Run Code Online (Sandbox Code Playgroud)
身份验证失败:
{ error: 'unauthorized_client',
error_description: 'Unauthorized client or scope in request.' }
Run Code Online (Sandbox Code Playgroud)
我对'my.personal@gmail.com'并不是100%肯定.使用我的客户端ID,我收到错误"无效模仿prn电子邮件地址.".
我根据文档创建了服务帐户客户端ID,服务电子邮件和证书指纹.我是否必须指定其他内容?我的范围不正确吗?如果是的话,应该是什么?
Google云端硬盘控制台已在Google Developer Console中启用.我还激活了试用帐户.
在解释中:
n=.1 2 3 4
(+/@*:) n NB. 1 4 9 16
(+/@:*:) n NB. 30
Run Code Online (Sandbox Code Playgroud)
在第一个中,sum(+/)应用于square(*:)的每个单个结果,而在第二个中,sum应用于整个结果列表.到现在为止还挺好.但是下一个例子似乎没有那样工作(可能它确实如此.我只是不明白):
mean=.+/%#
mdev=.-mean
(*:@:mdev) n NB. 2.25 0.25 0.25 2.25
ssq=.+/@(*:@:mdev)
ssq n NB. 5
+/@(*:@:mdev) NB. 5 - why not: 2.25 0.25 0.25 2.25
+/@:(*:@:mdev) NB. 5
Run Code Online (Sandbox Code Playgroud)
在ssq括号中表达式很好.它按预期工作:(*:@:mdev) n产生一个正方形列表.这与哪个@或@:使用无关.我理解其中的区别.但是@括号外面应该是我理解sum(+/)每个项目的结果(*:@:mdev).
谁可以启发我的理解是错的?为什么是第一个@在+/@(*:@:mdev)应用到整个结果列表,而不是每个项目中(+/@*:)?
最近,我有一个光荣的主意,可以J用作脚本语言(否则,我将永远不会在任何地方使用J)。jsoftware页面中的示例按承诺工作。这里供参考sumsquares:
#!/home/fred/j807/bin/jconsole
echo +/*:0".>,.2}.ARGV
exit''
Run Code Online (Sandbox Code Playgroud)
据我所知,这ARGV是一个包含内容的框式列表(带有1 2 3作为参数):
?????????????????????????????????????????????????????
?/home/fred/j807/bin/jconsole?./sumsquares.ijs?1?2?3?
?????????????????????????????????????????????????????
Run Code Online (Sandbox Code Playgroud)
但是,当在J REPL中执行时,它失败(我希望这不仅仅是我这边的一些愚蠢的错误):
+/*:0".>,.2}. ('/home/fred/j807/bin/jconsole';'./sumsquares.ijs';1;2;3)
|domain error
| +/*:0 ".>,.2}.('/home/fred/j807/bin/jconsole';'./sumsquares.ijs';1;2;3)
Run Code Online (Sandbox Code Playgroud)
我认为,我可以解密其中的一部分:
2}.:将两个字符串元素斩首>:拆箱/打开元素但是其余的还是个谜。有人能解释一下发生了什么0".>,.2}.吗?尤其是带有东西的东西0。
另外:
为什么它在脚本中起作用而不在REPL中起作用?
echo +/*:0".>,.2}.ARGV+/*:0".>,.2}.('/home/fred/j807/bin/jconsole';'./sumsquares.ijs';1;2;3)修改版本的工作方式与此相反:
echo +/*:@:>2}.ARGV+/*:@:>2}.('/home/fred/j807/bin/jconsole';'./sumsquares.ijs';1;2;3)我正试图解决这个问题J.在easy-j.pdf(可在这里 ;第19页)介绍中有这个钩子:
ti=.{.(*i.)}. NB. ti=times index generator
ti 2 5 NB. Usage
Run Code Online (Sandbox Code Playgroud)
我理解上一学期: 2(*i.)5 NB. 2 times 0 1 2 3 4
我可以理解/想象}.从参数列表(上面2 5)中创建的最后一个元素(*i.)5.但是什么使得明确/显而易见的是,参数列表也以某种方式传递{.给检索2(在我目前的理解中,参数已经被使用了}.)?
我希望这个问题对J专家来说是可以理解的.
node.js ×4
j ×3
amazon-ecs ×1
android ×1
aws-fargate ×1
bash ×1
build.gradle ×1
google-api ×1
grails ×1
grails-2.0 ×1
heroku ×1
javascript ×1
jwt ×1
linux ×1
sails.js ×1
waterline ×1