methods

c# creating a database query METHOD

I'm not sure if im delluded but what I would like to do is create a method that will return the results of a query, so that i can reuse the connection code. As i understand it, a query returns an object but how do i pass that object back? I want to send the query into the method as a string argument, and have it return the results so tha...

Credit card payment getway in cakephp

I am developing a project in cakephp. And the requirement is to integrate all types of payment getway for donet. I dont know how to integrate credit card like master card, visa, american express etc. into my project in cakephp format. Please help me. I am very grateful to you. ...

How to turn jQuery/Javascript functions into methods

Could anyone explain how to turn functions into methods and the variables into parameters of an object in jQuery/Javascript? And even more interesting Why i should do that? ...

Java asynchronous method call

I have already one thread that has to do following work: public class DetectionHandler extends TimerTask { @Override public void run() { bluetoothAddresses = BluetoothModule.scanAddresses(); wiFiAddresses = WiFiModule.scanAddresses(); ...//when scanning is finished, continue work } I would like that scanning to be parallel. So I assu...

change div content based on three for elements

Hey guys, I'm new to jQuery/js and having a hard time figuring this out. There are two fields in a form of mine i want to do some calculations with, what i tried is this: jQuery.fn.calculateit = function(){ var one = $("#one").val(); var two = $("#two").val(); //total var total = one + two; $("#total").text(total)...

Using variables in methods in objective c

Is there any way define a object in a method, call a method of another object, and in that method use the first object: -(IBAction)method{ class * instance = [[class alloc] initWithValue:value]; [instance method]; } The method defined in class.m file: -(void) method { instance.value = someOtherValue; } ...

How can I convert from Gregorian Calendar to Unix Time, in Java?

Hi, I am in need of a method to convert GregorianCalendar Object to Unix Time (i.e. a long). Also need a method to convert Unix Time (long) back to GregorianCalendar Object. Are there any methods out there that does this? If not, then how can I do it? Any help would be highly appreciated. Link to GregorianCalendar Class --> http://down...

How to do method aliasing in groovy?

Hi, I am trying to redefine dynamic methods of a domain in groovy. Is there something similar alias method in ruby in groovy? ...

Should methods that implement pure virtual methods of an interface class be declared virtual as well?

I read different opinions about this question. Let's say I have an interface class with a bunch of pure virtual methods. I implement those methods in a class that implements the interface and I do not expect to derive from the implementation. Is there a need for declaring the methods in the implementation as virtual as well? If yes, why...

jquery variables, the difference between with and without $ prefix

Hi there, I have read another post/question regarding jquery variables and it was useful but I'm still having trouble understanding... Below is a bit of code from a simple tabbed content functionality that I'm modifying. Please could someone explain why this works: $tabMenuItem.click(function() { var activetab = $(this).find(...

Convert B(C(),D()) to (c,d)=>B(()=>c(),()=>d()) - Generating delegate wrappers from MethodInfos?

Ultimately, I'm looking forward to a reflection based approach to create a delegate wrapper for a method B(C(),D()) - to some what like (c,d)=>B(()=>c(),()=>d()) First question - Given that you've a Methodinfo, what are the considerations to create a delegate type (via reflection) which corresponds to that method signature? Do you hav...

Castle Windsor - Lookup Method Injection for transient instances

Hello all, The short question: Does Castle Windsor have something similar to Spring.Net's "Lookup Method Injection" that can be configured from XML, which provides the ability to fetch transient instances from the container without the class being aware of the IoC container? The long question: I'm a long time Spring/Spring.Net user and...

ruby: overriding strings' methods returning nil (strip!, upcase!, downcase!, capitalize!, chop!, chomp!, delete!, gsub!)

Those stupid 'string'.method! returning nil instead of self in ruby - can be easily overriden: class String ['strip!', 'upcase!', 'downcase!', 'capitalize!', 'chop!', 'chomp!', 'delete!', 'gsub!'].each do |meth| orig_meth = "orig_#{meth}" alias_method orig_meth, meth define_method(meth) do |*args| ...

Semantics of Objective-C Methods

Coming from a Java background, I'm still don't quite understand the semantics of Objective-C methods as opposed to their syntax. Take as an example the following method: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; Easy enough. There is a method named numberOfSectionsInTableView which takes a UITableView as a par...

Why am I getting NoMethodError from IRB for my own Module and method

Hi, I have taken this example exactly from the Ruby Cookbook. Unfortunately for me, like a whole lot of the examples in that book, this one does not work: my file (Find.rb - saved both locally and to Ruby\bin): require 'find' module Find def match(*paths) matched=[] find(*paths) { |path| matched << path if yield...

Getting "method undefined" when it is CLEARLY defined in JS

I have a very simple bit of code (relies on jQuery): var dom_builder = function() { this.table = function(elem,attributes) { return $("<table>").attr(attributes).appendTo(elem); } }; console.log(dom_builder.table); Now when I try to run it I get the following error: Uncaught TypeError: Object # has no method 'table'...

Is there a built in method that is call-able as the app is about to close?

I have an iphone app, and I need to capture some data right as the app is about to close... Is it possible to associate a method call with the clicking of the iphone home button? So that I can get the most recent and current data of a particular type that I can? ...

How do I see the arguments (and types) of a python method?

$ py twitterDump2.py Traceback (most recent call last): File "twitterDump2.py", line 30, in <module> stream=tweepy.Stream(username,password,listener) TypeError: __init__() takes exactly 3 arguments (4 given) My code: username="abc" password="abc" listener = StreamWatcherListener() stream=tweepy.Stream(username,password,listener...

Running methods with returned objects.

I am brushing up on my non-framework Object Oriented PHP and decided to do a test. Unfortunately, while I understand the concept of calling methods from a class, this particular test is slightly more complicated and I don't know what the terminology is for this particular type of situation is. Test Create a PHP class that parses (unkno...

C# method call error

Yes I'm new to C# but I'm a decent Java Dev. OK Ive got a project in visual studio with a program.cs file and a Class.cs file. All I'm trying to do is make a call to the method in Class.cs in Program.cs.... I have 1 frustrating error. The name 'mymethod' does not exist in the current context. All the other code builds fine if I comment o...