Project 2 Programming - Theory
Project 2 Programming - Theory
Task: Read these examples, in groups try to analyze and understand them.w
Imagine you're developing a personal task management app. You should design a model
that represents the tasks, their properties, and the interactions between them.
+--------------------+
| Task|
+--------------------+
| - Title|
| - Description|
| - Creation date. |
| -Expiration Date. |
| - Priority|
| - State|
+--------------------+
5. Translation to code:
You can implement the Task class in a programming language such as Python:
class Tarea:
self.titulo = titulo
self.descripcion = descripcion
self.fecha_creacion = fecha_creacion
self.fecha_vencimiento = fecha_vencimiento
self.prioridad = prioridad
self.estado = estado
7. Maintenance:
As you develop more functionalities, you could add the ability to filter and sort
tasks, set reminders, etc..
Let's say you're designing a management system for a library. You want to model the
reality of how book lending and collection management work.
- Properties: Book Title, Author, User Name, Loan Date, Return Date, Loan Duration,
etc..
- Relationships: A book can be lent to several users, a user can borrow several books, a
loan is associated with a book and a user, etc..
2. Abstraction:
- Simplify the physical details of the library, such as its architectural design.
- No need to model the exact physical location of each book on the shelves.
3. Defining relationships:
4. Model design:
You can create a class diagram that represents entities and their relationships. Here is a
simplified version:
| | | - Book| | |
+----------------+
5. Traducción a código:
class Libro:
self.titulo = titulo
self.autor = autor
class Usuario:
self.nombre = nombre
self.id = id
class Prestamo:
self.libro = libro
self.usuario = usuario
self.fecha_inicio = fecha_inicio
self.fecha_fin = fecha_fin
Instantiate classes, make loans, repayments, and make sure date calculations are
correct.
7. Mantenimiento:
As the system evolves, you could add features like expiration notifications, loan
history, etc..
Let's consider the task of creating a weather forecasting application. You want to
model the real-world aspects of weather data and provide accurate predictions.
5. Translation to Code:
class Location:
self.latitude = latitude
self.longitude = longitude
class WeatherData:
self.humidity = humidity
self.wind_speed = wind_speed
self.forecast_date = forecast_date
self.weather_data = weather_data
Create instances of the classes, simulate weather data, and verify that forecasts are
generated accurately.
7. Maintenance:
As the application evolves, you could integrate external data sources, refine prediction
algorithms, and enhance user interactions.
Task: (In groups) We are going to organize a running race and we need you to represent the
problem through reality modeling. Try to do it following the same steps as in the previous
examples.
Task: (In groups) Represent a problem of your choice through reality modeling. Try to do it
following the same steps as in the previous examples.
Task: Create a table with the common symbols of flowcharts and their meaning. Resource:
https://es.wikipedia.org/wiki/Diagrama_de_flujo
Imagine you're developing a mobile app to help users track their daily spending. You
should create a flowchart that models the logic behind the expense entry and totals
calculation.
Design a flowchart that allows users to enter a list of expenses and then calculate and
display the total expenses.
2. Requirements:
o Users can enter multiple expenses in the form of positive
numbers.
o The expense entry process should be repeatable and finished when the
user decides.
o After the expense entry is complete, the application must calculate and
display the cumulative total.
o If the total expenses exceed a certain threshold (for example, $100),
display a warning message.
3. Suggested Steps:
Display a welcome message.
o Set the total expense variable to 0.
o Start a loop for expense entry:
o Ask the user to enter an expense.
o Add the expense to the cumulative total.
o Ask the user if they want to enter another expense.
o Check if the total expenses exceed the established threshold. If so,
display a warning message.
Show the cumulative total of expenses and a farewell message.
4. Flowchart Design:
Design a flowchart that represents the steps mentioned above. Use symbols such as
rectangles for processes, diamonds for decisions, and arrows to indicate the sequence
of actions.
Sesión 3 Sostenibilidad e inclusión como requisitos del diseño del software. (ampliación de 1º
Bach)
Task: Read this text, create a diagram and prepare a presentation in group about it. Each group
will present one section:
Sustainability and Inclusion as Software Design Requirements
Sustainability and inclusion are two critical aspects that should be considered as fundamental
requirements in software design. These elements ensure that technological solutions are
beneficial for both the environment and a wide range of users. Here's a description of how
these requirements can be incorporated into software design:
1. Sustainability:
2. Inclusion:
Inclusion in software design involves creating solutions that are accessible and useful for a
wide range of users, including individuals with disabilities and diverse abilities. Some important
guidelines are:
- Accessibility: Designing user interfaces that are easy to use for individuals with visual,
auditory, cognitive, and motor disabilities.
- User Diversity: Considering the needs of different user groups, cultures, and contexts to
ensure that the software is useful for everyone.
- Universal Design: Creating solutions that are intuitive and effective for the majority of
users, minimizing the need for specific adaptations.
- Accessibility Testing: Conducting regular tests to ensure that the software complies with
recognized accessibility standards.
- Incorporating Feedback: Listening to and responding to user feedback to improve the
experience and address unmet needs.
Task: Read this text, create a diagram and prepare a presentation in group about it. Each group
will present one section:
Programming Languages, Objects, and Events
In the realm of programming, the concepts of programming languages, objects, and events are
fundamental for creating efficient software with interactive functionalities. Here is a
description of each of these concepts:
1. Programming Languages:
2. Objects:
Objects are fundamental elements in object-oriented programming (OOP), which is a
programming paradigm that focuses on organizing code into coherent units called "objects."
Each object is an instance of a class, which is a template or definition that describes the
properties (attributes) and behaviors (methods) the object will have. Objects allow effective
modeling of real-world entities in code and promote reusability and modularity.
3. Events:
Events are occurrences that happen within a software program, such as mouse clicks, key
presses, or changes in data. Events can be generated by the user or the system and trigger
specific responses in the program. Programming languages and environments often provide
mechanisms for detecting and handling events. Event-driven programming is common in
interactive applications, such as graphical user interfaces and web applications.
Example of Objects and Events Usage: In a drawing application, you might have objects like
"line" and "circle," which are instances of the "Shape" class. Then, you can register events like
"mouse click" on the graphical interface, and when these events occur, create and display a
new instance of "line" or "circle" at the clicked position.
These concepts are essential to understanding how modern applications and software systems
are built. Programming languages allow writing instructions, objects allow modeling entities,
and event-based programming enables dynamic interaction between the user and the
software.
In the realm of programming, there are two primary categories of programming languages:
compiled languages and interpreted languages. Here's an explanation of each:
1. Compiled Languages:
Compiled languages are programming languages that are translated entirely into machine
code or a lower-level intermediate code by a compiler before being executed. A compiler is a
software tool that takes the entire source code of a program and converts it into an executable
file, which can be run directly by the computer's hardware. Examples of compiled languages
include C, C++, and Rust.
2. Interpreted Languages:
Interpreted languages are programming languages that are executed line by line by an
interpreter at runtime. An interpreter reads the source code of a program and executes it
directly, without the need for a separate compilation step. Examples of interpreted languages
include Python, JavaScript, and Ruby.
In recent years, the distinction between compiled and interpreted languages has become less
clear due to the introduction of techniques like Just-In-Time (JIT) compilation, which combines
elements of both approaches. Regardless, understanding these categories is important for
choosing the right language for a given project and understanding how the code will be
executed.
4. Expressions:
Expressions are combinations of constants, variables, operators, and functions that represent
a value. For example, `x + y` is an expression that adds the values of variables `x` and `y`.
5. Control Structures:
Control structures determine the flow of a program. They include conditional statements (if-
else), loops (for, while), and switches that allow the program to make decisions and repeat
tasks.
1. Queries:
Queries are fundamental operations used to retrieve specific data from a database. They
allow you to request information that meets certain criteria, helping you extract relevant
insights from your data. Queries are often written in SQL (Structured Query Language), a
language specifically designed for managing and querying databases.
For example, imagine you have a database of customer information and you want to retrieve
the names and email addresses of all customers who have made a purchase in the last month.
The SQL query for this could look like:
```sql
SELECT first_name, last_name, email
FROM customers
WHERE purchase_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH);
```
This query selects the first name, last name, and email of customers from the "customers"
table where the purchase date is within the last month.
2. Inserts:
Insert operations involve adding new data into a database. They are used when you have
new records or information that you want to include in your dataset. Insert operations help
you populate your database with fresh data.
Continuing the customer example, if a new customer named "Sarah" with email
"[email protected]" signs up, you could add her information to the "customers" table using
an SQL insert statement:
```sql
INSERT INTO customers (first_name, last_name, email)
VALUES ('Sarah', 'Smith', '[email protected]');
```
This SQL statement adds a new record with Sarah's information to the "customers" table.
3. Updates:
Update operations are used to modify existing data in a database. They allow you to make
changes to specific records or fields, ensuring your data stays accurate and up-to-date.
Imagine you have an "inventory" table with product information, including product names
and quantities. If you receive a new shipment of 50 units for the product with ID 123, you
could update the quantity in the database:
```sql
UPDATE inventory
SET quantity = quantity + 50
WHERE product_id = 123;
```
This SQL update statement increases the quantity of product ID 123 by 50 units in the
"inventory" table.
In summary, basic database operations include queries to retrieve information, inserts to add
new data, and updates to modify existing data. These operations are essential for managing
and maintaining the integrity of data in a database, enabling effective data-driven decision-
making and application functionality.
Task: Search a video tutorial of how to install “Visual Studio Code with Python” and create
document with the steps (including screenshots) to do it
Task: In groups, create a presentation of the basic use of Visual Studio Code and its features.
We will share our findings.
"Optimization and maintenance of software" refers to the ongoing processes of improving the
performance, efficiency, and functionality of software applications, as well as ensuring their
continued operation and support over time. This involves refining the code, enhancing features,
fixing bugs, and addressing evolving needs. Here's a breakdown of these two aspects:
1. Optimization:
Optimization involves making a software application run more efficiently and effectively. This
can include improving the speed at which the software executes, reducing memory usage, and
optimizing algorithms for better performance. Optimization aims to enhance user experience,
reduce resource consumption, and make the software more responsive.
- Code Optimization: Identifying and modifying code sections that are resource-intensive,
redundant, or inefficient to improve execution speed.
- Algorithm Optimization: Refining algorithms to make them faster or require fewer
resources for the same task.
- Database Optimization: Tuning databases to perform queries and updates more efficiently,
improving overall application speed.
- Memory Management: Efficiently managing memory usage to prevent memory leaks and
improve system stability.
2. Maintenance:
Maintenance involves the continuous care and support of software throughout its lifecycle.
This includes addressing issues that arise post-launch, ensuring compatibility with new
technologies, and adapting to changing user requirements.
- Bug Fixes: Identifying and resolving errors (bugs) that users encounter during software
usage.
- Updates and Enhancements: Adding new features, improvements, or optimizations to keep
the software relevant and competitive.
- Security Updates: Patching vulnerabilities to protect the software from security threats.
- Compatibility: Ensuring that the software works correctly with new operating system
versions, browsers, or hardware.
- User Support: Providing assistance to users, addressing their inquiries, and helping them
resolve issues.
Optimization and maintenance are integral to the life cycle of software applications.
Optimizing software ensures that it performs well and efficiently, while ongoing maintenance
ensures that the software remains functional, secure, and aligned with changing user needs
and technological advancements. Both aspects contribute to the longevity and effectiveness of
software in meeting its intended purposes.
Sesión 8
Propiedad intelectual. Tipos de derechos, duración, límites a los derechos de autoría y licencias
de distribución y explotación. (ampliación de 1º Bach)
Importancia de la computación en el desarrollo igualitario de la sociedad. Sesgos en los
algoritmos. (ampliación de 1º Bach)
Task: Read this text, make a diagram and do a presentation in group:
Intellectual Property. Types of Rights, Duration, Limits to Copyright, and Distribution and
Exploitation Licenses
Intellectual Property (IP): Intellectual Property refers to creations of the mind, such as
inventions, literary and artistic works, designs, symbols, names, and images used in commerce.
IP is protected by laws, granting creators exclusive rights over their creations, which typically
include the right to use, distribute, and profit from them.
Types of Rights:
- Copyright: Protects original literary, artistic, and intellectual works. It grants creators the
exclusive right to reproduce, distribute, perform, and display their work.
- Patents: Protect inventions, granting the inventor exclusive rights to make, use, and sell the
invention for a specific period.
- Trademarks: Protect symbols, names, and slogans used to identify goods and services,
preventing confusion with others' products.
- Copyright: Generally lasts for the creator's lifetime plus a certain number of years (varying by
jurisdiction).
- Patents: Typically last for 20 years from the filing date of the patent application.
- Trademarks: Can be renewed indefinitely as long as they are actively used and maintained.
Limits to Copyright:
Copyright protection is not absolute and has limitations, including "fair use" exceptions that
allow limited use of copyrighted material for purposes like education, commentary, or
criticism.
Creators can license their intellectual property to others for distribution and exploitation under
specific terms. Licenses can grant various rights, such as the right to use, modify, distribute, or
sell the work. Licensing agreements outline the conditions and limitations of use.
Distribution Licenses:
Distribution licenses specify how software can be distributed to other parties. They outline
whether the software can be freely shared, sold, or redistributed. Some common types of
distribution licenses include:
- Open Source Licenses: These licenses allow developers to access, modify, and distribute the
source code of the software. Examples include the GNU General Public License (GPL) and the
MIT License.
- Proprietary Licenses: Proprietary licenses restrict how the software can be distributed. They
may require users to purchase a license or obtain permission from the copyright holder to
distribute the software.
Exploitation Licenses:
Exploitation licenses pertain to how the software can be commercially used or exploited. These
licenses may cover aspects such as:
- Commercial Use: Whether the software can be used for commercial purposes, such as in a
business environment, or if it's restricted to non-commercial use.
- Derivative Works: Whether users can create modified versions or derivative works of the
software and distribute them.
- Resale: Whether users can sell the software to others, and if so, under what conditions.
Examples:
- GPL (General Public License): This is an open-source license that allows users to freely use,
modify, and distribute software covered by the GPL. However, if modified versions are
distributed, they must also be open source under the GPL.
- Proprietary Software License: A proprietary software license might allow users to install and
use the software on a limited number of computers within their organization, but it prohibits
distribution to others.
- Creative Commons Licenses: These licenses apply to creative works like software, images, and
text. They offer a range of permissions, from allowing commercial use to requiring attribution
for the original author.
In summary, distribution and exploitation licenses in programming govern how software can be
shared, used, and commercially exploited. Developers and users must understand and adhere
to these licenses to ensure legal and ethical use of software products.
Sesión 9
Importancia de la computación en el desarrollo igualitario de la sociedad. Sesgos en los
algoritmos. (ampliación de 1º Bach)
Implicaciones éticas del Big Data y la Inteligencia Artificial. (específica de de 2º Bach)
Comunidades de desarrollo de software libre. (específica de 2º Bach)
Task: Read and discuss in groups this text, extract a few ideas and your opinion. And answer
these question:
1. How has computing technology contributed to bridging societal gaps and
promoting equitable development in various areas such as education and
healthcare?
2. Can you think of examples from your own experience or observation where
technology has helped underserved communities access resources and
opportunities?
3. In what ways do biases in algorithms pose challenges to achieving equitable
outcomes in decision-making processes? Can you provide specific instances where
biased algorithms may have unintended consequences?
4. How might the inadvertent biases in algorithms exacerbate existing societal
inequalities? Can you imagine scenarios where these biases lead to unfair
treatment or missed opportunities for certain groups?
5. What strategies and practices can be implemented to address biases in
algorithms and ensure that technological advancements lead to fair and inclusive
outcomes for all individuals, regardless of their background or identity?
Big Data and AI often involve the collection and analysis of massive amounts of personal
data. The ethical concern revolves around how this data is obtained, stored, and used. There's
a need to ensure that individuals' privacy is respected, and their data is protected from
unauthorized access or misuse.
AI algorithms learn from historical data, and if that data contains biases, the algorithms can
inadvertently perpetuate those biases. This raises concerns of unfair treatment and
discrimination based on race, gender, or other characteristics. Ensuring fairness and mitigating
bias becomes crucial to avoid reinforcing societal inequalities.
AI systems, especially complex ones like deep learning neural networks, can be challenging to
understand. Ethical considerations arise when decisions made by AI systems lack transparency.
There's a need to make AI systems more interpretable and to hold organizations accountable
for the outcomes of AI-driven decisions.
4. Autonomy and Human Control:
As AI systems become more sophisticated, there's a concern about the degree of autonomy
these systems should have. Ethical considerations involve determining the extent to which
humans should retain control over AI systems and decisions that impact individuals' lives.
The deployment of AI in industries and workplaces can lead to job displacement, potentially
impacting individuals' livelihoods. The ethical challenge is to manage this transition in a way
that minimizes negative economic consequences and ensures that people have opportunities to
upskill and adapt.
The potential misuse of AI and Big Data for harmful purposes, such as cyberattacks or the
creation of deepfake content, raises ethical concerns. Ensuring robust cybersecurity and
responsible use of AI technology becomes crucial.
In a world where personal data is constantly collected and analyzed, the ethical challenge is
to ensure that individuals provide informed consent and are aware of how their data is being
used. This transparency empowers users to make informed decisions about their digital
interactions.
In conclusion, as Big Data and AI continue to reshape our society, ethical considerations
become increasingly important. Addressing these ethical implications involves developing
guidelines, regulations, and best practices that prioritize the well-being, autonomy, and
fairness of individuals and communities in the era of technological advancement.
1. Shared Goals: Members of these communities share a common goal of creating high-quality
software that is freely available for anyone to use and contribute to. These goals often align
with the principles of transparency, collaboration, and innovation.
4. Licensing: Open-source software is typically distributed under licenses that grant users the
freedom to view, modify, and distribute the code. Different licenses have varying requirements,
such as attributing original authors or sharing modifications under the same license.
6. Version Control and Code Hosting: Version control systems like Git and platforms like
GitHub or GitLab facilitate collaborative development. Developers can contribute changes,
propose improvements, and manage the evolution of the software.
7. Code Reviews and Quality Assurance: Peer review is a common practice in open-source
development. Contributors review each other's code, offering feedback and ensuring code
quality before it's integrated into the project.
9. Global Impact: Open Source Software Communities have a global reach. People from various
countries, backgrounds, and skill levels can participate, contributing to a diverse and inclusive
community.
Prominent examples of open-source communities include the Linux Kernel, the Apache
Software Foundation, Mozilla, and the Python programming language community.