I'm not sure of the best idiom for C style call-backs in Ruby - or if there is something even better ( and less like C ). In C, I'd do something like:
void DoStuff( int parameter, CallbackPtr callback )
{
// Do stuff
...
// Notify we're done
callback( status_code )
}
Whats a good Ruby equivalent? Essentially I want to call a ...
I am trying to make a simple asynchronous call with WCF, but the callback function is never executed. Can anyone tell me what is wrong with the code?
I am using visual studio 2008 with .Net 3.5
You can download a visual studio 2008 solution from here:
http://dl.getdropbox.com/u/419244/AsyncCalls.zip
Service code
[ServiceContract]
pu...
It seems to me the following code should produce these results:
mademoiselle
demoiselle
mesdemoiselles
Instead, as "ma" fades out, "mes" fades in making the sequence:
mademoiselle
madesdemoiselles
mesdemoiselles
The code:
<span class="remove">ma</span><span class="add">mes</span>demoiselle<span class="add">s</span>
$(document).re...
Lets say I have this code
$(document).ready(function()
{
$('.checkbox').change(function()
{
$('.hidden').slideUp('slow', function()
{
alert(checkbox value);
}
}
}
How do I access the checkboxes value? $(this) doesn't work as you're now in the .hidden element?
...
Using techniques as hinted at in:
http://msdn.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.callbackcontract.aspx
I am implementing a ServerPush setup for my API to get realtime notifications from a server of events (no polling). Basically, the Server has a RegisterMe() and UnregisterMe() method and the clie...
I have a callback inside a C DLL (static void __stdcall) . I want another program to register it as such (by passing it the func ptr) and then call the calback inside the DLL. I have had no luck so far. However, the same callback works if its inside a regular C++ program. I am now wondering if having callbacks in a DLL is even possible. ...
hi all,
i'd like to use this plugin for dynamic includes:
http://plugins.jquery.com/project/jquery-plugins
i managed to include one file + getting a done-callback.
my question: is it possible to include several files at once (eg. 10 .js + 10 .css files) and getting a global done-callback?
thx,
fuxi
...
I want code in a php5 page be executed after all of the page (or maybe even after the first part of the page) is displayed.
I would prefer no javascript and no frames / iframes and no redirects. Just one page written in php, only emitting html.
I remember some special function in php5 to register a callback function that will be execu...
How can I make sure that some code, that is executed in a php shutdown function, that was registered via "register_shutdown_function" is also executed, if the user leaves the page or closes the tab or the whole browser of that page, before the shutdown code is executed, but after the page is displayed?
I just want to make sure the user ...
I have a System.Threading.Timer that calls its appropriate event handler (callback) every 10 ms. The method itself is not reentrant and can sometimes take way longer than 10 ms. Thus, I want to stop the timer during method execution.
Code:
private Timer _creatorTimer;
// BackgroundWorker's work
private void CreatorWork(object sender, ...
Hi.
I have a standard active record model with an attributes that is required:
class Sample < ActiveRecord::Base
has_many :colors
before_validation :grab_colors
validates_presence_of :size
validate :number_of_colors
private
def grab_colors
# grab x number of colors | x = size
end
def number_of_colors
self...
I have looked at similar queries here, but I can't seem to apply them to my problem. I am pretty new to jquery, so I may be doing something dumb.
I have a simple getJSON test:
$(document).ready(function() {
$(".testurl").click(function() {
// do a json call
var url="testjson.php";
var rc=$.getJSON(
url,
{parm1: "P1"...
Hi,
I've tried all sorts of design approaches to solve this problem, but I just can't seem to get it right.
I need to expose some static functions to use as callback function to a C lib. However, I want the actual implementation to be non-static, so I can use virtual functions and reuse code in a base class. Such as:
class Callbacks {
...
The solution may be simple. Then again it may not be possible.
I have the base callback class:
class CFCallback {
int command_;
int transfer_rate_;
public:
CFCallback(int command, int transfer_rate = 0) {
command_ = command; transfer_rate_ = transfer_rate; }
virtual ~CFCallback() {}
virtual void operator...
Here's my dilema. I have 2 animations that need to run sequentially.
The first animation runs on a group of elements acquired through jQuery's siblings() function.
The second animation runs on a single element. (The one upon which siblings() was called.) This needs to take place after the first animation has finished.
If I don't use q...
Hey everyone - I'm having some difficulties properly getting a return value from one of my Javascript callback functions, and it looks to be dependent on a race condition, but I'm not sure:
JSOBJ.container = function() {
return {
getName: function() {
var value;
companyfn.app.getInfo(callback);
function callback(foo) ...
Hey,
Im using the xulrunner example application and im trying to work out how to call into c++ code from javascript. I have googled and the best i came up with was to use nsIDOMEventListener interface but have no idea how.
Any ideas?
...
Hello,
void functions::start()
{
io_iterator_t enumerator;
...some code...
result = IOServiceAddMatchingNotification(
mNotifyPort,
kIOMatchedNotification,
IOServiceMatching( "IOFireWireLocalNode" ),
serv...
Q1. Why are callback functions used?
Q2. Are callbacks evil? Fun for those
who know, for others a nightmare.
Q3. Any alternative to callback?
...
This may be more of a scoping question. I'm trying to set a JSON object within a $.getJSON function, but I need to be able to use that object outside of the callback.
var jsonIssues = {}; // declare json variable
$.getJSON("url", function(data) {
jsonIssues = data.Issues;
});
// jsonIssues not accessible here
A similar question...