Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [function]

A function (also called a procedure, method, subroutine, or routine or macro) is a portion of code intended to carry out a single, specific task. Use this tag for questions which specifically involve creating or calling functions. For help implementing a function to perform a task, use [algorithm] or a task-specific tag instead. By creating function the logic can be isolated and can be called repeatedly.

-2 votes
0 answers
19 views

I can't display values ​from a javascript function separately through an array or a callback function [duplicate]

I need to retrieve the latitude and longitude coordinates to use them elsewhere. What is the easiest way? Using an Array? Or an callback function? According to the code snippet below, the console.log(...
MOMO Des Îles's user avatar
0 votes
0 answers
33 views

Exact same line of code not working between 2 PCs

On my home PC with R4.4.0 avg_demand_per_yearday <- aggregate(demand ~ yearday, df, 'mean') it works as expexted. On my work machine with R4.4.1 an error occurs Error in UseMethod("aggregate&...
Siam Bhuiyan's user avatar
0 votes
0 answers
23 views

Calculations with the MS excel tool using the functions and formulas in a single cell

How do we calculate Coefficient C if R/W=0.64 and H/W=1.8? using functions in a single cell/step. Detailed query: If We have a table with some rows and columns, How do we calculate the respective ...
Nirottam Singh's user avatar
0 votes
0 answers
14 views

Prevent VS Code suggesting turning a function into a class

I have an issue with VS Code suggestion turning a function in JS into a class. It gives the following suggestion message: This constructor function may be converted to a class declaration. ts(80002) ...
tacoshy's user avatar
  • 12.1k
0 votes
0 answers
12 views

How do I write a function that "converts" an arrow function to a normal function? [duplicate]

For example, can I write some function (call it convert) that can convert an arrow function to a normal function? I want to bind the function to some object but I can't do that for arrow functions. ...
azhen7's user avatar
  • 371
-1 votes
0 answers
22 views

Is it a good practice for wrapper function/adapter function to be overload of the original function? [closed]

I believe the title describes my question well enough, but still I will an example: std::string GraphFunction(std::function<std::vector<float>(float)>function, FunctionGraphingParameters ...
Serhii Horbanov's user avatar
0 votes
1 answer
26 views

Issue retrieving City/State/Zip line from block of text

I have a bunch of blocks of text that will contain address information such as: Fake Name Business name 60 N Address Ave. San Jose, CA 95126 (555)255-5555 Email: [email protected] I need to ...
Maurice Fiorani's user avatar
0 votes
0 answers
15 views

How to configure Azure APIM enabling to access using oAuth2.0? Call the endpoints through Azure Function in a separate Azure Subscription with token

I have 2 separate Azure Subscriptions, one has APIM and another subscription has Azure Function, This Function is a consumer of APIM endpoints. The Problem Statement: Protect the APIM with OAuth2 and ...
Deepak Shaw's user avatar
0 votes
1 answer
21 views

What is the best practice on importing packages for functions in a multi-file project

I have a multi-file project, where I have one main file and import almost all necessary functions from other files. Some of these functions require certain packages. I would import all packages at the ...
pmaen's user avatar
  • 63
2 votes
1 answer
44 views

Confusion about Caching with Decorators in Python

I'm working with Python decorators to implement caching for functions. I understand the basic concept of caching results to improve performance, but I'm struggling with how to handle different ...
ABIGAIL WOOLLEY's user avatar
-1 votes
1 answer
39 views

What is necessary for any few lines of code to be a function in python? [closed]

I was taking a computer science class, and I was tasked to create a program that implemented a function which took parameters. My teacher told me that the following code is not a function leaving me ...
Eesh Pant's user avatar
0 votes
1 answer
54 views

Woocommerce Single product Hooks issue: Replace add to cart button

I have created a new FUNCTION for my product page. It says WHEN _shipping_costs is empty (no digit) than change the button on "price on request". Archive page On the archive page you can ...
Jason Lommelen's user avatar
0 votes
0 answers
17 views

Multilevelannotation function error in xMSannotator package. Error in hclust() NA/NaN/Inf

I have been trying to use the multilevelannotation function within the xMSannotator package to process mass spectrometry data. This package can be accessed through using: install.packages(c('...
TCB at EU's user avatar
  • 131
1 vote
1 answer
65 views

Finding largest root of a function in R

I have a function that is data generated and not a polynomial. For most data, it only has one root, but it can also have two roots, as in in the following plot: uniroot() tends to fail because the ...
cdalitz's user avatar
  • 1,235
1 vote
0 answers
45 views

Cannot get this elif function logic to work for word-game solver, might need suggestions on better method overall

This is the latest functional attempt at doing entry validation for a Solver app (w/ a customtkinter GUI). It seems straight forward, and with a set defining the absolute values of what characters can ...
nannerpuss's user avatar

15 30 50 per page
1
2 3 4 5
7431