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
62
votes
5 answers

React - TypeError: Cannot read property 'props' of undefined

I'm trying to create a click event be able to delete an item on my list, but when I click it I get "TypeError: Cannot read property 'props' of undefined". I'm trying to stick to ES6 as much as possible, and I'm pretty sure its something to do…
pyan
  • 865
  • 2
  • 12
  • 23
62
votes
4 answers

Why is bind() used in TCP? Why is it used only on server side and not in client side?

I wanted to know the exact function of bind() in TCP. What does it mean by 'binding' a local address to the socket? If it's assigning a port number to the socket, then why don't we use it in the client? I know that port is assigned by OS…
Crocode
  • 3,056
  • 6
  • 26
  • 31
61
votes
15 answers

Cannot assign requested address using ServerSocket.socketBind

When I'm trying to set up a socket server, I've got an error message: Exception in thread "main" java.net.BindException: Cannot assign requested address: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at…
Adrian Adamczyk
  • 3,000
  • 5
  • 25
  • 41
53
votes
4 answers

Why is JavaScript bind() necessary?

The problem in example 1 is 'this' referring to the global name instead of the myName object. I understand the use of bind() in setting the value of this to a specific object, so it solves the problem in example 1, but why does this problem occur in…
Tom
  • 1,636
  • 2
  • 13
  • 21
51
votes
2 answers

What does binding a Rails Server to 0.0.0.0 buy you?

I am using "www.xip.io" as a DNS wildcard for testing on different devices. I set my primary domain to my IP address. I fire up a rails server with bundle exec rails server and I go here www..xip.io:3000 and notice my rails server…
andy4thehuynh
  • 2,042
  • 3
  • 27
  • 37
51
votes
4 answers

.live() vs .bind()

I want to know the main difference between .live() vs. .bind() methods in jQuery.
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
50
votes
6 answers

jQuery bind/unbind 'scroll' event on $(window)

I have this function: function block_scroll(key){ if (key) { $(window).bind("scroll", function(){ $('html, body').animate({scrollTop:0}, 'fast'); }); } else { $(window).unbind(); } } The first part…
o01
  • 5,191
  • 10
  • 44
  • 85
46
votes
4 answers

Why does click event handler fire immediately upon page load?

I playing around with a function that I want to bind to all the links. At the present the function fires when the page loads, instead of when I click on the link. Here's my code. (I can post the function showDiv(), if you need to see it.) Can you…
Jeff
  • 3,943
  • 8
  • 45
  • 68
46
votes
2 answers

How to enable named/bind/DNS full logging?

I am trying to find the perfect logging clause in named.conf that would help me enable full-level logs for named service. Can someone give an example here? My current clause is given below, but this generates very minimal logs. logging { …
deppfx
  • 701
  • 1
  • 10
  • 24
42
votes
4 answers

php closures: why the 'static' in the anonymous function declaration when binding to static class?

The example in the php documentation on Closure::bind include static on the anonymous function declaration. why? I can't find the difference if it is removed. with: class A { private static $sfoo = 1; } $cl1 = static function() { // notice the…
learning php
  • 1,134
  • 2
  • 10
  • 14
41
votes
13 answers

SQLite: bind list of values to "WHERE col IN ( :PRM )"

all I want to do is send a query like SELECT * FROM table WHERE col IN (110, 130, 90); So I prepared the following statement SELECT * FROM table WHERE col IN (:LST); Then I use sqlite_bind_text(stmt, 1, "110, 130, 90", -1,…
Sebastian
  • 2,109
  • 1
  • 20
  • 15
40
votes
3 answers

Remove focus programmatically?

I have a jquery ui dialog with tabs loaded dynamically/JSON with content. Due to the complexity, I can't really post a fiddle or a relevant code (too much code). What's happening is that when the dialog opens, you can tab through the elements within…
Jason
  • 7,612
  • 14
  • 77
  • 127
39
votes
2 answers

When should I use std::bind?

Every time I need to use std::bind, I end up using a lambda instead. So when should I use std::bind? I just finished removing it from one codebase, and I found that lambdas were always simpler and clearer than std::bind. Isn't std::bind completely…
gnzlbg
  • 7,135
  • 5
  • 53
  • 106
36
votes
5 answers

JQuery event model and preventing duplicate handlers

Once again I want to load a page which contains its own script into a div using $("divid").load(...). The problem I face is related to events. Let's say we trigger("monkey") from the parent page and on the loaded page we bind("monkey") and just do…
Mr AH
  • 1,100
  • 3
  • 11
  • 23
36
votes
2 answers

dig returns SERVFAIL but +trace works

Here is the main problem: dig maktabkhooneh.info +trace works perfectly fine and returns the right answer. dig maktabkhooneh.info (without +trace) returns: ; <<>> DiG 9.8.1-P1 <<>> maktabkhooneh.info ;; global options: +cmd ;; Got answer: ;;…
Hamed Tabatabaei
  • 695
  • 1
  • 7
  • 16