callback

How to read bound hover callback functions in jquery

I used jquery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behavior for some elements. The new module has no access to the original code for the hover functions. I want to store the old hover functions before I set new ones so I can restore them when finished with the ...

WSDualHttpBinding for duplex callbacks

Would using WSDualHttpBinding for duplex callbacks work in real-world scenarios? Say, I have a .NET application that uses a random port, would the service be able to resolve the client's base addresses and port for callbacks? ...

Has anybody compared WCF and ZeroC ICE?

ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP). Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since interoperability isn't much of a...

In MATLAB, can a class method act as a uicontrol callback without being public?

In MATLAB 2008a, is there a way to allow a class method to act as a uicontrol callback function without having to make the method public? Conceptually, the method should not be public because it should never be called by a user of the class. It should only be called as a result of a UI event triggering a callback. However, if I set th...

What is effect of "__callback" SAL annotation?

While I certainly understand the purpose of buffer annotations, I can't see what kind of errors __callback detects. Any ideas, examples? ...

Do callbacks stop operations in rails

If a callback handler returns false, does it cause only the handlers for that callback to not be called, or does it cause the remaining callbacks in that handler and all subsequent callbacks to not be called as well? ...

How do I 'validate' on destroy in rails

On destruction of a restful resource, I want to guarantee a few things before I allow a destroy operation to continue? Basically, I want the ability to stop the destroy operation if I note that doing so would place the database in a invalid state? There are no validation callbacks on a destroy operation, so how does one "validate" whethe...

Alternatives to using delays when automatically testing an AJAX web UI

I will soon be working on AJAX driven web pages that have a lot of content generated from a Web Service (WCF). I've tested this sort of thing in the past (and found it easy) but not with this level of dynamic content. I'm developing in .NET 3.5 using Visual Studio 2008. I envisage this testing in: TestDriven.NET MBUnit (this is not ...

What is a "callback" in C and how are they implemented?

I am new to C, Objective-C, and Core Audio programming on OSX. From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that's another story). I understand the concept (sort of) of setting up a function that is called by another function repeatedly to accomplish a task. I just don't understand how they g...

ASP.NET 3.5: GetCallbackEventReference doesn't work synchronously

I have an ASP.NET 3.5 WebForm that leverages the frameworks Page.ClientScript.GetCallbackEventReference() method and I'd like some of the calls to be synchronous. Now, the documentation says that the 5th parameter (see below) controls this. Specifically, when you pass 'false' it's supposed to be a non-asynchronous call. However, reg...

How can circular dependencies be avoided when callbacks are used?

How can you avoid circular dependencies when you're designing two classes with a producer/consumer relationship? Here ListenerImpl needs a reference to Broadcaster in order to register/unregister itself, and Broadcaster needs a reference back to the Listeners in order to send messages. This example is in Java but it can apply to any OO l...

Handling Managed Delegates in Unmanaged code

I know I can get this to technically work but I'd like to implement the cleanest possible solution. Here's the situation: I have a managed library which wraps an unmanaged C-style library. The C-style library functionality I'm currently wrapping does some processing involving a list of strings. The library's client code can provide a...

How to Pass an Object Method as a Parameter in Delphi, and then Call It?

I fear this is probably a bit of a dummy question, but it has me pretty stumped. I'm looking for the simplest way possible to pass a method of an object into a procedure, so that the procedure can call the object's method (e.g. after a timeout, or maybe in a different thread). So basically I want to: Capture a reference to an object'...

JavaScript Callback Scope

I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function. function foo(id) { this.dom = document.getElementById(id); this.bar = 5; var self = this; this.dom.addEventListener("click", self.onclick, false); } foo.prototype = { onclick : function() { this...

Client side Callback in GWT

I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the client can be updated. My First question is, is this possible, I ...

ASP.NET 2.0 callbacks not working correctly in Firefox

I've implemented a .NET Web control that uses the callback structure implemented in ASP.Net 2.0. It's an autodropdown control, and it works correctly in IE 6.0/7.0 and Google Chrome. Here's the relevant callback function: function ReceiveServerData(args, context) { document.getElementById(context).style.zIndex = 300; document.getEleme...

What is a callback function and how do I use it with OOP

I want to use the php simple HTML DOM parser to grab the image, title, date, and description from each article on a page full of articles. When looking at the API I notice it has a set_callback which Sets a callback function. However im not sure what this does or how I would use it? In one of the examples its used to call a function whic...

Javascript callback functions and recursion

This is kind of a brainteaser question, since the code works perfectly fine as-is, it just irritates my aesthetic sense ever so slightly. I'm turning to Stack Overflow because my own brain is failing me right now. Here's a snippet of code that looks up an address using the Google Maps JS API and places a marker on a map. However, someti...

How can I disable a validation and callbacks in a rails STI derived model?

Given a model class BaseModel < ActiveRecord::Base validates_presence_of :parent_id before_save :frobnicate_widgets end and a derived model (the underlying database table has a type field - this is simple rails STI) class DerivedModel < BaseModel end DerivedModel will in good OO fashion inherit all the behaviour from BaseModel,...

Javascript callback for knowing when an image is loading

I want to know when an image has finished loading. Is there a way to do it with a callback? If not, is there a way to do it at all? ...