bind

Bind function trouble

Hello, I'm using boost (signals + bind) and c++ for passing function reference. Here is the code: #define CONNECT(FunctionPointer) \ connect(bind(FunctionPointer, this, _1)); I use this like this: class SomeClass { void test1() {} void test2(int someArg) {} SomeClass() { CONNECT(&SomeClass::test1); CONNECT(&S...

How can boost::bind does not match the signature provided but works fine?

My confuse is like this code: #include "stdafx.h" #include <boost/bind.hpp> using namespace std; void fool(std::string s) { std::cout<<s<<endl; } void fool2() { std::cout<<"test2 called\n"<<endl; } void fool3(std::string s1,std::string s2) { std::cout<<"test3 called\n"<<endl; } typedef boost::function<void(std::string)> myHandl...

jquery bind button click event fails

test.html: <html> <head> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript" src="test.js"></script> </head> <body> <input id="but2" type="button" value="2"/> </body> </html> jquery-1.4.2.js is downloaded from http://jquery.com/ test.js: var fn=...

Register(/bind/match) a device with a driver

Hello, I am writing a usb driver (for a gamepad) on linux, and when I plug it in, ti loads usbhid. How can I make it so it loads my driver (gp_driver)? I did the unbind usbhid and bind to my driver trick, but I don't want to do it every single time. Should I have my driver already loaded? Should I code something in my driver? I have the...

SQL date format bind variable

Can anyone please tell me what is wrong with this SQL query. "select USERNAME, DATECREATED, CREDTYPE, USAGETYPE, OPERATIONID, TXNID, CALLERID from arwfissuanceauditlog where OPERATIONID in (2104,2107) and datecreated >= 'to_date('2010/06/21', 'yyyy/MM/dd HH24:MI:SS')' and datecreated < 'to_date('2010/08/03', 'yyyy/MM/dd HH24:MI:SS')'" ...

jQuery binding live events

Hi I am having troubles binding live events to dynamically created content. I have a page which loads a html page through an ajax call. The loaded html page contains some javascript which is then executed. The executed javascript creates some elements. I want to bind a click event handler to those elements, however after binding them ...

C++ binding question

Hello! Is there any way to make boost::bind work with std::fill? I tried the following, but it didn't work: boost::bind(std::fill, x.begin(), x.end(), 1); ...

bind() error with errno == ENOENT ?

Can anyone help explain what an errno value of ENOENT means when the bind() socket function fails? The man page says this means "the file does not exist". What file? I tried calling bind() with a bad file descriptor and that sets errno to EBADF as expected, so it's not that. ...

c# bind 2 lists to repeater

Hi [c# linq] i have 2 datasources, 1 coming from an xml document and 1 coming from an sql server database, both return an IEnumerable<EventsDetails> is it possible to bind both of these lists to a single repeater? ...

Bind to NSTreeController selectionIndexPaths

Hello, I want to bind to a NSTreeController's selectionIndexPaths programatically by doing the following (so that I can get a string a selection and display in a text view) [activePDFView bind:@"name" toObject:treeController withKeyPath:@"selectionIndexPaths.nodeName" options:options]; The tree controller is bound to a NSMut...

using static_cast with boost::bind

I want to transform a vector of type T to a vectorof type K. I tried this, but it doesn't work: transform(vec.rbegin(),vec.rend(),vecNew.begin(),boost::bind(static_cast<K>(),_1)); I get the error: "expected primary-expression before ‘)’ token". What am I doing wrong? ...

Bind gui controls within a UserControl to another UserControl and its containing controls in WPF

Hello I have UserControl1 which is a FormatButtonBar with format buttons AND I have UserControl2 which is a DataGrid with RichTextBoxes as cell editors. I want to reuse UserControl1 at different places of my application. This is what I want to achieve with pseudo code: <UserControl1> <ToggleButton Content="bold" IsChecked="{Binding I...

Bind custom event handler after ajax load

Specifically I'm looking to bind lightbox to a specific element. Normally I would just do this: $('a.lightbox').lightBox(); but that isn't working since I'm doing some loading with AJAX. Looking at the jQuery API I found .bind() and .live() but I'm not getting anything when I do $('a.lightbox').bind('lightBox') after the AJAX .load() cal...

bind two arguments

Consider I have the following struct: struct IDirect3D { IDirect3D() : ref_count_(0) {} unsigned long Release() { return --ref_count_; } private: long ref_count_; ~IDirect3D() {} }; I want to use shared_ptr to it like in the followed code (minimal example): int main() { boost::shared_ptr<IDirect3D> ptr; IDire...

Waiting on JQuery to finish .live() or .bind() bindings?

Hi, I have a script which adds click event handlers to about 500 elements in the page via JQuery .live or .bind (not decided which yet), and I am having a JQuery performance issue. With a small dataset, I can load the page and as soon as the page has finished loading according to the browser, I can click on something and off we go. ...

WPF: How to bind to a element when it is inside a DataGrid template column?

I can not bind the EditingCommand to the elementname Bla , how can I fix that? <StackPanel Orientation="Vertical"> <ToggleButton Content="bold" IsChecked="{Binding IsTextBold}" Command="EditingCommands.ToggleBold" CommandTarget="{Binding ElementName=Bla}" /> <DataGrid ScrollViewer.C...

Java Socks proxy connection

Socket skt; Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(proxy_address,proxy_port)); Socket server = new Socket(address, port); skt = new Socket(proxy); try { skt.setSoTimeout(5*1000); skt.connect(server.getRemoteSocketAddress()); } catch (Exception e) {} the skt socket creates a new socket with the pr...

Templating boost::bind to automatically handle multiple arguments for member function

I have a class with an "Attach" function that accepts a function object and stores it into a collection. The class itself is templated on the function signature. Something like this: template<class Signature> class Event { public: void Attach(boost::function<Signature> signature) { MySignatures.push_back(signature); } private: ...

Haskell: Scope of variable when using lambda expression with bind functions

The following line works as expected, but I am a little concerned why: getLine >>= \x-> getLine >>= \y-> return [x, y] Consider the addition of parenthesis to scope the lambda expressions: getLine >>= (\x-> getLine) >>= (\y-> return [x, y]) The second line is errorneous because x is not in scope when used in the return, and I am ha...

PDO BindValue without adding to query!

Im trying to find out the best way to execute these types of queries What I want to do is build a filter type function where i was in an array and the query is constructed! the problem is with PDO before you can bind a value you need to prepare the statement, but if i prepare the statement I cant change the query. Let me show you an e...