CSE Basics

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

creates or edits file

vi filename

What does git status do?

view status of files in working directory and staging area

How do you run valgrind

valgrind --leak-check=yes myprog arg1 arg 2

Can dependencies name other targets?

yes

Is Vim lightweight and found on every Unix system

yes

How do you move files back into the repository?

you commit them

delete to next paragraph

} ( in vim command mode )

What refers to the home directory

~

Note to Java Folks (ref, parameters, garbage)

•You still need to do this from time to time •There's no ref keyword in java, so you can: -Make the variable a global variable (or a public variable in the class) -Have the function return a value and assign that to the variable in the calling function:

Common data types

•byte, short, int, long, double, float, char, •C#: bool, string / String •Java: boolean, String

class Dog { }

•created a new (complex) data type! • created the "concept" of a Dog We don't have any Dogs yet, just the concept

Bus Topology

▪ Uses a cable running through area that required network connectivity ▪ Each device "taps" into the cable using either a T connector or vampire tap ▪ Old technology, not commonly used anymore ▪ Devices on cable form single collision domain

o Client/Server Model

▪ Uses dedicated server to provide access to files, scanners, printers, and other resources ▪ Administration and backup are easier since resources are located on a few key servers

▪ NFC

● Enables two electronic devices to communicate within a 4 cm range

Object-Oriented Programming (OOP) is based...

...on the concept of classes, from which objects are created. Remember: •Classes are "templates" •Objects are instances of those templates

How do you redirect the output of a script called "myscript.sh" to a file called "out.txt"

./myscript.sh > out.txt

How do you run a shell script in a new process?

./scriptfilename.sh

How do you write the suffix directive for java compilation and runs in a make file.

.SUFFIXES: .java .class .java.class: javac $<

List the names of the two files that a shell automatically opens when it starts up

.bashrc .profile

Example of login scripts

.bashrc and .vimrc

write suffix rule

.java.class:

What are to login scripts?

.profoile .bashrc

directories are seperated by what in a pathname

/

delete first occurrence of "pattern"

/pattern ( in vim command mode )

Vim search

/text ?test - reverse mode n - search for same word again N - search for same word again but in backwards direction

The binary addition of 1 + 1 + 1 + 1 = __________.

0100 (base 2)

Relative to the working directory, (..) refers to:

1 level above like a parent directory

Key features that all unit testers have

1. test runner (engine) 2. test cases (all units are inherited from here) 3. test suites 4. test execution

Cons of unit testing

1. time consuming 2. does not test the full software 3. requires team buy in 4. same developer testing and coding the feature

Git has three areas:

1. working directory 2. staging area 3. git directory (repository)

67 (base 10) = ____________ (base 3)

2111

424 (base 8) = ____________ (base 10)

276

What will be printed after the following code is executed? FOR(number ← 5, number <= 15, number ← number + 3) PRINT number + ", " ENDFOR

5, 8, 11, 14,

save

:w

write to a new file def but stay in existing file

:w def

write to an existing file def but stay in the existing file

:w! def

save and quit if or not if changes made

:wq

What is am example of a close tag in xml?

</journal>

What is an example of an opening tag in xml?

<dblp>

<some number> in *pts/<some number>

<some number> the device ex) echo "Hello world" > <some number> will echo in a specific terminal

What is an example of element in xml?

<title>PRPL: A .... </title>

The complement, F', of F(x, y, z) = x(y'z + y) + x'(y + z')' (not simplified) is:

(x' + (y + z')(y'))(x + (y + z')).

Reproduce the problem

- Make it fail - Be able to reliably reproduce the problem

Methods of Object - C#

Equals(Object) Equals(Object, Object) Finalize() GetHashCode() GetType() MemberwiseClone() ReferenceEquals(Object, Object) ToString()

Big endian computers store a two-byte integer with the least significant byte at the lower address.

False

Fixed-length instructions always have the same number of operands.

False

One problem with Flynn's taxonomy is with the MIMD category; there are very few, if any, applications for this type of architecture.

False

Signed-magnitude and two's complement both have two representations for zero.

False

Superpipelining occurs when a pipeline has stages that require less than two clock cycles to execute.

False

Switches handle only one packet at a time, while hubs can handle multiple incoming and outgoing packets simultaneously.

False

The general idea of Booth's algorithm is to increase the speed of addition when there are consecutive zeroes or ones in the multiplier.

False

The range of decimal values that can be expressed in 7 bits using binary two's complement is -32 to 31.

False

To find the classes that you need for an OO application, you identify all of the verbs in a description of a problem.

False

Using recursion for a linear sequence such as Factorial is efficient.

False

A class inherits only the methods from its super classes.

False (PP Part I - Inheritance pg. 42)

Recursion can occur whenever a method calls any other method

False *Method calling itself

What does the positional parameter $@ contain?

Same as listing all positional parameters except one at a time unlike $* which lists all together.

What will ${string%substring} do?

Strip the shortest match of $substring from back of $string account = 'cs15szz' echo ${account%??} = cs15s

A unix pipe is a way to send output of one command to the input of another

T

What are attributes in xml?

They are named values where only one attribute name per element

Each instance of a class has its own set of fields.

True

In a multithreaded program many threads run concurrently within a single program/process.

True

Only a limited range of real numbers can be expressed using the IEEE 754 standard.

True

The class constructor that runs is determined by the parameters passed.

True

The largest positive unsigned decimal number that can be expressed in 6 bits is 63.

True

___ ( uniformed resource locator): every web page has a unique address

URL

a ___ specifies the way data is represented on the disk and in RAM

data type

a ___ is a collection of information

database

notify​()

Wakes up a single thread that is waiting on this object's monitor.

Does the shell start up automatically when you login?

Yes

_____ uses an intermediary or proxy server to relay web page requests after masking the original IP address

anonymous proxy service

What is the PATH Global variable?

It searches the path for commands?

What does git diff do?

It shows a different of what is staged and what is modified and unstaged

Which MARIE instruction is being carried out by the RTN statement that follows? PC ← X

Jump X

Java ____________ are bytecode that runs in browsers.

applets

DLL stands for:

dynamic link library.

Custom functions

Format: function function_name { .... } or function_name () { ... }

This logical operator will return true if either or both conditions are true.

Logical OR

This is a control structure that causes a statement or group of statements to repeat.

Loop

In 1965 one of the founders of Intel predicted, "The density of transistors in an integrated circuit will double every year." This is now known as:

Moore's Law.

Complete the characteristic table for the sequential circuit shown below.

Next State A - Row#: 1 = invalid; 2 = 0 ; 3 = 1; 4 = invalid

____ are written for procedures that specify how the computer responds to each event

even-handling code

an ___ is defined as an action, such as a click, drag, or key press, associated with a form of control

event

cursor moves to the bottom of the sceen and preceded with :, /, or ?

ex(last line)

____ is a file sharing protocol that distributes the role fo a file server across a collection of dispersed computers

bittorrent

Select the appropriate data type for a variable to store whether or not are registered for a class, in a statically-typed language:

boolean

Which of the following is a computer that used second-generation (transistor) technology?

PDP-1

The device that functions primarily at Layer 2 that can join two similar types of networks so they look like one network (subnet) is called a _________.

bridge

____ refers to the number of associations that can exist between two record types

cardinality

Write a command that redirects the contents of standard input to an output file called tempt.txt

cat > tempt.txt

A constructor is a method that:

Performs initialization or setup operations.

What are the two ways to create a local repository?

clone or init

Methods of Object - Java

clone​() equals​(Object obj) getClass​() hashCode​() notify​() notifyAll​() toString​() wait​() wait​(long timeout) wait​(long timeout, int nanos)

___ is concept that apps and data are available any time, from anywhere, on any device

cloud computing

what are files

collections of data whether they be text, binary

in 1943, british engineers created ____ to decode messages encrypted by german enigma machine (prototype with real computing

colossus

Redirect standard output explicitly as FD1(stdout)

command 1> afile2

Redirect standard error to write to a file

command 2> afile3

How do you redirect stdout/stderr to multiple files

command 2> afile4 > afile5

What are properties in build xml files?

constants that assign a value to a variable

This is a method that is automatically called when an instance of a class is created.

constructor

What is the syntax of for loops?

for arg in list do command done

search engines have ___ components

four

A ___________ is moving the disk arm from the innermost track to the outermost, or vice versA)

full-stroke seek

enter insert mode

i ( in vim)

What is a simple but powerful scripting framework?

make

In order to pass parameters to subprograms, a(n) ____________ must be implemented to support the ISA.

stack

Clock skew is a problem for:

synchronous buses.

each ___ is a sequence of records, similar to a flat tile

table

Microcontroller memory is usually measured in kilobytes, while SOCs can include memory on the order of:

megabytes.

what makes a directory

mkdir

The electrical phenomena that work against the accurate transmission of signals are called _______.

noise

A byte stores:

one character.

What is a command to print all environment variables?

printenv

Zombie process

process that has completed running but is still an entrant on the process table and is now in a terminating state

two commands for processes

ps - shows all processes running top - shows listing of the processes that use most computing resources

what checks relative working directory

pwd

cut

remove sections from line of files

The main purpose of a __________ is to reduce attenuation, although some models provide other functions in addition to this.

repeater

____ is the first commercially successful digital computer

univac

A string enclosed in back quotes (``) in a Unix shell script is treated as a ___ and the shell attempts to execute

unix command

git reset HEAD --filename

unstage a change on a file before a commit

Assembly language:

uses alphabetic (mnemonic) codes in place of binary strings.

how can you redirect output

using > or >>

exit without changes assuming changes have been made

:q!

add file def into current file

:r def

Vim substitute command

:rs/old/new/ % - specifies the range should be the whole document

How to put a mark at a certain character in vim

'ma' - creates a mark named a at the current character

This company invented the Firewire interface:

Apple Computer

If all your unit tests pass, that means the software being tested has no bugs

F

What is TERM global variable?

It is the terminal type?

What is a unit?

It is usually a single method

source is not in the path so what does that mean?

bash internal

How do u execute a shell script in a new bash process

bash scriptfilename.sh

This statement tests a series of conditions and will execute a block of code when it finds one is true.

is-else-if

standalone -> lan access -> ____ -> ____ -> internet backbone

isp, nsp

Relevance of shell scripting?(3)

-Create own commands -Save times -Task automation

The first completely electronic computer was the:

Atanasoff-Berry Computer.

The first general-purpose programmable electronic computer was the:

ENIAC.

An object is a(n)

instance of the class

____ (transport layer security) is the successor of ssl but does same thing

tls

The "." operator

"Dot" operator used to -Get to an instances attributes -Get to an instances methods -Basically get inside the instance Format: <instance>.<attribute or method>

Print Shell PID

$$

How do you call a macro

$(CLASSES)

Print all arguments

$*

Print the name of the script

$0

Common positional paramters

$0 - $# - $$ - $? - $@

Printing the positional arguments passed to a script from command line

$1, $2, $3, ..... $9

Makefile variable to refer to the dependency

$<

Print the login name

$USER

The Boolean function F(x, y) = x'y' + x'y + xy is equivalent to:

(xy')'.

The Boolean function F(x, y) = x'y' + x'y + xy' is equivalent to:

(xy)'

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below?

(xy)'+ z(x + y)'

What is ANT?(5)

-It is a java based tool for automating a build process -Similar to make but for java -XML based format -open source apache project - It is an acronym for another neat tool

What does the positional parameter $1, $2.... $9 contain?

1,2,...9th command line args

What are steps for good practice for pulling and pushing?(3)

1. Add and Commit 2. Pull and fix conflicts 3. Push changes

3 types of operators in bash/bourne/ksh shell

1. evaluation/definition 2. arithmetic 3. pipe/redirect

Perks of Git

1. fast 2. supports non linear programming 3. fully distributed 4. able to handle large projects like linux efficiently

What will be returned from the following method? METHOD addTwoNums() a ← 8.5 + 9.5 return a END addTwoNums

18.0

____ designed to provide peak data rates of 100 mbps/1 gbps while a device is in motion

4g

What is the result of the following expression?10 + 5 * 3 - 20

5

The relational operator to test equality is:

==

_____________ gives the programmer direct access to the underlying machine architecture.

Assembly language

Suppose the state machine shown below is in State C and receives the string 100010. What is its ending state?

B

Animal is a parent class that has a method sound() which returns "eek". And the following child classes have methods that do as given below: Sheep has a method sound() that returns "Baa" Horse doesn't have a method sound() Cow has a method sound() that returns "Maa" Duck doesn't have a method sound() Dog has a method sound() that returns "Bow-wow" Java: System.out.print(mySheep.sound() + "\t"); System.out.print(myHorse.sound() + "\t"); System.out.print(myCow.sound() + "\t"); System.out.print(myDuck.sound() + "\t"); System.out.print(myDog.sound()); C#: Console.Write(mySheep.sound() + "\t"); Console.Write(myHorse.sound() + "\t"); Console.Write(myCow.sound() + "\t"); Console.Write(myDuck.sound() + "\t"); Console.Write(myDog.sound()); What is the output from the above code, assuming all the objects have been created?

Baa eek Maa eek Bow-wow As the parent class has already a sound() function the child classes Sheep ,Cow, Dog has overridden the sound() function. Soz when the sound function is called in the classes like Duck and Horse the sound function from the parent class is executed, hence "eek" is printed.

BASIC stands for:

Beginners All-purpose Symbolic Instruction Code.

common shells (5)

Bourne, Bash, C Shell, Turbo C Shell, Korn Shell

How do you define multiple files to a macro

CLASSES = A.class B.class X.class

Variables in ant are called what? What tags are they defined in?

Called constants Defined in property tags

wait​()

Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.

___________networks are those in which all components are connected to all other components.

Completely connected

Consider the following code for class XYZ public class XYZ { private int myNum; public XYZ (int n1) { myNum = n1; } // getter, setter and modifier methods go here } Which of the following statements is TRUE about class XYZ

Correct: Class XYZ inherits from the Object class A subclass cannot inherit from class XYZ (Inheritance PP pg. 37-38)

Choose the answer that best describes the array created upon executing the following: Create array myStudents[30][6]

Creates a 2D array with 30 rows and six columns

What is the function of git clone?

Creates a local git repository of an already existing one

MemberwiseClone()

Creates a shallow copy of the current Object.

clone​()

Creates and returns a copy of this object.

What does the following statement do? Create array grades[10]

Declares grades to be a reference to an array Creates an instance of an array of 10 values Will allow valid indices in the range of 0 - 9 **All of these

A class can have only one constructor.

False

Memory organization has no effect on instruction format.

False

Parallel programming is a process of running multiple tasks on a single processor.

False

The LinkedLIst<T> class is a dynamic implementation of a doubly-linked list. Its elements contain a certain value and only one pointer which points to the next element.

False

Arrays (cont.)

Fixed size Holds objects and primitive data types Data it holds is homogenous Array when instantiated is set to a specific size

_________ is EEPROM that can be written and erased in blocks.

Flash memory

What tools are available for debugging and memory

GDB JDB Valgrind

tools to debug memory leaks? (3)

GDB, JDB, Valgrind

GetType()

Gets the Type of the current instance.

____ is a protocl that works with TCP/IP to get web resources to your desktop

HTTP

The organization that sets standards for photographic film and the pitch of screw threads, in addition to matters concerning computers, is the:

ISO.

Useful features of Eclipse

Import organization Context assist Javadoc assist Getter/Setter generation Add unimplemented methods Exception handling Reminders Local history

git init

Initialize a new git repo Add/stage a new file to your repo

What is PWD global variable?

It is the current working directory

What does git push do?

It pushes your new branches and data to a remote repository

Command to terminate a process

Kill -SIGNAL [pid]

____ can assemble small network just about anywhere, connects to mobile carriers data services and creates hotspot

MiFi

_____________ is a classification for software that provides services above the operating system layer and below the application program layer.

Middleware

The state machine shown below is an example of a(n): Question 50 options: A) Mealy machine. B) Moore machine. C) deterministic finite automaton. D) algorithmic state machine.

Moore machine.

Which of the following is NOT true for Moore's Law?

Moore's Law predicted the doubling of transistor capacity per square inch of integrated circuit every year.

___________ allows multiple processes to run concurrently.

Multitasking

search for text reverse direction of initial search

N ( in vim command mode )

The lifetime of a method's local variable is:

Only while the method is executing.

hashCode​()

Returns a hash code value for the object.

replace text at beginning at cursor

Rtext ( in vim command mode )

____________ delays the binding process until the process is actually running.

Run-time binding

The first successful attempt at making I/O self-managing by pushing intelligence into the interface was _______________.

SCSI-1

The early computer networking protocol that provided nearly instantaneous access between client terminals and host computers was:

SNA

Each shell automatically opens 3 "files" when they start up. What are they, and where do they usually open up?

Stdin : keyboard Stdout : terminal Stderr : terminal

