callback

callback function for php preg_replace_callback not getting called on linux CentOS 5.4

I have used the preg_replace_callback as $string = preg_replace_callback($pattern,'CreateTemplatesController::callbackhandler',$string ); I have called the callbackhandler function with the class name as this function is a private static function. Problem is "callbackhandler" function is not getting called. Please post if any one k...

callbacks via objective-c selectors

I have a "BSjax" class that I wrote that lets me make async calls to our server to get json result sets, etc using the ASIHTTPRequest class. I set it up so that the BSjax class parses my server's json response, then passes control back to the calling view controller via this call: [[self delegate] performSelectorOnMainThread:@selector(...

Scoping problem with Javascript callback

I am having some trouble getting a callback function to work. Here is my code: SomeObject.prototype.refreshData = function() { var read_obj = new SomeAjaxCall("read_some_data", { }, this.readSuccess, this.readFail); } SomeObject.prototype.readSuccess = function(response) { this.data = response; this.someList = []; for (v...

php Preg_replace_callback problem

Hi I have the following code but im not a big fun of reg exp as they are too confusing: <?php $r = '|\\*(.+)\\*|'; $w = ''; $s = 'hello world *copyMe* here'; function callbk($str){ print_r($str); foreach($str as $k=>$v) { echo $v; } } $t = preg_replace_callback($r,'callbk',$s); //output: Array ( [0] => *copyMe* [1...

Should I use Qt signal/slot mechanisms over traditional callbacks?

A senior developer in my team used traditional C-style callbacks in our Qt application instead of using Qt signal/slot mechanisms. My first reflex would be to replace his code and use Qt signal/slot instead. Is there any good reasons to use callbacks in a Qt application/library? Thanks. ...

What's the difference between a Callback and a Partial Postback?

Is there a difference, or are the terms synonymous? Sorry if this has been asked before, I could only find the difference between a full postback and a callback. I'm already aware of how a full postback is different. In using ASP.Net 2.0, if that matters. (By the way, does it matter? Or are these terms defined the same for any web b...

ASP.NET Client to Server communication

Can you help me make sense of all the different ways to communicate from browser to client in ASP.NET? I have made this a community wiki so feel free to edit my post to improve it. Specifically, I'm trying to understand in which scenario to use each one by listing how each works. I'm a little fuzzy on UpdatePanel vs CallBack (with Vie...

CodeIgniter Validation in Library does not accept callback.

Hey guys, my problem is the following: I am writing a login library. This library has a function _validation() and this uses the validation library to validate the data. With using normal validation methods it works just fine, but using a callback function just does not work. It is not called. I call it like this. $this->CI->form_vali...

In c++ is there any Events/delegates/interfaces/notifications! anything?

Say i have these classes ViewA and ViewB In objective C using the delegate pattern I could do @protocol ViewBDelegate{ - (void) doSomething(); } then in ViewB interface: id<ViewBDelegate> delegate; then in ViewA implementation i set the delegate: viewB.delegate = self; and now I can call in doSomething from viewB onto any tha...

C# async callback on disposed form

Quick question: One of my forms in my winform app (c#) makes an async call to a WCF service to get some data. If the form happens to close before the callback happens, it crashes with an error about accessing a disposed object. What's the correct way to check/handle this situation? The error happens on the Invoke call to the method to ...

Codeigniter form validation config file not working

Hi, I'm using the technique of saving codeigniter form validation rules to a config file as specified here, but can't seem to get it working. I am also attempting to invoke validation callback functions from a Validation_Callbacks.php library which I'm autoloading via the autoload.php mechanism. Below is a snippet from my form_validat...

wait for async javascript function to return

I am using a function supplied by a third party library. This function takes a callback function as a parameter, but I would like to wait for this callback to be called before continuing. Is there a standard / accepted way to do this? ...

CURL C API: callback was not called

Hi all, The code below is a test for the CURL C API . The problem is that the callback function write_callback is never called. Why ? /** compilation: g++ source.cpp -lcurl */ #include <assert.h> #include <iostream> #include <cstdlib> #include <cstring> #include <cassert> #include <curl/curl.h> using namespace std; static size_t writ...

Design problem with callback functions in android

Hi folks! I'm currently developing an app in android that is accessing wifi values, that is, the application needs to scan for all access point and their specific signal strengths. I know that I have to extend the class BroadcastReceiver overwriting the method BroadcastReceiver.onReceive(Context context, Intent intent) which is called wh...

c++ callback syntax in a class

I am trying to figure out the syntax to register a callback with this 3rd party software. I think it is probably a basic question, I just am not too familiar with c++. They have a method for registering a callback function so their code can call a function in my code when an event happens. They provided a working example that register...

Does submit() function has a callback?

Hi, I have this code, and a file upload form which is submited to a frame: setMyCookie('name','value_1'); $('.myform').submit(); setMyCookie('name','value_2'); Problem: Webkit browsers seem to update 'MyCookie' with 'value_2' before the form gets submited, or in the exact moment it is being submited, so wrong cookie value is sent with...

Wrong sessionID being used in callback, but only on one particular computer

I am writing a Python/Django web application that uses OAuth (for the TwitterAPI, not that it should matter). I am storing a session ID in my login function, and then after using OAuth to get the user's token, I try to retrieve the sessionID in my callback function. The callback function then always fails(throws an exception) because i...

Does inline code keep the method [which wrote in it] in memory after finishing executing?

Hi all, Depending on what I know, when I define a method in C#, the local variables in this method will be released from memory after finishing executing the block of this method [when GC wants], but if I have an inline callback in a method, will these local variables be released from memory also ? In the following example, the [x] va...

How can I check if a facebook like button has been clicked?

I've put facebook like buttons into my wordpress blog... the idea is to use them as kind of a voting mechanism for posts. What I would like to do is automatically add a comment for the blog post everytime someone 'likes' it via the facebook like button. So my question is- does the like button api provide some kind of a callback to my pa...

How do I implement a before_filter callback in javascript?

Say I got this singleton object with some public methods and one private method: var QuestionFactory = (function() { // private method function google_it_first() { ... } // public methods return { ask_a_stupid_question: function() { ... }, ask_a_relatively_non_stupid_question: function() { ... }, ask_a_difficult_q...