methods

Problem calling method inside another method in javascript?

Hi, I am having a JavaScript namespace say A={ CA: function() { this.B(); }, B: function() { var test='test'; var result='t1'; C: function() { this.test='test1'; ..... ..... return 'test1'; } result=this.C(); return result; } } Now when I am executing such c...

Eclipse 3.5 is generating a "method not applicable for the arguments" error for no reason at all.

The error is this: The method add(String, int) in the type DataNode is not applicable for the arguments (String, String) However, in the DataNode class, I have a number of overloaded add() methods, including one that takes a String and an int and one that takes two Strings. It appears that Eclipse isn't "seeing" the right add() met...

How can I find out if an object implements a particular method?

I am iterating through an NSArray that contains many different types of objects. There are many methods to figure out what class the object is. However, I haven't been able to find a good way to find out if an object can implement a particular function. I can put it in a try-catch but it will still output an error message in the console ...

Is it possible to use Objective-C runtime features to determine where a method was called from?

Objective-C uses a sophisticated message-passing system when one object calls a method on another object. I want to know if it is possible, within the called method, to determine what the calling object was? For example: @implementation callingClass - (void)performTest { calledObject = [[[calledClass alloc] init] autorelease]; ...

In c# , when sending a parameter to a method, when should we use "ref" and when "out" and when without any of them?

In c# , when sending a parameter to a method, when should we use "ref" and when "out" and when without any of them? ...

C# delegate definition - anonymous methods vs. formally defined methods

When should anonymous methods be used when defining a delegate and when should formally defined methods be used when defining a delegate ? ...

Modifying a non-static object from a static method.

Hi, I'll first tell you what I am trying to do, and then how I am trying to do it. If there is a better way please let me know. I am working with two forms - lets call them form_main and form_preferences When the form_preferences form is up, I want form_main to be disabled until a button (save button) on the form_preferences is clicke...

Is it possible to create a type method in Delphi?

Hello, It's possible to create a type idenitifier for example: type PByte = ^Byte; Is it possible to do the following: function a:shortint; begin Exit(8); end; type b = a; so you can call "b" and "a". Is it possible? I'm asking,because I'd like to replace "Exit" with "return" so I can call this: return(5);// for example ...

Help with understanding C# code and porting to Objective-C

Ok, I have this prototype that was written by someone else in C# and I'm trying to put it into Objective-C. Now, I haven't had any formal experience with C# yet, so I don't know everything about it yet. I understand what the first three variables are, but I'm running into problems with what the fourth and fifth lines (c_data) are doing. ...

Are Method Attributes Inherited in C#?

Hi, Are attributes applied to an abstract method in a base class applied to the overridden versions in the child classes? I hope the question is clear enough without an example. ...

I want to add a singleton method with a closure to a Ruby object (Ruby)

I wish to add a singleton method to a particular object. I wish that when a instance method on a object is first called, it does some work, and then creates a singleton method for said object of the same name (that contains the work). On all subsequent calls on said object, the singleton method would shadow the instance method and would ...

What's the most practical way to have "functions in a dictionary" in Java?

Hello folks, When programming with C/C++ or Python I sometimes used to have a dictionary with references to functions according to the specified keys. However, I don't really know how to have the same -- or at the very least similar -- behavior in Java allowing me dynamic key-function (or method, in Java slang) association. Also, I did...

PHP Class error on calling method

Hi, I have a class to connect to my database, strip stuff and return things from a db query. Anyhow, the problem I am having is that I am tryinmg to call runQuery() method but every time I try, I get this error: Fatal error: Call to undefined function runMyQuery() in DatabaseConnector.php line 22 Any ideas perhaps? I know runQuery ...

ruby 1.9 methods in ruby 1.8.6

Is there a gem or a library to get ruby 1.9 methods like [1, 2, 3].combination(2) [1, 2, 3].permutation(2) [1, 2, 3].product([1, 2, 3]) [1, 2, 3, 4, 5].cycle ...

Is there any automated way to implement post-constructor and pre-destructor virtual method calls?

Hi all, Due to the well-known issues with calling virtual methods from inside constructors and destructors, I commonly end up with classes that need a final-setup method to be called just after their constructor, and a pre-teardown method to be called just before their destructor, like this: MyObject * obj = new MyObject; obj->Initiali...

methods to store binary files in SVN

Are There different methods to store binary files in SVN? if so, what are they, and how I modify the storage options? I read that there are 4 ways to store binary files in SVN: Compressed tar - import - export. Tar - import - export. import - export. Efficient check-in. Which of those are the most useful for time efficiancy? and how...

How to override a method in dojox _Scroller class?

Hi there, How do I override a method in dojox.grid._Scroller class from a class extending dojox.grid.DataGrid. dojox.grid.DataGrid extends dojox.grid._Grid, which requires dojox.grid._Scroller. The method of interest here is: getScrollBottom(inTop). Thanks in advance! David ...

i need to send through the GET method data using the thickbox library and jquery

cause i got some 403 errors ... that's beacuse my server doesn't has enabled the directory listing anybody has done something like that ? thanks. ...

ajax post for django template

HI all, I have a problem when i want to submit value then full page again reload. I want to update my table with asynchronous call, that specific information will be loaded but full page not... plz help me aboput this...thanks ...

C# - Calling a method from within a Class

I have 2 Forms (Form1 and Form2) and a class (Class1). Form1 contains a button (Button1) and Form2 contains a RichTextBox (textBox1) When I press Button1 on Form1, I want the method (DoSomethingWithText) to be called. I keep getting "NullReferenceException - Object reference not set to an instance of an object". Here is a code example:...