Questions tagged [dynamic-function]
75 questions
2
votes
5 answers
Variable functions in Java
Is it possible through some method to assign a function to a variable in Java, like in PHP or JavaScript?
...Or does this area works on a different way when it comes to Java?
user1845673
1
vote
1 answer
Python3. Create list of dynamically generated functions
I am building simple reporting tool based on pandas and I want report developer will be able to transform dataframe by using functions. The way I see it report developer creates in the UI DB connection, sql query and bunch of python functions in a…

Vitaliy
- 29
- 1
- 4
1
vote
1 answer
how to use "snapshot.hasData" with Dynamic Future builder
I had a String type future method but I had to do some modifications to the code and I changed my future method to dynamic future and everysince the future builder never validate if snapshot has data
late final Future myFuture;
@override
void…

taha khamis
- 401
- 4
- 22
1
vote
2 answers
Dynamic function call in mule 4
I have multiple functions:
fun testadd(payload) =
({
addition: payload.value1 as Number + payload.value2 as Number
})
fun testsub(payload) =
({
substraction: payload.value1 as Number - payload.value2 as Number
})
fun testmultiply(payload) =…

Kunal Awasthi
- 29
- 3
1
vote
2 answers
Script to execute 1 of 2 functions randomly?
Is it possible to modify the script below so that the value of each option is a function?
Obviously, this doesn't work:
function…

Scott B
- 38,833
- 65
- 160
- 266
1
vote
1 answer
Setting a value to a dynamically executed function in R
For lab data, measurements are normally provided with detection/reporting limits and confidence intervals. For example, I might have a measurement of Magnesium concentration in water where the minimum reporting value is 5 and I have received two…

vorpal
- 268
- 4
- 17
1
vote
0 answers
Shunting Yard Algorithm Dynamic Function Generation
I need some conceptual help for my Qt application.
I have a program that receives image data from 12 Analog Digital Converters (ADCs - they digitize the signal of 12 detectors in an electron microscope). I display these images live in my app. Now I…

kleinpoe
- 11
- 2
1
vote
5 answers
Is this a suitable case in which using dynamic function creation would be justified?
I'm currently developing a tutorial site for teaching the fundamentals of Web development (HTML, CSS, and JavaScript, for starters). I'd like a setup where I could give in-depth coverage of all sorts of topics and then provide a basic sandbox…

Hexagon Theory
- 43,627
- 5
- 26
- 30
1
vote
1 answer
Dynamic variable names using SE mutate function
I don't know how to cut dynamic variables into groups within a for loop.
df is the data frame that contains clm_april - clm_sept variables that are double. Also I would like to put different names for new columns.
Groups which are different for…

Luka
- 113
- 1
- 6
1
vote
4 answers
Unable to call a function by using a string
I am trying to call a function in a class based on the string I passed in.
I tried following the steps at this link:
Calling a function of a module from a string with the function's name in Python
Here is my code:
methodNameString = "add" +…

ChickenFur
- 2,360
- 3
- 20
- 26
1
vote
1 answer
Is there a way to create/modify function on the fly in python
I try to simulate keyboard with python and I don't know how to deal with multiple keyboard button press. Code below works perfectly fine with 1 or 2 keys pressed at the same time (fe 'ctrl + c'):
if '+' in current_arg:
current_arg =…

Gunnm
- 974
- 3
- 10
- 21
1
vote
2 answers
Dynamic reference to an object-and-method combination in PHP
I know that if I have a function in PHP named "foo", I can call it dynamically in the following way:
$var = "foo";
$var();
And if foo is a method to an object named "bar", I can call it dynamically as follows:
$var = "foo";
$bar->$var();
The only…

Sophia_ES
- 1,193
- 3
- 12
- 22
1
vote
1 answer
Replace function behind a function pointer on microcontroller at runtime
I wonder if there is a way to load a C function with its data at runtime to the text segment of a running microcontroller system. After the function is placed in the text segment and the data is stored in data segment the function pointer to the new…

Jonny Schubert
- 1,393
- 2
- 18
- 39
1
vote
3 answers
C - dynamic function call
I have a testing file with tests defined as
static int test1(){
/*some tests here*/
return 0;
}
static int test2(){
/*some tests here*/
return 0;
}
/*...etc*/`
and I was wondering if there's a way to call all of the tests in a loop,…

SaintlyWolf
- 13
- 2
1
vote
2 answers
JavaScript Dynamic variables
With this script I add variables to an object on runtime :
function MyDocument(someDocument)
{
if(!(someDocument instanceof KnownDocumentClass))
throw "Object must be an instance of KnownDocumentClass: " + someDocument;
this.Document =…

Kooki
- 1,157
- 9
- 30