developer

What is a “static” function?

Question: ❓❓❓ The question was about plain c functions, not c++ static methods, as clarified in comments. Ok, I understand what a static variable is, but what is a static function? And why is it that if I declare a function, let’s say void print_matrix, in let’s say a.c (WITHOUT Read more…

By admin, ago
developer

How to get a function name as a string in Python?

Question: ❓❓❓ In Python, how do I get a function name as a string without calling the function? def my_function(): pass print get_function_name_as_string(my_function) # my_function is not in quotes should output "my_function". Is this available in python? If not, any idea how to write get_function_name_as_string in Python? Good Answer: 👌👌👌 Read more…

By admin, ago
developer

Pass a JavaScript function as parameter

Question: ❓❓❓ How do I pass a function as a parameter without the function executing in the “parent” function or using eval()? (Since I’ve read that it’s insecure.) I have this: addContact(entityId, refreshContactList()); It works, but the problem is that refreshContactList fires when the function is called, rather than when Read more…

By admin, ago