Reference list

Helpful references

Unix Commands

cat:

Concatenate files and print the result (or print a single file)

cd:

Change the working directory

cp:

Copy a file

echo:

Display given text

(gdb) ba:

Print a backtrace

(gdb) break:

Set a break point

(gdb) continue:

Continue execution after breaking

(gdb) disassemble:

Disassemble a block of instructions

(gdb) print:

Print a value

(gdb) quit:

Quit

(gdb) run:

Run program you have loaded in GDB

(gdb) stepi:

Step forward one instruction

(gdb) x:

Examine the contents of memory

git add:

Designate one or more files as part of the next commit

git clone:

Make a local copy of a Git repository

git commit:

Perform a commit and record an associated message

git diff:

Display the changes made since the last commit

git log:

Print the history of commits to a project

git push:

Push committed changes back to the original repository

git reset:

Reset Git repository to a previous state

ls:

List directory contents

man:

Display a Unix manual page

mkdir:

Create a directory

mv:

Move (rename) a file

nc (netcat):

Concatenate and redirect sockets

objdump:

Display information about object files, including disassembly

pwd:

Print working directory

rmdir:

Permanently remove an empty directory

rm:

Permanently remove a file

sudo:

Execute a command as another user

su:

Switch user

C Elements

argc:

An integer indicating the number of command-line arguments received by the program

argv:

An array of pointers to the program’s command-line arguments

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

else:

Execute the following block when the previous if did not execute

float:

A floating-point type that approximates a real number

foo[n] = 42:

Set the nth element of the array foo to the value 42

for:

Iterates until a condition is no longer met

if:

Conditionally execute the following block

int:

An integer type from -n to n-1

||:

The logical-or operator

>:

The greater-than operator

>=:

The greater-than-or-equal operator

<:

The less-than operator

<=:

The less-than-or-equal operator

t foo[] = { 1, 2, 3, 4, 5 }:

Create an array named foo with given values

t foo[n]:

Create an array named foo of n objects of type t

+:

The addition operator

=:

The assignment operator

/:

The division operator

==:

The equality operator

!=:

The inequality operator

&&:

The logical-and operator

!:

The logical-negation operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

Go Elements

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

else:

Execute the following block when the previous if did not execute

float:

A floating-point type that approximates a real number

for:

Iterates until a condition is no longer met

if:

Conditionally execute the following block

int:

An integer type from -n to n-1

os.Args:

A slice of command-line arguments

||:

The logical-or operator

>:

The greater-than operator

>=:

The greater-than-or-equal operator

<:

The less-than operator

<=:

The less-than-or-equal operator

+:

The addition operator

=:

The assignment operator

/:

The division operator

==:

The equality operator

!=:

The inequality operator

&&:

The logical-and operator

!:

The logical-negation operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

Java Elements

a.length:

The length of the array a

args:

An array of command-line arguments

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

else:

Execute the following block when the previous if did not execute

float:

A floating-point type that approximates a real number

foo[n] = 42:

Set the nth element of the array foo to the value 42

for:

Iterates until a condition is no longer met

for:

Loop with initialization, condition, and increment

if:

Conditionally execute the following block

int:

An integer type from -n to n-1

int foo[] = { 1, 2, 3, 4, 5 }:

Create an array named foo with given values

java.net.Socket:

A client socket class able to send or receive communication messages

JButton:

A button widget that reacts to clicks or presses

JFrame:

A window

JLabel:

Display area for a short text string, an image, or both

JPanel:

Generic lightweight container

JTextField:

A field that accepts text input

Math.PI:

An approximation of the value of π

||:

The logical-or operator

>:

The greater-than operator

>=:

The greater-than-or-equal operator

<:

The less-than operator

<=:

The less-than-or-equal operator

t foo[] = new t[n]:

Create an array named foo of n objects of type t

+:

The addition operator

=:

The assignment operator

/:

The division operator

==:

The equality operator

!=:

The inequality operator

&&:

The logical-and operator

!:

The logical-negation operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

Timer:

A timer that produces an action event when it expires

while:

Repeat the following block as long as an expression evaluates to true

Python Elements

elif:

Conditionally execute the following block, but only when the previous if did not execute

else:

Execute the following block when the previous if did not execute

for:

Iterates over the elements of a sequence

if:

Conditionally execute the following block

sys.argv:

An array of command-line arguments

||:

The logical-or operator

>:

The greater-than operator

>=:

The greater-than-or-equal operator

<:

The less-than operator

<=:

The less-than-or-equal operator

+:

The addition operator

=:

The assignment operator

/:

The division operator

==:

The equality operator

!=:

The inequality operator

//:

The integer division operator

&&:

The logical-and operator

!:

The logical-negation operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

C Functions

connect:

Connect a socket to an address

execvp:

Execute a file

exit:

Terminate the current process

fork:

Create a new process by duplicating the calling process

freeaddrinfo:

Free the address object provided from a getaddrinfo call

gai_strerror:

Print the error string associated with a failed getaddrinfo call

getaddrinfo:

Obtain one or more addresses for a host

isalpha:

Determine whether the given value represents an alphabetic character

printf:

Print to standard output with formatting

recv:

Receive a message from a connected socket

scanf:

Read formatted values from standard input

socket:

Return a socket abstraction able to send or receive communication messages

strcmp:

Compare two strings

strstr:

Search for the occurrence of one string in another

tolower:

Convert a capital letter to lower-case; return lower-case letter unchanged

wait:

Wait for a child process to stop or terminate

Go Functions

bufio.NewReader:

Create a buffered reader from a non-buffered reader such as a connection

bufio.Reader.ReadString:

Read up to and including the first occurrence of a delimiting string

fmt.Printf:

Print to standard output with formatting

fmt.Println:

Print to standard output

fmt.Scanf:

Read formatted values from standard input

net.Dial:

Create a connection to the given address

Java methods

Character.isLetter:

Determine whether the given value represents an alphabetic character

Character.toLowerCase:

Convert a capital letter to lower-case; return lower-case letter unchanged

java.util.Scanner:

Read values from text

Math.pow:

Raise one value to the power of another

String.contains:

Search for the occurrence of one string in another

String.equals:

Compare two strings

System.out.printf:

Print to standard output with formatting

System.out.println:

Print to standard output

Python Functions

print:

Print to standard output

socket.socket:

Return a socket abstraction able to send or receive communication messages

SocketType.connect:

Connect a SocketType object to an address

SocketType.recv:

Receive a message from a connected SocketType object

References