Enable contrast version

Tutor profile: Cyan K.

Inactive
Cyan K.
Graduate Student Researcher in Human Computer Interaction
Tutor Satisfaction Guarantee

Questions

Subject: Python Programming

TutorMe
Question:

As an example of how function execution works with imported modules, take two scripts, testmain.py and testmain2.py. Here is testmain: def main(): print("Hello World!") main() print("Hello World!") And here is testmain2: import testmain testmain.main() print("Hello World!") How many times does "Hello World" appear when you run testmain.py? How many times does "Hello World" appear when you run testmain2.py?

Inactive
Cyan K.
Answer:

For testmain.py, twice. 1. The main() function executes first. 2. Then the print statement is executed second. For testmain2.py, four times. 1. The testmain script is imported, and with it, the main() function executes 2. Then testmain's print statement executes. 3. Testmain2 invokes the main function of testmain, which prints it again. 4. Finally the print statement in testmain2 executes. Follow up question: How would you modify testmain.py so that "Hello World!" prints twice when you run it directly, but three times when you run testmain2.py? Answer: Move the second print statement underneath an if __name__=='__main__': statement

Subject: MATLAB

TutorMe
Question:

Repmat is a function that repeats an array or matrix. Let's define a variable 'a': >> a = [1:3; 4:6]; Write a statement using repmat and 'a' as the matrix to be copied, to create the following output: 2 2 5 5 2 2 5 5

Inactive
Cyan K.
Answer:

Possible answers are: >> repmat(a(:,2), 2, 2) or >> repmat(a(:,2), [2 2]) or >> repmat(a(:,2), [2, 2])

Subject: Human-computer Interaction

TutorMe
Question:

Fitt's law is a model which predicts that the time it takes for a user to point to a target. The pointing can be done either physically with hands and fingers, or virtually using a pointing device (i.e. a mouse) on a computer screen. The amount of time it takes to point to a target relies on a few factors: one is the distance to the object. Use your intuition and name two other factors that would affect the movement time.

Inactive
Cyan K.
Answer:

The pointing device or interface can affect the movement time. For most people with normal movement, pointing with one's finger is much easier than, say, pointing with a mouse or a joystick. The size of the target also will affect the time to target. Targets with a larger area will be easier to point to than smaller ones.

Contact tutor

Send a message explaining your
needs and Cyan will reply soon.
Contact Cyan

Request lesson

Ready now? Request a lesson.
Start Lesson

FAQs

What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.