COMP 211 Midterm 1 UNC

¡Supera tus tareas y exámenes ahora con Quizwiz!

What are non-terminals in the context of grammars?

"syntactic variables" that are replaced by production rules

What is contained in /usr

"user installed" pro- grams, source code, and libraries which are widely useful but not required by the operat- ing system.

In regEx, what is the end of line command?

$

How to rename a file in shell?

'mv originalname newname'

What does verbose mode do

--verbose tells the program to state what it is doing, even if nothing problematic is occurring

In regEx, what is the any character command?

.

How many hex digits would make up a byte?

2 (it takes 4 bits to represent 16 combinations)

How many bits in a memory address?

64 bits; means pointers are 8 bytes

In a computer, what is the smallest addressable piece of memory?

A byte (8 bits)

What is the root directory?

A single directory that has all other files/directories as its descendants. It's address is '/'

In git, what is a branch?

A special named reference to a commit

What is a path?

A text designation of the location of a file or subdirectory in a file system

What is a derivation tree?

A tree of grammars ending in all terminals and starting with the start-symbol. Derivation completes when all leaf nodes are terminals

What is the fastest way to convert binary to hex or vice versa?

Add leading zeros until the total number of digits is divisible by 4. Convert each nibble into its binary/hex character and substitute them in order

In shell, what two things does autocomplete do to help you out?

After finishing a directory it adds a forward slash; after finishing a filename it adds a space

What information is stored in a function call's frame on the stack?

Argument Values, Return Address, Return Value, Other CPU State

What is a root node?

In a derivation tree, it is the start symbol. Each of its children is a symbol derived from its production rule

What files are ignored by git status and git add?

any file in .gitignore/

What is the command to create a new git repo?

change directories and then execute 'git init'

what is cp and its usage?

cp source_file target_file cp source_file target_directory

Vim how do you go back to Normal Mode?

ctrl + [

What is a segmentation fault?

Trying to read or write to segments of memory you aren't allowed

In shell, what is grep and how do you use it?

Uses regular expressions to search through one or more files grep PATTERN [FILE...] What does it mean for FILE... to be optional? What does grep search if no file is given to it? It searches any input piped into it.

In regEx, what is the start of line command?

^

What are production rules in the context of grammars?

a nonterminal "name" for the rule, followed by ->, and a sequence of terminals, nonterminals, and alternations; Defines the meaning of a non-terminal

In git, what is a commit?

a snapshot, or backup, of your project's files at a specific moment in your project's history.

In git, where is data about your project stored?

in ./.git/ (notice how it is hidden)

What is the default branch in git?

master

What is a relative path?

specifies only what comes after the working directory and is not preceded by a slash

What are terminals in the context of grammars?

the elementary symbols of a language (i.e. letters, numbers, whitespace, and reserved words) Terminal characters are in single quotes, Terminal keywords in double-quotes

What does rm do?

Deletes a file; can be used for directories but not easily

In git, what does each commit have?

Each commit has a unique message along with other metadata (like timestamp). Each commit also has unique identifier

In git, how are various commits related to each other?

Each commit holds a reference to its parents, or previous commits like a LinkedList

In git, when is HEAD automatically changed?

Head is changed to the newest commit when you make a commit

In git, what is in each commits ID?

It is created by hashing the new files of the commit and other metadata

What does find do?

Recursively lists all files and files in subdirectories Has an optional parameter of starting point

What does rmdir do?

Removes an empty directory; throws error if there are still files in it

In git, what is in your staging area after a commit?

Nothing, it is empty

What is the dirname?

Path up to and including the parent directory of the basename.

What are absolute paths?

Paths that start by referencing the root directory

How do you represent a bit pattern in c?

Prefix it with 0b or 0B, such as char temp = 0b00001100

How do you represent hex in c?

Prefix with 0x or 0X, hex digits are case insensitive but we try to use uppercase

What is the /bin directory

Short for binary program files; stores files which your computer can evaluate as a program

What are system utilities?

Standard programs available to you at anytime on a unix system

If you have a recursive function, what order does its memory grow in?

Starts in a high address and works down

How do you negate any signed value that is represented using two's complement?

Take one's complement and then add 1

What is two's complement?

Take the highest order bit and treat it as negative and analyze the rest of the bits the normally

What does realpath do?

Takes in a path and expands it to its absolute path

In shell, what does the cat command do?

Takes in one or more input files and prints its content to the screen. cat [file ...] Since file is optional, you can pipe input into it

In git, what happens when you checkout a branch?

The contents of all files in the commit the branch refers to are copied into your working tree. HEAD is updated to reference the checked-out branch

What is the basename?

The last name in a path which is either a directory or a file. It is what the path is specifically referring to

What is a start symbol in the context of grammars?

The nonterminal symbol the grammar starts with; Always underlined

In git, If I have a new commit that adds a single new file, how are the old files handled?

The remaining files that have not changed are linked to their last changed version in a previous commit

What are hidden files?

files and directories whose name starts with a dot; not shown in ls

In git, how do you add a file to your staging area?

git add filename.filetype

In git what command lists all your branches?

git branch

In git, how do you create a branch

git branch name

in git how do you create and checkout a branch at once

git checkout -b branchname

in git how do you checkout a branch

git checkout branch name

In git, what does the commit command do?

packages up your staging area and converts it into a commit. git commit -m "I added x, y, and z!"

In git, what is HEAD?

refers to the branch you are working on in your working directory/tree


Conjuntos de estudio relacionados

Fundamentals of IT and Cybersecurity Chapter 1 Study Guide

View Set

ECO2013 Exam 1 Pearson Questions

View Set

Emissions Control Systems and Components

View Set

Chronic: Exam 2: Chapter 41: PREP U

View Set

Business Ethics Now Test (Ch. 1-2)

View Set