function

C++: Why does VS2005 interpret direct-initialization of local instance as a function, when the class constructor has a polymorphic parameter?

Hi there, I have the following C++ code in Visual Studio 2005... class Base {}; class Derived : public Base {}; class Other { public: Other(const Base& obj) {} void test() {} }; int _tmain(int argc, _TCHAR* argv[]) { Other other(Derived()); other.test(); return 0; } ... Compilation fails and gives: test.cpp(19) : error C2228:...

How to Handle a Long Description Line For Interface Function

Hi, I got a long description for my interface function. IMyInterface.cs [Description("Line 1 description content here! Line 2 description content here!Line 3 description content here!Line 4 description content here!Line 5 description content here!Line 6 description content here!")] void foo() { } How to convert the single line to mu...

Function list of php file

How to get list of functions that are declared in a php file ...

Please assist in explaining this asp.net error message when converting string to datetime

Function: Public Shared Function ConvertoDate(ByVal dateString As String, ByRef result As DateTime) As Boolean Try Dim supportedFormats() As String = New String() {"MM/dd/yyyy"} result = DateTime.ParseExact(dateString, supportedFormats, System.Globalization.CultureInfo.CurrentCulture, System.Globalization...

SQL code inside SQL Scalar-value function - want to generalize - optimize

I got this code, I would like to optimize. I basically can add new columns to "Disp" table later on, and I don't want to come back modify this function. I cannot use dynamic SQL. Right? Is there anything else that would work in my case? This is the function: ALTER FUNCTION [GetDate] (@hdrnumber INT, @DateColName VARCHAR(50)) RETURNS D...

Pass the current state of a function into another function in C/C++

Is there a way to pass the current state of a function into another function in C/C++? I mean all the parameters and local variables by current state. For example: void funcA (int a, int b) { char c; int d, e; // Do something with the variables. // ... funcB(); // Do something more. } void funcB() { // funcB...

How to identify group elements enclosed by other element or tag?

Hi Friends! I have question please refer the following code to understand the question. (I removed '<' and '>' character from the following html code because otherwise the html tags will not be visible so i have written only tag names) <div> <div> <img /> <img /> <img /> <img /> </div> </div> I wan...

Giving PHP include()'d files parent variable scope

Is there anyway to for an included file to be used in a parent scope to the one it was called in? The following example is simplified, but does the same job. In essence, a file will be included by a function, but would like the scope of the included file to be the scope of where the function that included it was called from. main.php: ...

Does it prohibited calling classic C function from Objective-C++ class method body?

I have experienced some strange behavior of Objective-C++. I have an Objective-C++ class, and it calls a classic C function in a method body. But linker cannot find the C function. I described the problem here: http://stackoverflow.com/questions/2213589/xcode-print-symbol-not-found-for-my-c-function-which-used-in-objective-c-method-b/22...

how to run my own jQuery function correctly?

I've got this code that's changing a picture and additional link with it. var imgSwap(pic, link){ $("#sampleimg") .load(function () { $(this).hide(); $('#indexPic').removeClass('loading'); $(this).fadeIn(500); }) .error(function () {}) .attr({src : picArray[5]});...

MySQL functions don't load when using custom PHP.ini on windows server

php.ini on the server loads mysql functions, but as i have to use a custom php.ini on the site root, after adding the file the server is not loading mysql function. without the custom php5.ini file mysql functions and their values appear in the phpinfo() but when i create the custom php5.ini on the site root and run the phpinfo() mysq...

The advantage / disadvantage between global variables and function parameters in PHP?

sorry i'm a beginner and i can't determine how good a question this is, maybe it sounds utterly obvious to some of you. if our use of these two below is the same which is better? function doSomething ($var1,$var2,..){ ... } OR function doSomething (){ global $var1,$var2,..; ... } by our use I mean that I know that in t...

How to implement scoped function in PHP?

function parent($key) { function son() { global $key; } } I want to achieve this: son can access the $key of parent As it's quite a simple function,I don't want to change parent into a class OK,I've been told that function are global anyway.Is there a way for son to get $key of parent then? ...

PHP function not working as expected

<?php function getPosts($showposts,$tags, $thumb_key="thumb_300x166", $thumb_class, $thumb_width="300", $thumb_height="166") { $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('tag=$tags&showposts=$showposts'); while ($wp_query->have_posts()) { $...

How to separate returned values in php?

I am using a php function that will return 2 arrays.below is my function function imserv($id){ $xml=simplexml_load_file("feed.xml"); $images=$xml->xpath('//IMAGE'); $services=$xml->xpath('//SERVICES'); return array ($images,$services); } i use the below code to get results from the services block $services=imgserv('5874'); foreac...

convention to represent the exit status and actual result in XMLRPC

in the C world, a function can return error code to represent the exit status, and use INOUT/OUT parameter to carry the actual fruit of the process. when it comes to xmlrpc, no INOUT/OUT parameter, is there any best practice/conventions to represent the exit status and actual result? the context is i am trying to write an agent/daemon ...

How can I detect when a function is called as a jQuery callback vs. called directly?

I'm using hoverIntent which, as part of its settings, will call a function. I think this is called 'referencing a function' (correct?): var HIconfig = { interval: 250, sensitivity: 8, over: myFunction, timeout: 100, out: myOtherFunction }; However, I'd like to reuse said function at times and explicitly pass i...

How do you handle multi-argument JavaScript functions?

I have defined my JavaScript function as follows: function printCompanyName(company1, company2, company3, company4, company5) { document.write("<p>" + company1 + "</p>"); document.write("<p>" + company2 + "</p>"); document.write("<p>" + company3 + "</p>"); document.write("<p>" + company4 + "</p>"); document.write("<p>" + company5 + "</p...

Java function Else issue

Sooo I'm having an issue with my function. static int syracuse(int x){ if (x%2==0){ return x/2; else{ return 3*x+1; } } } Well soo my issue is : if x is even, return x/2 OR is x if odd. returns 3x+1. But when I try to compile java tells me that ( 'else' with 'if') I don't know what to do :\ why...

In php, is 0 treated as empty?

Code will explain more: $var = 0; if (!empty($var)){ echo "Its not empty"; } else { echo "Its empty"; } The result returns "Its empty". I thought empty() will check if I already set the variable and have value inside. Why it returns "Its empty"?? ...