Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

Caloreats: Personalized Daily Calorie and Meal Planning

Classified in Computers

Written on in English with a size of 2.48 KB

Caloreats

Functionality

The goal of Caloreats is to help users control their daily calorie intake. With an intuitive menu, users can select their preferred diet (e.g., gluten-free, vegetarian, vegan) and their daily calorie target. The app then generates a personalized meal plan for the day, including breakfast, lunch, and dinner, complete with detailed nutritional information.

All recipes are provided by the Spoonacular API, which features over 2,600 ingredients and 360,000 recipes. Each recipe includes pricing, health information, nutritional analysis, images, and cooking tips.

Navigation

Upon launching the app, users are directed to the login page, which supports email or Google account authentication. Once logged in, the user is taken to the... Continue reading "Caloreats: Personalized Daily Calorie and Meal Planning" »

Python Syntax, Indentation, Comments, Variables, Data Types, Numbers, Casting, and Strings

Classified in Computers

Written on in English with a size of 5.67 KB

Python Syntax

As we learned in the previous page, Python syntax can be executed by writing directly in the Command Line:

>>> print("Hello, World!")
Hello, World!

Python Indentation

Indentation refers to the spaces at the beginning of a code line.

Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important.

Python uses indentation to indicate a block of code.

if5 > 2:
    print("Five is greater than two!")

Python will give you an error if you skip the indentation:

if5 > 2:
print("Five is greater than two!")

Python Comments

Comments can be used to explain Python code.

Comments can be used to make the code more readable.

Comments can be used to prevent execution when testing... Continue reading "Python Syntax, Indentation, Comments, Variables, Data Types, Numbers, Casting, and Strings" »

Java Student Management System Implementation

Classified in Computers

Written on in English with a size of 5.78 KB

Java Student Management System: Core Concepts

This document presents a foundational Java program designed to manage student data. It demonstrates key Object-Oriented Programming (OOP) principles through a simple console-based application.

Prerequisites

  • Basic understanding of Java programming.
  • Familiarity with classes, objects, methods, and variables.

Core Components of the Student System

The Aluno Class: Student Data Model

The Aluno class serves as the blueprint for creating student objects. Each object encapsulates a student's name, course, and a unique registration number.

Class Attributes

  • nome (String): Stores the student's name.
  • curso (String): Stores the student's enrolled course.
  • num_matricula (int): Represents the unique registration number (RA)
... Continue reading "Java Student Management System Implementation" »

Radio nav

Classified in Computers

Written on in English with a size of 10.2 KB

  1. Telephone communication

it has been the medium used as the first contact with a company. It is used to arrange meetings , interviews or to ask for information, so the impression of the first telephone call is very important

  1. Telephone means and equipment

Fixed individual devices

Private branch exchanges (PBX):  it connects calls between two destinations or ends

Mobile devices:

