有没有可能的方法来传递任何额外的参数而不是datein schedule.scheduleJob(date,function(id))
下面的代码不起作用
var id =record.id;
var date =record.date;
jobsCollection.save({
id: record.id
}, {
$set: record
}, function (err, result) {
var j = schedule.scheduleJob(date, function (id) {
return function () {
console.log("inside----------")
console.log(id)
};
}(id));
if (!err) {
return context.sendJson([], 404);;
}
});
Run Code Online (Sandbox Code Playgroud)
我想传递日期和其他数据来安排工作。这样我就可以根据date schedule执行其他操作id
是mongodb的新手
db.myjobs.find() 得到以下结果
{ "_id" : ObjectId("52849a7b8dd61980d1b49b87"), "browser" : "FF20", "id" : "70", "jobs" : [ { "_id" : "5281d1680d0f2f2aaec5787e", "date" : "Tue Nov 12 2013 12:27:44 GMT+0530 (IST)", "id" : "29" } ], "os" : "VM-WIN7-64", "server" : "172.16.2.120" }
Run Code Online (Sandbox Code Playgroud)
从以上结果我必须"os" : "VM-WIN7-64"根据id=29内部返回 jobs
我正在使用以下代码,这是不正确的。
db.myjobs.find( { id: 29 } )
Run Code Online (Sandbox Code Playgroud)
我如何"os" : "VM-WIN7-64"通过id在内部输入(id = 29)而jobs 不用获取os详细信息"id":"70"
我正在尝试从数组中获取最后 2 项
result.forEach(function (re) {
console.log(re.files)
// prints ["utilities.rb", "print_utilities.rb", "lities.rb", "agination.rb"]
});
Run Code Online (Sandbox Code Playgroud)
我只想按顺序保留数组中的最后两个元素
[ "agination.rb", "print_utilities.rb"]
Run Code Online (Sandbox Code Playgroud)
怎么可能
我有一个mongo db表
{
"_id": ObjectId("531963b60748a6078fe4f345"),
"acces": "172.1.6.2.18",
"adapter": "Win 9",
"flavour": "LokiSnap",
"jobid": "8",
"os": "VM-WIN7-32",
"results": "",
"tests": "Test01"
}
Run Code Online (Sandbox Code Playgroud)
这里的result领域是"".如何更新此表中的值result与{"test" : "conenct","os":"osf"}基于jobid
更新表后是
{
"_id": ObjectId("531963b60748a6078fe4f345"),
"acces": "172.1.6.2.18",
"adapter": "Win 9",
"flavour": "LokiSnap",
"jobid": "8",
"os": "VM-WIN7-32",
"results": {
"test": "conenct",
"os": "osf"
}`,
"tests": "Test01"
Run Code Online (Sandbox Code Playgroud)
}
我试图在ubuntu 12.4中安装sikuli,遵循以下网站中提到的步骤
http://www.verious.com/tool/installing-sikuli-automation-tool-on-ubuntu-11-10/
java安装在ubuntu中
~$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Run Code Online (Sandbox Code Playgroud)
sikuli-ide成功加载,当我试图在屏幕上捕获图像时,我正在跟踪错误
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /home/ushusadmin/sikuli/Sikuli-IDE/libs/libVisionProxy.so: libml.so.2.1: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
at org.sikuli.script.TextRecognizer.(TextRecognizer.java:24)
at org.sikuli.ide.NamingPane.getFilenameFromImage(NamingPane.java:55)
at org.sikuli.ide.CaptureButton.update(CaptureButton.java:149)
at org.sikuli.script.CapturePrompt.notifyObserver(CapturePrompt.java:44)
at org.sikuli.script.CapturePrompt$1.mouseReleased(CapturePrompt.java:197)
at java.awt.Component.processMouseEvent(Componen
t.java:6505)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Window.processEvent(Window.java:2022)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at …Run Code Online (Sandbox Code Playgroud) 我有一个div id.i必须附加一个值为div的表.
<div id="testResult" style="padding-left: 120px; "></div>
Run Code Online (Sandbox Code Playgroud)
我正在做以下步骤,但它不起作用.
$.ajax({
url: '/getReports',
cache: false
}).done(function (html) {
if (html != "") {
$('#testResult').show();
var htm = "";
var string1 = '<table border="1"><tr><td>No</td><td>Testcase</td> <td>OS</td> <td>Browser</td> <td>Result</td></tr></table>';
$.each(html, function (i, data) {
string1 + = '<tr><td rowspan="3">1</td><td rowspan="3">' + data.status.test + '</td><td rowspan="3"><!--OS--></td><td>' + data.status.bwser + '</td> <td> ' + data.status.report + ' </td></tr>';
});
$('#testResult ').append(string1);
$("#testResult").html("<br/><br/>");
$("#testResult").html("<p>" + htm + "</p>");
}
}).fail(function () {
$("#testResult").html("Failed to run the …Run Code Online (Sandbox Code Playgroud) 我有一个像这样的字符串:
var report = 'Verifying Wireless Interface is present and state is Disconnected:PASSED<br>Verify Profile not present on the Client:PASSED<br>Add Profile to the Client:PASSED<br>Verify Profile Added Present on the Client:PASSED<br>Connecting to Access Point:PASSED<br>Verify the State is Connected:PASSED<br>Disconnecting from Access Point:PASSED<br>Verify the State is Disconnected:PASSED<br>ReConnecting to Access Point:PASSED<br>Verify the State is Connected:PASSED<br>Verify Ping to the Gateway (Access point):PASSED<br>Verify Signal Strength Greater than 75%:PASSED<br>Verify Round Trip Time not greater than 30 millieseconds:PASSED<br>Disconnecting from Access Point:PASSED<br>Verify the State is Disconnected:PASSED<br>Delete Profile to the Client:PASSED<br>Verify …Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码来检查某些条件
for myarg in myargs:
if myarg=='heading.png':
t = find(dirpath + '\\' + myarg)
t1= capture(t.getX() - 50, t.getY() + 50, t.getW(), t.getH())
click(t1)
else
print "else inside-----------"
Run Code Online (Sandbox Code Playgroud)
myargs conatians heading.png,name.png etc
执行上面的代码是gettign erros IndentationError: unindent does not match any outer indentation level
javascript ×3
jquery ×3
mongodb ×2
automation ×1
node.js ×1
python ×1
sikuli ×1
ubuntu ×1
ubuntu-12.04 ×1