Which MARIE instruction is being carried out by the RTN that follows? MAR ← X MBR ← M[MAR] MAR ← MBR MBR ← AC M[MAR] ← MBR

StoreI X

What will ${string#substring} do?

Strip the shortest match of $substring from there front of $string account = 'cs15szz' echo ${account#??} = 15szz

What will -s file do?

Test if the file has a nonzero length

What will -z do?

Test if the file has zero length

What will -x do?

Test if the file is executable

When you pass an argument to a method, be sure that the argument's data type is compatible with:

The parameter variable's data type or intended use of the parameter.

In GUI coordinate system, which of the following positions refers to the coordinates (0,0)?

The top left corner of the GUI box

If two people edit the same parts of the code what will happen?

There will be a conflict

What do suffix directives do?

They can write one rule to handle multiple skeletons of target and dependencies at once x.class: x.java javac x.java

How does git keep track of version numbers when multiple people are committing?

They use checksums

When the person with the conflicts receives the updated code what will they see?

They will see notifications on the conflicts inside the code

Review: What is a Method?

Think of a method as a black box that contains the detailed implementation for a specific task. The method may use inputs (parameters) and may return an output with a specific type.

Assume that the class Lamp has a static method brightness ( ). If objLamp is an object of type Lamp, then to invoke brightness, you could do Lamp.brightness( )

True

C#'s ReadLine, Write and WriteLine and Java's nextLine, print and println work the same with stream readers/writers as they do with console.

True

Color depth reflects the number of colors that can be displayed on an LCD screen at one time:

True

Embedded systems can be found in simple items like coffeemakers and tennis shoes.

True

Embedded systems differ from general-purpose computers because they are designated to carry out a limited set of tasks.

True

Embedded systems rarely use virtual memory.

True

Excess-M notation uses unsigned integers to express negative integers.

True

Executing a shell script will start a new process?

True

In a singly-linked list the elements keep information about their next element.

True

In counter-controlled repetition, we can set the incrementation to any value.

True

Interpreted languages also have a one-to-many relationship between the source code statements and executable machine instructions.

True

Logic errors are harder to diagnose and correct than syntax errors.

True

Overflow is indicated when the carry in to the high-order bit is not equal to the carry out.

True

Pressing a GUI button normally causes an event to occur.

True

Programmers are able to annotate their code using special character(s) provided by syntax of a language. These annotations are ignored by the compiler.

True

Quantum computers use quantum bits (qubits) that can be in multiple states simultaneously.

True

Recursion represents a powerful programming technique in which a method makes a call to itself from within its own method body.

True

Security experts caution that wired equivalent privacy (WEP) is insufficient to block all types of network intrusion.

True

Selection structures allow us the ability to modify the order of statement execution based on boolean expressions.

True

Since toString () is a method that is in the Object class, any call to the toString () method refers to the toString ( ) method in the Object class unless specifically overridden in the child class

True

Stacks and queues are typically implemented internally as an array or a linked list.

True

Streams are opened before we can begin working with them and are closed after they have served their purpose. Closing the stream is very important and must not be left out, because you risk losing data, damaging the file, to which the stream is opened

True

The CDC 6600 supercomputer was among the first computers to employ transistors.

True

The base case (bottom of recursion) is also known as the stopping state.

True

The best architecture for evaluating postfix notation is the stack-based architecture.

True

The code within the finally block is always executed, no matter how the program flow leaves the try block. This guarantees that the finally block will be executed even if an exception is thrown or a return statement is executed within the try block.

True

The main() method always has a thread that can create additional threads

True

ASCII is a 7-bit code, while Unicode is a 16-bit code.

True ASCII uses 7 bits to store each character.This gives ASCII the ability to store a total of 2^7=128 different values.

Steps in debugging

Understand the system Identify errors Reproduce errors in as few steps as possible Diagnose the cause of the problem Fix the problem Reflect upon the problem and fix

Write a script to display environment variable for username, date, and how long the system has been up.

Username=$USER date=`date` timeup=`uptime`

How would you access elements of an aggregated object (such as a collection) sequentially without exposing the underlying structure of the object?

Using an iterator The main intent of an iterator is to access the elements of an aggregate object sequentially without exposing its underlying representation.

Are commands programs?

Yes

Do shell scripts support increments/decrements as an arithmetic operation?

Yes

Suppose, there is a recursive Java/C# method, foo() . Then is it always possible to write an iterative efficient non-recursive version of the method foo() ?

Yes, always possible

Suppose, there is an iterative Java/C# method, foo() . Then is it always possible to write a recursive version of the method foo() ?

Yes, always possible

Can you edit the default settings for the terminal and vim? If so, how?

Yes. You need to edit the .bashrc and .vimrc files.

What will be displayed on the console after the following code is executed? price ← 10 cash ← 20 IF (price < cash) THEN PRINT ("You can afford it. ")ENDIF IF (price > 5) PRINT ("The price is too high. ")ENDIF

You can afford it. The price is too high.

What will display to the screen when the following code executes? age ← 55 IF(age >= 16 && age <=80) THEN PRINTLINE("You can drive!") ENDIF PRINT ("Be safe!")

You can drive! Be safe!

What will be displayed to the console after the following code is executed? grade ← 70 IF (grade < 60) THEN PRINT("You failed.") END IF PRINT ("Your grade is " + grade)

Your grade is 70

What is USER global variable?

Your login name

What is the simplified expression for the following Kmap?

Z

save the file only if changes have been made

ZZ or :x

What is a workspace?

a location to store source code, allowed to have mutliple workspaces

When a sequence of commands are combined using a pipe, what is it called?

a pipeline

git remote add

adding a remote server

A computer bus consists of data lines, __________, control lines, and power lines.

address lines

Solid state drives:

are build using flash memory.

A "subtract" statement is an example of a(n) __________ instruction.

arithmetic

Consider an ArrayList arrInt of integer objects. To access the last element in the arraylist which of the following statements are valid:

arrInt.get(arrInt.size()-1) ("As we mentioned, arrays, like Strings, are zero indexed, so the last element of the array is always given by its length vs. length() length-1." pg. 397 / Get the last element of ArrayList with use of get(index) method by passing index = size - 1.)

List 3 common Unix shells

bash, tcsh, ksh

The approximate cost of building a chip fabrication plant today is:

between $1 billion and $15 billion.

What do &, |, ^ do in shell arithmetic operations?

bitwise AND OR and XOR

a ____ (binary large object) is a collection of binary data stored ina single field of a database

blob

A class is analagous to a(n)

blueprint

What is the syntax for case statements?

case argument in pattern 1) command add this and this;; pattern 2) command and this and this;; esac

Difference between cat and more commands in Unix?

cat displays the files contents which can cause them to go off screen more acts like a pager and allows the pages to be viewed indipendently

How do you pipe a cat foot.txt into wordcount

cat foo.txt | wc

Pros of Eclipse

code completion faster code/compile/run cycles Open source extensible (plug ins)

How do you redirect stderr to append a file

command 2>> afile3

How do you redirect standard input to read from a file

command < somefile

How do you redirect stderr and stdout to the same file

command > afile 2>&1

a ___ is a screen-based object whose behavior can be defined by a programmer

control

What is a great command to use for debuggin shell scripts

echo

How to get the current shell's Process ID

echo $$

How do you see staged changes?

git diff --cached

git diff vs git diff --cached

git diff : shows files that are modified but not staged git diff --cached : to see staged changes

How do you create a git repo in the current directory?

git init

What is the structure or if statements?

if command executes then execute command elif command executes then execute command else execute command fi

Twisted pair cabling is twisted in order to reduce _________.

inductance

___ refers to passing certain characteristics from one class to other classes

inheritance

Consider the following fxyz() method: fxyz(1) = 1 fxyz(N) = fxyz( (N + 1)/2 ) + fxyz(N / 2), for N >1 Which of the following Java methods correctly implements it?

int fxyz( int N ) { if ( N==1 ) { return 1; } else { return fxyz( (N+1)/2 ) + fxyz( N/2 ) ; } }

Select the appropriate data type for a variable to store the number of eggs that represent a dozen, in a statically-typed language:

integer

What does git help [command] do?

it gets help about a certain command

What is github.com

it is an online storage of git repositories and is used by kernel

Which of the following is placed into the symbol table during the first pass?

labels

NSF used arpnet to creater larger networks with entire ____

lans

MTTR means:

mean time to repair

It would be easy for the computer buyer if there were some way to classify systems according to a ___________.

metric

____ (multipurpose internet mail extensions) provides a clever way of disguising digital photos, sounds, and other media as plain ASCII code that travel over internet with text-based email data

mime

delete previous n characters

nX ( in vim command mode )

What does the positional parameter $0 contain?

name of script

Modern CPUs need only a few ___________ to execute an instruction when all operands are in its registers.

nanoseconds

If the most significant bit of a signed binary number is 1, that number is:

negative.

If the dependencies are older than the target will the action run?

no

does ./ ignore execution permission to run programs

no

If two people edit different parts of code and upload it what happens?

no conflict

Do you need to add execute permission for a Unix shell script to run using the source command? If not, why?

no, because bash is an interpreter and does not care about the execution bit due to its value in being portable and working on systems where there is no execution bit. the operating system kernal is what cares about the execution bit

ls

prints the directory common flags: -1 long format -a shows hidden files

What are commands

programs

Unix Processes

programs that are executing; they take up memory and get a unique identifier (PID)

____ : allows you to access the database by entering search terms and then produces a list of web pages that contain content relevant to your query

query processor

This keyword causes a method to end and sends a value back to the statement that called the method.

return

Inheritance major advantage

reusing proven and debugged high-quality software.

What unix command deletes a file

rm

What unix command deletes a directory

rmdir

How do you set a pathname or a command to a variable or substitute to set the variable?

set mydir=`pwd`

Which of the following would be a valid method call for the following method? METHOD showProduct (parameters: num1, num2) product = num1 * num2 PRINT("The product is " + product) END showProduct

showProduct(10, 4);

Ant targets are composed of:

some number of tasks

Variable names cannot contain which of the following?

spaces and special characters

The three basic ISA architectures for internal storage in the CPU are:

stack, accumulator, and general-purpose registers.

____ is a simple way to display data in a database by converting a database report into an html document, which can be displayed as a web page by a browser

static web publishing

delete up to a on this line

ta ( in vim command mode )

"To make the ___, first make all its ___, then perform all the ___"

targets dependencies actions

_____ is normally assigned to fixed-length fields that hold character data - names, album titles, etc

text data type

Cache memory is typically positioned between:

the CPU and RAM.

What does the positional parameter $? contain?

the exit code of the last command

What are environment variables?

they are a way of passing information from the shell to programs when you run them

What do "" in shell scripts signify?

they are weak quotes. If weak quotes then $variable will replace the variable with its value. Back-quote and escape characters are treated specially.

How do checksums work?

they generate a unique SHA-1 hash which is a 40 character string of hex digits

git log --graph

useful for showing branches

finger

user information look up program

Method overloading:

using the same method name for multiple methods

___ is an electronic device that controls the flow of electrons in a vacuum

vacuum tube

Examples of defining/evaluating operators in bash/bourne/ksh shells

variable=value (set variable=value for C shell) Or you can set variables to a pathname or command

Name five filter commands:

wc grep more sort less

Which commands are considered filter commands?

wc grep more/less sort

____ is a collection of document, image, video, and sound files that can be linked and accessed over the internet using a protocol called http

web

_____ : combs the web to gather data that representative of the contents of web pages - automated to methodically visit websites

web crawler

you can create _____ using HTML conversion utility, online web authoring tools, web authoring software, or a text editor

web pages

server-side scripts or programs run on _____

web servers

What is the syntax of while loops?

while true do command done

JUnit

widely used framework for unit testing java software

Can you delete a directory that is not empty

with rmdir no. delete contents before deleting directory with rm -r yes

wall command

write all command

___ is a markup language that allows field tags, data, and tables to be incorporated into a web document

xml

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below?

xy+y'

A stack-organized computer uses _______ addressing.

zero-address

open or closed curly braces, move to beginning, end of current paragraph

{,} ( in vim command mode )

Iterators

•An Iterator traverses the collection -process elements in collections one at a time. -Two important methods: --next() --hasNext() •Iterators are primarily used for processing an unordered collection of objects. •Iterators are used to implement for... each loops •Iterators are interfaces -Will be discussed in detail in later topics

Pass-by-value vs. Pass-by-reference vs. Pass-by-reference-type

•Be careful to note the difference between a pass-by-reference parameter and a parameter of a reference type. •Use the activation stack to track local variables and how parameters of the above types affect the variables from one stack frame to the next.

A quick Recap: Inheritance

•Before you can understand Polymorphism, you must understand Inheritance -By the end of this lecture, you must understand how these concepts are different from one another -You must also understand how they are related •Review: A subclass can override (redefine) a method that it inherits

Abstract classes - super class

•Cannot be instantiated •At least one method has the word abstract in the method header •Like other super classes -Declare fields -Implement methods -constructors/ toString ( )

Defining the class

