methods

C#: Generate XML SOAP Request from Reference.cs and WSDL without actually calling web method?

Is it possible in C#/ASPNET to generate the XML SOAP request from the local web method reference without actually posting a request to the web service server? I'm trying to create a class which will generate this SOAP request XML without actually invoking the service. I've looked at the SOAP Extension classes and other methods but they...

Double clicking on map annotations

I want to zoom in on an annotation after double clicking on it, but I cant seem to find a method in the developer documentation that does this, So how do I zoom in on a double clicked annotation? ...

Android: How can I pass parameters to AsyncTask's onPreExecute()?

I use an AsyncTask for loading operations that I implemented as an inner class. In onPreExecute() I show a loading dialog which I then hide again in onPostExecute(). But for some of the loading operations I know in advance that they will finish very quickly so I don't want to display the loading dialog. I wanted to indicate this by a boo...

Calling base class method from derived constructor

class Base { public: Base() {} void Foo(int x) {...} }; class Derived : public Base { public: Derived(int args) { /* process args in some way */ Foo(result); } }; Is it allowed to call a method of the base class in the constructor of the derived class? I would imagine this is fine as the Base ...

PHP : How to ensure script does not fail if method does not exist?

I have a PHP script which calls methods from a class I have written. However due to the nature of the system there are occasions where the method called does not exist e.g $snippets = new Snippets(); echo $snippets->fakeMethod(); in the above example fakeMethod() does not exist and the script fails with a fatal error and stops altoge...

obj-c : iphone programming, call method with 2 parameters

i have a method that call another method with 1 parameter to another class. It is working perfectly but now i need 1 more parameters this is my code : i am getting a 'addobject may not respond' test.m calling method : DrunkeNewIdeaAppDelegate *appDelegate = (DrunkeNewIdeaAppDelegate *)[[UIApplication sharedApplication] delegate]; ...

List<>.Find(delegate) issue

I have a multi-column combobox where the datasource is a List<> in my Select Class Select selection = new Select(); RadComboBox1.DataSource = selection.GetAcctUtilCo(e.Text, 10).Skip(e.NumberOfItems); I have a few DataTextFields. My DataValueField is the AcctID. Once an account is selected, I need the datatextfield values to pop...

Why would anyone make additional local variable just to put final keyword on it?

I've encountered the code similar to this: public void foo(String param1) { final String param1F = param1; ... } I doubt that the author doesn't know that he can put final keyword directly in the method signature cause in the rest of the method he only uses param1F but I'm curious if anyone has the idea for what this could be...

How to prevent a method of a class to be called before the class is ready ?

Still exploring C# ... so bare with me please. Here is my custom "logger" class, which helps me create logs file in my project. namespace MyProject { class Logger { private FileInfo fFile; private DirectoryInfo dDir; /// <summary>Add a new entry to the log file.</summary> /// <param name="sData">The line to add.</param...

How to find a "method usage" all along a VS solution by specifying its parameters that are not NULL?

Hi, Is it possible in VS -maybe by using Resharper- to find a method's usage which has some of its parameters NOT set as NULL. Imagine I have this method: public string MyMethod(ParameterClass param1, ParameterClass param2 , ParameterClass param3,ParameterClass param4) { // Some processes return "Hello Pandora!"; } and I want to...

REST Architecture - Resources and Methods

In REST based architectures what's the difference between a resource and a method. Is there one? ...

Meaningful Method Name

Hi all, I'm writing a method which calculates a user's phone recharge credit expires within n months. I couldn't think of a meaningful name. At the moment, it is called getCreditExpiresInNMths(); What would you name it? Hope you don't think it is a silly question, I think a good method name is important. :) Sarah ...

consolidating class members in PHP

I recently came across an article by Matthew Weier O'Phinney (ZF project lead) that contains sample code similar to this: class User { protected $_data = array( 'username' => null, 'email' => null, 'fullname' => '', 'role' => 'guest', ); /* ... */ } Notice how what would traditionall...

What Method is used to identify when the user switches views in a tabview controller

I am working on my first simple tabview controller app. The first tab is a setup tab, and I just had a tester provide an unexpected use case. In order to address this use case, I need to execute when the user is leaving the view and before I load the next one. Running code in the next view is too late. What method is called from the c...

calling class method (with constructors) without object instantiation in php

Hi everyone, Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): <?php class Test { private $end=""; function __construct($value) {...

Retrieve method/code from many files

I have many .cs files and I want to retrieve the method behind the [AcceptVerbs(HttpVerbs.Post)] attribute from these files automatically. so input is: [AcceptVerbs(HttpVerbs.Post)] public ActionResult sample(string msg) {......} and output is: public ActionResult sample(string msg) {......} My idea is use the RegularExpressions a...

Convert C# CUSTOM getSHA512 function into Ruby

hello, I was wondering if someone could help me to get this method converted to ruby, is this possible at all? public static string getSHA512(string str){ UnicodeEncoding UE = new UnicodeEncoding(); byte[] HashValue = null; byte[] MessageBytes = UE.GetBytes(str); System.Security.Cryptography.SHA512Managed SHhash = new Sy...

Generate DynamicMethod from MethodInfo

I was going over a Joel Pobar's Dodge Common Performance Pitfalls to Craft Speedy Applications article on Reflection and I was looking at a particular piece of code that isn't compiling (slightly modified to narrow down to the specific error, because his example had more errors): MethodInfo writeLine = typeof(Console).GetMethod("WriteLi...

calling ApplicationDidFinishLauching Method

hi , i need from another nib file to call the method (applicationDidFinishLauching) from appdelegate. I am a bit new into the calling methods system can you help me? i have done this code since : DrunkeNewIdeaAppDelegate *appDelegate = (DrunkeNewIdeaAppDelegate *)[[UIApplication sharedApplication] delegate]; ...

PHP: "Call to undefined method" error when calling static method from parent

How is the correct way to call a child class method from a parent class if both are static? When I use static classes it returns the error "Call to undefined method A::multi()", however when I use non-static methods there is no problem, for example: //-------------- STATIC ------------------ class A { public static function calc($a...