callback

Updating a loading/saving message in JavaScript that clears after all callbacks are complete

I'm building an AJAX app that constantly saves to the server when the user changes things. Every time the user changes something, I want a status area to say "Saving..." (with animated ellipses) and then change back to "Saved" at the callback (when the server returns) In theory this is easy enough, because I could change the status area...

better understanding of callback functions in javascript

I am reading this function in a book, and I don't understand how the anonymous function is passed the thirst three arguments? This is what I understand function multiplyByTwo(a, b, c, callback) { var i, ar = []; for(i = 0; i < 3; i++) { ar[i] = callback(arguments[i] * 2); } return ar; } but not this myarr = multiplyByTw...

Curl RETURNTRANSFER data ?timing? problem and multiple identical POSTs

Hello, I am running into a sporadic problem with curl's RETURNTRANSFER option. I am not sure if I have overlooked something in my code that is causing it, or if it is just not well documented and I am unaware of the RETURNTRANSFER workings. I am using curl (via php) to send xml data via POST to an external listener. If successful, the ...

Create new records on before_save.

While creating new records. I need to create more records for the same model. Example :: class XYZ < ActiveRecord def before_save # At this point object is already initialized .. # And it's containing values. # At this point i want to create 10 more records for the same class. # something like this XYZ.new(:att1 => valu...

How to disable jQuery Fullcalendar plugin window resizing?

I'm using the FullCalendar plugin and it's working very well. I would like to disable the dynamic resizing of the table and its cells when the browser window is resized. Is that a possibility? (I noticed in the documentation the 'windowResize' callback fires after the calendar is already resized, so it looks like that won't help.) ...

Are callbacks always asynchronous?

This example is JavaScript, since that's where I'm using callbacks mostly. I want to understand how they work at a low level. In the example below, I'd expect everything to happen in order and "calling back" to occur after "step 3" and before "step 4." This makes sense to me, as everything is done in order on a single thread of execut...

Ajax async callback behaviour

Hi all, I'm investigating a bug in some software where basically two users press search at the same time and one gets the others results back. I believe this to be a combination of things. the connection is a a singleton that is shared across all instances on the server when search is pressed an async ajax callback is used to send the ...

Make a Dialog ViewModel binding ready, call Dialog and return data from it in MVVM

Hello, Do you see a better way how I can call/contstruct a Dialog from a Controller/ViewModel return data from it and set the DocumentViewModel as DataContext of the Dialog? The problem is I can not use View first approach in the DocumentDetailWindow and its belonging UserControl because I can not set the Model to the DocumentViewModel...

Is there an Objective-c regex replace with callback/C# MatchEvaluator equivalent ?

I have a C# project I'm intending to port to Objective-C. From http://stackoverflow.com/questions/422138/regular-expressions-in-an-objective-c-cocoa-application, it looks like there's a confusing variety of Regex options but I can't see anything about a way of doing a replace with callback. That is, the equivalent of the C# MatchEvaluato...

Chaining functions in a jQuery plugin

I wrote a small plugin to handle text-to-input-to-text fields for on-the-fly editing, and it includes arguments that allow a user to run functions at different intervals of the process. I want the user to be able to click the "actuator" (the element that controls the process), and choose to have an intervening function run after the but...

C++: Trouble loading long string from XML file using Mini-XML

I'm using the Mini-XML library to parse and XML file. I am able to load just about every element and attribute, but I am having trouble loading a long string. Here is the relevant part of the code: //Load XML file into XmlO void load(wxString filenam){ //First, convert wxString to std::string for safety (char* is transient...

Convert callback function from C++ to VB.Net

I'm trying to convert C++ API to VB.Net, but this function is too hard and i don't know how make it work. Here is the API doc for this function: void RemoteDllSetReceiver(void *inst, on_received_buffer_t received_buf_cb); Sets a callback function to receive notifications from the DLL. The prototype of the callback is: typedef bool...

In OnLoad, which of two ASP.NET controls triggered a given callback?

How do I differentiate between two triggers that can both POST callbacks to the page during OnLoad? The controls themselves will automatically trigger their callback handlers, but that is too late. The background on my issue is probably irrelevant, but ... I am creating an ASP.NET web page and I have two controls on the page that can...

Calling a function from a function pointer in Delphi

I'm trying to build a generic worker thread in Delphi, one that I can pass a function/procedure (doesn't matter) as an argument and let it execute. My guess is to add a field in the TThread class and call it from TThread.Execute. So the code outside the thread is gonna be: MyThread := TWorkerThread.Create(True); Mythread.CallBac...

C++ call back system. Pointers to member functions.

Hi, Im trying to create a call back by passing a pointer to member functions but am running into all types of issues. How can i go about implementing such a thing template<class T> class A{ void (T::*callBackFunction)(int); public: void addCallBack(void (T::*callBackFunction)(int)){ void (T::*callBackFunction...

ASP.NET controls opening new windows intead of postback in same window

The fils containing these control work fine in another project and they work fine on visual studio so I guess it is safe to assume that the problem is not in the files or with the server but has something to do with the project? What could be causing this? ...

Android: Is there any way to directly configure a menuItem to startActivityForResult instead of startActivity?

I know I can do this: menu.findItem(R.id.menusettings) .setIntent(new Intent() .setClass(this,SettingsScreen.class)); Which is equivalent to this in a callback: Intent myIntent = new Intent(); myIntent.setClass(this, SettingsScreen.class); startActivity(myIntent); But is there any way I can issue a startActivityForResult with a s...

Debug .NET Socket callbacks

I use the async BeginReceive method of System.Net.Sockets.Socket. This requires a callback to an OnReceive function. However, nothing bugging in this section seems to be taken in charge by the debugger. So if anything goes wrong (uncatched exception), the app just crashes. Any idea how to fix that? ...

Save active_record without calling callbacks in rails3

In rails 2 there was a private method on active_records called create_without_callbacks which you could call to save a record into the database without triggering the callbacks associated with that object. This method has disappeared in rails 3, is there any way to achieve the same thing? ...

PHP: Callback functions

Some functions in PHP require a callback function. How can I do this in a function myself? First of all, how do I define a function that require a callback function? And secondly, how do I provide a custom function as the callback function? How do I provide a regular function, an instance function and a static function? ...