callback

iPhone performSelector changes object type

I have a callback class with the method -(void)fire and it calls [target performSelector:selector withObject:dictionary]; Just before that line I added NSLog(@"%@", [[dictionary class] description]); to see where the object changed, when debugging it returns NSCFDictionary. So that was all fine. Next I went and added a similar line to g...

How do I know how to design my callback function for my event listener in YUI?

I'm just starting to use YUI. I'm trying to understand how to subscribe elements to different events. It seems pretty simple. Here's some code that I've been tweaking from Yahoo's examples: // "click" event listener for the second Button's Menu instance var onMenuClick = function (p_sType, p_aArgs) { var attributes = { width: { to:...

How to open multiple socket connections and do callbacks in PHP

I'm writing some code which processes a queue of items. The way it works is this: Get the next item flagged as needing to be processed from the mysql database row. Request some info from a google API using Curl, wait until the info is returned. Do the remainder of the processing based on the info returned. Flag the item as processed in...

android - pass value back to the same activity on a button click and refresh the page

Hi, I need to pass a value back to the same activity and refresh the activity to generate new data. Can anyone please provide me some ideas/guidance on how to do it? Thank you. I had try using intent to call the same activity but it doesn't work. Here is the code which i tried to use intent: btn_next = (ImageButton) findViewById(R.id.b...

a strange $.get()

Hello everyone, I have this code, a simple jQuery GET: $.get(url, params, function(){ function_call() }) I wonder why the function_call() is never executed. The server at url is up and running and changing the function to $.ajax() shows no errors (the error option is not executed), but it's not working. Any clue? param...

Adding callbacks for model classes in separate file (RoR)

I have a Message model class (which inherits from ActiveRecord::Base). For a particular deployment, I would like to have a separate file which modifies Message by adding a callback. So, instead of doing: # app/models/message.rb class Message < ActiveRecord::Base before_save :foo def foo puts 'foo!' end end I would like to b...

How can I make use of a JavaScript variable across two separate functions?

I have the following jquery function $(function(){ $('.buttonEffectWrapper a').not('#browse-all a').hover(function(){ pauseResume(); var imageBrowserContent = $('#mainImageBrowser').html(); $('#mainImageBrowserTabButtonWrapper, #slideshow > div') .animate({opacity:"0"}, {duration:250}); ajaxFunction('footer');...

OAuth Callback procedure for mobile devices

Hello, I am designing a Netflix Application for BlackBerry mobile devices. I am currently working on the OAuth. I am at the point where I can generate a Netflix login page in an embedded browser field in my application. After the user signs in, Netflix will send the user from the login page to a specified callback url. The callback url...

.NET wrapping a call/callback pair to appear synchronous

Hi. I have a 3rd party COM object I call that uses a event callback to signal it has completed its task. obj.Start(); then sometime later it will raise an event to say it is done. void OperationFinished() I would like to be able to do this operation synchronously and have tried to use AutoResetEvents to handle this e.g. obj.Sta...

How to take the result of a method called Asynchronously?

Hello, to not block the UI of my applications when there is a long operation I use to do: Public Sub ButtonHandler() handles Button Dim auxDelegate as Action auxDelegate = New Action(AddressOf DoAction) auxDelegate.BeginInvoke(AddressOf EndAction,Nothing) End Sub Private Sub DoAction() ''# Do long time operations here...

What is a callback?

What's a callback and how is it implemented in C#? ...

Jquery callbacks with masonry pluggin

I have a basic toggle switch that shows the clicked on div while closing all other similar divs. This works just fine, the toggle is not the issue. See below: $(document).ready(function(){ $('.threadWrapper > .littleme').click(function() { $(this).next().toggle('slow'); $(this).toggle('slow'); $('.littleme').not(this).next().hide...

Rails updating attribute security: use a callback or attr_accessible?

I've got a website model that requires a user to verify ownership of the website. Thanks to stack overflow, I was able to find the solution for user ownership verification here: http://stackoverflow.com/questions/1842416/validate-website-ownership-in-rails After the model passes the verification test there is a verified attribute that ...

How do I include an instance method inside a before_save callback in a plugin?

Hi there, I'm creating a plugin and am having a hard time defining a before_save filter that calls an instance method I've just defined. Here's a quick sample: module ValidatesAndFormatsPhones def self.included(base) base.send :extend, ClassMethods end module ClassMethods def validates_and_formats_phones(field_names = [...

Howto implement callback interface from unmanaged DLL to .net app?

Hi, in my next project I want to implement a GUI for already existing code in C++. My plan is to wrap the C++ part in a DLL and to implement the GUI in C#. My problem is that I don't know how to implement a callback from the unmanaged DLL into the manged C# code. I've already done some development in C# but the interfacing between manage...

Best way to send an email upon creation of a new model instance in Rails?

I have an app with the following models: User, Task, and Assignment. Each Assignment belongs_to a User and a Task (or in other words, a Task is assigned to a User via an Assignment). Once a User completes a Task, the Assignment is marked as complete, and the app immediately creates a new Assignment (or in other words, assigns the task t...

Help with ajax callback and drupal_process_form

I have a form that is added through the nodeapi displayed only on view mode. Users can select an item from a select menu and their choice will automatically get saved to the database with a hook_menu callback on change. If the user has javascript disabled, it'll submit normally with the form api. This is all working fine, but now for sec...

Rails - in what order does dependent => destroy follow?

Say i have this fictitious example below class Server < ActiveRecord::Base has_many :clients,:dependent => :destroy after_destroy: delete_server_directory end class Client < ActiveRecord::Base belongs_to :server before_destroy :copy_some_important_stuff_from_the_server_directory_before_its_too_late end So when i use server.de...

access response from .NET webservice in callback function on HTML page

Hi All, I am trying to call a .net webservice from HTML page. This HTML page will be hosted on a different server. I using the following html code for this. The webservice code is below HTML code. This code runs just fine in IE and runs fine in Mozilla when debugging with venkman. But fails in normal execution in Firefox. I dont get any...

Impementing Clickatell CallBack in ASP.NET using C#.NET

Hi Group, I am building a web application in ASP.NET using C#.NET which sends a SMS using clickatell. I am trying unsuccessfully to receive a status back from clickatell by creating a CallBack Page called ClickatellCallBack.aspx Here is the codebehind of the Page: public partial class ClickatellCallBack : System.Web.UI.Page { p...