•Constructor: -same name as class -public visibility -default and overloaded •Class instance variables -Should normally be private •Methods: -public, private or protected -return or not •Properties (C#) -get -set

Rules for Operator Overloading

•Keyword operator, followed by an operator symbol, indicates that a method overloads the specified operator. •Methods that overload binary operators must take two arguments—the first argument is the left operand, and the second argument is the right operand. •Overloaded operator methods must be public and static.

ArrayLists

•Linear Data Structure •Similar to a 1D array, but dynamic -Keeps track of its capacity & size •Elements are indexed starting at 0 •Java: arraylist holds only objects of specified kindC#: arraylists holds objects of any kind

Commonly used Static Method

•Math Class -abs () -min() -max() -sqrt()

Overloading Methods

•Method overloading: using the same method name for multiple methods •Do not confuse with overriding (from inheritance) •The signature of each overloaded method must be unique •The signature includes the number, type, and order of the parameters •The compiler determines which version of the method is being invoked by analyzing the parameters •The return type of the method is not part of the signature

Our first piece of garbage

•No one is pointing to the old dog anymore! •We've created trash -Yes, it's really called that (or garbage) -Yes, we have a garbage collector (GC) -The GC picks up unloved objects •There's no way to recover the unloved dog •Rule: when no one points to an object,it's TRASHED!

Polymorphism - Late binding

•Normally a method is bound to an object at compile time -This means the compiler "knows" which methods to run at compile time -This is called early binding •When methods are bound when the program is running -This is how polymorphism works -We don't know what m is until the program is running... -... so we have to determine which method to call at the last minute -This is called late binding •Employers *love* asking questions about early and late binding

The static keyword

•Only attributes and methods can be marked static •Static attributes: -Previously, each instance/object had it's own independent set of variables -With static all instances share one variable -Good for counting the number of instances

Polymorphism

•Poly - means "many" (πολλές - "polles") •Morph - "forms" (μορφές - "morfes") •Objects that take more than one form

What about out?

•Remember, this is used to initialize a variable •Why even have it? We have ref, right? •Honestly, out isn't used often, but: -Marks the "intent" of what you're doing -Could prevent bad data from coming in

A class:

•has attributes (which are just variables) • has a constructor which is used to initialize attributes • has other methods (like eat and growl) • is a blueprint (template) for creating objects • creates a new data type

An object:

•is an instance of a class • has a state (variables) that is independent from others

Referencing Parent Classes

•super and base are how we reference things in the parent class -super - Java -base - C# •In the child classes, you may see code like: -super.myMethod( ) - call the parent class's myMethod() -base.myMethod( ) - C#'s way of doing it •When you see super() or base() directly called: -It's calling the parent constructor -This happens whether you like it or not!!! -This is more "invisible code"

o Benefits of Client/Server

▪ Centralized administration ▪ Easier management ▪ Better scalability

Network Components

▪ Client ▪ Server ▪ Hub ▪ Wireless Access Point ▪ Switch ▪ Router ▪ Media ▪ WAN Link

o Wide Area Network (WAN)

▪ Connects geographically disparate internal networks ▪ Consists of leased lines or Virtual Private Networks tunneled over the Internet ▪ Covers distances around the country or around the world ▪ Examples: ● The Internet (largest WAN) ● Connecting two private corporate networks from New York to Seattle

Switch

▪ Connects networked devices such as clients and servers (like a hub) ▪ Switches learn what devices are on which switch ports ▪ Switches only forward traffic received from a port to the destination port based on the device's MAC address ▪ Provides more security and efficiently uses available bandwidth

o Metropolitan Area Network (MAN)

▪ Connects scattered locations across a city ▪ Larger than a CAN, but smaller than a WAN ▪ Covers up to a 25-mile radius in larger cities ▪ Examples: ● City departments like the police department ● Community college with campuses spread across a county

o Drawbacks of Peer-to-Peer

▪ Decentralized management ▪ Inefficient for large networks ▪ Poor scalability

o Wireless Mesh Topology

▪ Interconnection of different types of nodes or devices ▪ Consists of clients, routers, and gateways ▪ Utilizes different radio frequencies to extend and expand access ▪ Reliable and redundant connections

o Infrastructure Mode

▪ Most common type of wireless network ▪ Requires centralized management ▪ Uses a wireless access point as a centralized point like a star topology ▪ Supports wireless security controls

o Peer-to-Peer Model

▪ Peers (PCs) share resources (files/printers) with each other directly ▪ Administration and backup are more difficult since resources are located on a many PCs which adds to the administrative burden

o Wide Area Network (WAN) Link

▪ Physically connects networks together ▪ Numerous WAN links are available: leased lines, DSL, Cable, Fiber Optic, Satellite, Cellular, Microwave, ... ▪ Connects internal network to external networks, such as a SOHO network to Internet

Server

▪ Provides resources to the rest of the network ▪ Different servers provide different functions, such as an E-mail server, Web server, File server, Chat server, and Print server ▪ Can be a dedicated server hardware/software or can be a device that is acting like a server for a particular function

o Personal Area Network (PAN)

▪ Smallest type of wired or wireless network ▪ Covers the least amount of area (few meters) ▪ Examples: ● Bluetooth cellphone to car ● USB hard drive to laptop ● Firewire video camera to computer

Ring Topology

▪ Uses a cable running in a circular loop ▪ Each device connects to the ring, but data travels in a singular direction ▪ FDDI (Fiber networks) used two counter-rotating rings for redundancy ▪ On token ring networks, devices wait for a turn to communicate on ring by passing a token

▪ Bluetooth

● Low energy use variant of Bluetooth which allows for a mesh network

▪ 802.11

● Operates as infrastructure or ad hoc

▪ Infrared (IR)

● Operates with line of sight

Parts of Eclipse? (7)

-Menu Bars -Package Explorer Pane -Perspective Switcher -Editor Pane -Miscellaneous Pane -Outline pane -Task List Pane

What are alternate uses for &&, ||?

-a and -o

What are the commands to set name and email for git to use when you commit?

-git config --global user.name "Ishaan" -git config --global user.email "[email protected]"

What is SIGKILL?

-if a process gets this signal it must quit and not perform any cleanup operations

What is a shell (5)

-interface between user and kernel -command line interpreter -starts automatically when you login -allows programming -allows system calls

How do you test if a file is owned by the user?

-o file

Two cons of test-driven development

1. Same Developer writing test and code 2. Doesn't test full software 3. decrease development speed

Two of the basic operations of a queue are Push and Dequeue.

False Two of the basic operations of a queue is Enqueue and Dequeue

In 1991, the European Organization for Nuclear Research invented ______________.

Fibre Channel

Which of the following is the best choice for connecting high performance storage components within the data center?

Fibre Channel

When a set of methods have the same name but different types/number of parameters in the same class, they are called:

Overloaded methods

POSIX stands for:

Portable Operating System Interface

In Unix, executing programs have unique process identifiers

T

In Test Driven Development, what is written first?

Tests are written before the software is

It is possible for a computer with a single logical address to have more than one NIC, each with distinct MAC addresses.

True

in 1822, the ______ would operate using steam power to calculate

difference engine

Platform as a Service (PaaS) replaces the _________ of the computer hierarchy with an Internet-based platform.

digital logic level through high-level language levels

Select the appropriate data type for a variable to store the price of an item in a statically-typed language:

double or float

Select the appropriate data type for a variable to store your GPA, in a statically-typed language:

double or float

web crawlers ____ web pages and submit them to an indexing utility for processing

download

_____ is rate of data downloaded to your computer

downstream speed

_____ is temporarily assigned

dynamic IP address

____ process generates customized web pages as needed or on the fly

dynamic web publishing

Two ways of making a git repo

git clone an existing repo XOR create a git repo using "git init"

To move staged changes into the repo we commit?

git commit -m "Bug"

navigational vim commands

h, j, k, l ( in vim command mode )

____ allows one-to-one and one-to-many relationships linked in a hierarchical structure

hierarchical database

The approach of using a combination of memory types to provide the best performance at the best cost is called:

hierarchical memory.

____ languages were dubbed ___ generation languages becuase major improvement from machine and assembly languages

high level, third

what is standard error in terminal

stderror

git status

show status of files in the directory

when upstream and downstream speeds are the SAME, it is a _____

symmetric internet connection

Specially designed hardware units, known as ___________, monitor inconsistencies in caches in a multiprocessor system.

snoopy cache controllers

What is the format to write rules

tareget: dependancy action

In target0: target1... targetM, this will execute in what order?

target 1, targetM, and then target0

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below? Question 13 options: A) xy+y' B) (x+y)y' C) x'(x+y)' D) (x+y)'(x + y')'

xy+y'

The Boolean function F(x, y) = x'y' + xy' + y(xy') can be simplified to:

y'.

___ allows programmers to use abbreviated command words called op codes rather than 1's and 0's used in machine language - ___ gen languages

assembly language, second

What are three main features in shell programming?

- Shell variables which keep track of memory for later use. -Operators including mathematical operators and more -Logic Structures

How do you understand the system (4)

- Understand the software you are debugging - Understand the context the software is running in - Understand the tools you have available - Understand the techniques you have available

Identify the Problem

- What behavior is the software exhibiting? - How is this different from what it should be doing

Why do we need version control?

- collaboration w/ other developers - recovering prior version of code - improve communication on changes to project

Relevance of memory management(4)

- engineers need to know result of actions in environment - core component of all computers -some bugs can only be understood by understanding memory and how it works -insight into memory allows for better solutions

Which of the following types of memory has the shortest (fastest) access time?

Registers

General-purpose computers do not need watchdog timers because they interact directly with human beings, who deal with issues when the system hangs or crashes.

True

The new keyword makes a call to a class's constructor.

True

The stack provides 3 major operations: push (add an element at the top of the stack), pop (take the last added element from the top of the stack) and peek (get the element from the top of the stack without removing it).

True

This keyword will cause the loop to terminate immediately.

break

What is the default ant organization

build.xml doc *.html src *.java bin *.class

____: when html source document that received by your local browser handles interactions

client-side

___ encompasses a broad set of activities that include planning, coding, testing, adn documenting

computer programming

_____ is when data and program modules being so tightly interrelated that they become difficult to modify

data dependence

A user interface is a program, or small set of programs, that constitutes the _____________.

display manager

____ = nike.com or blank.com

domain name

What is the syntax of functions?

functionname() { block of commands }

Clock speeds in today's microprocessors are measured in:

gigahertz.

Public-resource computing is also known as _______________ computing.

global

using source and . to run scripts will:

ignore execution permission

cursor moves within text

in-line

A major advantage of direct mapped cache is its simplicity and ease of implementation. The main disadvantage of direct mapped cache is:

its performance is degraded if two or more blocks that map to the same location are used alternately.

____ is commonly used to add logic and other programmable elements to a web page

javascript

The _____________ is the core of the operating system.

kernel

Show all signal types command?

kill -l

___ was the first commercial micro computer was developed by ed roberts and mits

mits altair

What unix command makes a directory

mkdir

What is an example of a task?

mkdir task <mkdir dir="${build.dir}"/>

We study computer ___________ to become familiar with how circuits and signals collaborate to create working computer systems.

organization

What are the three categories of users in the chmod command?

owner(u), group(g), others(o), or all(a)

When you are working with a ________, you are using a storage location that holds a piece of data.

primitive variable

Limitations regarding where a variable can and cannot be seen inside of a program is know as:

scope

How do you define a variable in a shell script?

set x=37;

a ___ is an abstract concept that represents one end of a connection

socket

Identify the keyword that an object can use to refer to itself.

this or self

A "jump" statement is an example of a(n) ____________ instruction.

transfer of control

In 1948 John Bardeen, Walter Brattain, and William Shockley invented the:

transistor.

A Boolean expression is one that is either:

true or false

Which of the following expressions will determine whether x is less than or equal to y?

x <= y

In a statically typed language, if x has been declared an int, which of the following statements is invalid?

x = 1,000;

Implementation

• Overloading the constructor involves using the same method/function name - Vary the number of parameters; AND/OR - Vary the type of parameters

Summary (Static Modifers)

• Static Methods can be accessed using a class name •Static variables are common across all instances of a class •The reserved word static is used to identify a variable or method as static

Which one of the following is the not equal operator?

!=

What character signifies a comment in a shell script?

#

Print exit code

#?

what is the wildcard in unix

*

Relevance of Bugs(4)

- in all software -software needs to be correct - debugging is detecting, diagnosing, and fixing problems -need to know how to debug to produce good software

what is SIGFPE?

-8 -issued if illegal mathematic operation is conducted such as divisible by 0

What is Eclipse? (4)

-IBM product -Open Source -an IDE -Originally designed for java but supports Python, php, Ruby, C/C++, etc

Pros of Test Driven Development (4)

-Increased productivity -Modular extensible software -better code functionality and interfaces -concise goal driven code

What can you change in run configuration in eclipse?(5)

-JVM Arguments -Command line arguments -Classpath settings -Environment variables -Which JVM to use

How do you compile C and Java code to enable debugging symbols?

-g

What are the four types of logic structures?

-sequential logic -decision logic -looping logic -case logic

Searching in vim

/pattern

Convert 0.3828125 to binary with 8 bits to the right of the binary point.

0.01100010

Suppose the state machine shown below is in State A and receives the string 10010100. What is its output?

00 10 11 10 00 01 11 10 11

What will be the value of x after the following code is executed? x ← 1 WHILE (x < 0) x ← x + 1 ENDWHILE

1

Steps in software integration testing

1. (Re)Write a test 2. Check if test fails success : go back to 1 fail : move to 3 3. Write production code 4. Run all tests success : go to 5 fail : go back to 3 5. Clean up code

List two problems that can arise in non-version controlled software when there is only one individual involved in the software development process

1. Possibility to overwrite the file 2. no ability to revert back to prior versions

Common signals?

1. SIGHUP - Hang up detected on controlling terminal or death of... 2. 3. 8. 9. SIGKILL - if process gets this signal it must quit immediately and will not perform cleanup operations 14. 15

Name three steps in debugging and put them in order

1. Understand the System 2.Understand the problem 3. Reproduce the problem 4. fix the problem 5. Reflect on the problem and learn

How does JUnit help:

1. defines and executes tests and test suites 2. formalize requirements and clarify architecture 3. write and debug code 4. integrate code and always be ready to release a working version

Pros of unit testing

1. increased productivity 2. result: modular and extensible software 3. result: better code functionality and cleaner interfaces 4. result: concise goal driven code

3 parts to the unix operating system

1. kernel 2. shell 3. programs (commands included)

satellite services avg. ___ dl but only _____ to 256 kbps for upload

1.0, 100

FC-AL supports _________ MBps packet transmission in one direction, with a theoretical maximum of __________ devices in the loop.

100 / 127

Convert 0B2C (base 16) to binary

1011 0010 1100

355 (base 10) = ____________ (base 7)

1015

138 (base 10) = ____________ (base 5)

1023

____ = analog, offered few features besides voice communications

1g

The binary string 01000110001000 is a floating-point number expressed using the 14-bit simple model given in your text. (There are no implied bits.) What is its decimal equivalent?

2.125

There are ____________ gigabytes in a terabyte.

2^10

The truth table shown below is supposed to reflect the function F(x, y, z) = y(x + z') but two lines are in error. Identify them.

3 and 4

If a system's instruction set consists of a 5-bit opcode, what is the maximum number of output signal lines required for the control unit?

32

Suppose a system has a byte-addressable memory size of 4GB. How many bits are required for each address?

32

What is the maximum value of the cycle counter when the following sequence of microoperations is executed? MAR ← X, MBR ← AC M[MAR] ← MBR

4

What is the maximum value of the cycle counter when the following sequence of microoperations is executed?MAR ← X, MBR ← ACM[MAR] ← MBR

4

cellular data transport has ___ classes - 1g, 2g, 3g, 4g

4

How many prompts are available in the Unix system?

4 PS1 - PS2 - PS3 - PS4 -

What will be the value of x after the following code is executed? x ← 10 FOR(y ← 5, y < 20, y ← y + 5) x ← x + y ENDFOR

40

01D7 (base 16) = ____________ (base 10)

471

What will be the value of x after the following code is executed? x ← 0 WHILE ( x < 5 ) x ← x + 1 ENDWHILE

5

664 (base 9) = ____________ (base 10)

544

The characteristic table shown below contains two rows where the next state for A and B is incorrect for the accompanying circuit. Which two rows are incorrect?

6 and 7

Suppose we have a 1024 byte byte-addressable memory that is 16-way low-order interleaved. What is the size of the memory address module offset field?

6 bits

public static int arrCall (int [] arr) { int sum = 0; int count = 0; while (count < arr.length) { sum = sum + arr[count]; count = count + 2; } return sum; } Refer to above code, assume that the array arr has been declared and initialized as follows: int [] arr = {2, 10, 2, 3, 2, 5, 1}; What value will be returned as a result of the call arrCall(arr)?

7

671 (base 10) = ____________ (base 9)

825

10022 (base 3) = ____________ (base 10)

89

10122 (base 3) = ____________ (base 10)

98

Vim: execute a single unix command from vim

:!cmd

execute a single command from inside the editor

:!cmd

show current filename

:f

Vim: temporarily returning to shell (hint: what do vim commands start with in vim and what are some key letters from 'shell')

:sh

Setting value of an array at index

ARRAY[index] = value

What will be the results of the following code? ARRAY_SIZE ← 5 Create array x [ARRAY_SIZE] FOR (int i = 0, i < length of x, i++) x[i] ← 10 ENDFOR

All the values in the array are initialized to 10

What is a process?

An executing program with a unique PID (process identifiers)

Suppose the state machine shown below is in State C and receives the string 100010. What is its ending state? Question 36 options: A) A B) B C) C D) D

B

________ is the hexadecimal symbol for 11.

B

The Boolean AND operation is also known as:

Boolean product.

Techniques for debugging:

Breakpoints Watch Step etc. And how to use them

This algorithm works by comparing each item in the list with the item next to it, and swapping them if required. This process repeats until the list is fully sorted.

Bubble

Difference between git and centralized code system

CCS increments the version number of the repo (issues though because each person can have their own local version of the repo) Git assigns a unique hash of 40 characters for each commit. This hash is present regardless of local repositories

3 parts of memory

CPU Main memory Input/output system

Vim modes

Command - default mode; efficient navigation in line - cursor moves in text last line - cursor moves at bottom of screen Insert - used to enter text into a file

A method override occurs when two methods in the same class have the exact same method signature.

Correct: False True (Inheritance PP pg. 17

git checkout (branchname)

Create a new branch

Select the code you would use to create a 2D array with 5 rows and 12 columns.

Create array myNums[5][12]

ReferenceEquals(Object, Object)

Determines whether the specified Object instances are the same instance.

A software version management repository holds a master copy of only test/html code

F other artifacts as well

stdout should be used for unusual output from your program, such as error reporting

F stderr

Eclipse does not allow you to have multiple workspaces

F you can have multiple workspaces

Child C is able to inherit from two different Parents A and B in Java and C#.

False (Inheritance PP pg. 24)

509 (base 10) = ____________ (base 16)

IFD

What can you do in a static method: I) Access non-static data inside instances of this class II) Call other static methods in this class III) Access static data in this class

II & III A static method can access static methods and variables as follows: A static method can call only other static methods; it cannot call a non-static method A static method can be called directly from the class, without having to create an instance of the class A static method can only access static variables; it cannot access instance variables Since the static method refers to the class, the syntax to call or refer to a static method is: class name.method name To access a non-static method from a static method, create an instance of the class

equals​(Object obj)

Indicates whether some other object is "equal to" this one.

If a loop does not contain within itself a way to terminate, it is called a(n):

Infinite loop.

Of the algorithms that we have studied in this module, which is the most efficient in practice?

Insertion

This algorithm works using two sets. The sorted part is initially empty. We remove the entries from the unsorted portion one at a time and insert them in the the sorted part.

Insertion

Another term for an object of a class is:

Instance.

the NSF network was an internet, and as it grew it became known as the____

Internet

The computer can do such a wide variety of tasks because:

It can be programmed.

What does git pull do?

It fetches a remote repo and tries to merge it in the current branch

What are tasks in build files?

It is an action that needs execution

What is the HOME Global Variable?

It is the fully qualified name for the login directory

What does the command: "ls -l | wc -l > file1" do?

It stores the number of lines from ls in long form to the file file1 instead of displaying the output to stdout

If a parent process dies, what happens to the child processes? (usually)

It'll kill all the child processes

This search scans one item at a time, without jumping to any item.

Linear

List three tools for diagnostic output

