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
35
votes
6 answers

(ubuntu) nginx: [emerg] bind() to 0.0.0.0:80 failed (13: permission denied)

I need help figuring out the root cause of this permission denied error. What permissions does nginx need? Why is it so complicated?
user2350858
  • 681
  • 2
  • 10
  • 16
34
votes
5 answers

How to bind DataTemplate datatype to interface?

I am writing a composite loosely coupled MVVM WPF application and child VMs in a parent VM are interfaces rather than class instances, e.g. public IChildViewModel { get; set; } Now how do I render this property using a DataTemplate?…
Charlie
  • 764
  • 2
  • 13
  • 24
33
votes
1 answer

Detect user scroll down or scroll up in jQuery

Possible Duplicate: Differentiate between scroll up/down in jquery? Is it possible to detect if user scroll down or scroll up ? Example : $(window).scroll(function(){ // IF USER SCROLL DOWN DO ACTION // IF USER SCROLL UP …
Steffi
  • 6,835
  • 25
  • 78
  • 123
33
votes
1 answer

Lambda functions vs bind, memory! (and performance)

I would like to determine which is the best practice between equivalent solutions. The use case is an instance of a class that listen to an event. Dr. Axel Rauschmayer prefers the lambda for readability. I agree with him. But in term of performance…
Paleo
  • 21,831
  • 4
  • 65
  • 76
33
votes
5 answers

HAProxy doesn't start, can not bind UNIX socket [/run/haproxy/admin.sock]

I'm trying to start haproxy (version 1.5.8 2014/10/31) with an "empty" config file and I get: user@server:~$ sudo service haproxy start [....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket…
Balazs Varhegyi
  • 991
  • 1
  • 18
  • 37
33
votes
3 answers

Bind more arguments of an already bound function in Javascript

I try to sort my thoughts about how javascript's bind() works. I see that if I do var f = function (a) { ... } var g = f.bind(obj); g(1) then f is called with obj as this and 1 as a. What I thought is g is a wrapper function around f. But when I…
Martin Pecka
  • 2,953
  • 1
  • 31
  • 40
32
votes
4 answers

Using cbind on an arbitrarily long list of objects

I would like to find a way to create a data.frame by using cbind() to join together many separate objects. For example, if A, B, C & D are all vectors of equal length, one can create data.frame ABCD with ABCD <- cbind(A,B,C,D) However, when the…
rtyro
  • 321
  • 1
  • 3
  • 3
32
votes
3 answers

what's the difference between 'call/apply' and 'bind'

var obj = { x: 81, getX: function() { console.log( this.x) } }; var getX = obj.getX.bind(obj);//use obj as 'this'; getX();//81 var getX = function(){ obj.getX.apply(obj); } getX();//also 81 The use of bind and call/apply look…
bennyrice
  • 323
  • 1
  • 3
  • 7
32
votes
4 answers

jQuery: trigger a hover event from another element

When you hover over one
Don P
  • 60,113
  • 114
  • 300
  • 432
31
votes
2 answers

template argument deduction/substitution failed, when using std::function and std::bind

I have a compile error when using std::function in a templated member function, the following code is a simple example: #include #include using std::function; using std::bind; using std::shared_ptr; class Test { public: …
haipeng31
  • 635
  • 1
  • 7
  • 16
30
votes
4 answers

bind a jquery function to fancybox .close() event

I would like to trigger a simple jQuery function based on a fancybox closing. it is the only fancybox on the page $.fn.fancybox.close = function() { $('#sub_cont').hide(250, function() { $('#IDsearchform input').val(''); }); …
Jeff Voss
  • 3,637
  • 8
  • 46
  • 71
30
votes
5 answers

What is the difference between $.proxy() and bind()?

In 2009, ECMAScript 5 added a built-in bind() function which takes an object as a parameter and returns an identical function in which this will always refer to the object you passed it. (I couldn't find anything that looked like a canonical…
Max Cantor
  • 8,229
  • 7
  • 45
  • 59
29
votes
2 answers

Communicate with foreground service android

First question here, but I've been around for a while. What do I have: I'm building an Android app which plays audio streams and online playlists. Everything is working fine now, but I'm having issues in communicating with my service. The music is…
ores
  • 423
  • 1
  • 4
  • 6
28
votes
1 answer

How to bind a socket to multiple interfaces

After hours of searching on the internet, I still wasn't able to find an answer for my problem. My task is to create a server that accepts sockets from a variable number of interfaces (given in a config file as eth0, eth1, etc.). What is the easiest…
Hynek Blaha
  • 633
  • 2
  • 6
  • 8
28
votes
3 answers

Binding multiple values in pdo

Is there's an easy way of binding multiple values in PDO without repitition ? Take a look at the following code : $result_set = $pdo->prepare("INSERT INTO `users` (`username`, `password`, `first_name`, `last_name`) VALUES (:username, :password,…
Yousuf Memon
  • 4,638
  • 12
  • 41
  • 57