Notes, summaries, assignments, exams, and exercises for Computer science for University
SQL Database Exercise: Clients, Carriers and Orders Queries
SQL Database Exercise: Clients, Carriers and Orders
CREATE DATABASE EX4_1;
USE EX4_1;
Creating the clients table
CREATE TABLE clientes
(codcli INT,
nome VARCHAR(30),
endereço VARCHAR(40),
cidade VARCHAR(30),
fone CHAR(9),
CONSTRAINT pk_clientes PRIMARY KEY(codcli));
INSERT INTO clientes VALUES
(1,'Elevanir','Rua do Parque','Mauá','945653285'),
(2,'Lucas','Rua do Iorgute','Mauá','954658545'),
(3,'Ludirbe','Rua da Vadiagem','Santo André','954785452'),
(4,'Lairdison','Rua do Fermento','São Bernardo do Campo','954658532'),
(5,'Leandro','Rua do Bolo','Norte','954658545');
Creating the carriers table
CREATE TABLE transportadora
(codigo INT,
nome VARCHAR(20),
CONSTRAINT pk_transportadora PRIMARY KEY(codigo));
INSERT INTO transportadora VALUES
(1,'Fedex'),
(2,'Polar...
Android Mobile Application Development Essentials
CSC525 Wireless and Mobile Computing
Mobile Devices: The Good
- Always-on person
- More than one means of connection
- Applications are free or low cost
- Has many sensors: accelerometer, GPS
- Increasing in capability at an alarming rate
Mobile Devices: The Bad
- Battery life
- Unreliable, costly, and high-latency network access
- Screen size
- Different platforms across and even within device families
- Input
- Processor
- Storage
How do you think you can compensate for these shortcomings?
Why Android?
- Popularity
- Feature set
- Flexibility
- No license fee
- Powerful SDK
- Documentation and developer community
- Android market
- No approval process
- Ease of distribution and monetizing
Native vs. Web Applications
What are the pros and cons?
Types of Applications
- Foreground: Typically only useful when visible
Core Principles of Object-Oriented Programming
Abstraction
- Application Analysis: The class or object model extracts the essential features of a real-world class or object.
- Software Design: The public interface supports a simple logical model, while implementation complexity remains hidden from the client view.
Modularity
- Application Analysis: Objects provide a more expressive and fine-grained structuring capability than decomposition by processing activity alone.
- Software Design: Objects are information clusters that can be declared as often and wherever needed.
Encapsulation
- Classes build “firewalls” around objects, forcing all access through public interfaces and preventing access to private implementation.
- Objects intercept errors before they propagate outward throughout the system.
Implementando 4x4 Matriz Transposta em Linguagem C
Implementação da Transposição de Matriz 4x4 em C
Este programa em C demonstra como calcular e exibir a matriz transposta (B) de uma matriz quadrada de ordem 4 (A). A transposição é realizada trocando as linhas pelas colunas, ou seja, o elemento na posição A[i][j] é copiado para B[j][i].
Código Fonte em C para Transposição de Matriz
O código utiliza as bibliotecas padrão stdio.h para entrada/saída e conio.h (comum em ambientes legados) para controle de console.
#include <stdio.h>
#include <conio.h>
int main()
{
int i, j, A[4][4], B[4][4];
// 1. Entrada de Dados
printf("Insira os elementos da Matriz A (4x4):\n");
for(i = 0; i < 4; i++)
{
for(j = 0; j < 4; j++)
{
printf(...Fundamentals of Data Processing and Information Systems
Understanding Data and Information
A figure is a symbolic representation (numerical, alphabetical, algorithmic, etc.) and an attribute or characteristic of an entity.
Difference Between Data and Information
Data differs from information; various methods are used to compress information to allow for more efficient transmission or storage.
The amount of information in a message can be understood as the number of possible symbols representing the message. Symbols representing the message are considered meaningful data.
The Data Processing Cycle
Data Processing involves careful and systematic procedures performed to develop, codify, and organize data for analysis.
Four Key Data Processing Steps
- Data Capture: This involves making an observation in order
Software Architecture Design: UML Concepts & Layered Systems
Software Architecture Design Principles
Key aspects of software design include:
- Software Architecture Design: Defines the major structural components of the software and their relationships.
- Project Data Design: Involves designing the data structure needed to implement the software.
- Procedural Design: Refines and details the procedural description of the structural components defined in the software architecture.
- Interface Design: Describes how software communicates internally (internal interfaces), with other systems (external interfaces), and with users (user interface).
Component vs. Class Diagrams in UML
Similarities
- Both can realize a set of interfaces.
- Both can participate in various relationships (dependency, generalization, association).
- Both
Network Switches vs. Hubs: Performance and VLAN Benefits
Network Switches vs. Hubs: Key Differences
A network switch offers significantly higher performance than a hub. Below are the primary distinctions:
Hub Characteristics
- Bandwidth: Shared bandwidth (e.g., 10Mbps shared among 5 devices results in 2Mbps per device).
- Transmission: Cannot handle simultaneous transmissions to multiple devices at once.
- Cost: Generally cheaper than a switch.
Switch Characteristics
- Bandwidth: Each device receives the total available bandwidth.
- Performance: Supports multiple simultaneous data transmissions.
- Bridge Comparison: Unlike a bridge, a switch operates using the same protocols at the physical and link layers, offering superior speed and performance.
Virtual Local Area Networks (VLANs)
Traditional LANs are highly dependent...
Data Segmentation and Port Management in TCP/IP
Functions of the Transport Layer
The Transport Layer allows the segmentation of data and provides the control necessary to reassemble the parts into different streams of communication. The main responsibilities to be met include:
- Tracking individual communication between applications on hosts of origin and destination.
- Data segmentation and the handling and management of each segment in application data streams.
- Identification of different applications.
Data Segmentation and Encapsulation
The protocols of the Transport Layer describe the services that segment the application layer data. This includes the necessary encapsulation of data in each section. Each section of the application requires data to be added to headers in the Transport Layer to...
Visual Basic Student Management System: Code Walkthrough and Fixes
Student Management Form in Visual Basic
The following code implements a student records form in Visual Basic, including navigation between forms, database operations, and a password login.
Closing the Form
Private Sub btncerrar_Click()
c = MsgBox("Do you really want to quit?", vbYesNo, "Close")
If c = vbYes Then
frmmenuprincipal.Show
frmestudiantes.Hide
End If
End Sub
Creating a New Record
Private Sub btnnuevo_Click()
Call New
End Sub
Private Sub New()
Data1.Recordset.AddNew
Call habilitarcajas
btnnuevo.Enabled = False
btnguardar.Enabled = True
btnbuscar.Enabled = True
btneliminar.Enabled = True
btncerrar.Enabled = True
mnunuevo.Enabled...