Logging framework, GDB, JDB, standard in/out, Valgind

___________ combines loops that use the same data items.

Loop fusion

___________ is the process of removing the beginning or ending statements from a loop.

Loop peeling

__________ is an approach to I/O control in which I/O devices and main memory share the same address space.

Memory-mapped I/O

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?

Merge Sort

This part of a method is a collection of statements that are performed when the method is executed.

Method body

Shell script variables typed?

No

Is debugging algorithmic?

No. no software can debug any program

Hub

Older technology to connect networked devices, such as clients and servers ▪ Can be interconnected to provide more ports, but leads to increased network errors ▪ Receives information in one port and rebroadcasts it out all the other ports

What are PS1 & PS2 global variables?

Primary and secondary prompt strings

_______ memory allows data to be both read from and written to easily and rapidly.

RAM

The basic difference between RAM and ROM memory is:

RAM is read/write while ROM Is read only.

Only explicit load and store instructions are permitted access to memory in ___________ machines.

RISC

What are the short notation octal numbers for permissions?

Read Permissions - 4 Write Permissions - 2 Execute Permissions - 1

toString​()

Returns a string representation of the object.

ToString()

Returns a string that represents the current object.

getClass​()

Returns the runtime class of this Object.

___________ benchmarks are helpful to computer buyers whose prime concern is CPU performance.

SPEC's CPU

The first storage interface to break away from parallel connections was ______________.

SSA

______________are divisions of concentric circles (tracks) on disk drives.

Sectors

This algorithm works by selecting the smallest unsorted item in the list and then swapping it with the item in the next position to be filled.

Selection

GetHashCode()

Serves as the default hash function.

Key ingredients of a shell script

Shell programming syntax UNIX/LINUX commands

join two lines onto the upper line

Shift + j

__________________ schedules the processor giving preference to the job with the shortest execution time.

Shortest job first scheduling

SPEC stands for:

Standard Performance Evaluation Corporation.

A shell acts as an interface between the user and the system

T

As a command interpreter, the shell sends the commands to the kernel for execution

T

As a login script, .profile runs each time a Unix shell is started

T

Debugging is not algorithmic

T

IDE stands for integrated development environment

T

In Unix, the command line arguments passed to a shell script are stored in positional parameters

T

In debugging, reproducing the problem comes before fixing the problem

T

What will -w do?

Test if the file is writeable

What will -o do?

Test of the file is owned by the user

What will be displayed on the console after the following code is executed? mpg ← 30; IF (mpg < 20) THEN PRINT("That is poor gas mileage.") ELSE PRINT("That is acceptable gas mileage.") ENDIF

That is acceptable gas mileage.

What is the function of the Unix environment variable "PATH"

The PATH environment variable is a colon-delimited list of directories that your shell searches through when you enter a command

A parameter variable's scope is:

The method in which the parameter is declared.

When calling a predefined method, you must pass how many parameters in the method call?

The same number as the parameter list

Parameters

There are three main types of parameters: 1. Value - passes a copy of the value of the variable to the method. This is the default. 2. Reference (C#)- passes a reference to the actual variable. Keyword is ref. Use this when you want to pass a value in and have any change to that value be persistent when the method is complete 3. Out (C#) - passes a reference to the actual variable. Keyword is out. Use this when you want the method to initialize a value and place it for later use in the actual variable (persists when the method is complete) 4. Note that Java passes all parameters by value. 5. C++ uses both Call-by-reference and Call-by-value

Why are scripting languages useful?

They allow people to create programs that handle tedious tasks in very short amount of time

What do '' in shell scripts represent?

They are strong quotes in which everything is taken literally and nothing is treated specially.

What do `` in shell scrips represent?

This is a back quote and is treated as a command and the shell attempts to execute it. If the execution is successful the primary output from the command replaces the string

___________ share a single centralized memory.

Tightly coupled multiprocessors

ArrayLists in Java

To create one: ArrayList <String> names = new ArrayList<String>(); •Can hold only String objects •Initial Capacity of an ArrayList 10 -Capacity - is the length of the currently allocated array that holds the lists values -Size - number of elements currently stored in the list -When size equals capacity an arraylist automatically increases capacity

Processes structure

Tree like structure

The goal of object-oriented programming is to encapsulate all attributes and methods a real-life object needs to perform its duties.

True (jjj. pg. 134 "To reiterate a point made at the outset, object-oriented programming is a process of constructing objects that will interact with each other. Object oriented programs must ensure that the objects themselves are well designed in terms of their ability to carry out their designated functions. Good design in this sense requires careful selection of instance variables and careful design of methods to ensure that the object can carry out its assigned tasks."

What is required for test driven development?

Understanding the specifications of the software. You must know how the software works before writing a test for it.

Diagnose the cause of the problem

Use scientific method of debugging

fork() system call

Used by Unix child process creation invoked by parent process

Classes

Using classes, we're actually creating new data types! A class represents the concept of things in the real world, like Dogs. Classes follow a template, and have: • a name • variables (often called "attributes") • functions (which are now called "methods", "behaviors" or "member functions")

Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished by:

Using proper notation to set access to private on the class fields.

VMs vs containers

VMs will create a guest os and bins/libraries to run application while containers will use the host os and (sometimes) host bins/libraries

_____ (virtual private network) is a secured connection for accessing corporate networks from home or other offices

VPN

What is test driven development?

Where you write the tests for a software before writing the software itself

Equivalent of the test command

[]

copy a portion of the file determined by measurement ( 2yW will yank 2 spaces seperated by words)

[n]ym ( in vim command mode )

In the following code, PRINT(num) is an example of _________. num ← 5.4 PRINT(num) num ← 0.0

a void method call

Opening program in background:

add ampersand & symbol to end;

How do you make a custom function run when you exit?

add the line "trap functinon_name EXIT" below the function

What does git add files do?

adds a file to staging area

an ___ is a set of steps for carrying out a task that can be written down and implemented

algorithm

-X in bash aliases

allows ssh tunneling so GUI apps can be opened

Large computer systems use an intelligent type of DMA interface known as:

an I/O channel.

the _____, created in 1969, connected computers at UCLA, Stanford, Utah, UCSB etc.

arpanet

The embedded systems programmer typically writes programs exclusively in ________________ and does not have the luxury of after-the-fact performance tuning.

assembly language

Electrical signal loss over time or distance during data transfer is called:

attenuation Any signal losses its energy, when it travels over the long distances. This general phenomenon is called attenuation.

Logging definition:

automatically recording diagnostic output from a program

____ is business to business

b2b

____ is business to consumer

b2c

____ is business to government

b2g

most popular game development programming language is - ___, ___, ___

c, java, c++`

(*) in *pts/<some number>

cannot receive messages

What unix command is used for changing file access permissions

chmod

Which command changes file permissions?

chmod

Watson defeated human Jeopardy! champions using ______ methods.

cognitive

redirect standard output to write to a file

command > afile1

How do you redirect stdout to append a file

command >> afile1

a ____ is the doorway that allows a computer to exchange data with other devices

communications port

diff

compare file line by line

The computer component that makes sure that instructions are decoded and executed properly is the:

control unit.

Why do you ./ to execute programs?

current directory is not in the path

_____ is separating data from teh programs that manipulate data - therefore single data management tool can be used to maintain many different files and etc

data independence

____ : stores billions of index references to web pages

database

Does git use a distributed model or a centralized model?

distributed

_____ is when a database is stored on several computers, or multiple networks, or in a different geographical locations

distributed database

Containers

encapsulation of applications and their interfaces to the system that surrounds it

insert(3)

enter text into file, multiple ways, not efficient for navigating

an ____ is used to depict graphically the relationships between record types

entity-relationships diagram

What do processes do and have

execute programs and have unique ID

What does -e flag do in echo

expand \ characters

a connection might not be secure if: - security certificate is ___ - are suspected ___ sites - are ___ secure, no http

expired, phishing, partially

delete up to and including a on this line

fa ( in vim command mode )

Everything is a _____ or a ______

file or a process

____ can be characterized by their use of vacuum tubes to store individual bits of data

first gen computers

____ is designed to offer internet access to home snad businesses by broadcasting data signals over areas large enough to cover most cities and outlying areas

fixed wireless internet service

How do you modify a modified file?

git checkout --filename

How do you switch to another branch?

git checkout branchname

How do you merge changes from a branch called experimental into a branch called master?

git checkout master git merge experimental

How do you search for the pattern "history" in a file called "text.txt"

grep history text.txt

_____ adds html tags to a document, spreadsheet, or other text-based file to create an HTML document that cna be displayed by a browser

html conversion utility

What does the -n flag do in echo

it makes sure the command does not output a new-line at the end

kill

kills processes use kill -9 to kill it dead

3 points of Relevance of vim

lightweight, fast, industry uses it

Comments in a .vimrc file

lines beginngin with "

___ includes commands specific to a particular CPU or microprocessor family

low-level language

the ___ developed by jonathan a titus was one of the first personal computers

mark 8

What is the file system that holds all the main files of a project?

master copy

git merge (branchname)

merge branch with current branch

Class objects normally have ________ that perform useful operations on their data.

methods

___ uses a mesh-like structure to offer the additional capacity to define many to many relationshipos

network database

backbone links and routers are maintained by ______ (ATT, verizon)

network service providers

Can a process ignore kill -9

no

web mail is ___ the same as html mail

not

What does the positional parameter $# contain?

number of command line args

delete current [and n-1] characters

nx ( in vim command mode )

n column

n| ( in vim command mode )

insert new line after/before current line

o ( in vim )

___ is based on the idea that the solution for a problem can be visualized in terms of objects that interact with each other

object-oriented paradigm

Cache memory is effective because:

of the principle of locality. The effectiveness of a cache memory is general determined based on the principle of locality that is locality of reference and cache block. Locality of reference refers to the frequent access items present.

_____ is when one record is related to many records

one to many

____ is when one record type is related to only one record in another record type

one to one

What does piping do?

pass the output of one tool to the input of another who | wc -l

Many desktop computers utilize the ___________ bus standard in which the system augments its main bus with dedicated I/O buses using expansion slots.

peripheral component interconnect

___ redirects users to fake sites by poisoning a domain name server with a false IP address

pharming

ps

prints the current processes

____ can be accessed only from the routine in which it is defined

private attribute

____ provides ways to surf the web w/o accumulating a trail of cookies

private browsing

____ is a non-routable IP address that can be used within a LAN bt not for internet data transport

private ip address

Which is the method we will use in CSE 1321 for expressing an algorithm?

pseudocode

___ is available for use by any routine in the program

public attribute

git pull

pull changes from remote server

git push

push changes to remote server

The realization of ______________ computing has prompted many to consider what is known as the technological singularity.

quantum

split line

r + return ( in vim command mode )

____ is assigned to fields that contain numbers with decimal places

real data type

uniq

report or omit lines

Absolute path in Unix paths start at:

root (/)

____ is one that can be accessed by packets on the internet

routable ip address

./script.sh

runs script in current process

What does 'rc' stand for in the .bashrc and .vimrc files?

runtime configuration

disadvantage of 0bject oriented programs is ____

runtime efficiency

____ occurs when a program runs

runtime error

replace current character with x

rx ( in vim command mode )

What is a shell script?

script written for a shell (lol)

unless specified other way, ___ is normal pattern of program execution

sequential execution

_____ : the interactions are handled by remote server

server-side

Upon detecting an error, the ISO/OSI layer that requests retransmission of a PDU is the ________ layer.

session

What is a command to set environment variables?

setenv

This keyword is used to indicate a field belongs to a class, and not an instance.

static

_____ is a permanently assigned

static IP address

Select the appropriate data type for a variable to store your name in a statically-typed language:

string

The extra line used for synchronization in parallel data transmission is called a:

strobe.

algorithms are best expressed in ___, ___ or ___

structured english, pseudocode, flowchart

Arithmetic operator: expr

supports: arithmetic, comparison (<, >, etc.), boolean/logical operators (&& and ||), parenthesis

____ is when instruction does not follow syntax rules or grammer

syntax error

The IDE helps us identify:

syntax errors

The level of the computer hierarchy where an operating system functions is the:

system software level.

which command

tells you where a command is by listing the path

Square brackets ([]) in a Unix shell script is an alias for the ___ command

test

What will -d file do?

test if file is a directory

What will -f file do?

test if file is not a directory

To become a good programmer, the knowledge of a particular language is secondary to:

the ability to solve problems.

Cache mapping is necessary because:

the address generated by the CPU must be converted to a cache location

What is the default target for make

the first target that doesn't begin with a .

In a statically typed language, the boolean data type may contain which values?

true or false

git checkout -- filename

unmodifies a modified file

What is command of until loop

until test do command done

Git file status lifecycle:

untracked --> unmodified --> modified --> staged

What are the four stages of a git life cycle?

untracked, unmodified, modified, and staged

Put the following steps in order within an version control workflow: makes changes resolve conflicts commit

update make changes update resolve conflicts commit

How do you create a .vimrc file in the home directory

vim ~/.vimrc

a ____ converts signals from your computer into audible analog signals that can travel over telephone lines

voiceband modem

This type of method performs a task and then terminates.

void

delete word

w ( in vim command mode )

Regression testing

whenever you make a change to the software, build the software and run all tests again to make sure the change did not introduce new bugs

What are the three areas of a LOCAL git repository?

working directory, staging area, and git directory

The complement, F', of F(x, y, z) = x'(y'z) + (x'yz' + xz + xyz)' (not simplified) is:

x + (y + z')(x'yz' + xz + xyz).

Given x ← 2 of the following expressions is equivalent to: x ← x + 5

x += 5

Does Eclipse have auto compilation?

yes

Does git take snapshots?

yes

Summary (Arraylist)

• ArrayLists -Are a dynamic data structure -Have methods to add/remove •For Each Loops are used to iterate through ArrayList objects •Iterator Objects are used to go through a collection of objects

Static Classes

•This is only possible in nested classes where the inner class is static

What should be the first line in the shell script?

#!/usr/bin/bash

Line needed at the top of a shell script?

#/bin/bash

How do you set a list elemnt

$set Y[2] = HUSKER with square brackets

geting an entire arrays contents.

${ARRAY[*] or ${ARRAY[@]}

Geting a value of an array at index

${ARRAY[index]}

What is the safest way to reference a variable?

${variable}

Identify the operator that you can use to determine if a number is even or odd.

% (modulus, mod)

How do you get to a mark named a?

'a "apostrophe-a"

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below? Question 48 options: A) ((x + y') + y + (x + y')') B) ((x + y')y + (x + y'))' C) ((xy') + y(xy')) D) ((xy)' + y(xy)')'

((x + y')y + (x + y'))'

What is SIGQUIT?

-3 -Issued if user sends a quit signal ctrl d

What are the three types of variables in a shell script?

-Global variables such as HOME, PATH, SHELL -Local variables that user defines and stay in the shell -Special variables such as positional parameters $1 and $2

What are strategies used for unit testing?

-Identify and prioritize testing of core functionality, corner cases, special input values, and frequency of a functionality being exercised -Test related functionality as test suites -Should test both positive and negative execution paths

What are some problems of Unit testing?

-Mostly only works for methods that actually return an output instead of methods that may change an object state -Creates a style of programming where most methods are then used to return a value rather than have side effects ("functional style")

What are commands to get help for git?(3)

-git help <verb> -git <verb> --help man git-<verb>

What can you type before a target to make sure a make file executes a target and not a file with the same name in the directory

.PHONY: targetname

in the make file,e write the suffix directory

.SUFFIXES: .java .class (tab) javac $< The $< symbol means the dependency, whatever it is

What are the two startup scripts to help configure startup?

.profile and .bashrc

search for text forward

/text ( in vim command mode )

Array indexes always starts at what value?

0

List Two cons of Unit testing

1. Does not test full software 2. Time consuming

List two pros of unit testing

1. Increase Productivity 2. Leads to concise goal-driven code

379 (base 10) = ____________ (base 7)

1051

1101101 (base 2) = ____________ (base 10)

109

Convert -52 (base 10) to binary 8-bit one's complement.

11001011

122 (base 10) = ____________ (base 2)

1111010

How is -9 (base 10) represented in 8-bit two's complement notation?

11110111

How is -1 (base 10) represented in 8-bit two's complement notation?

11111111

What will b = $a + 1 print

1234 + 1

What will b = `expr $a + 1 ` print

1235

The first supercomputer, the CDC 6600, had a memory size of:

128 kilowords.

For the following program, trace the code and show how the final value is derived (i.e. the values of the parameters and/or local variables in each instance of the recursive call): public class TestRec2{ public static void main(String []args) { int number = 10; PRINT( pblmOne(number)); } public static int pblmOne(int myNum){ if (myNum < 2) return 3; else return 2 + pblmOne(myNum-2); } }

13

What will be the value of x after the following code is executed? x ← 0, y ← 2 WHILE(x < 10) x ← x + y y ← y + 1 ENDWHILE

14

1031 (base 5) = ____________ (base 10)

141

Suppose a computer's control unit consists of a 4-bit counter and a 4 × 16 decoder. What is the maximum number of clock cycles that can be consumed by any instruction?

16

Consider the infix expression: 16/(5+3). The equivalent postfix (reverse Polish notation) expression is:

16 5 3 + /

public int mtdA(int v) { int abc = v; do { if (abc / 10 % 2 == 0) { return abc; } abc = abc / 10; } while (abc > 0); return abc; } Refer to the codes above, what value is returned as a result of the call mtdA(2031)?

203

What would be the value of x[1] after the following code is executed? Create array x [22, 33, 44] CALL ARRAY_PROCESS with x ... METHOD ARRAY_PROCESS(parameter [] a) BEGIN FOR (int i = 0, i < length of x, i++) a[i] ←a[i] + 5 ENDFOR END ARRAY_PROCESS

38

____ = offer digital transmission for both voice and data , speed of 200 kbps to 5 mbps`

3g

Consider the following definition of myFunc(): myFunc(0,N) = N myFunc(P,Q) = myFunc(P-1, Q+1) According to the above definition, what is myFunc(2,4)?

6 Given, myFunc(P, Q) = myFunc(P-1, Q+1). This should be continued until the first argument becomes 0. So, myFunc(2, 4) = myFunc(1, 5) = myFunc(0, 6) Now, myFunc(0, N) = N. So, the Final answer comes out to be 6. So the first option is correct. I hope it helps. For any doubt, feel free to ask in comments, and give upvote if u get the answer.

Suppose we have a 4096 byte byte-addressable memory that is 64-way high-order interleaved, what is the size of the memory address module offset field?

6 bits Total memory size = 4096 bytes = 2^12 bytes, so 12 bits is the length of a physical address. Now, there are 64 (= 2^6) memory modules/chips/hierarchies, interleaved. So, the higher 6 bits of physical address will be used to select the suitable memory module/chip/hierarchy. So, number of bits for module offset = 12 - 6 = 6 So, the correct option is D) 6 bits

601 (base 10) = ____________ (base 9)

737

Consider a definition of fxyz(): fxyz(1) = 1 fxyz(n) = fxyz( (n + 1)/2 ) + fxyz(n / 2), for n >1 According to this definition, what is fxyz(8)?

8

If a cache access requires one clock cycle and dealing with cache misses requires an additional five clock cycles, which of the following cache hit rates results in an effective access time of 2 clock cycles?

80%

How to create a new buffer for a file named filename from inside your current vim file:

:e filename

provides info on file currently editing including current line number and if it has been modified

:f

Vim: repeat a colon command or go back to a previous one

:↑ :↓

Finalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

create make file array thingy so that you can compile multiple things at once

CLASSES = A.class B.class X.class Y.class all: $(CLASSES) using make all will compile all the .java files into .class files

Define a shell array called CLASS with elements "Altintas", "CSE15L", "Fall 2013" in the given order. Display the second element with a Unix command

CLASS[0] = "Altintas" CLASS[1] = "CSE 15L" CLASS[2] = "Fall 2013" echo ${CLASS[1]}

Equals(Object, Object)

Determines whether the specified object instances are considered equal.

A method of a class cannot take in any parameters and cannot return any data.

False

A method of a class should never interact with its object.

False

A process contains only one path of execution called a thread

False

A stack is a data structure where we add elements on the top and remove the element, which has been added first.

False

You should create your classes so that all fields of an instance can be accessed from other parts of the program.

False

The unique feature of an abstract class is that a subclass that extends it also needs to have the abstract reserved word in its declaration.

False (PP Part III - Abstract pg. 5)

Which of the following types of memory has the longest (slowest) access time?

Secondary memory

SCSI is the acronym for ______________.

Small Computer Systems Interface

Making changes to a software repository means editing, adding, and deleting files

T

The Makefille contains rules which tell make what to do

T

When debugging it is best practice to make one change at a time and keep a record of the changes?

T

ArrayLists in C#

To create one: ArrayList names = new ArrayList(); •Can hold only different kinds of objects •Initial Capacity of an ArrayList 16 -Capacity - is the length of the currently allocated array that holds the lists values -Count - number of elements currently stored in the list -When count equals capacity an arraylist automatically increases capacity

Summary (Polymorphism)

To use polymorphism, these conditions must be true: -all subclasses override the same set of methods -a subclass object reference is assigned to a superclass/base class object reference. -the superclass/base class object reference is used to call the method that is overridden. -You can't have polymorphism without inheritance

A biased floating-point exponent uses some manner of excess-M representation.

True

In embedded systems, one major challenge is that the events can happen asynchronously and can occur in any order, making it impossible to test all possible sequences of events.

True

In pseudocode, it is not necessary to include the data type when you declare a variable.

True

It is possible for a single host to support both IPv4 and IPv6.

True

____ is technology in which a broadband Internet connection is used to place telephone calls instead of regular phone system

Voice over Ip

____ (wireless application protocol) is a communications protocol that provides internet access from handheld devices such as cell phones

WAP

notifyAll​()

Wakes up all threads that are waiting on this object's monitor.

The index of the center position of a 3*3 2D array would be:

[1][1]

copy n lines

[n]Y ( in vim command mode )

How to execute a command unaliased?

\<command name> or full path name to command

first non-blank position

^ ( in vim command mode )

How do you execute a process in the background?

^Z - sleeps bg - background fg - foreground (return it from bg)

_____________ gives the programmer direct access to the underlying machine architecture.

_____________ gives the programmer direct access to the underlying machine architecture.

portable satellite technology needs to be correctly ____ from where it is used to get connection

aimed

Once you have read and understand the problem for which you are trying to create a program to solve, you should first design a(n):

algorithim

commit -m "message

commit staged changes to your repo

___ refers to computer algorithms that analyze info to discover previously unknown and potentially useful info including relationships and patterns

data mining

____ is designed to manage billions of records and several hundred transactions every second

database server software

____ is used to store dates in a format

date data type

__________ is the process whereby devices connected to a bus autonomously determine which of the devices shall have control over the bus:

distributed arbitration using self-selection

What is the command to open git using emacs?

git config --global core.editor emacs

What command is useful for seeing branches?

git log --graph

What is the command to fetch the most recent updates from the remote repository into your local repo?

git pull origin master

How do you push your changes from your local repo to the remote repository?

git push origin master

How do you unstage a change on a file before you commit it?

git reset HEAD --filename

A Layer 1 device whose primary purpose is to receive incoming packets from one or more locations and broadcast the packets to one or more devices on the network is called a _________.

hub

___ is used for fields that contain whole numbers - rankings, repetitions etc.

integer data type

A value that is written into the code of a program exactly as its meant to be interpreted is a:

literal

What is an Eclipse workspace?

location to store source code and where Eclipse will write out our preferences

git log

log of all the commits made to the repo

___ is a type of runtime error in the logic or design of a program

logic error

____ is used for true/false or yes/no data using minimal storage space

logical data type

a ____ is the use of automated software to locate computers that have open ports and are vulnerable to unauthorized access

port probe

What does git commit do?

records snapshot of staging area

What is the purpose of '2>' in Unix

redirect standard error to the destination file

____ stores data in a colelction of related tables

relational database

public void swap(String str1, String str2) { String holdString; holdString = str1; str1 = str2; str2 = holdString; } String s1 = "Computers"; String s2 = "Rock"; swap(s1, s2); System.out.println("s1 is "+s1+" and s2 is "+s2); The values of s1 and s2 after a call to method swap (s1, s2) are as follows:

s1 and s2 remain unchanged

What is MANPATH global variable?

search path for <man> pages

_______ routing works best in networks where a large number of users in one location use a centralized host, or gateway, in another location.

static

_____ or html editors provides tools specifically designed to enter and format web page text, graphics, and links

web authoring software

Multiple Constructors (a.k.a. overloading)

• We can have more than one constructor • Remember, constructors are used to initialize our objects • We can use parameters with the constructor to customize the initialization • Sometimes we have more or less data to use in the customization • We'd like to be able to pass in only what we know

Sloppy Definitions

• public: anyone (or anything) can see it from anywhere! That is, anything outside the class. • private: can only be seen/called inside the class. • Note, variables, methods and even classes can be marked either public or private

Static Methods

•A Static method is invoked through a class name -A static method is also called a class method -An object is not instantiated -A method becomes static by adding the static reserved word to the method header: --public static int carCount () --The main method in Java uses public static void main() •A static method can access only static variables and local variables

Static Variables

•A Static variable is shared among all instances of a class •Also called a class variable •A variable become static by adding the reserved word static •e . g. static int noOfCars =0; •A local variable cannot be static if the method is not static •Constants which are instant variables are often static because just having one copy is good enough.

Last rule (interface)

•A class that implements an interface has a choice: 1. Override the methods, OR 2. Declare itself as abstract

Static methods

•A method marked static: -Can call these methods like normal, BUT... -...don't have to create an instance to use the method! -Can't access non-static attributes -Is called using <Class Name>.<Method Name>

Sub class - that extend the abstract class

•Can be instantiated •All methods should be implemented -Methods should have a body •No method should have the abstract reserved word in its header

Diamond of Death

•Man and Wolf inherit from Mammal •If both override run( ), which version does Werewolf inherit? •What's the solution to this? -Don't allow multiple inheritance -Instead, use interfaces

o IoT Technologies

▪ 802.11 ▪ Bluetooth ▪ RFID ▪ NFC ▪ Infrared (IR) ▪ Z-Wave ▪ Ant+

What symbol is used to access variables?

$

delete to end of the line

$ ( in vim command mode )

print the number of arguments

$#

Vim delete options

dd, deletes line

finger command

find information

What is an attribute in xml?

key="tr/dec/SRC1997-018"

mesg y/n

turns on messages through write command

What are the steps of software control?(5)

1. Update 2. Make changes 3. Update 4. Resolve Conflicts 5. Commit ( go back to 1)

Vim substitute/replace

:%s/bar/foo/g :s. will search a single line :%s/ the entire docutment :6,12s/ can be used to search between specific lines

What is a shell?

A command line interpreter that acts as an interface between the user and the kernel

What is a commit message and how do you change it?

A commit message is a message to tell yourself or others what changes you made to a file git commit --amend

The logic circuit below is supposed to be designed to produce the truth table also shown below. However, there is a component missing. Which type of component is missing? Question 33 options: A) XOR B) OR C) AND D) NAND

