Notes, summaries, assignments, exams, and problems for Computer science

Oracle Tablespaces, Segments, and Data Blocks Explained

Computer science2.39 KB

Oracle Tablespaces and Data Storage

System tablespaces and the required sysaux tablespace are created when the database is created and must be online.

The System tablespace is used for core functionality, for example, the data dictionary tables.

The auxiliary Sysaux tablespace is used for additional database components, such as the Enterprise Manager repository.

A tablespace accounts for one or more data files.

Data files belong to one tablespace.

User process: It begins when the user database server requests a connection to Oracle.

Process server: Connects to the Oracle instance and starts when a user establishes a session.

Background processes: Start the Oracle instance.

Oracle is a server management system database that provides an open, comprehensive,...

Continue reading "Oracle Tablespaces, Segments, and Data Blocks Explained" »

Multimedia Production: Definitions, Video Editing, and Audio Formats

Computer science3.64 KB

Fundamentals of Multimedia Production

Media Types: Text, image, video, and sound.

Professional Standard: Macintosh.

Multimedia Production Stages

  1. Capture: Obtaining different media components containing the multimedia product, and storing them in computer formats.
  2. Editing and Integration: Editing each medium and integrating them all into a multimedia product, adding effects.
  3. Presentation: Using the appropriate device depending on the type of multimedia creation done.

Digital Audio Concepts

Streaming: The action of receiving real-time multimedia information over the Internet.

Digitalization of Sound: The process of converting the analog sound signal into a digital signal.

Sound Formats and Quality

  • WAV
  • MIDI
  • MP3
  • OGG
  • WMA
  • Real Audio

WMA: Compressed files known for...

Continue reading "Multimedia Production: Definitions, Video Editing, and Audio Formats" »

Prolog Predicates & Game AI Algorithms

Computer science3.47 KB

funcition min-max(pos,out-eval,out-best_move,in-whomoves,in-max_level){max=-?;min=?;best_move=0;if(level==0){evaluation=eval_(pos);best_move=0; return;}else{foi(i=0;i<num_succ(i);++i){succi=succesor(i);if(whomoves=='max'){min-max(succi,evaluation,best_move,'min', max_level-1);if(evaluation>max){max=evaluation; best_move=i;}}else{min-max(succi,evaluation,best_move,'max', max_level-1);}if(evaluation<min){min=evaluation;best_move=i;}}}}