PDA (Personal Digital Assistant) it`s like a small computer (Internet and electronic mail)

Smartphone:  A PDA with video, camera, radio, MP3 player  or television

Services: Internet, e-mail, videoconference, camera, audio and  Video quality player, an agenda, GPS,....

3. Additional services offered by the telephone equipment

3.1 Common features(a,b,c,)

  1. Fixed telephony: -

Notice

... Continue reading "Radio nav" »

Understanding Cache Memory and CPU Hazards

Classified in Computers

Written on in English with a size of 2.83 KB

1. General Questions (35%)

1.1. (5%) What is the difference between a write-back cache and a write-through cache?

Write-back cache: A store only writes data to the cache and marks the corresponding line as dirty. The modified line is written to the lower level of the memory hierarchy only when it is evicted.

Write-through cache: Data is written to the caches and the memory every time a store is executed.

1.2. (15%) Name the 3 Cs in cache misses and provide a brief explanation for each C.

Compulsory miss: A cache miss caused by the first access, a cold start effect.

Capacity miss: A cache miss due to the capacity limitation. Even with full associativity, it cannot accommodate all the working sets of an application.

Conflict miss: A cache miss that... Continue reading "Understanding Cache Memory and CPU Hazards" »

Software Design Principles and UML Diagrams Explained

Classified in Computers

Written on in English with a size of 4.2 KB

Dimensions of Software Design

Software design involves several key dimensions:

  • Problem solving
  • Modeling
  • Specification
  • Organizing the solution
  • Communication
  • Economics and reuse
  • Maintenance and evolution

Design Approaches

Divide-and-Conquer

A problem is decomposed into subproblems that are worked on independently. This approach can be applied recursively for complex problems and allows managers to allocate work to multiple people.

Procedural Design

Design is viewed as a set of procedures that are composed:

  • Sequentially
  • Conditionally
  • Iteratively
  • Hierarchically

Borderline Procedural Design

In this approach, the main steps are not fixed. The user has choices with few constraints, and there is typically a main loop to find the next operation.

Event-Driven Design

This... Continue reading "Software Design Principles and UML Diagrams Explained" »

Gestión de Libros: Formularios PHP para Insertar, Borrar y Consultar

Classified in Computers

Written on in English with a size of 464 bytes

Gestión de Libros: Formularios de Control

1. Insertar un nuevo libro

Título:

Autor:

Editorial:

Categoría: Texto Lectura

2. Borrar un libro

ID del libro:

3. Consulta de libros por categoría

Mostrar libros de la categoría: Todos Texto Lectura

OpenMP Parallel Programming: Optimization Techniques

Classified in Computers

Written on in English with a size of 3.13 KB

Conceptos Básicos de OpenMP

  • Flush: Ocurre cuando hay algo modificado y se escribe en la misma línea.
  • Bus Upgrade: Sucede cuando tienes un dato exclusivo y lo modificas.

Versión Secuencial con Pragma Parallel For y Reduction

int minimo(int *V, int n) {
    int i, k, i_end, i_start;
    int min = V[0];
    #pragma omp parallel for private(i_end, i_start) reduction(min:min)
    for(k = 0; k < 4; k++) {
        i_end = (k + 1) * (n / 4);
        if(k == 0) i_start = 1;
        else i_start = k * (n / 4);
        for(i = i_start; i < i_end; i++) {
            if(V[i] < min) min = V[i];
        }
    }
    return min;
}

Versión Usando Pragma OMP Task

int minimo(int *V, int N) {
    int i, k, i_end, i_start;
    int min;
    int min4[4][16]
... Continue reading "OpenMP Parallel Programming: Optimization Techniques" »

Functional vs Object-Oriented Programming: Python Concepts

Classified in Computers

Written on in English with a size of 2.29 KB

Functional vs. Object-Oriented Programming

Object-Oriented Programming (OOP) models problems as objects containing data and methods that perform actions on that data. Functional Programming treats problems as a chain of functions evaluated to produce a result.

Code Output Analysis

  • SQUARE [1, 4, 9]: []
  • FIB FUNC: 0: 1, 1: 8, 2: 19, 3: 46
  • HELLO F: The first prints “Hello world”. The second raises an error because say_hello() is bound to an object but is called without an instance.

Python Methods Explained

A class method takes the class as the first argument. A static method takes no class or instance reference. An instance method takes an instance as an argument.

Intersection of N Lists

To find the intersection of multiple lists, use reduce with set.

... Continue reading "Functional vs Object-Oriented Programming: Python Concepts" »

Responsibilities of the Transport Layer

Classified in Computers

Written on in English with a size of 1.9 KB

Transport Layer Responsibilities

Tracking Individual Conversations

At the transport layer, each set of data flowing between a source application and a destination application is known as a conversation (Figure 1). A host may have multiple applications that are communicating across the network simultaneously. Each of these applications communicates with one or more applications on one or more remote hosts. It is the responsibility of the transport layer to maintain and track these multiple conversations.

Segmenting Data and Reassembling Segments

Data must be prepared to be sent across the media in manageable pieces. Most networks have a limitation on the amount of data that can be included in a single packet. Transport layer protocols have services... Continue reading "Responsibilities of the Transport Layer" »