AND

What command makes a unix script executable?

chmod u+x scriptfilename.sh

__________ was the language of choice on the earliest personal computers because it gave programmers immediate feedback.

BASIC

How do you make sure a shell script is executable?

chmod u+x scriptname.sh

Override of the ToString method

C#: public override string ToString( ) { } Java: @Override public string toString() { }

____ defines the characteristics a set of objects

class attribute

wait​(long timeout, int nanos)

Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

wait​(long timeout)

Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.

grep

finds words in a text

________ are typically used by companies for specific applications such as data processing and financial transactions.

Mainframe computers

Which file does make look for in the current working directory

Makefile

The state machine shown below is an example of a(n):

Mealy machine.

Tools for debugging:

Memory Usage Profiling Tracing Testing Logging

The Boolean expressions, x + (yz) = (x + y)(x + z) and x(y + z) = xy + xz, are examples of (the):

Distributive Law

It is usually feasible to test all possible values of arguments to a method

F

What format is xml in?

Hierarchical human readable format that blends schema and data

What will be displayed on the console after the following code is executed? x ← 10 IF (x > 10) THEN PRINT ("AB") ELSE PRINT ("CD")ENDIF PRINT ("E")

None of the other answers

append after cursor

a ( in vim )

What will a=1234 represent

a as a string 1234

What is a loop?

a block of code that is repeating

What is it called when someone needs a code to the repository?

a checkout

Values that are sent into a method are called ________.

actual parameters or arguments

What is an until loop?

basically opposite of a while loop and will stop executing when condition is true

move back to the beginning of special character delimited word, whitespace delimited word

b, B ( in vim command mode )

what navigates a directory

cd

What is another way to add numbers besides the expr command?

c=`echo "$a + $b" | bc `

____ is a means of distributing always- on broadband internet access over the same infrastructure that offers cable television service

cable internet service

____ converts your computer's signal into one that can travel over CATV network

cable modem

git config -list

can be used to verify user name and email for account

delete line

d ( in vim command mode )

what is input from the keyboard called

stdin

what three files does each shell open on startup

stdin, stdout, stderror

what is output from the keyboard

stdout

edits filename in read-only mode does not allow changes to filename without an exclamation

vi -R filename or view filename

Default editor for commit messages git?

vim

What is a process ID?

-Process identifier -number used by unix to identify process -may be used as a parameter in various function calls allowing processes to be manipulated -commands: ps and top

What flag do you use change permissions for all files and subdirectories?

-R

What do all unit testing frameworks have?(4)

-Test runners(engine) -Test cases -Test suites( tests that share same JUnit configuration) -Test execution

Relevance of version control

-To collaborate with other developers -To recover earlier version of code -improve and communicate changes

What is the relevance of XML and ant?

-XML is language of internet applications to talk to each other alone with json -Ant is a build tool for java and uses xml to describe build properties -Many java projects are managed using Ant

What is the trap commands?

-allows to execute command when signal recieved by a script -trap args signal

What are the options for wc

