Computer science, technology: what is a virtual machine (VM)?

More technology self-tutoring: the tutor explains the idea of a virtual machine.

virtual machine (abbreviation: VM):

An entity that is accessible via keyboard and screen, like a desktop, and may function, to the user, like a standalone computer. However, the virtual machine resides in a server or computer that may host many others as well.

In a simple case, each employee might use her/his own separate VM at work, but in fact all of the VMs might reside on a single server. (In reality there would likely be at least two servers for back-up purposes.) Yet, each employee experiences their own PC.

On the client side, the actual deployment of the virtual machines might be accomplished via network connectivity and login credentials.

Source:

azure.microsoft.com

www.lifewire.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science, technology: what is firmware?

Technology has its own terms which may require self-tutoring to understand. The tutor defines firmware.

firmware (n):

instructions that reside in a device for the purpose of performing its pre-set functions. Typically, firmware is device-specific and meant to operate without the user’s awareness. It can be updated in order to resolve performance issues or increase the device’s capability.

Firmware is programming that runs hardware. Routers and mobile phones, for instance, have firmware. A PC does as well: its firmware enables it to cooperate with the monitor, keyboard, disk drives, etc.

Source:

www.lifewire.com

www.lifewire.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Java: running program when path not set

Tutoring comp sci, you experiment a lot. The tutor shares one.

The java command, in Windows, anyway, seems to like a space between the directory and the filename you are running.

java -cp f:/dir1/dir2 program_file

not

java -cp f:/dir1/dir2/program_file

Source:

stackoverflow.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science: what is a namespace?

Tutoring computer science, terms are so important. The tutor defines namespace.

namespace:
A labeled data structure that can contain its own definitions of variables, functions, files, etc.

An example of a namespace is a directory (aka, folder). Imagine two different folders – Folder0 and Folder1. Further, let’s imagine each contains a file named file-x, but the file-x in Folder0 is different from that in Folder1. Such a situation is possible because the full names of the two versions of file-x are different: one is Folder0/file-x, while the other is Folder1/file-x. We could also say that one version of file-x is from the Folder0 namespace, while the other exists in the Folder1 namespace.

Source:

stackoverflow.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science: what is a hash function?

Tutoring computer science, you might be asked about hash functions. The tutor shares an idea about them.

hash function:a mapping of a large data set to a much smaller one that preserves a desired peculiarity of the original data. The input data may be of complex type such as objects, while the output may be a string or a set of integers (or, possibly, just a single integer).
An example of a hash function might be as follows: Suppose a restaurant’s reservations for tonight are five tables of four, ten of two, and a large party of eight. Describing that as reservations for 48, you’ve used a hash function.

Source:

cs.stackexchange.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Comp sci: asynchronous vs synchronous communication

Tutoring comp sci, you might explain asynchronous communication vs synchronous. The tutor describes them.

Asynchronous communication refers to modes in which the correspondents need not be engaged simultaneously. Email, text messaging, and comment boards facilitate asynchronous communication. In such contexts, the receivers respond at their convenience.

Synchronous communication requires the correspondents to be simultaneously engaged, waiting for incoming messages, reading them as soon as they arrive and responding directly. The motivation for waiting and responding immediately is to continue the stream of communication. A phone call or face-to-face conversation is synchronous communication.

Source:

stackoverflow.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Calculator usage: how to use the random integer generator on the Casio fx-991ES PLUS C

Tutoring math or computer science, random numbers are often involved. The tutor shows the convenient random integer generator on the Casio fx-991ES PLUS C.

Example: Generate a random integer between 10 and 89 using the Casio fx-991ES PLUS C.

Solution:

Key in ALPHA . 10 SHIFT ) 89 ) =

HTH:)

Source:

Casio fx-991ES PLUS C User’s Guide.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Java: overriding methods: what it means, and rules about it

Tutoring Java programming, you might be asked to clarify about overriding. The tutor shares some thoughts.

In Java, when you override a method, you either

  1. define its performance (give it a “body”), or else
  2. redefine (change) its performance
  3. .

Case 1, above, refers to the situation of writing a subclass of an abstract class, or implementing an interface: in either case, a method with undefined functionality must (typically) be defined, aka overridden.

Case 2 often refers to the situation of writing a subclass that alters the performance of an inherited method. However, an instance of a class can have a method overridden as well.

Rules:

When overriding a method, its return type, name, and parameter list (including types) must be identical to its original ones [from the abstract class, interface, or base class].

@Override can be used at the beginning of the line where the override is declared. For example:

@Override public void method_x(String param0, int param1,….){

This may give the compiler extra opportunity to check the validity of the override, as well as improve the code’s human readability.

Source:

docs.oracle.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Java compile error: non-static method cannot be referenced from a static context – what causes it?

Tutoring Java programming, this error message might come up. The tutor talks about a couple of its causes.

The message

error: non-static method MethodX() cannot be referenced from a static context

has a couple of causes I know:

  1. The class that contains the static main method contains another method other_method that isn’t static. other_method can’t be called from the static one unless it, too, is declared static.
  2. An object has been created [Objectx Ox = new Objectx();], but then its method methodx() is called using the class name [Objectx.methodx();]
    as opposed to the instance name [Ox.methodx();]

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Java programming: constructors in subclasses

Tutoring Java programming, there are so many interesting facets to encounter. The tutor talks about a constructor of a subclass and the word super.

Let’s imagine you write a subclass. Furthermore, let’s imagine the parent class (the superclass) has a detailed constructor. Can you assume that the subclass will simply inherit the parent’s constructor and default to its use? Apparently not.

My situation: I wrote a subclass of an abstract class that, while abstract, has a well-defined constructor. In the subclass I just defined the abstract functions from the parent. The compiler protested, citing a mismatch between the parameters required for the constructor versus those given. I looked up the problem.

Apparently, to a subclass, the compiler provides a default constructor with no arguments.

To instill the parent’s constructor in the subclass, one can declare a constructor in the subclass with the same parameters as those of the superclass’ constructor, then call super(parameter list).

Let’s imagine a parent class PC like so:

class PC{

String name;
String color;

public PC(String name, String color){
this.name=name;
this.color=color;
}//end of constructor

}

Now, the subclass SC:

class SC extends PC{

public SC(String name, String color){
super(name,color);
}//end constructor

}

From my observation, the code in the blue rectangles above is what will make the subclass take on the parent’s constructor.

Source:

docs.oracle.com

journals.ecs.soton.ac.uk/java

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.