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

Runtime Memory Organization: Code, Static Memory

Computer science2.37 KB

Runtime Memory Organization

The organization of memory at runtime depends on the type of language (declarative, imperative), the compiler, and the operating system.

General Structure of Programming Languages

When you run a program, the OS loader allocates the required amount of memory and loads the code to be executed (stored in a file) into the code area.

The OS should detect collisions between the stack and the heap. In these cases, the program may abort, or the amount of allocated memory may be increased.

In memory paging systems, the above scheme can be fragmented and scattered between real memory and the virtual memory system.

Any reference to a storage location within the code should be relative to the position assigned to the process by the...

Continue reading "Runtime Memory Organization: Code, Static Memory" »

C Programming Language: Functions, Pointers, and Files

Computer science4.96 KB

Functions in C

Void functions provide a way to emulate what are called procedures in other languages (e.g., PASCAL). They are used when it is not required to return a value. Here is an example that prints the squares of certain numbers:

void square ()
{
int count;

for (counter = 1; count < 10; counter++)
printf ("%d\n", counter * counter);
}

main ()
{
square ();
}

Input and Output Parameters

To use parameters in/out, the formal parameter must be preceded by the ampersand symbol (&), and the current parameter must be a variable (not an expression). Input/output parameters are used when you want a procedure to change the contents of the current variable. The fact that these parameters are explicitly defined as variables makes the programmer aware of...

Continue reading "C Programming Language: Functions, Pointers, and Files" »

Understanding DNS Protocols and Network Naming

Computer science2.6 KB

DNS Protocols and Services

In data networks, devices are labeled with a numeric IP address so they can participate in sending and receiving network messages. However, most people spend much time trying to remember these numerical addresses. Therefore, domain names were created to convert the numeric addresses into a simple and recognizable name.

The DNS protocol defines an automated service that matches resource names with the numeric network address requested.

Top Level Domains (TLDs)

The different top-level domains represent the kind of organization or the country of origin. Examples of top-level domains are:

  • .au: Australia
  • .co: Colombia
  • .com: A firm or industry
  • .jp: Japan
  • .org: A nonprofit organization

The Application Layer

The application layer is...

Continue reading "Understanding DNS Protocols and Network Naming" »

Essential Linux Commands for File Management

Computer science4.57 KB

Essential Linux Commands for File Management

Basic Operations

  • mkdir /Destination/Name: Creates an empty directory named Name at the specified Destination.
  • touch /Source: Updates the access and modification date of the Source file to the current time. If the file does not exist, it creates an empty file.

Copying Files

  • cp /Source/Destination: Copies the Source file to the Destination with the same name.
  • cp -r /Source/Destination: Recursively copies files from the Source directory to the Destination directory, preserving the directory structure and file names.

Moving Files

  • mv -f /Source/Destination: Moves the Source file to the Destination, overwriting any existing file with the same name.
  • mv -u /Source/Destination: Moves the Source file to the Destination
...
Continue reading "Essential Linux Commands for File Management" »

Device Communication: Controllers and Functions

Computer science3.5 KB

Key Functions of Device Communication

The main functions related to device communication are:

  • Sending commands to devices.
  • Detecting interrupts.
  • Handling errors.
  • Providing a simple and easy-to-use interface between devices and the rest of the system. This interface should ideally be the same for all devices, regardless of their specific type.

Device Categories

Human-Readable Devices

Used for communication with the user:

  • Printers
  • Graphic display terminals
  • Displays
  • Keyboards
  • Mice

Machine-Readable Devices

Used for communication with electronic equipment:

  • Disk and tape drives
  • Sensors
  • Controllers
  • Actuators

Communication Devices

Used for communication with remote devices:

  • Digital line drivers
  • Modems

Device Types

Devices fall into two broad categories:

  • Block devices
  • Character
...
Continue reading "Device Communication: Controllers and Functions" »

Digital and Analog Signals: Input and Output Channels

Computer science2.58 KB

Digital Awareness

When you want to receive digital information from the outside: The business card input channels are available, usually in groups of 8 bits, to which binary information is assigned by a program. These can be assigned to an internal variable state of a byte by a reading instruction that may have a port. There can be one or more bytes of input, assigning each an address.

Analog Outputs

To send analog control signals to the outside, the tallies have one or more channels of output through their respective A/D converters. A 1V analog converter generates a constant proportional to the numerical value of the digital data that it has on its input lines. Internally, they have a 5V memory. Different voltage ranges can be obtained using...

Continue reading "Digital and Analog Signals: Input and Output Channels" »

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" »