-c : byte counts -l: newline counts (# of lines) -m: character count -w: word count --help: help page

What is an orphan process?

-child process in which the parent process dies -immediately adopted by grandparent process

How do you test if a file is a directory?

-d file

How do you test if a file is exists?

-e file

What is the relevence of testing?(3)

-ensures program is correct -increased development speed -increases confidence and reliability of code

How do you test if a file is not a directory?

-f file

What do target tags contain?

-name -depends: which are the target names that the task is dependent on -description: is a description

What do project tags contain? (3)

-name: a name -default: default target -basedir: base directory for which all operations are done

What is a parent process Id (PPID)

-process ID that tells which process started the child process

What is a daemon process?

-process orphaned intentionally -parent is init and runs as a background process without being controlled as an interactive user

What is a zombie process?

-process that has completed execution but still has entry in process table

What does in directory for a project?

-project directory: build.xml, src, bin, doc -src: *.java -bin: *.class -doc: *.html

How do you test if a file is readable?

-r file

How do you test if a file is has non zero length?

-s file

What is the finger command?

-shows information about other users -finger username

What were the initial goals for git?(4)

-speed -support for non linear development -fully distributed -able to handle large projects

How do you test if a file is writeable?

-w file

What is SIGINT?

-when press ctrl-c to interrupt a process

What is the anatomy of a build file?(5)

-written in xml -contains project and at least one target -targets are composed of tasks -contain properties like macros -comments which are symbolized by <!-- -->

How do you test if a file is executable?

-x file

How do you test if a file has zero length?

-z file

How do you execute a shell script in current shell process?

. scriptfilename.sh

what refers to the level above

..

What PID does the kernel have?

0

first and last position

0, $ ( in vim command mode )

Assuming we are using the Hamming algorithm presented in your text and even parity to design an error-correcting code, find the code word to represent the 8-bit information word 01001000.

010011001000

557 (base 10) = ____________ (base 16)

22D

Suppose a system has a byte-addressable memory size of 256MB. How many bits are required for each address?

28 since system has byte addressable memory hence every address represents a byte. 256 MB = 256 * 1024 * 1024 Byte = 228 bytes of memory space hence we need 28 bits of address. Why? because every bit requires 0 and 1 hence 28 bits can represent 228 numbers i.e. 228 memory locations.

There are ____________ kilobytes in an exabyte.

2^50

If the opcode field for an instruction has n bits, that means there are _______ potential distinct operations.

2^n

____ = replaced analog with digital, text messages

2g

The truth table shown below is supposed to reflect the function F(x, y, z) = y(x + z') but two lines are in error. Identify them. Question 58 options: A) 1 and 2 B) 3 and 4 C) 5 and 6 D) 7 and 8

3 and 4

Assuming an 8-bit virtual address with pages of 32 bytes, the virtual address format is:

3 bits for the page and 5 bits for the offset.

210 (base 10) = ____________ (base 8)

322

247 (base 10) = ____________ (base 8)

367

What does the fork() command do?

Creates a new child process from a parent process?

The _______ is a digital logic component that is often used in computer registers.

D flip-flop

The mechanical computer that included mechanisms that provided memory and an arithmetic processing unit was the:

Difference Engine.

What is a redirection in Unix?

Directing the flow of data to the file or from the file for input or output

____________ follows closely behind the CPU and memory in determining the overall effectiveness of a computer system.

Disk I/O

What does the following recursive function do for a given Linked List with first node as head? void myFunc(Node head) { if(head == NULL) return; myFunc(head.next); print(head.data + " "); }

Displays all nodes of linked list in reverse order

Methods that return void in testing?

Does not encourage a "functional" style - programming where software units JUST RETURN RESULTS and have no side effects so you can test the results returned against expected results - functional programming is very simple, general, and easy to test

Which of the following is a computer that used fourth-generation (VLSI) technology?

IBM PC

_____ is recognized by us and other gov entities that coordinates technical management of internet's domain names

ICANN

Two interfaces that support hot plugging are USB and _______________.

IEEE 1394 (FireWire)

The organization that sets standards for computer components, signaling protocols, and data representation is the:

IEEE.

Shell scripts work with source script.sh even if the script is not executable. Why do you think that happens?

It runs the script in the current process.

What does the shift command do in a shell script?

It shifts the position parameters down one and removes $1 completely.

Which of the following is not a valid state of Thread Life Cycle?

New State

Complete the characteristic table for the sequential circuit shown below. Question 41 options: A) Next State A - Row#: 1 = 1; 2 = 1; 3 = 1; 4 = 0 B) Next State A - Row#: 1 = 0; 2 = 1 ; 3 = 0; 4 = 0 C) Next State A - Row#: 1 = invalid; 2 = 0 ; 3 = 1; 4 = invalid D) Next State A - Row#: 1 = Invalid; 2 = 1 ; 3 = 0; 4 = Invalid

Next State A - Row#: 1 = invalid; 2 = 0 ; 3 = 1; 4 = invalid

Use of an ArrayList is preferred when we have to add / remove elements dynamically.

True

Verilog is patterned after the C programming language, while VHDL is more similar to the Ada programming language.

True

Virtual machine are essentially imaginary machines reflecting the resources of real systems.

True

We are using pseudocode to write algorithms because it is not concerned with syntax so it is easier to focus on concepts.

True

When passing by reference, it is actually a reference to the original place in memory of the object that is passed.

True

Inheritance through an extended / derived class supports code reuse.

True (Inheritance PP pg. 9)

A unified cache is a cache that holds both data and instructions.

True If there is a single cache at a known level that holds both data and instructions, then it is named unified cache

What would be the results of the following code? Create array1 ← [33, 88, 11, 44, 99, 55] value ← array1[0] FOR (int i = 0, i < length of array1, i++) IF(array1[i] < value) THEN value ← array1[i]ENDIFENDFOR

Value contains the lowest value in array1.

Arraylists

Variable size Holds only objects Data it holds is of a specified type Arraylist when instantiated creates an empty list.

What is the DISPLAY Global variable?

Variable used by X-Windows system to identify output display

____________________ must be declared before they can have values assigned to them or be used in a program.

Variables

Default vim configuration:

Very basic. No line numbers, options enabled, or color schemes

____ uses command words and grammar based on human languages to provide what computer scientists call a level of abstraction that hides the underlying low-level assembly or machine language

high-level language

When the requested data resides in a given level of memory, we call this a:

hit.

____ is email messages containing html tags that produce various fonts sizes, styles, text, etc.

html mail

_____ stores urls used to link directly from a database to a web page

hyperlink data type

____ is a computer system that could store literary documents, lin thme according to logical relationships, and allow readers to comment and annotate what they read

hypertext

The main reasons for the adoption of Internet SCSI (iSCSI) over Fibre Channel (FC) include ____________.

iSCSI is easier to learn

____ is stored in a cookie on your computer, search engines also store ip address where query was first initiated and etc.

id number

The ________ statement is used to make simple decisions in a program .

if

The tag field of a main memory address is used to determine:

if the cache entry is the desired block.

What is the main criteria to determine whether a dependency should be made or not?

if the dependency is newer than the target

___ (internet message access protocol) leaves messages on server until you specifically delete them

imap

The following declaration of a StreamReader requires the file to be stored in which location. StreamReader reader = new StreamReader("test.txt");

in the same location of the program

command mode has two sub modes

in-line and ex

What do you call the number that is used to pinpoint a specific element within an array?

index or subscript

____ : processes the info gathered by the crawler into a list of keywords and URLs stored in a database

indexer

Diagnostic Output definition

inspecting the internal operation of the software at finer grain (less abstraction)

The ________ is the agreed-upon interface between all the software that runs on the machine and the hardware that executes it. It allows you to talk to the machine.

instruction set architecture

During the first pass of an assembler:

instructions are only partially assembled

What command shows all hidden files

la -a

Which of the following is placed into the symbol table during the first pass?

labels During the first pass, the assembler checks to see if the instructions are legal in the current assembly mode. On the first pass, the assembler performs the following tasks: -Checks to see if the instructions are legal in the current assembly mode. -Allocates space for instructions and storage areas you request. -Fills in the values of constants, where possible. -Builds a symbol table, also called a cross-reference table, and makes an entry in this table for every symbol it encounters in the label field of a statement. The assembler reads one line of the source file at a time. If this source statement has a valid symbol in the label field, the assembler ensures that the symbol has not already been used as a label. If this is the first time the symbol has been used as a label, the assembler adds the label to the symbol table and assigns the value of the current location counter to the symbol. If the symbol has already been used as a label, the assembler returns the error message Redefinition of symbol and reassigns the symbol value.

Lineal spaces between the pits in a CD-ROM are called:

lands.

!$

last thing on the prior line

____ is time to make roundtrip from A to B and back to A

latency

What unix command shows all the files/directories

ls -a -a flag will display hidden files/directories hidden files begin with .

Write a Unix command that displays the contents of folder "Q1" in long form including the directory entries whose names begin with a dot

ls -la Q1

Construct the pipe to execute the following job: "output of ls should be displayed on the screen and from this output the lines containing the word 'poem' should be counted and the count should be stored in a file"

ls | grep poem | wc -l > file.txt

first gen languages are ____ becuase it was first to be available for programming computers

machine languages

What does running: "make [targetName]" do

make will look for the target with the same name as targetName and run its action if its dependency has been updated

Write a filtering command using Unix pipes to search for occurrences of the word 'time' in the manual page of Unix command called "time"

man time | grep time

____ is when one record in a particular record tyupe can be related to many records in another record type and vice versa

many to many

____ usually provides a variable-length field into which users can enter comments

memo data type

The register that holds the address of the data to be transferred is called the ___________

memory address register

After responsiveness, the next most important consideration in embedded operating system selection is:

memory footprint.

___ is the order in which records are stored on disk

sort order

The code that we write as programmers is known as:

source code

How do you run a Unix script in a new process?

source scriptname.sh

What do you do to execute a shell script as a current process

source scriptname.sh

How do you load changes to .bashrc

source ~/.bashrc

___ (secure socket layers) is protocols that encrypt data traveling between a client computer and an http server

ssl

What does the .git file hold?

staging area and actual repo?

Tools for diagnostic output

stdout/stderr Debuggers assertions java logging framework java profiling framework

The ________ statement lets the value of a variable or expression determine where the program will branch to.

switch

The _______ connects the CPU to memory.

system bus

The reserved word super (java) or base (C#). <method name> is used call the method which is defined in

the parent class

All of the following are cache replacement algorithms except:

thrashing Thrashing is the virtual memory page fault behavior

The purpose of a TLB is _________.

to cache page table entries

What do we need diagnostic output for

tracing timing profiling logging error reporting

one of easiest steps to enhance computer's security is to ____ when you aren't using it

turn it off

Software version control workflow

update --> make changes --> update --> resolve conflicts --> commit --> (wraps around)

What must a person with a conflict do to resolve it?

update changes by the first user

____ is the rate of data that is uploaded from computer to internet

upstream speed

How do you redirect standard input from a small section of text?

use cat << HERE and place HERE at the end of where u want the text to stop inputting

repeat colon command or go back to earlier

use up or down arrows

Assembly language:

uses alphabetic (mnemonic) codes in place of binary strings. In an assembly language, mnemonic code or abbreviations in alphabetic letters such as A for 'add' and S for 'sub' are used in place of strings of 0s and 1s.

edits filename using .filename.swp as input

vi -r filename

move to beginning of special character delimited word, whitespace delimited word

w, W ( in vim command mode )

a ____ is temporary files stored on computer when accessing web page (graphics, etc.)

web cache

cookies allow ___ to store info on client computer for later retrieval

web site

web crawlers are computer programs automated to methodically visit ____

web sites

unix relevence (3)

well adopted in industry, powerful, expected competence to get job, back end of big companies

3dw

what deletes three words from cursor

Orphan process:

when a parent process dies, the child becomes an orphan process gets adopted by grandparent (init process)

What will be displayed as a result of executing the following code? x ← 5, y ← 20 x += 32; y /= 4; PRINT("x = " + x + ", y = " + y);

x = 37, y = 5

What will be the value of x[3] after the following code has been executed? Create array x [5] y ← 0 FOR (i = 0, i < 5, i++) x[i] ← y y ← y + 10 ENDFOR

x = [0,10,20,30,40] x[3] is 30 Answer: 30

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below?

x'(x+y)

Which of the following equations correctly reflects the truth table shown below?

x'yz' + x'yz + xy'z' + xyz' + xyz

Which of the following equations correctly reflects the truth table shown below? Question 10 options: A) (xy'z + x'yz' + x'yz' + x'y'z + x'y'z)' B) xy'z + x'yz' + x'yz' + x'y'z + x'y'z C) x'yz' + x'yz + xy'z' + xyz' + xyz D) (x'yz' + x'yz + xy'z' + xyz' + xyz)'

x'yz' + x'yz + xy'z' + xyz' + xyz

The Boolean function F(x, y, z) = xy'z + (x + z' + xz')' simplifies to:

x'z + y'z

For the following code, which statement is NOT true? public class Circle private radius public x private y

y is available to code that is written outside the Circle class.

How do you copy every line from mark named 'a' to your current cursor's location?

y'a

When you checkout from a repository what happens?

you get a local copy of the repository

The Boolean function F(x, y, z) = y'z + x'yz + xyz is equivalent to:

z.

The body of a method is demarcated by:

{ } or indentation, as dictated by the language syntax.

Operator overloading

• C# enables you to overload most operators to make them sensitive to the context in which they are used. • Use operator overloading when it makes an application clearer than accomplishing the same operations with explicit method calls. • Example: Class ComplexNumber overloads the plus (+), minus (-) and multiplication (*) operators to enable programs to add, subtract and multiply instances of class ComplexNumber using common mathematical notation

Constructor Chaining

• It's possible for one constructor to leverages/calls another • You can do this as many times as you want

Accessors/Modifiers

• Main idea: create methods to access and change attributes • Also called "getters" and "setters" • Why is this cool? Can put in protections to prevent bad data

How do you create a branch?

git branch branchname

Information can be retrieved fastest from:

hard disk.

sort

sort lines of text files

How do you clone a git repository?

git clone <url> [local dir name]

What can you specify when creating a class in eclipse?

-Package -class name -superclass -to include main or not

How do view a list element

$echo ${Y[2]}

How do create lists (array)

$set Y = (UNL 123 CS251) with round brackets

Getting the arguments in an array

${#ARRAY[@]}

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below? Question 9 options: A) (xy')' + z'(x + y') B) (yz') + z(x + y') C) ((x + y)z)' + xy' D) (x + y)'(xy' + z')

((x + y)z)' + xy'

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below?

((x+y)y')'

The logic circuit shown in the diagram directly implements which of the Boolean expressions given below?

((xy)'(x + y'))'

open or closed parenthesis, move to beginning, end of current sequence

(,) ( in vim command mode )

Consider the postfix (reverse Polish notation) 10 5 + 6 3 - /. The equivalent infix expression is:

(10+5)/(6-3).

Which of the following points is/are true about Array List data structure when it is compared with array?

**(Wrong answer) Array List has better cache locality that can make them better in terms of performance

If a method has a void in its header then it still needs a return statement.

*False (Module 1 - Part 1 pg. 15 --A method that does not return a value has a void return type; jjj pg. 43)

When the "new" reserved word along with a class name is called in a program the constructor of the class is invoked.

*True (Module 1 - Part III OOP pg. 10; jjj pg. 110)

An example of overloaded methods are two methods that have the same name but different parameters.

*True (Module 1 Parr III OOP pg. 34; jjj pg. 113 / Lecture 6 @ 18:45)

A class is a complex data type, that can be a combination of primitive data types and other complex data types

*True! (Module 1 - Part III OOP pg.5)

Reflections after fixing a bug

- Is there something in the development process that enabled this bug and should be addressed? - should design be improved? - Should testing be enhanced?

Good practices when debugging(3)

- Make only one change at a time - Keep a record of changes made - If it does not do what expected, back out to original version and retry

Minimize test input

- Reproduce problem with minimal input - Once you reproduce the problem look for smaller datasets -reduce number of steps taken

What can go wrong if a development team is using a regularly backed up file sharing mechanism?

- last one who saves wins : results in blame game - how do you coordinate between members then? - work gets artificially sequentialized - why would people work on projects at the same time if they know it could get overwritten - still no ability to get prior version - bringing work home if you did it at a work desktop - how do you simultaneously work on new versions while keeping an old version hosted

What will be the value of x after the following code is executed? x ← 5 WHILE (x >= 0) x ← x -1 ENDWHILE

-1

What is SIGHUP?

-1 -hang up detected on controlling death of controlling process

What is SIGALRM?

-14 -alarm lock signal used for timers

What is SIGTERM?

-15 -software termination signal

What is SIGINT?

-2 -issued if user sends interrupt signal ctrl c

Unix based system architecture from inside to out?(5)

-CPU -Kernel -Shell -Program -Applications

What technologies are used in the broader ecosystem of data, schema, programmatic access, query, and distributed programs?

-Data: XML -Schema: DTD and XML Schema -Programmatic access: DOM and SAX -Query: XPath, XSLT, and XQuery -Distributed Programs: Web services

Cons of Test Driven Development(4)

-Does not test full software -Requires team buy-in -Same developer coding and testing a feature -Can consume too much time

What are some examples of unit testers?(4)

-JUnit -cppUnit -PHPUnit -NUnit

What are some environment variables?(6)

-OSTYPE -USER -HOME -HOST -DISPLAY -PATH

What is the grandparent?

-PID of 1 -grandparent process of all processer

Suppose, there is a 5-element queue Q (from front to back: 1, 2, 3, 4, 5, 6), and an empty stack S. If you remove the elements one-by-one from the queue Q and insert them into the stack S, then remove them one-by-one from the stack S and re-insert them into the queue Q. Then, finally how the queue will looks like (from back to front)?

1, 2, 3, 4, 5, 6 **NOT** 6, 5, 4, 3, 2, 1

What are the steps for Test driven development?(5)

1. (Re)write a test 2. Check if test fails ( if succeeds go back to 1.) 3.Write production code 4. Run all Tests ( if tests fail go to 3.) 5. Clean up code

Scientific Method of Debugging(5)

1. Make a guess to what is causing the problem 2. Conduct and experiment to see if your guess is correct 3. If the result of the experiment contradicts the guess, go back to 1. 4. If more experiments are needed to strongly confirm the guess, go to 2 5. Consider a fix

Strategies for unit testing

1. Test related functionality as test suites 2. Test both positive and negative execution paths 3. Identify and prioritize testing of: -core functionality -corner cases -special input -frequency of functionality being tested

DEBUGGING STEPS (6)

1. Understand the system 2. Identify the problem 3. Reproduce the problem in as few steps as possible 4. Diagnose the cause of the problem 5. Fix the problem 6. Reflect and learn from the problem and fix

Steps to kill a process?

1. look at processes and filter ones you want to kill -ps [options] to show all processes running 2. kill all processes you select -kill [PID] kills the process witht that PID 3. make sure the process is killed -kill elf 4. Kill process dead kill -9 125

Components of a good development environment for a mid-sized project team

1. source code version control system 2. fully automated testing system 3. Frequent build/integrate/distribute policy 4. fully automated compile/build system

Suppose the state machine shown below is in State B. In order for this machine to output the string 010 001 010 011 001 010 when given the input string 101101, what should the output value be as indicated by "?/???"?

1/010 , Presently your are at state B and you have input as 1 and for that output should be 010,, Since you don't have this transition from B, for the machine to work as mentioned "?/???" should be 1/010.

How many times will the following for loop be executed? FOR (count ←1, count <= 10, count ← count +1) PRINTLINE "CSE 1321 is great!!!" END FOR

10

What value is stored in myNumbers[1][2] after the following code executes: y ← 3 Create array myNumbers[3][4]FOR rows in myNumbersFOR columns in myNumbers myNumbers ← y y ← y + 2 ENDFORENDFOR

15

How is the command: "$cat file2" different from "$cat > file2" and "$cat >> file2"

1st: prints contents of file2 2nd: sends stding to a file called file2 3rd: appends the end of file2 with stdin

Consider the situation where no other data structure like arrays, linked list is available to you. Then how many stacks are needed to implement a queue.

2

