我正在尝试使用jQuery将函数绑定到这些事件:
$("#cmplist tr").bind('onmouseover', function(){
console.log('1');
});
$("#cmplist tr").bind('onmouseout', function(){
console.log('2');
});
$("#cmplist tr").bind('click', function(){
console.log('3');
});
Run Code Online (Sandbox Code Playgroud)
但是它们似乎都没有用.我有理由相信我的选择器是正确的,因为当我进入控制台时$("#cmplist tr")它返回:
[tr, tr#survey3, tr#survey20, tr#survey22, tr#survey26, tr#survey28, tr#survey29, tr#survey30, tr#survey33, tr#survey34, tr#survey6, tr#survey19, tr#survey14, tr#survey32, tr#sweepstakes5, tr#sweepstakes9, tr#coupons5, tr#freesample4, tr#freesample5, tr#freesample6, tr#freesample7, tr#gifts3, tr#gifts4, tr#polls2, tr#polls5, tr#polls6, tr#quiz8, tr#trivia4, tr#photo6, tr#photo10, tr#photo11, tr#photo12, tr#photo13, tr#photo15, tr#photo16, tr#photo17, tr#video4, tr#iframe2, tr#iframe4]
Run Code Online (Sandbox Code Playgroud)
我错过了有关jQuery事件如何工作的内容吗?
简单的任务
variable dept_id NUMBER
DECLARE
max_deptno NUMBER;
dept_name departments.department_name%TYPE := 'Education';
BEGIN
select max(department_id)
into max_deptno
from departments;
:dept_id := max_deptno + 10;
insert into departments (department_id, department_name, location_id)
values (:dept_id, dept_name, null);
DBMS_OUTPUT.PUT_LINE('The maximum department id is ' || max_deptno);
DBMS_OUTPUT.PUT_LINE('Rows made by insert: ' || SQL%ROWCOUNT);
END;
Run Code Online (Sandbox Code Playgroud)
max_deptno不是NULL.为什么dept_id在赋值后为NULL?我究竟做错了什么?
脚本输出:
MAX(DEPARTMENT_ID)
------------------
520
Error starting at line 10 in command:
DECLARE
max_deptno NUMBER;
dept_name departments.department_name%TYPE := 'Education1';
BEGIN
select max(department_id)
into max_deptno
from departments;
:dept_id := max_deptno + 10; …Run Code Online (Sandbox Code Playgroud) 我尝试编译这个函数:
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
void foo(unsigned n)
{
std::vector<unsigned> some_vector;
/* fill vector ... */
auto le_sqrt_n = std::bind(std::less_equal<unsigned>,
std::placeholders::_1,
unsigned(sqrt(n))
);
auto it = std::find_if(some_vector.rbegin(), some_vector.rend(), le_sqrt_n);
/* do something with the result ... */
}
Run Code Online (Sandbox Code Playgroud)
与gcc 4.6.3:
g++ -std=c++0x test_bind_02.cc
Run Code Online (Sandbox Code Playgroud)
并得到此错误:
test_bind_02.cc: In function ‘void foo(unsigned int)’:
test_bind_02.cc:10:55: error: expected primary-expression before ‘,’ token
test_bind_02.cc:13:9: error: unable to deduce ‘auto’ from ‘<expression error>’
test_bind_02.cc:14:77: error: unable to deduce ‘auto’ from ‘<expression error>’
Run Code Online (Sandbox Code Playgroud)
我的(可能是愚蠢的)错误是什么?
我正在一个网站上,各种对象绑定到$(窗口)上的常见事件.但是,我想在接收触发器的对象的上下文中运行这些函数.(换句话说,保留"this"所以它在调用函数时仍然引用对象而不是窗口.)我该怎么做?例如,在对象内:
var someNum = 1;
$(window).bind("test", printNum);
function printNum() {
alert(this.someNum); // should return 1
}
Run Code Online (Sandbox Code Playgroud) 我做了以下准备好的查询。如果我只是在 ? 的位置手动插入数字,它就可以完美地工作。是。
但是,如果我绑定参数,查询似乎不会运行。如何才能绑定限制号码呢?
if ($statement = $db -> prepare("SELECT blog_id, account_id, title, creation_time, body, timestamp
FROM blogs
ORDER BY creation_time DESC
LIMIT ?,?"))
{
$statement -> bind_param("ii", 2, 4);
$statement -> execute();
$statement -> store_result();
}
Run Code Online (Sandbox Code Playgroud) 我编写了以下 ldap 命令来测试 ldap 连接
ldapsearch -x -h ldap.com -b "uid=user1,ou=people,dc=domain,dc=com"
Run Code Online (Sandbox Code Playgroud)
我得到以下输出
# extended LDIF
#
# LDAPv3
# base <uid=user1,ou=people,dc=domain,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 1 Operations error
text: 000004DC: LdapErr: DSID-0C0907C2, comment: In order to perform this opera
tion a successful bind must be completed on the connection., data 0, v2580
# numResponses: 1
Run Code Online (Sandbox Code Playgroud)
请建议如何解决绑定错误
我正在对一个数据集进行探索性分析,其中包括过去 20 年中游戏数量以及每个平台的销量。
我想选择在任天堂平台上发布的所有游戏,我为实现这一目标所做的工作是:
dfNintendo <- dfNintendo[dfNintendo$Platform=="GBA", ]
Run Code Online (Sandbox Code Playgroud)
它仅用于提取在 Nintendo GBA 上发布的游戏,但我不知道如何同时提取具有与 GBA 不同的标签的多行,我尝试过:
dfNintendo <- dfNintendo[dfNintendo$Platform=="GBA" |
dfNintendo$Platform=="Wii" |
dfNintendo$Platform=="WiiU", ]
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我最终得到一个空的 data.frame。
我正在通过learningyouahaskell.com学习Haskell,并想在完成输入/输出模块之前测试一些概念。尽管看起来很简单,但我仍无法用谷歌或笨拙的方式解决这个问题。
当我尝试运行以下代码时
getName = do
name <- getLine
return name
Run Code Online (Sandbox Code Playgroud)
的输出getName成为type IO String而不是的元素String,即使name绝对是aString
通过阅读文档和其他StackVverflow的问题,我无法弄清楚为什么当我声明getName为一个函数时会发生这种情况(当我直接使用bind <-操作时main,没有任何问题)。
这是我服务器的代码:
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
int main (int argc, char **argv)
//------------------------MAIN--------------------------//
{
int sock; // sock descriptor
int new_sock;
int c;
int sin_size;
int koniec = 0;
char *ip_address;
char *port_number;
while (1)
{
static struct option OpcjeProgramu[] =
{
{ "port", required_argument, 0, 'p'},
{ "interface", required_argument, 0, 'i'},
{ 0, 0,0,0 }
};
int option_index = 0; …Run Code Online (Sandbox Code Playgroud) 在下面的代码中:
function User(name) {
this.name = name;
}
var user = new User('Jason Bourne');
User.prototype.sayHi = function() {
return 'Hi ' + this.name;
};
var sayHello = function() {
return 'Hello ' + this.name;
};
Run Code Online (Sandbox Code Playgroud)
如果我将对象绑定到 sayHello (sayHello.bind(user)) 或使用 user.sayHi();,这两个函数都会给出相同的结果。
所以我的问题是,是否有理由使用一种方法而不是另一种方法?我想我在某处读到过不鼓励在原型上创建东西,如果是的话为什么?
更正:
我错误地写了 Object.prototype.. 而不是指定 (Object I create).prototype..
鉴于以下代码:
#include <functional>
#include <iostream>
struct worker
{
std::function<bool(std::string)> m_callback;
void do_work(std::function<bool(std::string)> callback)
{
m_callback = std::bind(callback, std::placeholders::_1); // <--- replace this with lambda
std::cout << "worker is working..." << std::endl;
callback("worker is complete");
}
};
// pretty boring class - a cut down of my actual class
struct helper
{
bool work_callback(std::string str)
{
std::cout << "Helper: msg from worker: " << str << std::endl;
return false;
}
};
int main()
{
helper the_helper;
worker the_worker;
std::cout << "Main: …Run Code Online (Sandbox Code Playgroud) 可以说像PGM1(cobol)调用-> PGM2(cobol-db2)调用-> PGM3(cobol)->调用PGM4(cobol-db2)。1Q。PGM3被修改,这纯粹是COBOL程序。我们是只编译PGM3并将其推广到生产中,还是应该再次进行BIND,因为它由和调用cobol-db2程序进行了调用。2Q。如果修改了PGM4,则必须执行的操作。(我正在使用PACKAGE-> PLAN概念)?此外,当我们进行cobol-cobol / db2调用时,任何人都可以请我解释一下如何使用软件包概念进行绑定。