Questions tagged [bind]

This tag means different things in different contexts: consider using less ambiguous tags instead. Common meanings include: the bind function in socket programming; binding to naming contexts; the bind method in jQuery; BIND the DNS server (named), . For boost::bind in C++, use [boost-bind]. Do not use this tag just to say that you're binding something to something else.

  • In and , bind() is a system call that associates an IP address and port number with a socket.
  • In , Function.prototype.bind() is a method to attach a function to a fixed this value.
  • In , bind is a method to attach a handler to an event. This method was deprecated in jquery v3.0
  • In , 'bind' is a connect/authenticate step.
  • in , 'bind' is the process of associating an object with a name in a context.
  • in , 'bind' is the process of associating a remote object with a name in an RMI Registry.
  • In , 'bind' is the process of associating an exported object with a name in a COSNaming context.
  • In bind or binding refers to specifying the target of an inject request.
  • In , questions about the library's boost::bind function should use the tag instead and questions about the function std::bind should use the tag .
  • BIND, the Berkeley Internet Name Domain is the most commonly used DNS server software on the Internet. Questions about BIND are often off-topic for StackOverflow and may belong on SuperUser.com or unix.stackexchange.com.
  • In , "bind" often refers to the >>= operator. Questions about it should use the tag .

Do not use this tag just to indicate that you're binding something to something else — use tags that are related to the topic of your question.

4006 questions
22
votes
4 answers

Get function pointer from std::function when using std::bind

I'm trying to use std::function in conjunction with std::bind, but I'm having some problems. This works: #include #include void print() { std::cout << 2; } int main() { std::function foo = print; …
chris
  • 60,560
  • 13
  • 143
  • 205
21
votes
2 answers

std::bind a bound function

I'm having trouble in detecting why the heck is this not compiling. I've got some lambda function that returns a std::function based on some argument. I've narrowed down my problem to this snippet(which doesn't use lambdas, but reproduces my error…
mfontanini
  • 21,410
  • 4
  • 65
  • 73
20
votes
2 answers

jQuery binding click to a link after AJAX call

I'm getting furious - perhaps someone will be able to help me with this. I need to re-bind the click to the link after AJAX call, but for some reason it doesn't want to work. Here's my code: if ($('.active').length > 0) { …
user398341
  • 6,339
  • 17
  • 57
  • 75
20
votes
2 answers

Bind a directory to a docker container

I'm building a test project that requires a module outside of the project directory. The project folder is in docker, and I would like to bind that module directory to the docker container of my project. Is it even possible to do it? Or am I asking…
avian
  • 343
  • 1
  • 2
  • 10
20
votes
5 answers

python TCPServer address already in use but I close the server and I use `allow_reuse_address`

Here is my code to run the server: class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): #.... PORT = 8089 httpd = SocketServer.TCPServer(("", PORT), MyRequestHandler) httpd.allow_reuse_address = True print "Serving forever at…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
20
votes
7 answers

Binding to a weak_ptr

Is there a way to std::bind to a std::weak_ptr? I'd like to store a "weak function" callback that automatically "disconnects" when the callee is destroyed. I know how to create a std::function using a shared_ptr: std::function
Scotty
  • 2,480
  • 2
  • 16
  • 20
19
votes
6 answers

Binding an 'unsigned long' (uint64) in an sqlite3 statement? C++

I'm using the sqlite3 library that is available at sqlite.org. I have some unsigned longs that I would like store in a database. I do not want to construct the query myself and leave it open to some sort of injection (whether it be accidental or…
g19fanatic
  • 10,567
  • 6
  • 33
  • 63
19
votes
2 answers

How can boost::bind call private methods?

boost::bind is extremely handy in a number of situations. One of them is to dispatch/post a method call so that an io_service will make the call later, when it can. In such situations, boost::bind behaves as one might candidly expect: #include…
Gabriel
  • 2,841
  • 4
  • 33
  • 43
19
votes
11 answers

ASP.NET using Bind/Eval in .aspx in If statement

in my .aspx I'm looking to add in an If statement based on a value coming from the bind. I have tried the following: <% if(bool.Parse(Eval("IsLinkable") as string)){ %> monkeys!!!!!! (please be aware there will be…
Funky
  • 12,890
  • 35
  • 106
  • 161
19
votes
8 answers

How to bind mysqli bind_param arguments dynamically in PHP?

I have been learning to use prepared and bound statements for my sql queries, and I have come out with this so far, it works okay but it is not dynamic at all when comes to multiple parameters or when there no parameter needed, public function…
Run
  • 54,938
  • 169
  • 450
  • 748
19
votes
4 answers

Angular 2. @Input since it isn't a known property of

I got a parent component with following template:
Alexander Zakusilo
  • 1,466
  • 3
  • 16
  • 34
19
votes
1 answer

Is `std::function` allowed to move its arguments?

While working on this question, I noticed that GCC (v4.7)'s implementation of std::function moves its arguments when they are taken by value. The following code shows this behavior: #include #include struct…
Luc Touraille
  • 79,925
  • 15
  • 92
  • 137
18
votes
4 answers

Using Angular, how do I bind a click event to an element and on click, slide a sibling element down and up?

I'm working with Angular and I'm having trouble doing something that I normally use jQuery for. I want to bind a click event to an element and on click, slide a sibling element down and up. This is what the jQuery would look…
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59
17
votes
4 answers

Bind error while recreating socket

A have the following listener socket: int sd = socket(PF_INET, SOCK_STREAM, 0); struct sockaddr_in addr; bzero(&addr, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(http_port); addr.sin_addr.s_addr =…
spe
  • 1,031
  • 6
  • 18
  • 24
17
votes
3 answers

Run PHP inside DNS zone Bind 10

I'm using linux CentOS 6.64 with BIND 10.1.2 I have an additional zone (list.example.com) within the main DNS (example.com) Bind (named) config file /etc/named.conf is include the zone: zone "list.example.com" IN { type master; file…
user2203703
  • 1,955
  • 4
  • 22
  • 36