If a cache access requires one clock cycle and dealing with cache misses requires an additional five clock cycles, which of the following cache hit rates results in an effective access time of 2 clock cycles?

80% So, a hit takes a total of 1 clock cycle.a miss takes a total of 6 clock cycles.Assume there are a total of 100 accesses, and out of that x are hits, and 100 - x are misses.So, x + (100 - x)*6 = 200=> x + 600 - 6x = 200.=> -5x + 600 = 200.=> 5x = 600 - 200.=> x = 400 / 5.=> x = 80.So, the answer is: b. 80%

Challenge Question: How could you use vim's substitute command to only replace matching strings delimited by spaces? For example, if you wanted to replace all individual instances of the word "the" in a file without changing words like "therefore" or "theory".

:%s/\<foo\>/bar/g if g is changed to gc it will ask for confirmation when replacing words

substitute/replace command (g is global)

:[address] s /old/new[g]1 ( in vim command mode )

How to move back and forth between buffers in vim:

:bn - next buffer :bp - previous buffer

Vim: showing name of current file

:f

How do you list all of your marks?

:marks

exit without changes assuming no changes have been made

:q

Vim replace

:s/foo/bar/g

Vim: turning line numbers on and off

:set nu and :set nu!

turn line numbers on and off

:set nu and :set nu!

return to shell use

:sh

How do you ignore tabs and spaces when redirecting input

<<-

What is an example of a processing instruction in xml?

<?xml version.... ?>

What is a task to delete and clean up files?

<delete dir="${build.dir}"/>

What is a task to compile java files?

<javac srcdir="${source.dir}" destdir="${build.dir}"/>

What is a task to create html documentation for java?

<javadoc sourcepath="${source.dir}" destdir="${doc.dir}"/>

The symbol used for assigning a value to a variable is the:

=

For the following program, trace the code and show how the final value is derived (i.e. the values of the parameters and/or local variables in each instance of the recursive call): Here, a and b are parameters for the recursive function pblm2(). Which of the following answer choices, given below, for num1 and num2 respectively, allows this recursive function to terminate.

? 1, 2 ?

search for text backwards

?text ( in vim command mode )

What will be displayed on the console after the following code is executed? x ← 22 IF (x > 0) THEN PRINT ("A") ELSE IF (x > 10 ) THEN PRINT ("B") ELSE PRINT ("C") END IF

A

What is a pipe and give an example

A pipe is two or more commands separated by a pipe char ( | ) that tells the shell to arrange for the output of the preceding command to be passed as input to the following command ex) ls -l | pr

What does each ant file contain

A project and at least 1 target

For the following code, what would be the value of str[2]? Create array myStrings ← ["abc", "def", "ghi", "jkl"]

A reference to the string "ghi"

A computer program is:

A set of instructions that enable the computer to solve a problem or perform a task.

Suffix directive

A way to write one rule in a makefile that handles all files of a given type

___________ has focused on efficiency, giving it a lead in the mobile and embedded systems market.

ARM

Creating an Array in Bash

ARRAY=(value1 value2 ... valueN)

What is the staging area or index in git

An area between the working directory and the git repo. It's where changes are made that haven't been saved to the repo yet. Like a "loading dock" for code before getting shipped to repo

Each repetition of a loop is known as what?

An iteration

Objects

An object: • is an entity in the real world that can be distinctly identified • might represent a particular dog, employee, student, etc. • has a unique identity, state, and behavior. •

Cons of Eclipse

heavy weight learning curve requires JRE

Benefits/Disadvantages of Eclipse

Benefits: -code completion -faster -open source -extensible Cons: -heavyweight -requires JRE -Learning curve

We can use this notation to analyze an algorithm's efficiency.

Big O

This search compares the target value with the middle element in the collection, then ignores the half of the collection in which the target cannot exist.

Binary

How do you determine the difference between a bug and a feature

By understanding the system (step 1 of debugging steps)

The IPv4 address 136.11.22.116 is a ________ network address.

Class B

One or more objects may be created from a(n):

Class.

git diff

File differences for unstaged, modified files

Which of the following types of memory needs to be refreshed periodically to maintain its data?

DRAM

A UML diagram is used to ...

Depict objects and object oriented concepts (jjj pg. 11 "Throughout this text, we will use the notation shown in Figure 5 to depict objects and to illustrate object-oriented concepts. The notation is known as the Unified Modeling Language, or UML for short, and it is a standard in the object-oriented programming community")

Equals(Object)

Determines whether the specified object is equal to the current object.

tempMax is a variable that holds the maximum value of an array. When searching a 2D array of type double called nums that contains only positive values, if we want to find the largest value, what is the most appropriate value the local variable tempMax be set to?

Double.MIN.VALUE (In C# Double.MinValue) *nums[0] (wrong answer)

Which of the following statements is NOT true for a thread?

Every runnable process contains at least two threads

A logger cannot have multiple handlers

F A long can indeed have multiple handlers

In a shell script, lines starting with a #! are comments

F This is the interpreter line and tells the script which shell to use

If a target in a Makefile names a file that is older than the files it depends on, then the actions in that rule will not be performed

F target must be older to perform action

In a Makefile, every target line must begin with a tab

F action line

Unit testing is the testing of the whole class as a unit

F methods

File Descriptors for stdin, stdout, stderr respectively

FD 0, FD 1, FD 2

____ (File transfer Protocol) provides a way to transfer files from one computer to another over any TCP/IP network like lan or internet

FTP

Difference between an error and a failure in JUnit?

Failure - test case actually returns failure (i.e. RESULT) Error - unexpected errors that occur while trying to actually run the test (i.e. DURING) e.g. exceptions not caught

A constructor must have a return type.

False

A fixed-length instruction must have fixed-length opcodes.

False

A function header is a complete statement and should be terminated according to the rules of the language you are using.

False

A thread is an incomplete program

False

A value represented using 16 bits will always be more accurate than a value represented using 8 bits.

False

Accumulator architectures store one operand on the stack and the other in the accumulator.

False

All methods must be called from the main method.

False

An ArrayList can store objects and primitive data types, at the same time.

False

Caching breaks down when programs exhibit good locality.

False

In order to provide greater range for a floating-point number, we make the significand larger.

False

Indentation is a requirement of all languages and will code will not run correctly if not used.

False

On a multiprocessor machine, a thread could be processed in multiple processors.

False

Programming language syntax is the hardest part of programming.

False

Threading is a quick way to "split" a program into multiple dependent parts.

False

When code in a method changes data passed by value into its parameter, the original piece of data is also changed.

False

Caching breaks down when programs exhibit good locality.

False Explanation: =>When program exhibit bad quality then caching breaks down. =>When the program has more number of misses(bas quality) then caching breaks down. I have explained each and every part with the help of statements attached to it.

An infinite recursion will never happen as long as there is a valid base case.

False jjj. pg. 554 If the method does not make progress toward its bound in this way, the result will be an infinite recursion. •Requirements •Must have the recursive call •Must have a terminating condition •Must make progress towards terminating

The SCSI Architecture Model-3 includes specifications for Serial Storage Architecture (SSA), Serial Attached SCSI, iSCSI, IEEE 1394 (FireWire) and ___________.

Fibre Channel (FC)

It is common practice in object-oriented programming to make all of a class's:

Fields private.

What are elements in xml?

Heirarchical structure with open tag-close tag pairs that can include nested elements

insert at beginning of line

I ( capital i in vim )

In general, a singly-linked list allows:

Insertions and removals anywhere

What file does the make command look for

Makefile

In the following code, what values could be read into number to terminate the while loop? PRINT "Enter a number: READ user input number ← user input WHILE (number < 1 or number > 10) PRINT "Enter another number: " READ user input number ← user input END WHILE

Numbers in the range 1 - 10

In the following code, what values could be read into number to terminate the while loop? PRINT "Type in a number"READ input number ← user input WHILE ( number > 0 ) PRINT "No, that is not it. Try again." READ input number ← user input ENDWHILE

Numbers less than or equal to zero

Chmod: main difference between letter and octal notation?

Octal: Overwrites permisions 4=read 2= write 1=execute first number user, second number group, third number everyone Letter: appends permissions ex u=users o=everyone g=group

Instruction sets are differentiated by which feature?

Operand storage Number of operands Operand location Operations ****All of these are correct.

Instruction sets are differentiated by which feature?

Operand storage Number of operands Operand location Operations **All of these are correct.

The try-catch construct consists of one try block and one or more catch blocks. The try block contains the code that could throw exceptions.

True

To speed up the performance of Java software, Java's Just-In-Time (JIT) compiler is used.

True

What are Makefile macros

They're like variables

Where is it shown where erros occur, process ID, and size of leak ==19182== 40 bytes in 1 blocks are definetly lost in record 1 of 1 ==19182== 0xASLKFHLKW malloc(vg_replace_malloc.c:120)

Process ID: 19182 Occurs: vg_replace_malloc.c:120 size of leak: 40 bytes in 1 blocks

What is called "garbage collection"?

Removing objects that are no longer referenced in the program and releasing their memory ("Java will eventually dispose of these orphaned objects, removing them from memory in a process known as garbage collection." pg. 308)

What are some vim configurations

SEARCHING: set ic : ignore case in search set incsearch : incremental search set hlsearch : highlight search results set smartcase : ignore case when lower case WINDOW SIZE: set lines=# : where # is the number of lines (height) set columns=# : where # is the number of spaces (width) USEFUL: set number : line numbers on syntax on : colored syntax on set ai : auto indent set si: smart ident; adds a level of indenting when needed set tabstop=# : where # is how many spaces the tab will be set expandtab : expands tab to appropriate amount of spaces

What can you Eclipse run configuration for?

Setting command line arguments JVM arguments Class path settings Environment variables Which JVM to use

How to kill a process?

Step 1: look at processes and filter the ones you want to kill Step 2: kill process you selected Step 3: make sure it was killed Step 4: or you can kill it dead (kill -9 <name/pid>)

_____________ computers derive their name from drawing an analogy to how blood rhythmically flows through a biological heart.

Systolic array Systolic algorithms are the efficient algorithms to perform the binary multiplication . Systolic array is an arrangement of processors in an array where data flows synchronously across the array between neighbors, usually with different data flowing in different directions.

A directory is a specialized form of a file that maintains a list of all files in it

T

In test driven development, you must understand the specification of what the software you are testing is supposed to do

T

In test-driven development, tests are written before the software to be tested is written

T

It is a good practice to download the latest version of the software before you report a bug

T

JUnit is a unit testing framework for the Java Programming Language

T

shell scripts are not executable by default?

T

The ___________ benchmarking suite models the activities of a wholesale product distribution company.

TPC-C

What will -e do?

Test if the file exists

What will -r file do?

Test if the file is readable

The stack trace contains detailed information about the exception including where exactly it occurred in the program. The stack trace is very useful for programmers when they try to understand the problem causing the exception.

True

The positional paramter $0 refers to:

The command/script name executed ex) -bash

What does $< mean?

The dependency whatever it may be

Which target is the default one if the make command doesn't specify a target in the command line?

The first target

A Very Long Instruction Word (VLIW) is an architectural characteristic in which each instruction can specify multiple scalar operations.

True

A class can inherit multiple interfaces

True

A field can be of any data type that is legal in the language you are using.

True

A method of a class is anything that an instance can do or have done to it.

True

A method should only handle exceptions which it expects and which it knows how to process. All the other exceptions must be left to the calling method.

True

A stream is an ordered sequence of bytes, which is send from one application or input device to another application or output device.

True

A unified cache is a cache that holds both data and instructions.

True

Absolute code is executable binary code that must always be loaded at a particular location in memory.

True

Always close the streams and files you work with! Leaving an open stream or file leads to loss of resources and can block the work of other users or processes in your system.

True

An exception is a notification that something interrupts the normal program execution. Exceptions provide a programming paradigm for detecting and reacting to unexpected events.

True

Arguments passed to a method MUST be passed in the same order that the parameters are defined in the method header.

True

CRCs use systematic error detection.

True

Frequently inserting and removing items from a collection (especially a large number of items), can lead to low performance. In such cases it is advisable to use linked lists.

True

Herman Hollerith invented punched card-tabulating machines.

True

If a recursive method has no base case, i.e. bottom, or if the base case is never reached, it will become infinite and the result will be StackOverflowException.

True

If an algorithm is described as O(n^2), then the time to process is directly proportional to the square of the size of the input data set.

True

In Java, deallocation of heap memory is referred to as garbage collection, which is done by the JVM automatically.

True

In a doubly-linked lists each element contains its value and two pointers - to the previous and to the next element.

True

In a language that uses static typing, we are limited to only values of only one data type in the array.

True

Most programming languages are written to coincide with standard mathematical order of operations, yet is it a good idea to use parentheses to explicitly define expected behavior.

True

PLA and PAL chips are referred to as complex programmable logic devices (CPLDs).

True

SPOOLing is the simplest form of multiprogramming.

True

TCP is a connection-oriented protocol.

True

The aggregatable global unicast address format of IPv6 helps keep the size of router tables under control.

True

It is important to know if a computer is byte or word addressable because we need to know how many addresses are contained in main memory, cache, and in each block when doing cache mapping.

True In the practical world, memory is only Byte addressable and binary addresses are used to poin to single bytes. Consider 1 word = 4 Bytes, In Byte addressable, the first word starts at address 0 and the next at address 4. In Word addressable, the bytes of the first word starts at address 0 and all the bytes of the second at address 1. Hence It is important to know if a computer is byte or word addressable

The "queue" data structure is created to model queues, for example a queue of waiting for printing documents. Such queues are very convenient and are naturally modeled via the structure "queue". In queues we can add elements only on the back and retrieve elements only at the front.

True Yes. We can add the element into queue at front and remove the element from queue at back.

A recursive method must have a valid base case to exit, otherwise the method execution will keep repeating.

True •Requirements •Must have the recursive call •Must have a terminating condition •Must make progress towards terminating

