Tutor profile: Josh R.
Subject: jQuery Programming
What is the difference between the "on" and "one" jQuery methods?
The "on" method binds an element to an event listener and that listener is called each time the event is triggered. The "one" method also binds an element to an event listener, but, the first time the event is triggered, the listener is called then unbound from the element so that it is only triggered once.
Since you don't have to worry about types it is easier to create and use anonymous objects inline, but this also means that you can't guarantee what data you will be working with. This can be especially helpful when you have a unique object that you only use once since you don't have to define a type for it in order to use it effectively. Not having types also means that you cannot take advantage of some of the benefits of polymorphism like function overloading.
Subject: C++ Programming
How do you pass or simulate passing a function to another function as a parameter?
To actually pass a function as a parameter you can use a function pointer or, since C++11, you can pass a lambda function. To simulate passing a function as a parameter you can use the command pattern. To do this you create pure abstract class with an "execute" method, create classes that implement the abstract class, and pass an instance of one of those classes to the function. Then you call the command's "execute" method in the function.
needs and Josh will reply soon.