funcition ??(pos,level,quien_juega,*eval,mejor_move,?,?){if(terminal(pos)||(level==0){*eval=eval(pos);return;}n_succ= num_succ(pos);for(i=0;i<n_succ;++i{if(quien_juega=='max'){succi=succesor(pos,i);??(succi,level-1,'min',evali, mejor_movi,?,?);if(evali>?){?=evali;*eval=?; *mejor_move=i;}if(?>?)...

Continue reading "Prolog Predicates & Game AI Algorithms" »

Essential OPAC Functions for Modern Libraries

Computer science2.77 KB

Features of an OPAC

OPAC (Online Public Access Catalogue):

Core Features of an OPAC

1. Advanced Search Capabilities

  • Multi-Field Searching: Allows retrieval using specific metadata like Author, Title, ISBN, Subject, and Call Number.
  • Boolean & Query Refinement: Supports Boolean operators (AND, OR, NOT), wildcard truncation, and phrase searching to narrow down results.

2. Real-Time Status & Location Tracking

  • Circulation Status: Displays live item availability (e.g., Available, Checked Out, On Hold, Lost).
  • Dynamic Location: Pinpoints the exact physical location, including the specific collection (e.g., Reference, Stack) and the Call Number/Shelf Mark.

3. Patron Self-Service (My Account)

  • Circulation Control: Enables users to log in to renew issued
...
Continue reading "Essential OPAC Functions for Modern Libraries" »

Mastering C++ Operator Overloading: A Practical Tutorial

Computer science5.41 KB

In C++, Operator Overloading is a compile-time polymorphism feature that allows you to grant custom meanings to existing C++ operators (like +, -, *, ==, etc.) when they are applied to user-defined data types (objects).

It does not let you create new operators (you cannot invent a ** operator), nor does it change the precedence or associativity of existing ones. It simply makes your custom objects behave intuitively, like built-in data types.

1. Syntax of Operator Overloading

To overload an operator, you define a special member function using the operator keyword followed by the symbol you want to overload.

ReturnType operator Symbol (Arguments) {
    // Custom logic here
}

2. Overloading Unary Operators

A unary operator operates on a single operand....

Continue reading "Mastering C++ Operator Overloading: A Practical Tutorial" »

Essential Shell Scripting Examples for Linux Automation

Computer science3.37 KB

1. Armstrong Number Checker

Write a shell script to check whether a given number is an Armstrong number.

echo "Enter a number"
read c
x=$c
sum=0
while [ $x -gt 0 ]
do
r=$(( $x % 10 ))
n=$(( $r * $r * $r ))
sum=$(( $sum + $n ))
x=$(( $x / 10 ))
done
if [ $sum -eq $c ]
then
echo "This is an Armstrong number"
else
echo "This is not an Armstrong number"
fi

2. Calculate Area of a Circle

Write a shell script to find the area of a circle.

echo "Enter radius"
read r
echo "Area is"
echo "3.14 * $r * $r" | bc

3. Average of Command Line Arguments

Write a shell script to find the average of numbers entered as command line arguments.

sum=0
for i in $*
do
sum=$((sum + i))
done
echo "Summation of $# numbers is: $sum"
N=$#
avg=$(echo "$sum / $N" | bc -l)
echo "Average = $avg"
...
Continue reading "Essential Shell Scripting Examples for Linux Automation" »

C Programming: Numerical Algorithms and Control Flow

Computer science18.07 KB

Unit 3: Core C Programming Concepts

Extracting Digits of a Number

Extracting digits of a number is a fundamental programming task used in various computational problems, such as reversing a number, checking for palindromes, or performing digit-based calculations. There are two main approaches: right-to-left extraction and left-to-right extraction.

Right-to-Left Extraction

In right-to-left extraction, the modulus operator (%) is used to obtain the last digit of the number, while integer division (/) removes the last digit after processing. For example, for the number 1234:

  • 1234 % 10 gives 4.
  • 1234 / 10 gives 123.

This process is repeated until the number becomes zero, allowing each digit to be handled individually.

Left-to-Right Extraction

Left-to-right...

Continue reading "C Programming: Numerical Algorithms and Control Flow" »

Network Congestion Control and Traffic Shaping

Computer science6 KB

Network Layer Design Issues

The network layer involves several critical design considerations, including store-and-forward switching, transport-layer services, the distinction between Virtual Circuits (VC) and Datagrams, and congestion management.

Understanding Network Congestion

Congestion occurs when too much traffic enters the network, leading to overloaded routers and a sharp drop in overall performance.

Congestion Control vs Flow Control

  • Congestion Control: A global issue involving all routers and hosts to manage total network load.
  • Flow Control: A point-to-point mechanism ensuring a sender does not overwhelm a specific receiver.

General Principles of Congestion Management

  1. Monitor the system to detect where and when congestion occurs.
  2. Distribute
...
Continue reading "Network Congestion Control and Traffic Shaping" »

Synchronization and CPU Scheduling in Operating Systems

Computer science3.87 KB

Chapter 5: Synchronization

Critical Section Conditions

  • Mutual Exclusion: Only one process may be in the critical section at a time.
  • Progress: If the critical section is empty, some waiting process can enter.
  • Bounded Waiting: No starvation; each process waits a bounded number of turns.

Atomic Instructions

  • Test-and-Set: old = *b; *b = TRUE; return old
  • Swap: temp = *a; *a = *b; *b = temp

Spinlocks

  • TAS:
    bool m = false;
    lock() { while (TestAndSet(&m)); }
    unlock() { m = false; }
    
  • Swap:
    bool m = false;
    lock() { bool key = true; while (key) Swap(&m, &key); }
    unlock() { m = false; }
    

Semaphores

  • wait(S): S.val--; if S.val < 0 block
  • signal(S): S.val++; if S.val <= 0 wake one
  • Binary semaphore as mutex: init = 1; lock = wait; unlock = signal

Peterson's

...
Continue reading "Synchronization and CPU Scheduling in Operating Systems" »

Assembly Language Fundamentals: Registers, Operands, and Data Types

Computer science4.73 KB

Assembly Language Fundamentals: Key Concepts and Definitions

1. Clock Frequency and Cycle Time

A clock that oscillates 1 million times per second (1 MHz) produces a clock cycle duration of $10^{-6}$ seconds (1 microsecond).

2. General-Purpose Registers (8-bit, 16-bit, and 32-bit Access)

The general-purpose registers that can be accessed in 8 bits, 16 bits, and 32 bits are: EAX, EBX, ECX, and EDX.

3. Purpose of EAX and ECX Registers

These registers serve specific roles in CPU operations:

  • EAX – Accumulator: Automatically used by multiplication and division instructions. It is often referred to as the extended accumulator register.
  • ECX – Loop Counter: The CPU automatically uses ECX as a counter for loop instructions.

4. Reserved Words and Identifiers

...
Continue reading "Assembly Language Fundamentals: Registers, Operands, and Data Types" »