A function (also called a procedure, method, subroutine, or routine) is a portion of code intended to carry out a single, specific task.

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

wrong partitions with matlab's cvpartition

I am having trouble with the cvpartition function of Matlab. I want to perform a 5-fold cross-validation (for classification) with a dataset that has 134 instances from class 1 (negative) and 19 ...
2
votes
2answers
21 views

Bash check element in array for elements in another array

I came over this cool Bash function for checking if an array contains an element: CONTAINS_ELEMENT(){ local e for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done return 1 } ...
2
votes
2answers
20 views

An issue with vectorising Gsub

Aim: I am a newcomer to R, but I am trying to familiarise myself with programming in R. In a current task, I wanted to replace a number of words occurring in a corpus whilst keeping in tact the ...
7
votes
4answers
77 views

I keep everything in an external .js file. But not all functions are used on every page. Does this affect speed?

My app's JavaScript/jQuery is contained in an external scripts.js file. It generally looks like this: $('document').on('ready', function() { giraffe(); elephant(); zebra(); }); function ...
2
votes
2answers
31 views

Putting correct php-code within eval()-string

I am working on a Wordpress project where I need to dynamically create a function (depending on which kind of template is used for a page or post) that retrieves the comments of each page in question. ...
-1
votes
2answers
64 views

C float reset to 0 after passing it to a function

In the code below,the variable "tmpRes" is correct before the call of "BuildCMD" but inside this function,it loose his correct value and sets to 0,why it just doesn't keep the correct value even ...
-2
votes
1answer
28 views

C++ event handling interface with function pointers

I want to implement a simple event interface with function pointers for a simple game in C++. This will be done to improve the event interface of the allegro lib. Therefore I've written the following ...
0
votes
1answer
36 views

JavaScript: SetInterval doesnt work if I use position:absolute

I am making my own image swapper: function slideImages() { var images = $('#frontimageswap a'); $(images[0]).fadeOut(1000).fadeIn(1000, function() { ...
0
votes
2answers
56 views

JavaScript & self executing functions

I'm trying to understand (probably simple concepts) about JS, and I've put together the below piece of code to explain what I don't get. What I do not understand is where the name variable is stored. ...
-6
votes
2answers
37 views

What does this function returns exactly? [closed]

I want to know exactly what this function returns. Does it return a null ? function create_test() { return; } $size = array(); $size = create_test(); // array is null ??
0
votes
3answers
30 views

error: no matching function for call to 'Rectangle::Rectangle()'

I do not understand why this program is not working. Im new to C++; im switching after three years of Java. I thought the error messages in Java made no sense but the errors ive been getting in C++ ...
1
vote
1answer
22 views

Restarting functions yeilds unexpected results

I'm creating a simple tic-tac-toe game and I have a button that when clicked resets all of the variables affected by the clickHandler function and clears the elements from the table cells, virtually ...
1
vote
2answers
51 views

function pointer to a class member

I am trying to do some like this: class A { void *(*func)(void *); A(void *(*function)(void *)){ func = function; } } class B { void *real_func(void *); A ptr; B() ...
-1
votes
2answers
28 views

Replacement variable inside of the replacing variable

I have a function, that check user language and write it down in a variable. After a time, i come of idea to merge they, so that i need a call the function anytime before the first use of a variable, ...
0
votes
0answers
28 views

Hiding Undocumented Functions in a Package - Use of .function_name?

I've got some functions I need to make available in a package, and I don't want to export them or write documentation for them. I'd just hide them inside another function but they need to be ...

1 2 3 4 5 1280
15 30 50 per page