Category "function"

mongodb & php: how can I store and callback a custom js function to parse data?

Before to submit the doubt that I have, let me start from preamble that I'm definitively a newbie on MongoDB world ;( but I'm going to learn quickly! The goal t

Can someone help me fix the bottom two rows of my nested loop? They shouldn't be the same lengths, but they are

I'm working on a project where I'd like to create the following pattern: X XX XXX XXXX .. and so forth. There are twenty rows in all, and the twentieth row sho

Python assigning the string to the variable - Str object is not callable message

I have the following problem where roles = models.StringField def role(player): if player.rank == 1: return 'leader' else: return 'memb

How do you call a variable that was returned at the end of a function?

I created this function and want to call the returned result but, I'm not sure how to get the variable back. If possible I'd also like a different message to po

functions running in loops and try/except does not work

I am a beginner in Python3 and was learning the basics during the last few weeks. I decided to use my knowledge and was trying to build a text-based game based

Python: I have a list of dictionaries but when I try to call a specific Key and Value it is throwing a error

def readParksFile(fileName="national_parks(1).csv"): nationalParks = open(fileName) headers = nationalParks.readline() keys = headers.split(",")

Called function work at printf but not at arithmetic statement

I made a struct Triangle and I made a function to calculate p(perimeter/2). When I call the function inside printf it works. But when I call the same function a

map2 equivalent apply family

I'd like to iterate between two vectors applying the following function to a dataframe. Since the dataframe is huge and I know that the apply family functions

Still can't use a function defined in a separate .cpp file

I've been searching through questions on this for hours, and it just isn't working for some reason, so sorry if there's already an answer and I just didn't unde

Delayed function calls

Is there a nice simple method of delaying a function call whilst letting the thread continue executing? e.g. public void foo() { // Do stuff! // Dela

How can I update values in MySQL database table to conform to a different pattern?

I intend to clean some data in a MySQL database table for some data that was not properly captured. The table in question contains numerous columns but the colu

I'm trying to make a function that takes a 2d array as a parameter and outputs a normal array containing every unique number, in java

The function needs to have a 2d array as a parameter and then return a normal array with all the unique numbers. If the 2d array is [ [1,1], [4,2] ] then it sh

C code collecting info through a function and passing it back, of datatype struct

//Program is to collect input from user so that can pass the array of inputs from the user to another print function but that are quite some Errors in the code

Call function at end of for loop is not working as intended

The following code is not working as intended when I call the next() function at end of for loop. For some reason only one item from the list is printed and it

Compute a function whose arguments stored in rows of a data frame in R

I have a very long function whose arguments take in different threshold values for different variables and give an event study result at the end. I want to comp

How to use recursion to sum up a list of numbers up until a certain index

I have to write a code that makes use of recursion to sum numbers in a list up until the index is equal to a pre-determined integer value. i.e. list = [1,4,8,

Stream Analytics: Best parameters to choose for the autopause of a day wise TUMBLINGWINDOW stream job and best trigger time to set for that function

Context I have a daywise TUMBLINGWINDOW (similar to the one shown below) SELECT DATEADD(day, -1, System.Timestamp()) AS WindowStart System.Timestamp() A

How to define and call functions in c++?

I am new to c++ and I am wodering how to properly define functions? Right now I am receiving the following errors: Severity Code Description Project File

pass an address to a function in vba function

see the basic function structure function test (first as range) whatever I do inside end function calling the function and first is the address of the first c

Python multiplication table school exercise

I have a school exercise, but im struggling to understand how to do the multiplication table. Could someone please help me? So depending on the number and colu