callback

Calling a Composite's GWT method from another Composite

I'm new to GWT and trying to make a simple app (like a small version of fmylife). Up to now i made a composite that loads the facts and another composite that has a form to submit new facts (this one has a load method that clear the list and populate again). I have a button that when you press it, it shows a Window with a form. That fo...

Is it possible to use a static private method of a class as callback?

I saw code that contained the following line: preg_replace_callback($regex, 'TextileParser::replaceAnchor', $text); where TextileParser::replaceAnchor() is a private static method. Is that possible, or the code is wrong? ...

create object if object is failed before_save.

Model def before_save self.default_file_name = "#{self.model_name.underscore}.csv" if self.default_file_name.nil? self.default_directory_name = "public/uploads" if self.default_directory_name.nil? verify_methods verify_record end def verify_methods self.errors.add_to_base(_("Invalid row instance method.")) \ if !self.each_r...

Implement Delegate Callbacks. How do i ?

i have been told to Implement Delegate Callbacks. In your header file, implement the callbacks, MFMessageComposeViewControllerDelegate and UINavigationControllerDelegate. how would i do this ? Thanks Mason ...

Examples of creating a simple COM component using C++ in Visual Studio 2008

Hello, Does anyone know of any recent examples of how to create a simple COM component in C++ using Visual Studio 2008 so I can learn how to marshal different kinds of data between unmanaged and managed code, and back again. I've found a few tutorials that suggest a C++ ATL project, but project settings page no longer has the settings m...

Ajax success callback for 'delete' not triggering in Firefox

Hi, I have got a test page to use Ajax to make a http 'delete' request to a server. The following JS code works as intended in IE7, but it does not work in Firefox (unless I make the ajax call asynchronous). In Firefox, unless async is false, the error callback gets triggered with status of 0. Can anyone assist in explaining why t...

Custom jQuery Delayed Callback

I am playing with extending jQuery with a function that has two params: a callback function and a timeout. I'm on pre 1.4 so I don't have the .delay() built-in, but even that isn't really what I want. I've started out with the below, but am unclear as to 1 why is the callback function undefined inside the setTimeout, and 2 how should ...

Using template for return value. how to handle void return?

Hello all, I have structure for storing callback function like this: template<class T> struct CommandGlobal : CommandBase { typedef boost::function<T ()> Command; Command comm; virtual T Execute() const { if(comm) return comm(); return NULL; } }; Seems like it should work fine except w...

ARG! Contravarience foils callback plot! Want to change virtual return type..

Hello all, I am working on a AI dynamic link library. It is to be explicitly linked and all of this is handled by a simple header include. I am at the moment trying to create the code for the DLL to be able to call functions in the main EXE to manipulate the world and also to be able to query functions to learn about the state of the ...

Question about combating contravariance. Callback-related question.

Hi guys, I have the following piece of code which doesn't compile when I try to instance something like CommandGlobal<int> because it tries to override virtual void Execute() const =0; with a function which returns int. It gives a non-covariance error. class CommandBase { public: virtual void Execute() const =0; }; template<class...

iPhone iAd -- not getting callbacks to didFailToReceiveAdWithError

I am testing an iAd app on an iPod touch. My iPod is connected to the internet. In all my testing, I have only received one callback to didFailToReceiveAdWithError. Here is the relevant code: #ifdef mAppHasAds - (void)bannerViewDidLoadAd:(ADBannerView *)banner { NSLog (@"Triangle ad"); bannerView.hidden = NO; } - (void)bann...

Using a Drawable.Callback to detect a gesture on top of it

What I mean by this is, if I have several drawables in different areas of the screen, how can I use a callback on that drawable to detect when a gesture is drawn by the user directly over one of them so that it is specific to that drawable and not all drawables on the screen at that time? Thanks ...

subclassing view and implementing SurfaceHolder.Callback

Can I have a class that extends View and implements SurfaceHolder.Callback and inside this class have a SurfaceView object? If this is possible, then I’d have to call on the SurfaceView constructor like this: SurfaceView sview = SurfaceView(this) inside the constructor of View’s subclass. I can’t compile because of the foll error: ‘...

C++ Singleton Threading problem

I have a C++ singleton that runs as a separate thread. This singleton is derived from a base class provided by a library and it overrides the method onLogon(...). The onLogon method is synchronous, it wants to know right away if we accept the logon attempt. Problem is we need to pass the logon information via message to a security ser...

authlogic current_user tracking

I use authlogic for authentication and paperclip for handling user's profile picture attachments. I use the following method to get the current_user def current_user_session return @current_user_session if defined? (@current_user_session) @current_user_session = UserSession.find end def current_user re...

callback function return global object :/

Please help with my problem described below: var Land = function(){ this.cities = []; } Land.prototype = { addCity : function(city){ this.cities.push(city); } } var City = function(){ this.val = "foo"; }; City.prototype = { test : function(){ this.val = "bar"; console.log(this); } } var ...

PHP / Scope / Callback

Hello, my code is : class myClass { $myVariable = 'myCallback'; function myFunction() { $body = false; $callback = $this->myVariable; function test($handle, $line) { global $body, $callback; if ($body) { call_user_func($callback, $line); } ...

CGDataProvider and callback

Hi, I am creating a very big buffer (called buffer2 in the code) using CGDataProviderRef with the following code: -(UIImage *) glToUIImage { NSInteger myDataLength = 768 * 1024 * 4; // allocate array and read pixels into it. GLubyte *buffer = (GLubyte *) malloc(myDataLength); glReadPixels(0, 0, 768, 1024, GL_RGBA, GL_UNSIGNED_BYTE,...

Invalid reference during callback

i have an object that is used for calling callback functions ----- static jobject o; i have assigned the callback function to that object through a pointer, env ----- o=env->NewGlobalRef(callback); The same pointer, env, points towards the function CallVoidMethod( ) that uses JNI to reach to the java code. env->CallVoidMethod(o, meth...

WCF Async Calls Polling or Flagging - Best Practice

I'm working on this Silverlight 3.0 Project that is completely filled with Async Calls to a Web Service. At the Main Page it fetches some needed data in order for the application to work correctly using 3 Async Calls. Right now the application does not disable any controls while executing those calls meaning a user can interact with it w...