Questions tagged [dynamic-function]
75 questions
0
votes
0 answers
What is effect of compile while creating dynamic functions?
While searched for creating dynamic functions in python, i end up with following code.
dynf = types.FunctionType(compile('print "really WoW"', 'dyn.py', 'exec'), {})
dynf()
As python guidelines, it suggested that use of eval and exec are not…

mcv
- 45
- 2
- 10
0
votes
0 answers
Python - Create list of functions in for loop
I am trying to create a list of functions. For example, if I have a function which takes in two arguments f(x,y) I want to create a list of functions f(x) like [f(x,0), f(x,1), f(x,2), f(x,3)].
Here is a contrived example: Given f(x,i) = x ** i.…

ACasey
- 3
- 3
0
votes
1 answer
How can I make dynamic functions?
I have 10 functions like these:
function instagram_ajax(){
return ajaxRequest('search/instagramid', 'instagramid').then(
function(res) {
var imgStatus = res[1].length > 0 ? "checked_successfully.png" : "checked_noRes.png";
…

Martin AJ
- 6,261
- 8
- 53
- 111
0
votes
1 answer
Postgresql user defined c function issues
I have installed postgresql in my ubuntu 14.04 with apt-get command..
postgresql 9.4
libpg 9.4.8
I want to add a user defined c function for dynamic loading.
I have my c file and sql function file ready as per specification but main problem is that…

rohan dhama
- 56
- 2
- 10
0
votes
3 answers
Dynamic functions, variable inputs
Right now, lets say I have code much like this...
$some_var=returnsUserInput();
function funcA($a) {...}
function funcB($a,$b) {...}
function funcC($a,$b,$c) {...}
$list[functionA] = "funcA";
$list[functionB] = "funcB";
$list[functionC] =…

Incognito
- 20,537
- 15
- 80
- 120
0
votes
3 answers
Java Dynamic Function Call
I have a class
class JsonMap extends HashMap {}
I initialized an object like this
JsonMap jm = new JsonMap();
I am inserting data into it like this
jm.put("id", 4);
jm.put("message", "Hello");
but i want to do something easy like…

syraz37
- 756
- 2
- 6
- 11
0
votes
2 answers
How to implement a dynamic function in Angular and UI-Router based on states?
Context:
I'm using Angular and ui-router...
I have a parent controller "ParentCtrl" with a template "ParentTempl".
Within the ParentTempl there is a view for 2 states: add and edit.
I want call a function from the ParentCtrl "abstractUpdate" that…

nipo
- 180
- 9
0
votes
2 answers
create dynamic functions keeping state
Python beginner question. Say you want to dynamically create a function that keeps some state (in the code below an integer i). Then as the function defined is an object, we could use it later on. In the following code, I add the functions to a…

aaragon
- 2,314
- 4
- 26
- 60
0
votes
1 answer
Evaluating another class's dynamic function pointer without templating
I have a class which interpolates a 2D function automatically (quite happy with it). It accepts a dynamic function pointer to the method being interpolated. I have had to template out the class, since I need the object instance as well as the…

ccook
- 5,869
- 6
- 56
- 81
0
votes
3 answers
How do I call a dynamically-named method with for in Javascript
I have 2 JavaScript functions that dynamically-named..
function a1(){
//some codes
}
function a2(){
//some codes
}
function a3(){
//some codes
}
these functions above generated by PHP for sure..

aswzen
- 1,512
- 29
- 46
-1
votes
1 answer
jQuery add method to object, then trigger event on it
Consider following situation:
I have a jQuery Object, $wrapper = $(this);. This happens in a init call, like this $('#unique-wrapper-id').initWrapper()'. As you can already imagine initWrapper() is a function in jQuery.fn.
Now, still in the…

HES_Xenon
- 103
- 1
- 1
- 8
-1
votes
3 answers
dynamic action names in codeigniter or any php mvc framework
I've noticed many sites are able to use a username or page title as an action. How is this done?
For example instead of www.example.com/users/my_username (where the users action is generic and responsible for fetching user data) how could I make…

Mohamed
- 1
- 2
-2
votes
2 answers
What does Type * foo() mean/return?
I am implementing a Binary Search Tree. And it so happens one of my sources have a function written such that:
Node * BST_Insert(Node *root, int val)
{
//Body
}
I already know that a pointer is a variable which contains the address of another…
user15939950
-2
votes
1 answer
Python: exec() and lists of objects
I'm trying to create a dynamic function currently only consisting of the following:
"chosen = random.choice([ , , ,…

TheRavenousEye
- 3
- 2
-3
votes
4 answers
How to use dynamic functions in SQL to get a snake pattern?
I am trying to make temporal decisions over a data set. Let me explain the problem with a simple table:
Time Var1 Var2 Var3 Var4 Var5 Var6 Total
0:00 1.69 3.27 4.80 2.14 0.70 2.14
0:05 2.73 2.73 …

zhivab
- 99
- 11