All Questions

7661
votes
88answers
1168136 views
5579
votes
29answers
822009 views

var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent. The previous developer uses two way...
355
votes
8answers
153641 views

How can I view the source code for a function?

I want to look at the source code for a function to see how it works. I know I can print a function by typing its name at the prompt: > t function (x) UseMethod("t") <bytecode: 0x2332948> &...
926
votes
8answers
111854 views
91
votes
13answers
68198 views

Why isn't the size of an array parameter the same as within main?

Why isn't the size of an array sent as a parameter the same as within main? #include <stdio.h> void PrintSize(int p_someArray[10]); int main () { int myArray[10]; printf("%d\n", sizeo...
1305
votes
31answers
495391 views

Difference between a method and a function

Can someone provide a simple explanation of methods vs. functions in OOP context?
44
votes
5answers
44836 views

Table name as a PostgreSQL function parameter

I want to pass a table name as a parameter in a Postgres function. I tried this code: CREATE OR REPLACE FUNCTION some_f(param character varying) RETURNS integer AS $$ BEGIN IF EXISTS (select...
2571
votes
19answers
591921 views

What is the difference between call and apply?

What is the difference between using call and apply to invoke a function? var func = function(){ alert('hello!'); }; func.apply(); vs func.call(); Are there performance differences between th...
131
votes
9answers
229177 views

Error: could not find function ... in R

I am using R and tried some.function but I got this error message : Error: could not find function `some.function` This question comes up very regularly. When you get the error: could not find func...
199
votes
5answers
53796 views

Difference between method and function in Scala

I read Scala Functions (part of Another tour of Scala). In that post he stated: Methods and functions are not the same thing But he didn't explain anything about it. What was he trying to say?

Previous Next