Month 5
Month 5
Month 5
● Weight: 1
● Project over - took place from May 3, 2023 6:00 AM to May 4, 2023 6:00 AM
In a nutshell…
Concepts
For this project, we expect you to look at this concept:
● Regular Expression
Background Context
For this project, you have to build your regular expression using Oniguruma, a regular
expression library that which is used by Ruby by default. Note that other regular expression
libraries sometimes have different properties.
Because the focus of this exercise is to play with regular expressions (regex), here is the
Ruby code that you should use, just replace the regexp part, meaning the code in between
the //:
Resources
Read or watch:
Requirements
General
Quiz questions
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. Simply matching School
mandatory
Requirements:
● The regular expression must match School
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
Example:
Repo:
1. Repetition Token #0
mandatory
● Find the regular expression that will match the above cases
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
Repo:
2. Repetition Token #1
mandatory
● Find the regular expression that will match the above cases
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
Repo:
3. Repetition Token #2
mandatory
● Find the regular expression that will match the above cases
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
Repo:
4. Repetition Token #3
mandatory
● Find the regular expression that will match the above cases
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
● Your regex should not contain square brackets
Repo:
mandatory
● The regular expression must be exactly matching a string that starts with h ends with
n and can have any single character in between
● Using the project instructions, create a Ruby script that accepts one argument and
pass it to a regular expression matching method
Example:
Repo:
6. Call me maybe
mandatory
This task is brought to you by a professional advisor Neha Jain, Senior Software Engineer at
LinkedIn.
Requirement:
Example:
Repo:
mandatory
Example:
Repo:
8. Textme
#advanced
Score: 65.0% (Checks completed: 100.0%)
This exercise was prepared for you by Guillaume Plessis, VP of Infrastructure at TextMe. It is
something he uses daily. You can thank Guillaume for his project on Twitter.
For this task, you’ll be taking over Guillaume’s responsibilities: one afternoon, a TextMe VoIP
Engineer comes to you and explains she wants to run some statistics on the TextMe app text
messages transactions.
Requirements:
Example:
Repo:
● Weight: 1
● Project over - took place from May 3, 2023 6:00 AM to May 5, 2023 6:00 AM
In a nutshell…
Resources
Read or watch:
● OSI model
● Different types of network
● LAN network
● WAN network
● Internet
● MAC address
● What is an IP address
● Private and public address
● IPv4 and IPv6
● Localhost
● TCP and UDP
● TCP/UDP ports List
● What is ping /ICMP
● Positional parameters
man or help:
● netstat
● ping
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
OSI Model
● What it is
● How many layers it has
● How it is organized
What is a LAN
● Typical usage
● Typical geographical size
What is a WAN
● Typical usage
● Typical geographical size
● What is an IP address
● What are the 2 types of IP address
● What is localhost
● What is a subnet
● Why IPv6 was created
TCP/UDP
● What are the 2 mainly used data transfer protocols for IP (transfer level on the OSI schema)
● What is the main difference between TCP and UDP
● What is a port
● Memorize SSH, HTTP and HTTPS port numbers
● What tool/protocol is often used to check if a device is connected to a network
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and pasting
someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
More Info
The second line of all your Bash scripts should be a comment explaining what is the script doing
For multiple choice question type tasks, just type the number of the correct answer in your answer file,
add a new line for every new answer, example:
1. Project manager
2. Backend developer
3. System administrator
Tasks
0. OSI model
mandatory
OSI (Open Systems Interconnection) is an abstract model to describe layered communication and
computer network design. The idea is to segregate the different parts of what make communication
possible.
● The lowest level: layer 1 which is for transmission on physical layers with electrical impulse, light
or radio signal
● The highest level: layer 7 which is for application specific communication like SNMP for emails,
HTTP for your web browser, etc
Keep in mind that the OSI model is a concept, it’s not even tangible. The OSI model doesn’t perform any
functions in the networking process. It is a conceptual framework so we can better understand complex
interactions that are happening. Most of the functionality in the OSI model exists in all communications
systems.
In this project we will mainly focus on:
The image bellow describes more concretely how you can relate to every level.
Questions:
1. Alphabetically
2. From the lowest to the highest level
3. Randomly
Repo:
● GitHub repository: alx-system_engineering-devops
● Directory: 0x07-networking_basics
● File: 0-OSI_model
1. Types of network
mandatory
Questions:
1. Internet
2. WAN
3. LAN
What type of network could connect an office in one building to another office in a building a few streets
away?
1. Internet
2. WAN
3. LAN
What network do you use when you browse www.google.com from your smartphone (not connected to
the Wifi)?
1. Internet
2. WAN
3. LAN
Repo:
● GitHub repository: alx-system_engineering-devops
● Directory: 0x07-networking_basics
● File: 1-types_of_network
mandatory
Questions:
What is a MAC address?
What is an IP address?
Repo:
mandatory
Questions:
Repo:
● GitHub repository: alx-system_engineering-devops
● Directory: 0x07-networking_basics
● File: 3-UDP_and_TCP
mandatory
Once packets have been sent to the right network device using IP using either UDP or TCP as a mode of
transportation, it needs to actually enter the network device.
If we continue the comparison of a network device to your house, where IP address is like your postal
address, UDP and TCP ports are like the windows and doors of your place. A TCP/UDP network device
has 65535 ports. Some of them are officially reserved for a specific usage, some of them are known to be
used for a specific usage (but nothing is officially declared) and the rest are free of use.
While the full list of ports should not be memorized, it is important to know the most used ports, let’s start
by remembering 3 of them:
● 22 for SSH
● 80 for HTTP
● 443 for HTTPS
Note that a specific IP + port = socket.
Example:
Repo:
mandatory
Requirements:
Example:
It is interesting to look at the time value, which is the time that it took for the ICMP request to go to the
8.8.8.8 IP and come back to my host. The IP 8.8.8.8 is owned by Google, and the quickest roundtrip
between my computer and Google was 7.57 ms which is pretty fast, which is a sign that the network path
between my computer and Google’s datacenter is in good shape. A slow ping would indicate a slow
network.
Next time you feel that your connection is slow, try the ping command to see what is going on!
Repo:
● Weight: 1
● Project over - took place from May 3, 2023 6:00 AM to May 5, 2023 6:00 AM
In a nutshell…
Resources
Read or watch:
● What is localhost
● What is 0.0.0.0
● What is the hosts file
● Netcat examples
man or help:
● ifconfig
● telnet
● nc
● cut
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of
Google:
General
● What is localhost/127.0.0.1
● What is 0.0.0.0
● What is /etc/hosts
● How to display your machine’s active network interfaces
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and
pasting someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
Quiz questions
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. Change your home IP
mandatory
Write a Bash script that configures an Ubuntu server with the below requirements.
Requirements:
Example:
● before running the script, localhost resolves to 127.0.0.1 and facebook.com resolves to
157.240.11.35
● after running the script, localhost resolves to 127.0.0.2 and facebook.com resolves to
8.8.8.8
If you’re running this script on a machine that you’ll continue to use, be sure to revert localhost to
127.0.0.1. Otherwise, a lot of things will stop working!
Repo:
mandatory
Write a Bash script that displays all active IPv4 IPs on the machine it’s executed on.
Example:
Obviously, the IPs displayed may be different depending on which machine you are running the
script on.
Repo:
#advanced
Terminal 0
Starting my script.
Terminal 1
Terminal 0
For the sake of the exercise, this connection is made entirely within localhost. This isn’t really
exciting as is, but we can use this script across networks as well. Try running it between your local
PC and your remote server for fun!
As you can see, this can come in very handy in a multitude of situations. Maybe you’re debugging
socket connection issues, or you’re trying to connect to a software and you are unsure if the issue is
the software or the network, or you’re working on firewall rules… Another tool to add to your
debugging toolbox!
Repo:
● By: Guillaume
● Weight: 5
● Manual QA review was done by Damilola Esan on May 19, 2023 11:41 PM
In a nutshell…
● Contribution: 100.0%
● Manual QA review: 48.0/48 mandatory
● Auto QA review: 295.5/302 mandatory & 233.0/233 optional
● Altogether: 196.28%
○ Mandatory: 98.14%
○ Optional: 100.0%
○ Contribution: 100.0%
○ Calculation: 100.0% * (98.14% + (98.14% * 100.0%) ) == 196.28%
Concepts
● Python packages
● AirBnB clone
Background Context
This is the first step towards building your first full web application: the AirBnB clone. This first step is
very important because you will use what you build during this project with all other following projects:
HTML/CSS templating, database storage, API, front-end integration…
● put in place a parent class (called BaseModel) to take care of the initialization, serialization and
deserialization of your future instances
● create a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <->
file
● create all classes used for AirBnB (User, State, City, Place…) that inherit from BaseModel
● create the first abstracted storage engine of the project: File storage.
● create all unittests to validate all our classes and storage engine
Do you remember the Shell? It’s exactly the same but limited to a specific use-case. In our case, we want
to be able to manage the objects of our project:
Resources
Read or watch:
● cmd module
● cmd module in depth
● packages concept page
● uuid module
● datetime
● unittest module
● args/kwargs
● Python test cheatsheet
● cmd module wiki page
● python unittest
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
General
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and pasting
someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
Python Scripts
GitHub
There should be one project repository per group. If you clone/fork/whatever a project repository
with the same name before the second deadline, you risk a 0% score.
More Info
Execution
$ ./console.py
(hbnb) help
(hbnb)
(hbnb)
(hbnb) quit
$
All tests should also pass in non-interactive mode: $ echo "python3 -m unittest discover tests"
| bash
Python: Unittests
Code consistency
Tasks
0. README, AUTHORS
mandatory
● Write a README.md:
○ description of the project
○ description of the command interpreter:
■ how to start it
■ how to use it
■ examples
● You should have an AUTHORS file at the root of your repository, listing all individuals having
contributed content to the repository. For format, reference Docker’s AUTHORS page
● You should use branches and pull requests on GitHub - it will help you as team to organize your
work
Repo:
1. Be pycodestyle compliant!
mandatory
Repo:
2. Unittests
mandatory
All your files, classes, functions must be tested with unit tests
OK
guillaume@ubuntu:~/AirBnB$
Note that this is just an example, the number of tests you create can be different from the above example.
Warning:
OK
guillaume@ubuntu:~/AirBnB$
Repo:
3. BaseModel
mandatory
Write a class BaseModel that defines all common attributes/methods for other classes:
● models/base_model.py
● Public instance attributes:
○ id: string - assign with an uuid when an instance is created:
■ you can use uuid.uuid4() to generate unique id but don’t forget to convert to a
string
■ the goal is to have unique id for each BaseModel
○ created_at: datetime - assign with the current datetime when an instance is created
○ updated_at: datetime - assign with the current datetime when an instance is created and
it will be updated every time you change your object
● __str__: should print: [<class name>] (<self.id>) <self.__dict__>
● Public instance methods:
○ save(self): updates the public instance attribute updated_at with the current datetime
○ to_dict(self): returns a dictionary containing all keys/values of __dict__ of the
instance:
■ by using self.__dict__, only instance attributes set will be returned
■ a key __class__ must be added to this dictionary with the class name of the
object
■ created_at and updated_at must be converted to string object in ISO format:
■ format: %Y-%m-%dT%H:%M:%S.%f (ex: 2017-06-14T22:31:03.285259)
■ you can use isoformat() of datetime object
■ This method will be the first piece of the serialization/deserialization process:
create a dictionary representation with “simple object type” of our BaseModel
my_model = BaseModel()
my_model.name = "My First Model"
my_model.my_number = 89
print(my_model)
my_model.save()
print(my_model)
my_model_json = my_model.to_dict()
print(my_model_json)
print("JSON of my_model:")
for key in my_model_json.keys():
print("\t{}: ({}) - {}".format(key, type(my_model_json[key]),
my_model_json[key]))
guillaume@ubuntu:~/AirBnB$ ./test_base_model.py
[BaseModel] (b6a6e15c-c67d-4312-9a75-9d084935e579) {'my_number': 89, 'name':
'My First Model', 'updated_at': datetime.datetime(2017, 9, 28, 21, 5, 54,
119434), 'id': 'b6a6e15c-c67d-4312-9a75-9d084935e579', 'created_at':
datetime.datetime(2017, 9, 28, 21, 5, 54, 119427)}
[BaseModel] (b6a6e15c-c67d-4312-9a75-9d084935e579) {'my_number': 89, 'name':
'My First Model', 'updated_at': datetime.datetime(2017, 9, 28, 21, 5, 54,
119572), 'id': 'b6a6e15c-c67d-4312-9a75-9d084935e579', 'created_at':
datetime.datetime(2017, 9, 28, 21, 5, 54, 119427)}
{'my_number': 89, 'name': 'My First Model', '__class__': 'BaseModel',
'updated_at': '2017-09-28T21:05:54.119572', 'id':
'b6a6e15c-c67d-4312-9a75-9d084935e579', 'created_at':
'2017-09-28T21:05:54.119427'}
JSON of my_model:
my_number: (<class 'int'>) - 89
name: (<class 'str'>) - My First Model
__class__: (<class 'str'>) - BaseModel
updated_at: (<class 'str'>) - 2017-09-28T21:05:54.119572
id: (<class 'str'>) - b6a6e15c-c67d-4312-9a75-9d084935e579
created_at: (<class 'str'>) - 2017-09-28T21:05:54.119427
guillaume@ubuntu:~/AirBnB$
Repo:
mandatory
<class 'BaseModel'> -> to_dict() -> <class 'dict'> -> <class 'BaseModel'>
Update models/base_model.py:
my_model = BaseModel()
my_model.name = "My_First_Model"
my_model.my_number = 89
print(my_model.id)
print(my_model)
print(type(my_model.created_at))
print("--")
my_model_json = my_model.to_dict()
print(my_model_json)
print("JSON of my_model:")
for key in my_model_json.keys():
print("\t{}: ({}) - {}".format(key, type(my_model_json[key]),
my_model_json[key]))
print("--")
my_new_model = BaseModel(**my_model_json)
print(my_new_model.id)
print(my_new_model)
print(type(my_new_model.created_at))
print("--")
print(my_model is my_new_model)
guillaume@ubuntu:~/AirBnB$ ./test_base_model_dict.py
56d43177-cc5f-4d6c-a0c1-e167f8c27337
[BaseModel] (56d43177-cc5f-4d6c-a0c1-e167f8c27337) {'id':
'56d43177-cc5f-4d6c-a0c1-e167f8c27337', 'created_at': datetime.datetime(2017,
9, 28, 21, 3, 54, 52298), 'my_number': 89, 'updated_at':
datetime.datetime(2017, 9, 28, 21, 3, 54, 52302), 'name': 'My_First_Model'}
<class 'datetime.datetime'>
--
{'id': '56d43177-cc5f-4d6c-a0c1-e167f8c27337', 'created_at':
'2017-09-28T21:03:54.052298', '__class__': 'BaseModel', 'my_number': 89,
'updated_at': '2017-09-28T21:03:54.052302', 'name': 'My_First_Model'}
JSON of my_model:
id: (<class 'str'>) - 56d43177-cc5f-4d6c-a0c1-e167f8c27337
created_at: (<class 'str'>) - 2017-09-28T21:03:54.052298
__class__: (<class 'str'>) - BaseModel
my_number: (<class 'int'>) - 89
updated_at: (<class 'str'>) - 2017-09-28T21:03:54.052302
name: (<class 'str'>) - My_First_Model
--
56d43177-cc5f-4d6c-a0c1-e167f8c27337
[BaseModel] (56d43177-cc5f-4d6c-a0c1-e167f8c27337) {'id':
'56d43177-cc5f-4d6c-a0c1-e167f8c27337', 'created_at': datetime.datetime(2017,
9, 28, 21, 3, 54, 52298), 'my_number': 89, 'updated_at':
datetime.datetime(2017, 9, 28, 21, 3, 54, 52302), 'name': 'My_First_Model'}
<class 'datetime.datetime'>
--
False
guillaume@ubuntu:~/AirBnB$
Repo:
● GitHub repository: AirBnB_clone
● File: models/base_model.py, tests/
mandatory
Now we can recreate a BaseModel from another one by using a dictionary representation:
<class 'BaseModel'> -> to_dict() -> <class 'dict'> -> <class 'BaseModel'>
It’s great but it’s still not persistent: every time you launch the program, you don’t restore all objects
created before… The first way you will see here is to save these objects to a file.
<class 'BaseModel'> -> to_dict() -> <class 'dict'> -> JSON dump -> <class
'str'> -> FILE -> <class 'str'> -> JSON load -> <class 'dict'> -> <class
'BaseModel'>
Magic right?
Terms:
● simple Python data structure: Dictionaries, arrays, number and string. ex: { '12': {
'numbers': [1, 2, 3], 'name': "John" } }
● JSON string representation: String representing a simple data structure in JSON format. ex: '{
"12": { "numbers": [1, 2, 3], "name": "John" } }'
Write a class FileStorage that serializes instances to a JSON file and deserializes JSON file to
instances:
● models/engine/file_storage.py
● Private class attributes:
○ __file_path: string - path to the JSON file (ex: file.json)
○ __objects: dictionary - empty but will store all objects by <class name>.id (ex: to store
a BaseModel object with id=12121212, the key will be BaseModel.12121212)
● Public instance methods:
○ all(self): returns the dictionary __objects
○ new(self, obj): sets in __objects the obj with key <obj class name>.id
○ save(self): serializes __objects to the JSON file (path: __file_path)
○ reload(self): deserializes the JSON file to __objects (only if the JSON file
(__file_path) exists ; otherwise, do nothing. If the file doesn’t exist, no exception should
be raised)
● import file_storage.py
● create the variable storage, an instance of FileStorage
● call reload() method on this variable
Update models/base_model.py: to link your BaseModel to FileStorage by using the variable storage
all_objs = storage.all()
print("-- Reloaded objects --")
for obj_id in all_objs.keys():
obj = all_objs[obj_id]
print(obj)
Repo:
Done? Help Check your code Ask for a new correction Get a sandbox QA Review
6. Console 0.0.1
mandatory
Write a program called console.py that contains the entry point of the command interpreter:
● You must use the module cmd
● Your class definition must be: class HBNBCommand(cmd.Cmd):
● Your command interpreter should implement:
○ quit and EOF to exit the program
○ help (this action is provided by default by cmd but you should keep it updated and
documented as you work through tasks)
○ a custom prompt: (hbnb)
○ an empty line + ENTER shouldn’t execute anything
● Your code should not be executed when imported
Warning:
if __name__ == '__main__':
HBNBCommand().cmdloop()
to make your program executable except when imported. Please don’t add anything around - the Checker
won’t like it otherwise
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) help
(hbnb)
(hbnb) help quit
Quit command to exit the program
(hbnb)
(hbnb)
(hbnb) quit
guillaume@ubuntu:~/AirBnB$
No unittests needed
Repo:
7. Console 0.1
mandatory
● create: Creates a new instance of BaseModel, saves it (to the JSON file) and prints the id. Ex: $
create BaseModel
○ If the class name is missing, print ** class name missing ** (ex: $ create)
○ If the class name doesn’t exist, print ** class doesn't exist ** (ex: $ create
MyModel)
● show: Prints the string representation of an instance based on the class name and id. Ex: $ show
BaseModel 1234-1234-1234.
○ If the class name is missing, print ** class name missing ** (ex: $ show)
○ If the class name doesn’t exist, print ** class doesn't exist ** (ex: $ show
MyModel)
○ If the id is missing, print ** instance id missing ** (ex: $ show BaseModel)
○ If the instance of the class name doesn’t exist for the id, print ** no instance found
** (ex: $ show BaseModel 121212)
● destroy: Deletes an instance based on the class name and id (save the change into the JSON
file). Ex: $ destroy BaseModel 1234-1234-1234.
○ If the class name is missing, print ** class name missing ** (ex: $ destroy)
○ If the class name doesn’t exist, print ** class doesn't exist ** (ex:$ destroy
MyModel)
○ If the id is missing, print ** instance id missing ** (ex: $ destroy BaseModel)
○ If the instance of the class name doesn’t exist for the id, print ** no instance found
** (ex: $ destroy BaseModel 121212)
● all: Prints all string representation of all instances based or not on the class name. Ex: $ all
BaseModel or $ all.
○ The printed result must be a list of strings (like the example below)
○ If the class name doesn’t exist, print ** class doesn't exist ** (ex: $ all
MyModel)
● update: Updates an instance based on the class name and id by adding or updating attribute
(save the change into the JSON file). Ex: $ update BaseModel 1234-1234-1234 email
"aibnb@mail.com".
○ Usage: update <class name> <id> <attribute name> "<attribute value>"
○ Only one attribute can be updated at the time
○ You can assume the attribute name is valid (exists for this model)
○ The attribute value must be casted to the attribute type
○ If the class name is missing, print ** class name missing ** (ex: $ update)
○ If the class name doesn’t exist, print ** class doesn't exist ** (ex: $ update
MyModel)
○ If the id is missing, print ** instance id missing ** (ex: $ update BaseModel)
○ If the instance of the class name doesn’t exist for the id, print ** no instance found
** (ex: $ update BaseModel 121212)
○ If the attribute name is missing, print ** attribute name missing ** (ex: $ update
BaseModel existing-id)
○ If the value for the attribute name doesn’t exist, print ** value missing ** (ex: $
update BaseModel existing-id first_name)
○ All other arguments should not be used (Ex: $ update BaseModel 1234-1234-1234
email "aibnb@mail.com" first_name "Betty" = $ update BaseModel
1234-1234-1234 email "aibnb@mail.com")
○ id, created_at and updated_at cant’ be updated. You can assume they won’t be
passed in the update command
○ Only “simple” arguments can be updated: string, integer and float. You can assume
nobody will try to update list of ids or datetime
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) all MyModel
** class doesn't exist **
(hbnb) show BaseModel
** instance id missing **
(hbnb) show BaseModel My_First_Model
** no instance found **
(hbnb) create BaseModel
49faff9a-6318-451f-87b6-910505c55907
(hbnb) all BaseModel
["[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'created_at':
datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'id':
'49faff9a-6318-451f-87b6-910505c55907', 'updated_at': datetime.datetime(2017,
10, 2, 3, 10, 25, 903300)}"]
(hbnb) show BaseModel 49faff9a-6318-451f-87b6-910505c55907
[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'created_at':
datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'id':
'49faff9a-6318-451f-87b6-910505c55907', 'updated_at': datetime.datetime(2017,
10, 2, 3, 10, 25, 903300)}
(hbnb) destroy
** class name missing **
(hbnb) update BaseModel 49faff9a-6318-451f-87b6-910505c55907 first_name "Betty"
(hbnb) show BaseModel 49faff9a-6318-451f-87b6-910505c55907
[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'first_name': 'Betty',
'id': '49faff9a-6318-451f-87b6-910505c55907', 'created_at':
datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'updated_at':
datetime.datetime(2017, 10, 2, 3, 11, 3, 49401)}
(hbnb) create BaseModel
2dd6ef5c-467c-4f82-9521-a772ea7d84e9
(hbnb) all BaseModel
["[BaseModel] (2dd6ef5c-467c-4f82-9521-a772ea7d84e9) {'id':
'2dd6ef5c-467c-4f82-9521-a772ea7d84e9', 'created_at': datetime.datetime(2017,
10, 2, 3, 11, 23, 639717), 'updated_at': datetime.datetime(2017, 10, 2, 3, 11,
23, 639724)}", "[BaseModel] (49faff9a-6318-451f-87b6-910505c55907)
{'first_name': 'Betty', 'id': '49faff9a-6318-451f-87b6-910505c55907',
'created_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'updated_at':
datetime.datetime(2017, 10, 2, 3, 11, 3, 49401)}"]
(hbnb) destroy BaseModel 49faff9a-6318-451f-87b6-910505c55907
(hbnb) show BaseModel 49faff9a-6318-451f-87b6-910505c55907
** no instance found **
(hbnb)
No unittests needed
Repo:
8. First User
mandatory
Update your command interpreter (console.py) to allow show, create, destroy, update and all used
with User.
all_objs = storage.all()
print("-- Reloaded objects --")
for obj_id in all_objs.keys():
obj = all_objs[obj_id]
print(obj)
Repo:
9. More classes!
mandatory
● State (models/state.py):
○ Public class attributes:
■ name: string - empty string
● City (models/city.py):
○ Public class attributes:
■ state_id: string - empty string: it will be the State.id
■ name: string - empty string
● Amenity (models/amenity.py):
○ Public class attributes:
■ name: string - empty string
● Place (models/place.py):
○ Public class attributes:
■ city_id: string - empty string: it will be the City.id
■ user_id: string - empty string: it will be the User.id
■ name: string - empty string
■ description: string - empty string
■ number_rooms: integer - 0
■ number_bathrooms: integer - 0
■ max_guest: integer - 0
■ price_by_night: integer - 0
■ latitude: float - 0.0
■ longitude: float - 0.0
■ amenity_ids: list of string - empty list: it will be the list of Amenity.id later
● Review (models/review.py):
○ Public class attributes:
■ place_id: string - empty string: it will be the Place.id
■ user_id: string - empty string: it will be the User.id
■ text: string - empty string
Repo:
mandatory
Update FileStorage to manage correctly serialization and deserialization of all our new classes: Place,
State, City, Amenity and Review
Update your command interpreter (console.py) to allow those actions: show, create, destroy, update
and all with all classes created previously.
Repo:
#advanced
Update your command interpreter (console.py) to retrieve all instances of a class by using: <class
name>.all().
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.all()
[[User] (246c227a-d5c1-403d-9bc7-6a47bb9f0f68) {'first_name': 'Betty',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 12, 19,
611352), 'updated_at': datetime.datetime(2017, 9, 28, 21, 12, 19, 611363),
'password': '63a9f0ea7bb98050796b649e85481845', 'email': 'airbnb@mail.com',
'id': '246c227a-d5c1-403d-9bc7-6a47bb9f0f68'}, [User]
(38f22813-2753-4d42-b37c-57a17f1e4f88) {'first_name': 'Betty', 'last_name':
'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 11, 42, 848279),
'updated_at': datetime.datetime(2017, 9, 28, 21, 11, 42, 848291), 'password':
'b9be11166d72e9e3ae7fd407165e4bd2', 'email': 'airbnb@mail.com', 'id':
'38f22813-2753-4d42-b37c-57a17f1e4f88'}]
(hbnb)
No unittests needed
Repo:
● GitHub repository: AirBnB_clone
● File: console.py
#advanced
Update your command interpreter (console.py) to retrieve the number of instances of a class: <class
name>.count().
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.count()
2
(hbnb)
No unittests needed
Repo:
13. Show
#advanced
Update your command interpreter (console.py) to retrieve an instance based on its ID: <class
name>.show(<id>).
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.show("246c227a-d5c1-403d-9bc7-6a47bb9f0f68")
[User] (246c227a-d5c1-403d-9bc7-6a47bb9f0f68) {'first_name': 'Betty',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 12, 19,
611352), 'updated_at': datetime.datetime(2017, 9, 28, 21, 12, 19, 611363),
'password': '63a9f0ea7bb98050796b649e85481845', 'email': 'airbnb@mail.com',
'id': '246c227a-d5c1-403d-9bc7-6a47bb9f0f68'}
(hbnb) User.show("Bar")
** no instance found **
(hbnb)
No unittests needed
Repo:
● GitHub repository: AirBnB_clone
● File: console.py
14. Destroy
#advanced
Update your command interpreter (console.py) to destroy an instance based on his ID: <class
name>.destroy(<id>).
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.count()
2
(hbnb) User.destroy("246c227a-d5c1-403d-9bc7-6a47bb9f0f68")
(hbnb) User.count()
1
(hbnb) User.destroy("Bar")
** no instance found **
(hbnb)
No unittests needed
Repo:
15. Update
#advanced
Update your command interpreter (console.py) to update an instance based on his ID: <class
name>.update(<id>, <attribute name>, <attribute value>).
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.show("38f22813-2753-4d42-b37c-57a17f1e4f88")
[User] (38f22813-2753-4d42-b37c-57a17f1e4f88) {'first_name': 'Betty',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 11, 42,
848279), 'updated_at': datetime.datetime(2017, 9, 28, 21, 11, 42, 848291),
'password': 'b9be11166d72e9e3ae7fd407165e4bd2', 'email': 'airbnb@mail.com',
'id': '38f22813-2753-4d42-b37c-57a17f1e4f88'}
(hbnb)
(hbnb) User.update("38f22813-2753-4d42-b37c-57a17f1e4f88", "first_name",
"John")
(hbnb) User.update("38f22813-2753-4d42-b37c-57a17f1e4f88", "age", 89)
(hbnb)
(hbnb) User.show("38f22813-2753-4d42-b37c-57a17f1e4f88")
[User] (38f22813-2753-4d42-b37c-57a17f1e4f88) {'age': 89, 'first_name': 'John',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 11, 42,
848279), 'updated_at': datetime.datetime(2017, 9, 28, 21, 15, 32, 299055),
'password': 'b9be11166d72e9e3ae7fd407165e4bd2', 'email': 'airbnb@mail.com',
'id': '38f22813-2753-4d42-b37c-57a17f1e4f88'}
(hbnb)
No unittests needed
Repo:
#advanced
Update your command interpreter (console.py) to update an instance based on his ID with a dictionary:
<class name>.update(<id>, <dictionary representation>).
Errors management must be the same as previously.
guillaume@ubuntu:~/AirBnB$ ./console.py
(hbnb) User.show("38f22813-2753-4d42-b37c-57a17f1e4f88")
[User] (38f22813-2753-4d42-b37c-57a17f1e4f88) {'age': 23, 'first_name': 'Bob',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 11, 42,
848279), 'updated_at': datetime.datetime(2017, 9, 28, 21, 15, 32, 299055),
'password': 'b9be11166d72e9e3ae7fd407165e4bd2', 'email': 'airbnb@mail.com',
'id': '38f22813-2753-4d42-b37c-57a17f1e4f88'}
(hbnb)
(hbnb) User.update("38f22813-2753-4d42-b37c-57a17f1e4f88", {'first_name':
"John", "age": 89})
(hbnb)
(hbnb) User.show("38f22813-2753-4d42-b37c-57a17f1e4f88")
[User] (38f22813-2753-4d42-b37c-57a17f1e4f88) {'age': 89, 'first_name': 'John',
'last_name': 'Bar', 'created_at': datetime.datetime(2017, 9, 28, 21, 11, 42,
848279), 'updated_at': datetime.datetime(2017, 9, 28, 21, 17, 10, 788143),
'password': 'b9be11166d72e9e3ae7fd407165e4bd2', 'email': 'airbnb@mail.com',
'id': '38f22813-2753-4d42-b37c-57a17f1e4f88'}
(hbnb)
No unittests needed
Repo:
For testing the console, you should “intercept” STDOUT of it, we highly recommend you to use:
Otherwise, you will have to re-write the console by replacing precmd by default.
Repo:
● By: Guillaume
● Weight: 1
● Project over - took place from May 15, 2023 6:00 AM to May 29, 2023 6:00 AM
In a nutshell…
Background Context
Fix my code is a new type of project, where we’ll jump into an existing code base and fix it!
Please download the repository 0x00-Fix_My_Code_Challenge and use it as initial files for all solutions.
This project is NOT mandatory at all. It is 100% optional. Doing any part of this project will add a project
grade of over 100% to your average. Your score won’t get hurt if you don’t do it, but if your current
average is greater than your score on this project, your average might go down. Have fun!
Requirements
General
Tasks
0. FizzBuzz
#advanced
$ ./0-fizzbuzz.py 50
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz 16 17 Fizz 19 Buzz Fizz
22 23 Fizz Buzz 26 Fizz 28 29 Fizz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41
Fizz 43 44 Fizz 46 47 Fizz 49 Buzz
$
15 should print FizzBuzz not Fizz
Repo:
1. Print square
#advanced
$ ./1-print_square.js 4
####
####
####
####
$ ./1-print_square.js 10
################
################
################
################
################
################
################
################
################
################
################
################
################
################
################
################
$
Repo:
2. Sort
#advanced
Score: 100.0% (Checks completed: 100.0%)
Repo:
3. User password
#advanced
$ ./3-user.py
Test User
is_valid_password should return True if it's the right password
$
Repo:
Repo:
● GitHub repository: Fix_My_Code_Challenge
● Directory: 0x00-challenge
● File: 4-delete_dnodeint/
● By: Guillaume
● Weight: 1
● Project over - took place from May 16, 2023 6:00 AM to May 17, 2023 6:00 AM
In a nutshell…
Concepts
● Databases
● Databases
Resources
Read or watch:
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of
Google:
General
● What’s a database
● What’s a relational database
● What does SQL stand for
● What’s MySQL
● How to create a database in MySQL
● What does DDL and DML stand for
● How to CREATE or ALTER a table
● How to SELECT data from a table
● How to INSERT, UPDATE or DELETE data
● What are subqueries
● How to use MySQL functions
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and
pasting someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
More Info
Comments for your SQL file:
$ cat my_script.sql
-- 3 first students in the Batch ID=3
-- because Batch 3 is the best!
SELECT id, name FROM students WHERE batch_id = 3 ORDER BY created_at DESC LIMIT
3;
$
$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> quit
Bye
$
Quiz questions
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. List databases
mandatory
Repo:
1. Create a database
mandatory
Write a script that creates the database hbtn_0c_0 in your MySQL server.
● If the database hbtn_0c_0 already exists, your script should not fail
● You are not allowed to use the SELECT or SHOW statements
Repo:
2. Delete a database
mandatory
● If the database hbtn_0c_0 doesn’t exist, your script should not fail
● You are not allowed to use the SELECT or SHOW statements
Repo:
3. List tables
mandatory
Write a script that lists all the tables of a database in your MySQL server.
● The database name will be passed as argument of mysql command (in the following
example: mysql is the name of the database)
Repo:
4. First table
mandatory
Write a script that creates a table called first_table in the current database in your MySQL
server.
● first_table description:
○ id INT
○ name VARCHAR(256)
● The database name will be passed as an argument of the mysql command
● If the table first_table already exists, your script should not fail
● You are not allowed to use the SELECT or SHOW statements
Repo:
5. Full description
mandatory
Repo:
mandatory
Repo:
7. First add
mandatory
● New row:
○ id = 89
○ name = Best School
● The database name will be passed as an argument of the mysql command
Repo:
8. Count 89
mandatory
Write a script that displays the number of records with id = 89 in the table first_table of the
database hbtn_0c_0 in your MySQL server.
Repo:
9. Full creation
mandatory
Write a script that creates a table second_table in the database hbtn_0c_0 in your MySQL server
and add multiples rows.
● second_table description:
○ id INT
○ name VARCHAR(256)
○ score INT
● The database name will be passed as an argument to the mysql command
● If the table second_table already exists, your script should not fail
● You are not allowed to use the SELECT and SHOW statements
● Your script should create these records:
○ id = 1, name = “John”, score = 10
○ id = 2, name = “Alex”, score = 3
○ id = 3, name = “Bob”, score = 14
○ id = 4, name = “George”, score = 8
mandatory
Write a script that lists all records of the table second_table of the database hbtn_0c_0 in your
MySQL server.
● Results should display both the score and the name (in this order)
● Records should be ordered by score (top first)
● The database name will be passed as an argument of the mysql command
Repo:
mandatory
Write a script that lists all records with a score >= 10 in the table second_table of the database
hbtn_0c_0 in your MySQL server.
● Results should display both the score and the name (in this order)
● Records should be ordered by score (top first)
● The database name will be passed as an argument of the mysql command
Repo:
mandatory
Write a script that updates the score of Bob to 10 in the table second_table.
● You are not allowed to use Bob’s id value, only the name field
● The database name will be passed as an argument of the mysql command
guillaume@ubuntu:~/$ cat 12-no_cheating.sql | mysql -hlocalhost -uroot -p
hbtn_0c_0
Enter password:
guillaume@ubuntu:~/$ cat 10-top_score.sql | mysql -hlocalhost -uroot -p
hbtn_0c_0
Enter password:
score name
10 John
10 Bob
8 George
3 Alex
guillaume@ubuntu:~/$
Repo:
mandatory
Write a script that removes all records with a score <= 5 in the table second_table of the
database hbtn_0c_0 in your MySQL server.
● The database name will be passed as an argument of the mysql command
Repo:
14. Average
mandatory
Repo:
mandatory
Repo:
mandatory
Score: 65.0% (Checks completed: 100.0%)
Write a script that lists all records of the table second_table of the database hbtn_0c_0 in your
MySQL server.
In this example, new data have been added to the table second_table.
Repo:
#advanced
Write a script that converts hbtn_0c_0 database to UTF8 (utf8mb4, collate utf8mb4_unicode_ci)
in your MySQL server.
● Database hbtn_0c_0
● Table first_table
● Field name in first_table
Repo:
● GitHub repository: alx-higher_level_programming
● Directory: 0x0D-SQL_introduction
● File: 100-move_to_utf8.sql
18. Temperatures #0
#advanced
Write a script that displays the average temperature (Fahrenheit) by city ordered by temperature
(descending).
Repo:
19. Temperatures #1
#advanced
Import in hbtn_0c_0 database this table dump: download (same as Temperatures #0)
Write a script that displays the top 3 of cities temperature during July and August ordered by
temperature (descending)
Repo:
20. Temperatures #2
#advanced
Import in hbtn_0c_0 database this table dump: download (same as Temperatures #0)
Write a script that displays the max temperature of each state (ordered by State name).
Repo:
● By: Guillaume
● Weight: 1
● Project over - took place from May 17, 2023 6:00 AM to May 18, 2023 6:00 AM
In a nutshell…
● Auto QA review: 58.5/104 mandatory & 15.6/24 optional
● Altogether: 92.81%
○ Mandatory: 56.25%
○ Optional: 65.0%
○ Calculation: 56.25% + (56.25% * 65.0%) == 92.81%
Resources
Read or watch:
● Design
● Normalization
● ER Modeling
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
General
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and pasting
someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
More Info
$ cat my_script.sql
-- 3 first students in the Batch ID=3
-- because Batch 3 is the best!
SELECT id, name FROM students WHERE batch_id = 3 ORDER BY created_at DESC LIMIT
3;
$
$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> quit
Bye
$
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. My privileges!
mandatory
Repo:
1. Root user
mandatory
Repo:
Done? Help Check your code Ask for a new correction Get a sandbox QA Review
2. Read user
mandatory
Write a script that creates the database hbtn_0d_2 and the user user_0d_2.
Repo:
Done? Help Check your code Ask for a new correction Get a sandbox QA Review
3. Always a name
mandatory
Write a script that creates the table force_name on your MySQL server.
● force_name description:
○ id INT
○ name VARCHAR(256) can’t be null
● The database name will be passed as an argument of the mysql command
● If the table force_name already exists, your script should not fail
Repo:
4. ID can't be null
mandatory
Write a script that creates the table id_not_null on your MySQL server.
● id_not_null description:
○ id INT with the default value 1
○ name VARCHAR(256)
● The database name will be passed as an argument of the mysql command
● If the table id_not_null already exists, your script should not fail
Repo:
mandatory
Write a script that creates the table unique_id on your MySQL server.
● unique_id description:
○ id INT with the default value 1 and must be unique
○ name VARCHAR(256)
● The database name will be passed as an argument of the mysql command
● If the table unique_id already exists, your script should not fail
6. States table
mandatory
Write a script that creates the database hbtn_0d_usa and the table states (in the database
hbtn_0d_usa) on your MySQL server.
● states description:
○ id INT unique, auto generated, can’t be null and is a primary key
○ name VARCHAR(256) can’t be null
● If the database hbtn_0d_usa already exists, your script should not fail
● If the table states already exists, your script should not fail
Repo:
7. Cities table
mandatory
Write a script that creates the database hbtn_0d_usa and the table cities (in the database
hbtn_0d_usa) on your MySQL server.
● cities description:
○ id INT unique, auto generated, can’t be null and is a primary key
○ state_id INT, can’t be null and must be a FOREIGN KEY that references to id of the
states table
○ name VARCHAR(256) can’t be null
● If the database hbtn_0d_usa already exists, your script should not fail
● If the table cities already exists, your script should not fail
Repo:
mandatory
Write a script that lists all the cities of California that can be found in the database hbtn_0d_usa.
● The states table contains only one record where name = California (but the id can be
different, as per the example)
● Results must be sorted in ascending order by cities.id
● You are not allowed to use the JOIN keyword
● The database name will be passed as an argument of the mysql command
Repo:
9. Cities by States
mandatory
Write a script that lists all cities contained in the database hbtn_0d_usa.
Repo:
mandatory
Import the database dump from hbtn_0d_tvshows to your MySQL server: download
Write a script that lists all shows contained in hbtn_0d_tvshows that have at least one genre linked.
Repo:
mandatory
Import the database dump of hbtn_0d_tvshows to your MySQL server: download (same as
10-genre_id_by_show.sql)
Write a script that lists all shows contained in the database hbtn_0d_tvshows.
● Each record should display: tv_shows.title - tv_show_genres.genre_id
● Results must be sorted in ascending order by tv_shows.title and tv_show_genres.genre_id
● If a show doesn’t have a genre, display NULL
● You can use only one SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
12. No genre
mandatory
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
11-genre_id_all_shows.sql)
Write a script that lists all shows contained in hbtn_0d_tvshows without a genre linked.
Repo:
● GitHub repository: alx-higher_level_programming
● Directory: 0x0E-SQL_more_queries
● File: 12-no_genre.sql
Done? Help Check your code Ask for a new correction Get a sandbox QA Review
mandatory
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
12-no_genre.sql)
Write a script that lists all genres from hbtn_0d_tvshows and displays the number of shows linked to
each.
● Each record should display: <TV Show genre> - <Number of shows linked to this genre>
● First column must be called genre
● Second column must be called number_of_shows
● Don’t display a genre that doesn’t have any shows linked
● Results must be sorted in descending order by the number of shows linked
● You can use only one SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
14. My genres
mandatory
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
13-count_shows_by_genre.sql)
Write a script that uses the hbtn_0d_tvshows database to lists all genres of the show Dexter.
● The tv_shows table contains only one record where title = Dexter (but the id can be different)
● Each record should display: tv_genres.name
● Results must be sorted in ascending order by the genre name
● You can use only one SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
mandatory
Score: 65.0% (Checks completed: 100.0%)
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
14-my_genres.sql)
Write a script that lists all Comedy shows in the database hbtn_0d_tvshows.
● The tv_genres table contains only one record where name = Comedy (but the id can be different)
● Each record should display: tv_shows.title
● Results must be sorted in ascending order by the show title
● You can use only one SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
mandatory
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
15-comedy_only.sql)
Write a script that lists all shows, and all genres linked to that show, from the database
hbtn_0d_tvshows.
Repo:
#advanced
Write a script that uses the hbtn_0d_tvshows database to list all genres not linked to the show Dexter
● The tv_shows table contains only one record where title = Dexter (but the id can be different)
● Each record should display: tv_genres.name
● Results must be sorted in ascending order by the genre name
● You can use a maximum of two SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
Import the database dump from hbtn_0d_tvshows to your MySQL server: download (same as
100-not_my_genres.sql)
Write a script that lists all shows without the genre Comedy in the database hbtn_0d_tvshows.
● The tv_genres table contains only one record where name = Comedy (but the id can be different)
● Each record should display: tv_shows.title
● Results must be sorted in ascending order by the show title
● You can use a maximum of two SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
● GitHub repository: alx-higher_level_programming
● Directory: 0x0E-SQL_more_queries
● File: 101-not_a_comedy.sql
#advanced
Write a script that lists all shows from hbtn_0d_tvshows_rate by their rating.
Repo:
#advanced
Import the database dump from hbtn_0d_tvshows_rate to your MySQL server: download (same as
102-rating_shows.sql)
Write a script that lists all genres in the database hbtn_0d_tvshows_rate by their rating.
● Each record should display: tv_genres.name - rating sum
● Results must be sorted in descending order by their rating
● You can use only one SELECT statement
● The database name will be passed as an argument of the mysql command
Repo:
● Weight: 1
● Project over - took place from May 18, 2023 6:00 AM to May 23, 2023 6:00 AM
● Manual QA review was done by Abel Udo on May 22, 2023 11:50 PM
In a nutshell…
Concepts
● HTML/CSS
● The trinity of front-end quality
Background Context
Now that you have a command interpreter for managing your AirBnB objects, it’s time to make them alive!
Before developing a big and complex web application, we will build the front end step-by-step.
During this project, you will learn how to manipulate HTML and CSS languages. HTML is the structure of
your page, it should be the first thing to write. CSS is the styling of your page, the design. I really
encourage you to fix your HTML part before starting the styling. Indeed, without any structure, you can’t
apply any design.
Before starting, please fork or clone the repository AirBnB_clone from your partner if you were not the
owner of the previous project.
Resources
Read or watch:
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
General
● What is HTML
● How to create an HTML page
● What is a markup language
● What is the DOM
● What is an element / tag
● What is an attribute
● How does the browser load a webpage
● What is CSS
● How to add style to an element
● What is a class
● What is a selector
● How to compute CSS Specificity Value
● What are Box properties in CSS
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and pasting
someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
More Info
Quiz questions
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. Inline styling
mandatory
● Body:
○ no margin
○ no padding
● Header:
○ color #FF0000 (red)
○ height: 70px
○ width: 100%
● Footer:
○ color #00FF00 (green)
○ height: 60px
○ width: 100%
○ text Best School center vertically and horizontally
○ always at the bottom at the page
Requirements:
1. Head styling
mandatory
Score: 100.0% (Checks completed: 100.0%)
Write an HTML page that displays a header and a footer by using the style tag in the head tag (same as
0-index.html)
Requirements:
Repo:
2. CSS files
mandatory
Score: 100.0% (Checks completed: 100.0%)
Write an HTML page that displays a header and a footer by using CSS files (same as 1-index.html)
Requirements:
Repo:
3. Zoning done!
mandatory
Write an HTML page that displays a header and footer by using CSS files (same as 2-index.html)
Layout:
● Common:
○ no margin
○ no padding
○ font color: #484848
○ font size: 14px
○ font family: Circular,"Helvetica Neue",Helvetica,Arial,sans-serif;
○ icon in the browser tab
● Header:
○ color: white
○ height: 70px
○ width: 100%
○ border bottom 1px #CCCCCC
○ logo align on left and center vertically (20px space at the left)
● Footer:
○ color white
○ height: 60px
○ width: 100%
○ border top 1px #CCCCCC
○ text Best School center vertically and horizontally
○ always at the bottom at the page
Requirements:
● No inline style
● You are not allowed to use the img tag
● You are not allowed to use the style tag in the head tag
● All images must be stored in the images folder
● You must have 3 CSS files:
○ styles/3-common.css: for the global style (i.e body style)
○ styles/3-header.css: for the header style
○ styles/3-footer.css: for the footer style
Repo:
4. Search!
mandatory
Write an HTML page that displays a header, footer and a filters box with a search button.
● Container:
○ between header and footer tags, add a div:
■ classname: container
■ max width 1000px
■ margin top and bottom 30px - it should be 30px under the bottom of the header
(screenshot)
■ center horizontally
● Filter section:
○ tag section
○ classname filters
○ inside the .container
○ color white
○ height: 70px
○ width: 100% of the container
○ border 1px #DDDDDD with radius 4px
● Button search:
○ tag button
○ text Search
○ font size: 18px
○ inside the section filters
○ background color #FF5A5F
○ text color #FFFFFF
○ height: 48px
○ width: 20% of the section filters
○ no borders
○ border radius: 4px
○ center vertically and at 30px of the right border
○ change opacity to 90% when the mouse is on the button
Requirements:
5. More filters
mandatory
Score: 100.0% (Checks completed: 100.0%)
Write an HTML page that displays a header, footer and a filters box.
Requirements:
Repo:
mandatory
Write an HTML page that displays a header, footer and a filters box with dropdown.
● Update Locations and Amenities filters to display a contextual dropdown when the mouse is on
the filter div:
○ tag ul
○ classname popover
○ text should be fake now
○ inside each div
○ not displayed by default
○ color #FAFAFA
○ width same as the div filter
○ border #DDDDDD 1px with border radius 4px
○ no list display
○ Location filter has 2 levels of ul/li:
■ state -> cities
■ state name must be display in a h2 tag (font size 16px)
Requirements:
● You must use: header, footer, section, button, h3, h4, ul, li tags
● No inline style
● You are not allowed to use the img tag
● You are not allowed to use the style tag in the head tag
● All images must be stored in the images folder
● You must have 4 CSS files:
○ styles/4-common.css: for the global style (body and .container styles)
○ styles/3-header.css: for the header style
○ styles/3-footer.css: for the footer style
○ styles/6-filters.css: for the filters style
Repo:
7. Display results
mandatory
Write an HTML page that displays a header, footer, a filters box with dropdown and results.
Requirements:
● You must use: header, footer, section, article, button, h1, h2, h3, h4, ul, li tags
● No inline style
● You are not allowed to use the img tag
● You are not allowed to use the style tag in the head tag
● All images must be stored in the images folder
● You must have 5 CSS files:
○ styles/4-common.css: for the global style (i.e. body and .container styles)
○ styles/3-header.css: for the header style
○ styles/3-footer.css: for footer style
○ styles/6-filters.css: for the filters style
○ styles/7-places.css: for the places style
Repo:
8. More details
mandatory
Score: 100.0% (Checks completed: 100.0%)
Write an HTML page that displays a header, a footer, a filter box (dropdown list) and the result of the
search.
● Price by night:
○ tag: div
○ classname: price_by_night
○ same level as the place name
○ font color: #FF5A5F
○ border: #FF5A5F 4px rounded
○ min width: 60px
○ height: 60px
○ font size: 30px
○ align: the top right (with space)
● Information section:
○ tag: div
○ classname: information
○ height: 80px
○ border: top and bottom #DDDDDD 1px
○ contains (align vertically):
■ Number of guests:
■ tag: div
■ classname: max_guest
■ width: 100px
■ fake text
■ icon
■ Number of bedrooms:
■ tag: div
■ classname: number_rooms
■ width: 100px
■ fake text
■ icon
■ Number of bathrooms:
■ tag: div
■ classname: number_bathrooms
■ width: 100px
■ fake text
■ icon
● User section:
○ tag: div
○ classname: user
○ text Owner: <fake text>
○ Owner text should be in bold
● Description section:
○ tag: div
○ classname: description
Requirements:
● You must use: header, footer, section, article, button, h1, h2, h3, h4, ul, li tags
● No inline style
● You are not allowed to use the img tag
● You are not allowed to use the style tag in the head tag
● All images must be stored in the images folder
● You must have 5 CSS files:
○ styles/4-common.css: for the global style (i.e. body and .container styles)
○ styles/3-header.css: for the header style
○ styles/3-footer.css: for the footer style
○ styles/6-filters.css: for the filters style
○ styles/8-places.css: for the places style
Repo:
9. Full details
#advanced
Score: 100.0% (Checks completed: 100.0%)
Write an HTML page that displays a header, footer, a filters box with dropdown and results.
● List of Amenities:
○ tag div
○ classname amenities
○ margin top 40px
○ contains:
■ title:
■ tag h2
■ text Amenities
■ font size 16px
■ border bottom #DDDDDD 1px
■ list of amenities:
■ tag ul / li
■ no list style
■ icons on the left: Pet friendly, TV, Wifi, etc… feel free to add more
● List of Reviews:
○ tag div
○ classname reviews
○ margin top 40px
○ contains:
■ title:
■ tag h2
■ text Reviews
■ font size 16px
■ border bottom #DDDDDD 1px
■ list of review:
■ tag ul / li
■ no list style
■ a review is described by:
■ h3 tag for the user/date description (font size 14px). Ex: “From
Bob Dylan the 27th January 2017”
■ p tag for the text (font size 12px)
Requirements:
● You must use: header, footer, section, article, button, h1, h2, h3, h4, ul, li tags
● No inline style
● You are not allowed to use the img tag
● You are not allowed to use the style tag in the head tag
● All images must be stored in the images folder
● You must have 5 CSS files:
○ styles/4-common.css: for the global style (body and .container styles)
○ styles/3-header.css: for the header style
○ styles/3-footer.css: for the footer style
○ styles/6-filters.css: for the filters style
○ styles/100-places.css: for the places style
Repo:
10. Flex
#advanced
Score: 84.0% (Checks completed: 100.0%)
Improve the Places section by using Flexible boxes for all Place articles
Flexbox Froggy
Repo:
#advanced
Improve the page by adding responsive design to display correctly in mobile or small screens.
Examples:
● no horizontal scrolling
● redesign search bar depending of the width
● etc.
Repo:
12. Accessibility
#advanced
Examples:
● Colors contrast
● Header tags
● etc.
Repo:
0x1C. C - Makefiles
C
● Weight: 1
● Project over - took place from May 24, 2023 6:00 AM to May 25, 2023 6:00 AM
In a nutshell…
● Auto QA review: 33.8/52 mandatory & 8.45/13 optional
● Altogether: 107.25%
○ Mandatory: 65.0%
○ Optional: 65.0%
○ Calculation: 65.0% + (65.0% * 65.0%) == 107.25%
Resources
Read or watch:
● Makefile
● Installing the make utility
● make-official documentation
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of
Google:
General
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and
pasting someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
More Info
Files
In the following tasks, we are going to use these files. We want to compile these only.
Tasks
0. make -f 0-Makefile
mandatory
Score: 65.0% (Checks completed: 100.0%)
Requirements:
Repo:
1. make -f 1-Makefile
mandatory
Requirements:
Repo:
2. make -f 2-Makefile
mandatory
Requirements:
Repo:
3. make -f 3-Makefile
mandatory
Score: 65.0% (Checks completed: 100.0%)
Requirements:
julien@ubuntu:~//0x1C. Makefiles$ ls -1
0-Makefile
1-Makefile
2-Makefile
3-Makefile
school.c
main.c
main.c~
m.h
julien@ubuntu:~/0x1C. Makefiles$ make -f 3-Makefile
gcc -c -o main.o main.c
gcc -c -o school.o school.c
gcc main.o school.o -o school
julien@ubuntu:~/0x1C. Makefiles$ make all -f 3-Makefile
gcc main.o school.o -o school
julien@ubuntu:~/0x1C. Makefiles$ ls -1
0-Makefile
1-Makefile
2-Makefile
3-Makefile
school
school.c
school.o
main.c
main.c~
main.o
m.h
julien@ubuntu:~/0x1C. Makefiles$ make clean -f 3-Makefile
rm -f *~ school
julien@ubuntu:~/0x1C. Makefiles$ make oclean -f 3-Makefile
rm -f main.o school.o
julien@ubuntu:~/0x1C. Makefiles$ make fclean -f 3-Makefile
rm -f *~ school
rm -f main.o school.o
julien@ubuntu:~/0x1C. Makefiles$ make all -f 3-Makefile
gcc -c -o main.o main.c
gcc -c -o school.o school.c
gcc main.o school.o -o school
julien@ubuntu:~/0x1C. Makefiles$ make all -f 3-Makefile
gcc main.o school.o -o school
julien@ubuntu:~/0x1C. Makefiles$ make re -f 3-Makefile
rm -f main.o school.o
gcc -c -o main.o main.c
gcc -c -o school.o school.c
gcc main.o school.o -o school
julien@ubuntu:~/0x1C. Makefiles$
Repo:
mandatory
Requirements:
5. Island Perimeter
mandatory
Create a function def island_perimeter(grid): that returns the perimeter of the island
described in grid:
Requirements:
if __name__ == "__main__":
grid = [
[0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0]
]
print(island_perimeter(grid))
guillaume@ubuntu:~/0x1C$
guillaume@ubuntu:~/0x1C$ ./5-main.py
12
guillaume@ubuntu:~/0x1C$
Repo:
● GitHub repository: alx-low_level_programming
● Directory: 0x1C-makefiles
● File: 5-island_perimeter.py
6. make -f 100-Makefile
#advanced
Requirements:
Repo:
● Weight: 1
● Project over - took place from May 25, 2023 6:00 AM to May 29, 2023 6:00 AM
In a nutshell…
● Manual QA review: 0.0/42 mandatory & 0.0/5 optional
● Altogether: 0.0%
○ Mandatory: 0.0%
○ Optional: 0.0%
○ Calculation: 0.0% + (0.0% * 0.0%) == 0.0%
Concepts
● DNS
● Monitoring
● Web Server
● Network basics
● Load balancer
● Server
Resources
Read or watch:
Learning Objectives
At the end of this project, you are expected to be able to explain to anyone, without the help of Google:
General
● You must be able to draw a diagram covering the web stack you built with the sysadmin/devops
track projects
● You must be able to explain what each component is doing
● You must be able to explain system redundancy
● Know all the mentioned acronyms: LAMP, SPOF, QPS
Copyright - Plagiarism
● You are tasked to come up with solutions for the tasks below yourself to meet with the above
learning objectives.
● You will not be able to meet the objectives of this or any following project by copying and pasting
someone else’s work.
● You are not allowed to publish any content of this project.
● Any form of plagiarism is strictly forbidden and will result in removal from the program.
Requirements
General
Quiz questions
Great! You've completed the quiz successfully! Keep going! (Show quiz)
Tasks
0. Simple web stack
mandatory
A lot of websites are powered by simple web infrastructure, a lot of time it is composed of a single server
with a LAMP stack.
On a whiteboard, design a one server web infrastructure that hosts the website that is reachable via
www.foobar.com. Start your explanation by having a user wanting to access your website.
Requirements:
Please, remember that everything must be written in English to further your technical ability in a variety of
settings.
Save
Repo:
mandatory
On a whiteboard, design a three server web infrastructure that hosts the website www.foobar.com.
Requirements:
Please, remember that everything must be written in English to further your technical ability in a variety of
settings.
Add URLs here:
Save
Repo:
mandatory
On a whiteboard, design a three server web infrastructure that hosts the website www.foobar.com, it
must be secured, serve encrypted traffic, and be monitored.
Requirements:
Please, remember that everything must be written in English to further your technical ability in a variety of
settings.
Save
Repo:
#advanced
Readme
Requirements:
Please, remember that everything must be written in English to further your technical ability in a variety of
settings.
Save
Repo:
● Weight: 5
● Project over - took place from May 29, 2023 6:00 AM to Jun 2, 2023 6:00 AM
In a nutshell…
● Contribution: 100.0%
● Auto QA review: 78.5/157 mandatory & 97.5/196 optional
● Altogether: 74.87%
○ Mandatory: 50.0%
○ Optional: 49.74%
○ Contribution: 100.0%
○ Calculation: 100.0% * (50.0% + (50.0% * 49.74%) ) == 74.87%