Tag: function

44 votes
11 answers
1K 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

avatar
Elicia
0 1 0 9
asked 07 September, 2021
59 votes
15 answers
380 views
How to deal with name/value pairs of function arguments in MATLAB

I have a function that takes optional arguments as name/value pairs. function example(varargin) % Lots of set

avatar
Bryan
0 1 0 9
asked 07 September, 2021
55 votes
4 answers
1.3K views
Function for 'does matrix contain value X?'

Is there a built in MATLAB function to find out if a matrix contains a certain value? (ala PHP's in_array

avatar
Majorie
0 1 0 9
asked 07 September, 2021
64 votes
7 answers
464 views
In MATLAB, can I have a script and a function definition in the same file?

Suppose I have a function f() and I want to use it in my_file.m, which is a script. Is it possible to have th

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
58 votes
7 answers
1.7K views
Map function in MATLAB?

I'm a little surprised that MATLAB doesn't have a Map function, so I hacked one together myself sinc

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
55 votes
11 answers
842 views
How can I apply a function to every row/column of a matrix in MATLAB?

You can apply a function to every item in a vector by saying, for example, v + 1, or you can use the function

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
61 votes
8 answers
1.2K views
How to elegantly ignore some return values of a MATLAB function

Is it possible to get the 'nth' return value from a function without having to create dummy variable

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
60 votes
9 answers
825 views
Is it possible to define more than one function per file in MATLAB, and access them from outside that file?

When I was studying for my undergraduate degree in EE, MATLAB required each function to be defined in its own

avatar
Majorie
0 1 0 9
asked 07 September, 2021
51 votes
1 answers
928 views
How to add nested functions javascript in custom commands for Nightwatch testing- forEach -loop through elements

Hi I am new to javascript and Nightwatch, I am a manual tester who started doing automation about 6 months ago

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
48 votes
2 answers
1.7K views
HTTP Error: 401 while setting up firebase cloud functions for android project

I`m trying to set up firebase functions, but I get an error after running firebase init. Error: HTTP Error: 4

avatar
Juliane
0 1 0 9
asked 07 September, 2021
55 votes
3 answers
3K views
How can I solve the error 'TS2532: Object is possibly 'undefined'?

I'm trying to rebuild a web app example that uses Firebase Cloud Functions and Firestore. When deploying

avatar
Tana
0 1 0 9
asked 07 September, 2021
54 votes
4 answers
2.2K views
How to deploy some functions to Cloud Functions for Firebase without affecting some other functions?

When I run firebase deploy --only functions it reads the index.js file and updates all functions exported fr

avatar
Majorie
0 1 0 9
asked 07 September, 2021
59 votes
6 answers
1.1K views
Firebase cloud functions is very slow

We're working on an application that uses the new firebase cloud functions. What currently is happening i

avatar
Santiago
0 1 0 9
asked 07 September, 2021
50 votes
23 answers
1.3K views
Get Download URL from file uploaded with Cloud Functions for Firebase

After uploading a file in Firebase Storage with Functions for Firebase, I'd like to get the download url

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
55 votes
9 answers
1.7K views
How to protect firebase Cloud Function HTTP endpoint to allow only Firebase authenticated users?

With the new firebase cloud function I've decided to move some of my HTTP endpoint to firebase. Everythin

avatar
Fabian
0 1 0 9
asked 07 September, 2021
63 votes
18 answers
1.1K views
How do I structure Cloud Functions for Firebase to deploy multiple functions from multiple files?

I would like to create multiple Cloud Functions for Firebase and deploy them all at the same time from one pro

avatar
Jeff
0 1 0 9
asked 07 September, 2021
52 votes
29 answers
491 views
Enabling CORS in Cloud Functions for Firebase

I'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is tha

avatar
Bryan
0 1 0 9
asked 07 September, 2021
71 votes
9 answers
2K views
Static vs class functions/variables in Swift classes?

The following code compiles in Swift 1.2: class myClass { static func myMethod1() { } class func

avatar
Stacia
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.1K views
map function for objects (instead of arrays)

I have an object: myObject = { 'a': 1, 'b': 2, 'c': 3 } I am looking for a na

avatar
Dusty
0 1 0 9
asked 07 September, 2021
55 votes
23 answers
867 views
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(

avatar
Kristopher
0 1 0 9
asked 07 September, 2021