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
28
votes
4 answers

Uncaught TypeError: Object [object Object] has no method 'on'

Can anyone help me to figure this out ? When I use the latest (or a newish) version of jQuery, the small script below works fine. However, when I use older versions of jQuery, my script says that the on function does not exist. Here is my script…
dvlden
  • 2,402
  • 8
  • 38
  • 61
28
votes
4 answers

Can I bind to a function that takes default arguments and then call it?

How can I bind to a function that takes default arguments, without specifying the default arguments and then call it without any arguments? void foo(int a, int b = 23) { std::cout << a << " " << b << std::endl; } int main() { auto f =…
Stephan Dollberg
  • 32,985
  • 16
  • 81
  • 107
27
votes
2 answers

first unbind click and then bind (jquery)

1.I have a onclick event on, $('#locations').click(function(){ $('#train').unbind('click'); //do some stuff } 2.Once the close button is clicked $('.close').click(function(){ //do some stuff } 3.Then again if I click #train…
Prithviraj Mitra
  • 11,002
  • 13
  • 58
  • 99
27
votes
1 answer

std::bind to std::function?

I get a compile error using this: std::vector> functions; std::function foo = [](int a, int b){ return a + b; }; std::function bar = std::bind(foo, 2); functions.push_back(bar); The error…
Philipp H.
  • 1,513
  • 3
  • 17
  • 31
26
votes
4 answers

How to handle lack of JavaScript Object.bind() method in IE 8

I am writing a bit of JavaScript that uses the Object.bind method. funcabc = function(x, y, z){ this.myx = x; this.playUB = function(w) { if ( this.myx === null ) { // do blah blah return; } …
25
votes
2 answers

Is monad bind (>>=) operator closer to function composition (chaining) or function application?

In many articles I have read that monad >>= operator is a way to represent function composition. But for me it is closer to some kind of advanced function application ($) :: (a -> b) -> a -> b (>>=) :: Monad m => m a -> (a -> m b) -> m b For…
24
votes
3 answers

How do I mount --bind inside a Docker container?

I have this container based on debian:jessie (but this is not very relevant as I had the same issue with alpine:3.3). I get to the point where I need to mount --bind /htdocs/www /home/user/example.com/www and I get mount: permission denied I can't…
Morpheu5
  • 2,610
  • 6
  • 39
  • 72
24
votes
1 answer

Bind address and MySQL server

I came across the bind address while trying to configure the MySQL server. The details of why I want to configure the bind address is in the link below. Multiple hostnames and multiple privileges? Now, I want to understand the purpose of the bind…
Karthick
  • 2,844
  • 4
  • 34
  • 55
24
votes
1 answer

jQuery on vs bind for invalid event type

Given the following HTML:
The following javascript works fine: (function( jQuery ) { jQuery("input").bind("invalid", function(event) { console.log(event.type); }); })( jQuery ); …
drummondj
  • 1,483
  • 1
  • 10
  • 11
24
votes
2 answers

Using a specific network interface for a socket in windows

Is there a reliable way in Windows, apart from changing the routing table, to force a newly created socket to use a specific network interface? I understand that bind() to the interface's IP address does not guarantee this.
Ofir
  • 8,194
  • 2
  • 29
  • 44
24
votes
3 answers

Can I get an unbound function from a bound function in JavaScript?

I'm getting my head wrapped about currying and other techniques using Function.prototype.bind. It seems extremely useful to change function scope (i.e., this value) in certain situations. However it looks like you can't change the scope with bind…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
22
votes
2 answers

Function.prototype.bind

I've got pretty interesting question about EcmaScript-5 Function.prototype.bind implementation. Usually when you use bind, you do it this way: var myFunction = function() { alert(this); }.bind(123); // will alert 123 myFunction(); Okay so…
Ruslan
  • 313
  • 1
  • 3
  • 16
22
votes
3 answers

How can I bind a driver with a USB device?

I am writing a USB device drive for linux. it's for a joystick. every time plug it in, linux loads a hid driver. is there a way to tell Linux to load mine when I plug it in? or at least not load the default one? I can echo the id in unbind of the…
pvinis
  • 4,059
  • 5
  • 39
  • 59
22
votes
7 answers

OSX Mavericks - BIND no longer installed... how to get local DNS server working?

I have always used BIND on OSX to provide a local DNS resolver for my local development machines, particularly to facilitate virtual machines accessing my local dev environment. Foolishly I decided to upgrade to OSX Mavericks overnight and it…
steve
  • 2,469
  • 1
  • 23
  • 30
22
votes
7 answers

Bind Param with array of parameters

I have a function that does this: function registerUser($firstName, $lastName, $address, $postcode, $email, $password) { $params = array($firstName, $lastName, $address, $postcode, $email, $password); $result = $this->db->bind("INSERT INTO…
David G
  • 6,803
  • 4
  • 28
  • 51