Function Questions
Ad
Ad
JavaScript object how to use Foreach loop
JavaScript's Array#forEach() function lets you iterate over an array, but not over an object. You can iterate over a JavaScript object using forEach() using Object.keys(), Object.values(), or Object.entries().
october cms extend custom twig markup
Add custom twig markup to October cms. add function, filter , test, and much more to Octobercms twig markup.
Essential javascript array functions
Much more efficient and flexible Essential javascript array functions to use in daily routine. Great Power at no performance cost.
How do I multiply values from different inputs to get a total using Javascript?
I am trying to do a shopping cart where i want the total to automatically change after the quantity is inputted (the total is the price times the
Full text search engine example in F#?
Are there any good examples (websites or books) around of how to build a full text search engine in f#?
Parent node elimination using child value
I am using firebase for my application and would like to be able to delete a parent node via its child value. i have already tried several
Drawing a custom label on a pie chart in Yahoo's Flash Library ASTRA
Has anyone looked at yahoo's astra? it's fairly nifty, but i had some
Detailed stack trace: Error: Cannot find module "Users/myhUser/downloads/myFolder/my.Json/"
I am trying to push firebase functions with node.js and terminal. when i push and check my logs in firebase i am seeing,
How to get data from firestore to google cloud functions?
My index.js file: const functions = require('firebase-functions'); const admin = require('firebase-admin'); const firestore =
Variadic template returning a N-tuple based on an unknown number of arguments
I would like to have a variadic function template that takes pointers of a certain type t, fills those pointers, and for each of them generate an
C incomplete types: linker doesn't warn about obvious error
A file main.c declares a function of the incomplete type int func(), then uses it as int func(void).
Passing elements of a slice to `fmt.Println` using the `...` operator to spread arguments doesn't work. Why?
I have an array/slice of elements (bytes in my example), and i want to print these values using ftm.println. i can of course just
error: cannot call member function without object - but I have an object?
I'm trying to compile the following code but i receive this error: commandprocessing.cpp:86:58: error: cannot call member function
Ad
R - Function that dichotomizes certain columns of a data frame based on different thresholds
I am trying to create a function that dichotomizes certain defined columns of a data frame based on different values depending on the column.
Kotlin "variable expected" error when doing assignment to Array element
I'm writing the following nested function where dfsvisit uses the arrays "numcaminos" and "colores" declared in the outer
Python function as argument
I have a problem with pass other function as parametr to another. i have function marks_as_done and delete_task in separate file
How to convert T-SQL NOT IN Query into KQL and limit batch size with parameter in C#
I am currently working on adx and need to convert following sql query into kql select
Stipe, React Native, [Unhandled promise rejection: SyntaxError: JSON Parse error: Unexpected identifier "Error"]
I'm developing an app with expo, firebase cloud function and stripe, for some reason the first time i navigate to the screen
SQL:ANSI Output a table with ID's when values first move from 0 to any positive number
I have a table with id's, dates, and values. i'd like to retrieve each unique id (date and value) the first time the value moves specifically from
calling a function in file1.as from file2.as?
How can i call a function in file1.as from file2.as? here is the code. package com.modestmaps { import
Recursion for even array in C
I understand there are a lot of questions around even recursion here, but i don't know in c wether its my logic or my syntax that's wrong (or
How to convert this line of code from Python to Julia?
In brief, i have the code below in python [n, m] = f() and i want to convert it to julia, which will not be more
Keep getting Type_Error in Python when trying to solve with formula containing >
I need to print all the values from xml data that are more than the average. i figured out how to solve for the average but i'm having trouble
Ad
Merge binary Strings and Insert bits in C
Function insertbits x and y are two integer values. the function insertbits must insert all the bits of y after the last set bit in
Change alpha component in a function returning a float *color
I've got a function returning a (float *) color. it works, until i tried to change the alpha component of one color, and now almost all colors
Are functions external by default?
Is a function without a storage class specified in its declaration and definition : void func(void); // declaration void
Can the main function be declared before is defined?
I know that the main function is just a "special" function, but can it be declared and then defined like any other function or not?
Initialize a variable with the sum of the first column
I have made a program which finds the column that has the min sum out of a 2d array. to calculate it, i initiated the min variable of
Why do I get Failed prop type: Invalid prop `onAnimationFinish` of type `object` supplied to `LottieView`, expected a `funtion`
I am pretty sure am supplying a function to the lottieview component, but am getting the aforementioned console warning error: failed prop
Email verification before user creation
According to the document, it is possible to
Firebase Functions sporadically updating doc
I´m receiving webhooks from an online store about categories created. the following function creates the document inside the collection
How are variadic variables represented on the stack?
I was trying to implement my own variadic function using this code. instead i got ub. #include <stdio.h> void test(int a,
Firebase Functions gives Timeout on Client side after 10s
I am using gethttpscallable to call a cloud function on android but the function returns with firebasefunctionsexception:
Pipe file read stream in Firebase callable function
I have a firebase callable function which is defined like this: exports = module.exports =
Ad
Function pointer to template class member functions
I have a templated class defined (in part) as template <class t> myclass { public: void dosomething(){} };
How do you pass a member function pointer?
I am trying to pass a member function within a class to a function that takes a member function class pointer. the problem i am having is that i
Virtual member call in a constructor
I'm getting a warning from resharper about a call to a virtual member from my objects constructor. why would this be something not to
PHP: Can I reference a single member of an array that is returned by a function?
Any idea how if the following is possible in php as a single line ?: <?php $firstelement = functionthatreturnsanarray()[0];
C++ inheritance and member function pointers
In c++, can member function pointers be used to point to derived (or even base) class members? edit: perhaps an example will help.
Simulating a virtual static member of a class in c++?
Is there anyway to have a sort of virtual static member in c++? for example: class baseclass { public:
How can I make a set of numbers that increase every 30 seconds to line up in an ascending order?
If you run this javascript code below, var i = 20220215155; function increment(){ i++;
I am not quite understanding the output of the following function
I wrote a simple sum() function in c with two arguments of integer type. but, while calling the function in main, i passed char type variables.
Program stops working after i call a function that returns a pointer in C
I have to create a function that, given 2 different values s1 and s2 (s1<s2) and a vector filled by a file, creates a new vector and arranges
How to differentiate between a number and a letter or sign?
If i have a digit within a string i can just do: x = "2" x.isdigit() and i get true. but when i do
How to notify the front end that it needs to refresh after setting a custom claim with Firebase cloud functions onCreate listener
I'm trying to initialize a user upon registration with a isuser role using custom claims and the oncreate listener. i've
Ad
Can't post to firebase's database
When i try to post data with postman to firebase i get this error: error: value for argument "data" is not a valid firestore document. cannot use
Firestore query is only returning 1 doc
I have written a simple firebase function to get all the docs in a collection called 'events'. my code: export const
firebase admin.auth().getUserByProviderUid is not a function
I want to delete by facebook provider user in my firebase authentication using
NaN in Javascript showing up when using a text input field
I am trying to use a simple function of javascript that was intended to be used with a select dropdown with single digits, but now i need to use
Why does reduceRight return NaN in Javascript?
I'm using firefox 3.5.7 and within firebug i'm trying to test the array.reduceright function, it works for simple arrays but when
~foo(arguments); What does "~" mean in this code snippet in nodejs?
Code snippet of unirest as you can see above,
Firebase Cloud Functions: can i start a live audio stream in a firebase cloud function?
I need to know if i can start a live audio stream through firebase cloud functions. for example i upload an audio file to firebase storage and use
What is the right way to update createdAt and updatedAt date fields for a document in firestore?
I have a document collection called schools for which we have kept fields called createdat and
Incrementation using functions
I want to increment the value of a integer using functions in c. so first i wrote a function inc where i incremented the
Call a function from different file where the file name and function name are read from a list
I have multiple functions stored in different files, both file names and function names are stored in lists. is there any option to call the
Loading a File from Google Bucket into PyDub AudioSegment
I have been trying for a while to load a .mp3 file which exists in a google bucket into pydub. here is my code f = io.bytesio()
Ad
How to ensure HTTP trigger will be called only via HTTPS?
I'm building an api on cloud functions with nodejs and express (firebase) and i'd like to accept only calls via https so calls made over plain
Firebase uses cloudfunctions.net instead of hosting rewrites rules
I have set up rewrites for named functions in firebase.json but still firebase.functions().httpscallable() envokes
Is it a good idea to run Socket.io on a Firebase Cloud Function?
Implementing it works, but i have read that due to how cloud functions are designed they are not the best way to use socket.io. why?
cannot find package "firebase.google.com/go" in google cloud function
I'm trying to run some example code that stores some random data using a cloud function in the firestore server, however, cloud functions deploy
Angular 8 + @angular/fire onCall function no CORS header present error
I have firebase hosting in multi-region 'europe-west' and firebase functions in 'europe-west1'. onrequest functions seem to work fine but all my
Cloud Functions - User custom claims returns undefined
I created a new user using custom token with additional claims. i can able to access the claims in firestore security
Firebase Function timeout when calling set many times on realtime db
In short: i have a scheduled firebase function that downloads a file, converts this into chunks of json and imports that into a realtime database.
How to create a new field in firestore using cloud functions?
I am a newbie in cloud functions. i want to create a new field counter whenever a document is created. i tried the following
Firebase Cloud Functions: Cannot use JSON output of http.get request via Axios
I am unable to use the json output of an external axios.get request in firebase cloud function. the function below gives the
Changing the output of a .map depending on the value
My title probably didn't make much sense but basically what i'm trying to achieve is each time my .map runs. i want it to spit out the
How correctly call multiple functions ReactJS
I would like to explain my problem of the day. currently, i have 2 functions that work proper i wish i could have both functions
Ad
javascript Cannot pass variables between 2 functions
I am wondering how to pass a variable between 2 functions. i have looked on stackoverflow but all examples i tried did not work for
How to call two model method in my controller in Laravel
I hope you can understand the question, the fact is that i have created two methods in my model, one used to filter records by category and the
TypeError: Cannot read property 'wanted' of undefined:
I have been deploying functions with firebase successfully all day learning how to use it. i was trying to see what happened if i initialized
How to grab json file from external url(PLACES API) using firebase functions
So, i want to send a request from my app to firebase using cloud funtions and then process process url and send back json file from places
event.params evaluating to undefined; Cant access event.params.post in Firebase Realtime Database Using Cloud Functions
I have tried every way i know to get this cloud function working but i don't know for what reason this cloud function evaluates event.params to be
Firebase Functions - You have exceeded your deployment quota
I have a firebase functions project with 70+ functions. it runs on node 8. after 5-7 full deployments i am getting an error:
JavaScript Google Cloud Function: write Stripe values to Firebase
I'm new to javascript and i have written the following js google cloud function with the help of various resources. this function handles
using Cloud Firestore in cloud function
Cloud function documentation says // the firebase admin sdk to access the firebase realtime database. const admin =
Firestore cloud functions.https.onRequest Request.url.split("/") not working
I try to make an https function with request url splitting but it keeps gave me undefine like this
How to upload image file to Google Storage Bucket from Google Cloud function
I have a google cloud function that take the screenshot of a url and i need to upload that image to google cloud bucket from google cloud
firebase cloud function return json object from batch function
I would like to return to the client json object {mesage: "this is what i want to return"} from batch operation... what
Ad
React + NodeJS - nodemailer google cloud functions
I am trying to make a reactjs app, and would like to when people ended up filling the form to send some emails. for that, i have firstly
How to rate limit a for each request
I'm calling the webflow cms api which has a rate limit of 60 requests per minute. as i have 300 items to update/create i am wondering how i can
`flip` function implementation in JavaScript?
Anyone please share the implementation of flip function in javascript. what i need is to reverse the first and the second parameters
JS through2 Arrow function this.push()
I have a problem with lexical binding in javascript. this is my code: .pipe(through.obj((url, enc, done)=>{ if(!url)
The state variable returned after using useState react hook shows .map is not a function
This code gives me error when i try to map the state variable returned after calling useeffect hook. on console, when i print the myappointment it
How can I make Python recognize an asterisk in a cell of my DataFrame?
So, i have a dataframe which in some cells presents an asterisk rather than a figure. i would like to build a function that spots the asterisks in
How do I return the results from a query in Firestore?
I am trying to return the results from a query. i have read 100 questions, but they all just show me how to log the results. my query appears to
Firebase firestore - use collectionGroup queries in cloud function
I want to use collectiongroup queries in a cloud function, and it only appears to be available if i import from firebase/app:
Unsubscribe all users from a topic in FCM
Is there a way to unsubscribe all users from a topic in firebase cloud messaging without knowing the tokens? basically, "delete" the topic?
google.storage.object.finalize not triggering firebase cloud function
I have a firebase app, when user uploads photo to storage, it triggers a generatethumbnail cloud function. all standard code, it worked fine, i
How can I sort a snapshot based on a timeStamp value further down in the structure?
I get a snapshot returned from the below code. i would like to be able to sort through the returned snapshot by using either the childval which is
Ad
How To Structure Data For Auto-Complete Search in Firebase
I am creating a social network app and i need to find an appropriate way to structure my cloud firestore database in order to store users. at the
Can I run Firebase Storage cloud functions locally?
From firebase docs: run
How to use multiple async/await functions?
I have an error when i deploy my functions : error parsing error: unexpected token savelastreview. i need to get some
Is there an upload limit on Firebase?
I can't seem to upload files more than 5mb in firebase storage using firebase function with busboy. the error returns:
Azure Service bus trigger for function app with session enabled - Node.js
I have a function that is trigged by service bus with session enabled, but i get the error: microsoft.azure.servicebus: it is not
How to load a firebase admin key in node js?
I want to use the firebase admin sdk to give my node server free access to my database. this is the code of index.js in my
How to get value from Firestore using Firebase Functions?
I would like to do a very basic request, to get the textvalue of my document 'la'. i need to retrieve the value before doing others things with
Keep variable between promises in a function?
On firebase function i need to get data from paypal and do 4 things : 1. returns an empty http 200 to them. 2. send the complete
javascript fat arrow in setTimeout function
<script type="text/javascript"> settimeout(alert('1'), 1000); settimeout(() => alert('a'), 1000); // second settimeout method
map an object which has some promises in it in a functional way in JS
Given the scenario that i am working on a form, and i have this validation object const
How to reuse argument from a function?
I have a function that shows image after input(type=file) loads. i need to save the source attribute of image, so i could use it furthermore. this
Ad
Function from list of parameters
Can you please help me with my python code? i wanted to parse several homepages with beautiful soup provided in the list html with the function
Python3 Indentation of return values
Find 33: given a list of ints, return true if the array contains a 3 next to a 3 somewhere. has_33([1, 3, 3]) → true
Ad
Blog Categories
Ad