toString( )(Java) or ToString() (C#) is a method that is in the Object class that is inherited by all Java / C# classes.

True (Inheritance PP pg. 17 / jjj pg. 377 "This is a method that is defined in the Object class and inherited by all Java objects.")

The state of an object refers to its attributes and not its behavior.

True (Module 1 - Part III OOP pg. 59) (An object is an instance of a class. The state of an object are the instance variables or attributes of the object. Option D is not true.)

If you write a constructor for a class, it should initialize all class fields.

True (not false, "should")

Sorting a collection makes searching for a value faster.

True, using binary search

Traversing an array

Use a for, while or do-while starting at index 0 and going to the last element C#: Use a for, while or do-while starting at index 0 and going thru .Length-1 Java: Use a for, while or do-while starting at index 0 and going thru .length-1

How do you delete until the next occurrence of the word "foo"?

V to enter visual mode /foo hit d

___ (visual development environment) provides programmers with tools to build substantial sections of a program by pointing and clicking rather than typing lines of code

VDE

How to change the editor for commit messages?

git config --global core.editor <editor name>

________________ is a technique that distributes data and erase/write cycles evenly over the entire disk to extend the life of the disk.

Wear leveling

Which one of the following is an application of Queue Data Structure?

When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes When a resource is shared among multiple consumers Load Balancing **All of the above

What are ant build files written in

XML

delete beginning of line

^ ( in vim command mode )

How do you check what is modified but unstaged?

git diff

Cache memory improves performance by improving memory __________ while virtual memory improves performance by increasing memory _____________.

access time, address space

when upstreams DIFFER from downstream speeds, it is a _____

asymmetric internet connection

where do absolute paths start

at the root

where do relative paths start

at working directory

A class field is also known as a(n):

attribute

How do you look at status of files?

git status or git status -s

How do you run ant through command line

go to directory of build.xml and type ant folwed by name of target

What are some filter commands?(5)

grep, more, less, sort, uniq

the _____ is a network of high-capacity routers and fiber-optic communications links that provides the main routes for data traffic across the Internet

backbone

What parameter is good to use before running a shell script to help with debugging?

bash -x ./myscript... -x

How do you set variables on a project only basis in git

by not using the --global flag with git config

If, after fetching a value from memory, we discover that the system has returned only half of the bits that we expected; it is likely that we have a problem with:

byte alignment.

___ is consumer to consumer

c2c

trap command:

catches signals trap "" 15 - causes program to only be killed with -9 signal

What unix command changes what directory you are in

cd

replace based on dimension d, use escape to terminate replacement

cd ( in vim command mode )

moves to end of special character delimited word, whitespace delmimted word

e, E ( in vim command mode )

touch

change file timestamps

Select the appropriate data type for a variable to store your letter grade for CSE 1321, in a statically-typed language:

char

Write a command to make the "Q3.txt" file in the current directory read only

chmod 444 Q3.txt

How to change the access permissions from a file called temp.txt to readable writeable and executable for only the user

chmod 700 tempt.txt

What is a command to add read permissions for all users and write permissions for the user

chmod a+r,u+w somefile

Abstract methods are used in defining

classes that need no methods implemented (jjj pg. 171 "An abstract method is one that consists entirely of its signature; it lacks an implementation—that is, it does not have a method body.")

"Locality of reference" refers to:

clustering of memory references.

a ____ is a small chunk of data generated by a Web server and stored in a text file on your computer's hard disk

cookie

if you constantly delete ____ then query database is unlikely to collect enough info to link back to you

cookies

What does git lone url [dir] do?

copy a git repository

The sole purpose of IP is to _______________.

correctly route datagrams across the network

git branch (branchname)

create a new branch

Virtualization

creation of a virtual os, server, network resources, or storage device

Before we commit a file what command should we run?

git add hello.java

How do you list all branches?

git branch

____ is the amount of data that is duplicated in a database

data redundancy

_____ allows any remote computer or network workstation to access data in a database

database client software

a ___ contains a list of keys and each key provides a pointer to the record that contains the rest of the fields related to that key

database index

command mode (3)

default, most powerful, allows for navigation

What is a project tag?

defines the project you wish to work to

Infrastructure as a Service (IaaS) replaces the _________ of the computer hierarchy with an Internet-based infrastructure.

digital logic level through machine levels

Software as a Service (SaaS) replaces the _________ of the computer hierarchy with an Internet-based application.

digital logic level through user levels

This type of loop should be used when you want your loop to iterate at least once.

do while

____ is huge database of domain names and corresponding unique ip addresses

domain name system

How do you add a custom greeting to .bashrc

echo "My custom greeting inserted here " .bashrc will run normally so just putting any echo statement will make it a custom greeting

What is the syntax for the echo command

echo {options} string

What are the two types of data items in xml?

elements and attributes

This alternative to an if will cause a block of code to execute if a Boolean expression is false.

else

___ refers to the process of hiding the internal details of objects and their methods

encapsulation

line in .bashrc to customize prompt so it shows the history number, user, and working dir

export PS1="[\! \u:\w] " \! - history number \u - user \w - working directory

most cable internet services are asymmetric, download _____ than upload ( 12 mbps dl, 2 mpbs upload)

faster

Sleeping process

fg %programName sleeping process is just a process waiting for an input or output

a ___ is a flash equivalent of a conventional web cookie - set and used by adobe flash player which is installed on many computers to run movies, games, etc.

flash cookie

the simplest model for storing data is a ____ that consists of a single, two-dimensional table of data elements

flat file

This type of loop is ideal in situations where the exact number of iterations is known.

for loop

What is Junit?

framework unit testing of java

The device that can connect networks having vastly different organizations and protocols is a _________.

gateway

ncm ( n is optional multiplier, c is command, m is optional scale modifier) ex. 3dw deletes three words

general format for commands?

The transmission mode whereby a single message is placed on the network is to be read by multiple nodes is called ______________.

multicasting

In the worst case, what is the number of comparisons needed to search a singly-linked list of length n for a given element?

n

search for same text again

n ( in vim command mode )

The ISO/OSI layer responsible for routing PDUs across intermediate nodes is the ________ layer.

network

NSP equipment and links are tied together by _____ (Verizon link, crossover to Sprint link)

network access points

___ helps database designers create a database structure that minimizes storage space and increases processing efficiency

normalization

Multiple Inheritance

not allowed (except in C++)

___ is an e-mail based scam thats designed to persuade you to reveal confidential info such as yoru bank account number or ssn - requires replying or click embedded web site link for scam to work

phishing

The two ISO/OSI layers that do not have a direct correspondence with TCP/IP are the ________ later and the ________ layer.

physical and data link

Superscalar computers are architectures that exhibit parallelism through ________________ and ______________.

pipelining, replication

___, sometimes called overloading, is the ability to redefine a method in a subclass

polymorphism

____ (post office protocol version 3) deletes messages from the server after they are downloaded

pop3

_____ can be defined as the ability to easily move your internet service from one location to another

portable internet access

___ refers to branch of data mining that analyzes current and historical data to predict future trends

predictive analytics

head

print first 10 lines

tail

print last 10 lines

The visibility level of a class field should be.

private

a program written in ____ consists of self-contained instructions in a sequence that indicates how a task is to be performed or a problem is to be solved

procedural language

What does the positional parameter $$ contain?

process ID of shell

Daemon process:

process orphaned intentionally its parent is init, will run as a background process without being controlled by an interactive user (continually sleeping; wait for some event to interrupt them; handle event; go back to sleep)

Zombie process:

process that has completed execution but still has an entry in the process table (zombie != orphan)

a control can be customized by specifying values for a set of built in ____

properties

Consider the following code: public class A { private int x; private int y; public A (int a, int b) { x = a; y = b; } public String toString( ) { return x + " " + y; } } Consider that B is a class that extends A. B contains a third int instance variable, z. Class B should display x, y, and z with spaces in between. Which of the following would best override the toString ( ) or ToString() method for B?

public String toString( ) { return super.toString( ) + " " + z; }

What unix command displays the current working directory

pwd

____ (simple mail transfer protocol) handles outgoing mail

smtp

____ is development process that uses mathematical, engineering and management techniques to reduce cost adn complexity of a computer program while increasing its reliability adn modifiability

software engineering

___ is one or more fields used to specify where new records are inserted in a table

sort key

The realization of ______________ computing has prompted many to consider what is known as the technological singularity.

quantum The technological singularity is a hypothetical point in time at which technological growth becomes uncontrollable and irreversible, resulting in unforeseeable changes to human civilization. Quantum computers are new type of machines that operate on quantum mechanical hardware and are predicted to give enormous speed advantages in solving certain problems.They can solve problem so complex that today's top supercomputer would take centuries to find a solution, while a quantum computer could crack it in minutes. Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system.The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them.Multiprocessing is already utilised to its fullest in current era of computing. Holographic computing promotes Human Computer Interaction (HCI) that has been evolving for the last 30 years in respect to achieving a natural feeling, by mimicking the human-to-human interaction and by involving various means: movements, vision, and speech. Hybrid Computing is a kind of platform tht lets customers connect the packaged small business software applications that they run on their own internal desktops or servers to applications that run in the cloud. Cloud computing services are also being implemented by many of the organisations and it is already a realised concept widely used nowadays.

What command in a shell script is used to read user input

read

Stack is a restrictive data type in a sense that we cannot

remove from the bottom

(A) ____________ is a precursor to modern operating systems that allowed programs to be processed without human interaction.

resident monitor

The Layer 3 device connected to at least two networks that determines the destination to which a packet should be forwarded is a _________.

router

A simpler and more elegant approach is memory-mapped I/O because I/O devices and main memory share the:

same address space.

_____ pulls keywords from a web page adn stores them in an index database

search engine indexer

a ___ tells a computer what to do based on whether a condition is true or false

selection control structure

Definition of algorithm:

self-contained step by step set of operations to be performed

The difference in expressive power between the physical components of a computer and a high-level language such as C++ is called a:

semantic gap.

What kind of shell structure logic types exist

sequential decision looping case

What does the --global tag do?

sets the git settings for all git projects

What are bash aliases? Give an example

shortcut for specific commands ex) alias la='ls -a'

Object is the mother of all classes

•All classes inherit from Object -If you don't specify, a class directly inherits from Object -This will be "invisible" code •Object defines basic things like toString( ) -You need to override toString( ) -Redefine it to print something meaningful -When overriding, method signature must match -Default: print memory address of object (Java) or class name (C#)

Designing the Constructor

•Constructors will vary, depending on design •Ask questions: -Are all Dogs born with the same rabid state? (yes - they are all born non-rabid) -Are all Dogs born with the same weight? (no - they are born with different weights) -Are all Dogs born with the same name? (no - they all have different names) •If ever "no", then you need information passed in as parameters.

More rules (interface)

•Convention says to use a capital I as the first letter for the name of the interface (e.g. ITalkable) - C# •You can "implement" multiple interfaces using a comma •You cannot instantiate it (i.e. make an object)

Odds and Ends

•Declaring instance variables as private and providing getters/setters helps enforce good design •A change in a parent class propagates down to child classes - good for maintenence/design •Constructors are not inherited. Why not? •Class Object's default (empty) constructor does nothing, but will always be called.

A little more detail (ref, parameters, garbage)

•Did we just see "pointers" from C/C++? -Yes and no - Concepts are the same -What you saw was working with memory addresses -They're called "references" because they refer to another chunk of memory •What about changing primitive data types? -C# has the ref keyword -Allows changes to be made -Java students: you still need to know this!

Purpose of abstract (super class)

•Eliminate redundancy •Force the sub-classes (child class) to implement the abstract method

The Power of Polymorphism (example)

•Imagine you have to design a video game •There's a player and three (3) different enemies •You also have projectiles and "other stuff" •All gaming things need to update( ) themselves -Position - things need to move (just a bit) on the screen between frames -Hit points/health -Other stats -Artificial Intelligence needs to run... •How would you design this? •Let's focus on just the enemies... •Imagine now that we create an array of 100 Enemies: Enemy[ ] enemies = new Enemy[100]; •Fill it with random enemies: enemies[0] = new Kitten(); enemies[1] = new Zombie(); enemies[2] = new Chihuahua(); // and so on... •BOOM - Polymorphism! Tell ALL enemies to do their thing... for (int i = 0; i < enemies.size; i++) { enemies[i].updateAI(); enemies[i].move(); enemies[i].drawYourself(); }

Overloading Operators

•In C# and C++, not only can methods be overloaded, even operators (e.g. +, -, *, /, ==, ++, etc) can be overloaded. •Java does not allow operator overloading

Default Constructors

•In many languages, there's a default constructor • If you don't create one, it's created for you AND • IT'S INVISIBLE! AND • It takes no parameters AND • It sets variables/attributes: -To zero (0) for numbers -To FALSE for booleans -To NULL (empty) for objects like strings

Summary (Abstract Classes)

•Inheritance -Concrete classes -Abstract classes •At least one method signature should have the reserved word abstract in it •Abstract class help facilitate polymorphism

Summary (Inheritance)

•Inheritance -One class "absorbs" members from another class -Doesn't absorb constructors or private members •You can only inherit from one class •You can access parent methods/variables using super or base •Access modifiers change what's inherited and what is visible

Summary (interfaces)

•Interfaces -Are an alternate to multiple inheritance and the Diamond of Death •Are similar to abstract classes -Contain only abstract methods and attributes •A class "implements" an interface

The "new" operator

•Right now, we have two "dead" dogs •new -Brings instances "to life" -Calls the class's constructor -Opens up enough space in memory to fit an instance of that class

Abstract methods

•Some methods are not implemented in the parent -But in the child / sub class -These methods are called Abstract

Method Returns

•The return type of a method indicates the type of value that the method sends back to the calling location. •The return statement halts execution within the method and (optionally) returns a value •A method that does not return a value has a void return type •A return statement specifies the value that will be returned return expression; •Its expression must conform to the return type

Array processing

•The simplest processes involve searching ( finding a value, finding the largest or smallest ),or finding a sum, product or average. •Remember to initialize properly. •Note the pattern in the next examples: we use a loop! *remember to use "new" to allocate memory for your object.

Access Modifiers

•There are four levels of visibility (for this course) •Here are loose/sloppy definitions: -public - is visible everywhere in the code -private - is visible only within the class -protected - is visible only within the class or child classes -default - varies by language --In general, visible to class in the same package/namespace --Note: you do not specify 'default' in your code --Note: default is a keyword used in switch statements •There are language specific rules associated with each modifier, so reference the book! •private members are not inherited and are not directly accessible by child-class methods and properties. -Must access a parent's private variables by methods of that parent class

The Constructor

•This is a special method -Used to give initial values to ALL attributes -Is activated when someone creates a new instance of the class •Doesn't have a return type •In most languages, the name of this method MUST be the same name as the class

The "Driver"

•Usually put this in a whole new file! •The Driver contains main •It's the controlling algorithm •Steps: -Type in the skeleton -Create a couple of instances of classes -Start telling them what to do

OOP Summary

•Variables should (almost) always be declared private • Methods intended for class client should be public. • Other methods for local use should be private. • Controlled access to the variables promotes encapsulation. • Methods (setters and getters) provide controlled access to variables

General Rules

•Variables/attributes are normally marked private -public variables can be tampered with and abused! •Methods are most often marked public -However, some methods should be marked as private

What is an interface?

•Very similar to an abstract class •Allows unrelated classes to share common methods •The "rules": -Methods must be abstract methods (i.e. no code) --Even if you don't list the word abstract or virtual •Interfaces do not contain a constructor

A common point of confusion

•We see a lot of keywords like this and self •What is that? •A reference to something inside the class we're coding in •Commonly used to resolve ambiguity of variables:

overide

•You can also override (redefine) inherited methods •Don't confuse overriding with overloading (which is having two methods with the same name)

Basic things you can do with ArrayLists

•add()/Add() -pass the item you want to add to the list •remove()/RemoveAt() -pass an index number •size()/Count -return the number of element in the list •Can access elements: -Using index and [ ] like arrays in C# -Using the get( ) method in Java

Inheritance

•allows a new class to "absorb" an existing class's members. •Inheritance saves time by reusing proven and debugged high-quality software. •Best shown through an example

Arrays

•can't use until memory is allocated with new. •In C#, the [] must be between the data type and the object reference while in java the [] can be between the or after the name.

o Media

▪ Connect two devices or a device to a port ▪ Made from copper cable, fiber optic cable, or radio frequency waves (WiFi) ▪ Each type has strengths and limitations, such as its available bandwidth, capacity, distance that can be covered, and cost to install and maintain

o Router

▪ Connect two different networks together ▪ Intelligently forwards traffic to and from a network based on its logical address ▪ Most modern routers use Internet Protocol (IP) address to determine routing of traffic

o Campus Area Network (CAN)

▪ Connects building-centric LANs across a university, industrial park, or business park ▪ Covers many square miles and buildings ▪ Examples: ● College campus ● Business Parks ● Military bases

o Local Area Network (LAN)

▪ Connects components in a limited distance ▪ Each segment is limited to short distances, such as 100 meters with CAT 5 cabling ▪ Consists of Ethernet (IEEE 802.3) or WiFi networks (IEEE 802.11) ▪ Examples: ● Internal wired or wireless networks

o Ad Hoc Mode

▪ Decentralized wireless network ▪ No routers or access points are required ▪ Forwarding decisions for data on the network are made dynamically ▪ Allows creation/joining of networks "on-the-fly" ▪ Creates P2P connections

Client

▪ Device end-user accesses the network with ▪ Workstation, laptop, tablet, smartphone, television, server, or other terminal devices ▪ Can be any device that connects to the network

Wireless Access Point (WAP)

▪ Device that allows wireless devices to connect into a wired network ▪ Commonly used in home, small business, and even some large enterprise networks ▪ Acts as a wireless hub

o Drawbacks of Client/Server

▪ Higher cost ▪ Requires dedicated resources ▪ Requires network operating system

o Partial-Mesh Topology

▪ Hybrid of the full-mesh and the hub-and-spoke topologies ▪ Provides optimal routes between some sites, while avoiding the expense of connecting every site ▪ Must consider network traffic patterns to design it effectively

o Benefits of Peer-to-Peer

▪ Lower cost ▪ No dedicated resources required ▪ No specialized operating system required

Star Topology

▪ Most popular physical LAN topology ▪ Devices connect to a single point ▪ Most commonly used with Ethernet cabling, but wireless or fiber are also used ▪ If the central device fails, the entire network fails

Full-Mesh Topology

▪ Most redundant topology ▪ Every node connects to every other node ▪ Optimal routing is always available ▪ Very expensive to maintain and operate ▪ Number of Connections ▪ x= n(n - 1) / 2

o Defining Network Topology

▪ Physical Topology ● How devices are physically connected by media ▪ Logical Topology ● How the actual traffic flows in the network

Hub-and-Spoke Topology

▪ Used for connecting multiple sites ▪ Similar to Star, but with WAN links instead of local area network connections ▪ Not redundant, if central office (hub) fails, the whole network can fail

▪ Ant+

● Collection and transfer of sensor data ● Used with remote control systems (tire pressure, TVs, lights)

▪ Z-Wave

● Provides short-range, low-latency data transfer at rates and power consumption lower than Wi-Fi ● Used primarily for home automation

▪ RFID

● Uses electromagnetic fields to read data stored in embedded tags


संबंधित स्टडी सेट्स

Dependent and Independent Variables

View Set

ECP 3403 Final Exam (Combined Quizlet)

View Set

Chapter 53 Care of the Patient with a Sensory Disorder mid term!

View Set

Chapter 2-1 - Psychology's Scientific Method

View Set

nclex book ch 62 immune problems

View Set

Accounting General Journal, 11E-Chapter 15

View Set

Human Growth and Development Finals (ch. 1-10)

View Set